Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct ica wiring and update pfm fixes for v8 upgrade #2008

Merged
merged 15 commits into from
Jan 16, 2023
Merged

Conversation

yaruwangway
Copy link
Contributor

@yaruwangway yaruwangway commented Jan 11, 2023

During the course of simulated upgrade testing with exported genesis from mainnet it was discovered that the node would panic after upgrading when attempting to prune two different stores, icacontroller and packetforwardmiddleware (PFM).

Update: The fix for ica controller is to remove this as it was accidentally leftover as an artifact from the original v8 release with v0.46 of the sdk. For PFM, the fix includes a corrected wiring in Gaia, and several updates to PFM itself due to an incorrectly named module and incorrect implementation of an interface necessary to pass to the TransferKeeper.

@codecov
Copy link

codecov bot commented Jan 11, 2023

Codecov Report

Merging #2008 (3fb8b0f) into main (a4d5b52) will increase coverage by 0.11%.
The diff coverage is 91.83%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2008      +/-   ##
==========================================
+ Coverage   79.08%   79.20%   +0.11%     
==========================================
  Files          23       23              
  Lines        1568     1577       +9     
==========================================
+ Hits         1240     1249       +9     
  Misses        274      274              
  Partials       54       54              

@damiannolan
Copy link
Member

damiannolan commented Jan 12, 2023

Hey @yaruwangway, @glnro as part of this PR or another can you remove the ICAControllerKeeper from AppKeepers as well as the store key in keepers/keys.go.

I was going to make one myself but I don't have push access rights on this repo it seems.
I think it would be worth retesting the upgrade scenario you were having issues with after making these changes. I recall there was errors regarding the icacontroller store during some store pruning. I'm not sure at what point you were trying to do pruning but the icacontroller store wouldn't have previously existed so may explain why its erroring trying to delete previous iavl versions. The error you're seeing is bubbling up from here, right?

@glnro
Copy link
Contributor

glnro commented Jan 12, 2023

Hey @yaruwangway, @glnro as part of this PR or another can you remove the ICAControllerKeeper from AppKeepers as well as the store key in keepers/keys.go.

I was going to make one myself but I don't have push access rights on this repo it seems. I think it would be worth retesting the upgrade scenario you were having issues with after making these changes. I recall there was errors regarding the icacontroller store during some store pruning. I'm not sure at what point you were trying to do pruning but the icacontroller store wouldn't have previously existed so may explain why its erroring trying to delete previous iavl versions. The error you're seeing is bubbling up from here, right?

Yes, that's where the error is bubbling up. We're running an upgrade test with this test branch and then will assess.

@glnro
Copy link
Contributor

glnro commented Jan 12, 2023

Hey @yaruwangway, @glnro as part of this PR or another can you remove the ICAControllerKeeper from AppKeepers as well as the store key in keepers/keys.go.
I was going to make one myself but I don't have push access rights on this repo it seems. I think it would be worth retesting the upgrade scenario you were having issues with after making these changes. I recall there was errors regarding the icacontroller store during some store pruning. I'm not sure at what point you were trying to do pruning but the icacontroller store wouldn't have previously existed so may explain why its erroring trying to delete previous iavl versions. The error you're seeing is bubbling up from here, right?

Yes, that's where the error is bubbling up. We're running an upgrade test with this test branch and then will assess.

@damiannolan the fix of removing the ICACOntrollerKeeper as well as the store key seems to have worked in the stateful upgrade test we ran. Now the sdk panics when it tries to prune the packetforwardmiddleware store. Not ideal but still at least we can close this up.

@faddat
Copy link
Contributor

faddat commented Jan 12, 2023

interesting!

@faddat
Copy link
Contributor

faddat commented Jan 12, 2023

hey, FYI I've PR'd into this branch:

#2012

Basically just handles the ibc-go v4 jump sooner.

@glnro glnro changed the title fix: remove duplicates of ica module fix: correct ica wiring and update pfm fixes for v8 upgrade Jan 13, 2023
@glnro glnro mentioned this pull request Jan 13, 2023
appKeepers.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec,
appKeepers.keys[ibctransfertypes.StoreKey],
appKeepers.GetSubspace(ibctransfertypes.ModuleName),
appKeepers.IBCKeeper.ChannelKeeper,
appKeepers.RouterKeeper,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like its not going to work as expected because the RouterKeeper is initialised below on line 314.
At this point it looks like we're going to be passing an empty struct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, TransferKeeper need routerKeeper, routerKeeper need transferKeeper to initialize, one must be empty

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sonarcloud
Copy link

sonarcloud bot commented Jan 13, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@glnro glnro merged commit a4e9d11 into main Jan 16, 2023
@glnro glnro deleted the fix-v8 branch January 16, 2023 06:44
@glnro
Copy link
Contributor

glnro commented Jan 16, 2023

@Mergifyio backport release/v8.0.x

@mergify
Copy link
Contributor

mergify bot commented Jan 16, 2023

backport release/v8.0.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jan 16, 2023
* fix: remove duplicates of ica module

* Remove ICAController

* Add back ica new module config

* Move migration run to end of upgrade

* Update strangelove

* Fix pfm

* Add sdk logging

* Add fix for pfm spelling mistake

* Update ugrade handler logging, update pfm config

* Fix linter

* Update pfm

* Update TransferKeeper to pass ChannelKeeper instead of RouterKeeper

* Update pfm config

* Update

* Fix pfm again

Co-authored-by: lg <[email protected]>
(cherry picked from commit a4e9d11)
glnro added a commit that referenced this pull request Jan 16, 2023
* feat: Add command bech32-convert (#1845)

* add bech32-convert command to gaiad

* add changelog notice

* add review fixes

* add tests for ConvertBech32Prefix

Co-authored-by: Petr Ivanov <[email protected]>
Co-authored-by: Danilo Pantani <[email protected]>
Co-authored-by: billy rennekamp <[email protected]>

* fix feegrant test accounts (#1861)

* Updated and new links (#1862)

* Updated and added links

Current Telegram links directs to a chat that no longer exists, replaced it with the main Cosmos Telegram group. Also added link to Mintscan's list of on-chain proposals

* Updated Telegram link: t.me/atomgov

Co-authored-by: billy rennekamp <[email protected]>

* chore: bump sdk to v0.46.4 (#1863)

* chore: bump sdk

* rename flag

* prepare v8 release (#1860)

* chore: changelog

* chore: update changelog

* chore: add changelog for v7.0.3

* chore: add v7.1.0 to changelog

Co-authored-by: Yaru Wang <[email protected]>

* Add backport for v8 & future v9/v10 (#1865)

* Revert "prepare v8 release (#1860)" (#1866)

This reverts commit f0397fd.

* chore: changelog (#1868)

* fix: print in app.go (#1878)

* fix: print in app.go

* fix: change print err to panic in init

* refactor: simplify the logic in fee antehandler (#1877)

* refactor: simplify the logic in fee antehandler

* fix: test

* test: add test for disable checkTx

* fix: err check (#1880)

* fix: change log.Fatal to panic, defer iter.Close()

* update export.go

* fix: lint

* chore(deps): bump github.com/spf13/viper from 1.13.0 to 1.14.0 (#1885)

Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](spf13/viper@v1.13.0...v1.14.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* test: export genesis (#1871)

* Add export test

* Add unit test for app export

* Refactor gaia helpers setup

Co-authored-by: Danilo Pantani <[email protected]>

* fix(chore): fix gosec issues (#1881)

* gosec improvements

* fix gosec issues

* defer to close iterator

* add gas adjustment

* Merge PR #1893: Delete CODE_OF_CONDUCT.md

* test: Unit tests for global fee module (#1858)

* test: add test for globalfee validateMinimumGasPrices

* test: add test for querier

* fix: panic in test

* update test

* update test

* use original test

* Update x/globalfee/types/params_test.go

Co-authored-by: Danilo Pantani <[email protected]>

Co-authored-by: Danilo Pantani <[email protected]>

* icamauth docs (#1813)

* docs: add icamauth docs

* docs: change uatom to stake

* chore: update docs

* docs: update icamuath.md according to review comments

* docs: rename icamauth.md to README.md

* docs: read mnemonic from file

* docs: add hermes download instruction

* update docs

* globalfee/README.md -> globalfee.md

* Update docs/modules/icamauth/hermes_setup.sh

Co-authored-by: Danilo Pantani <[email protected]>

* docs: fix dead link

* Update README.md

* Update README.md

* fixes

Co-authored-by: billy rennekamp <[email protected]>
Co-authored-by: Danilo Pantani <[email protected]>

* docs: correct `NoWithVeto` condition description (#1900)

According to (docs)[https://docs.cosmos.network/main/modules/gov#threshold] and [code](https://github.com/cosmos/cosmos-sdk/blob/bcff22a3767b9c5dd7d1d562aece90cf72e05e85/x/gov/keeper/tally.go#L115), it includes `abstain` when calculating the threshold of `NoWithVeto`.

* fix(CI): fix code coverage (#1903)

* fix the code test coverage measure

* fix folder type removal

* docs: update icamauth (#1905)

* docs: update icamauth

* docs: restructure icamauth docs

* docs: update links

* docs: fix dead links

* chore: update docs (#1906)

* feat(CI): skip run the go CI test for markdown/docs files (#1907)

* skip run the test CI for markdown files

* remove skip from the codeql ci

* only ignore md files for codeql

* feat(x/ica): add tests for icamauth module (#1897)

* add unit tests methods

* add tests for the types folder

* remove query test

* add test description

* refactor: e2e test (#1840)

* refactor: ica e2e test

* refactor: globalfee e2e test

* refactor: add execBankSendBatch

* refactor: add const proposalGlobalFee

* refactor: execBankSendBatch

* Update tests/e2e/e2e_exec_test.go

Co-authored-by: Danilo Pantani <[email protected]>

* test: refactor execBankSendBatch

* fix: failure test

Co-authored-by: Danilo Pantani <[email protected]>

* Update ibc-go v5.1.0 (#1898)

* Strangelove/forward middleware atomic (#1911)

* Update forward middleware to use packet memo field, async acks

* fixed e2e

Co-authored-by: Andrew Gouin <[email protected]>

* fix bank migration in upgrade handler (#1892)

* fix bank migtation in upgrade handler

* try atomated upgrade test

* fix build

* change so runs on yml change too

* change so runs on yml change too

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* change again

* passing upgrade test

* Update app/upgrades/v8/upgrades.go

Co-authored-by: Danilo Pantani <[email protected]>

* Update contrib/scripts/run-gaia-v7.sh

Co-authored-by: Danilo Pantani <[email protected]>

* Update contrib/scripts/run-gaia-v7.sh

Co-authored-by: Danilo Pantani <[email protected]>

* Update contrib/scripts/run-gaia-v7.sh

Co-authored-by: Danilo Pantani <[email protected]>

* Update contrib/scripts/run-gaia-v7.sh

Co-authored-by: Danilo Pantani <[email protected]>

* add unit test

* Update app/upgrades/v8/upgrades_test.go

Co-authored-by: Danilo Pantani <[email protected]>

* added check for deformed being removed

Co-authored-by: Danilo Pantani <[email protected]>

* chore: simplify logic of getting allFees (#1917)

* Updated codeowners, removed pantani, cmwaters & noomski

* Makefile: add govulnchecker (#1927)

Adds the Go vulnerability checker to the Makefile as a directive
dependency to the all directive.

Updates #1879

* spike to test feasibility of downgrade to v0.45 (#1902)

* pause

* no vscode errors

* rewrite go.sum, go.work.sum and fix amino import

* remove mauth docs

* gofumpt

* fix find

* cant get docker to build locally

* debug ibc test

* fix ibc test

* passing e2e

* clean up commented out tests

* remove more mauth

* forgot to save

* add back middleware test

* fix upgrade

* fix test setup

* add TODO note

* remove multihop test

* Update docs/modules/gov.md

* Update tests/e2e/query.go

Co-authored-by: lg <[email protected]>

* remove groups and gov docs

* laurens comment re moduleAccountAddress

* remove commented code that should not be added back

Co-authored-by: lg <[email protected]>

* feat: proto dependencies for downgrade to 0.45 (#1933)

* feat: add third_party proto

* feat: add script for generating go files from proto, and swagger

* feat: add protoc-doc-gen.sh

* fix: antehandler to fit sdk v0.45 (#1918)

* pause

* no vscode errors

* rewrite go.sum, go.work.sum and fix amino import

* remove mauth docs

* gofumpt

* fix find

* cant get docker to build locally

* debug ibc test

* fix ibc test

* passing e2e

* clean up commented out tests

* remove more mauth

* forgot to save

* add back middleware test

* fix upgrade

* fix test setup

* add TODO note

* remove multihop test

* fix: antehandler in sdkv0.45

* test: add back globalfee e2e test

* fix: failure of verifying sending token amount

* chore: remove comments

* feat: simplify fee logic

Co-authored-by: billy rennekamp <[email protected]>

* test re-org (#1913)

* pause

* no vscode errors

* rewrite go.sum, go.work.sum and fix amino import

* remove mauth docs

* gofumpt

* fix find

* cant get docker to build locally

* debug ibc test

* fix ibc test

* passing e2e

* clean up commented out tests

* remove more mauth

* forgot to save

* add back middleware test

* fix upgrade

* fix test setup

* add TODO note

* remove multihop test

* re-organized tests to make it easier to skip when working on a single one

* remove gov tests

* removed multihop tests

* markdownlint (#1936)

* fix: feegrant e2e test (#1940)

* docs: update state sync (#1946)

* Updated roadmap (#1947)

* bump versions, remove e2e go.mod (#1944)

* bump versions, remove e2e go.mod

* stupid gofumpt errors

* fixed packet forward configuration (#1941)

* exclude e2e tests from test coverage upload (#1953)

* exclude e2e tests from test coverage upload

* swap order of test to exclude e2e

* remove e2e from find

* updated gov docs as specified in issue #1948 (#1949)

* updated gov docs as specified in issue #1948

* fixed links

* missed a few links

* fix links (#1954)

* test: Refactor gov e2e for v0.45 Rho (#1951)

* WIP

* Refactor gov tests for v45

* Refactor gov and add community spend test

* Refactor

* Set explicit sdk & tm versions for all dependencies

Co-authored-by: billy rennekamp <[email protected]>

* Skip broken redirect link check

* Restrict disable link to single link

Co-authored-by: billy rennekamp <[email protected]>

* add back TestGaiaApp_Export  (#1955)

* pause

* unit pasing, check e2e

* Update test_helpers.go

* fix: put iterator in closure (#1934)

Co-authored-by: Milan Mulji <[email protected]>

* uncomment still existing test (#1956)

* uncomment still existing test

* forgot to include this file

* pause

* remove again

* add back rest of tests

* push e2e image and use released versions in docker push action (#1939)

Co-authored-by: billy rennekamp <[email protected]>

* lint tests, too (#1960)

* feat: Change MaxBypassMinFeeMsgGasUsage via NewFeeDecorator (#1961)

* change MaxBypassMinFeeMsgGasUsage easily

* move test to newTestGasLimit

* chore: remove unneeded replace tags (#1959)

* remove unneeded replace tags

* remove ibc dep

* Update go.mod

Co-authored-by: Marko Baricevic <[email protected]>
Co-authored-by: billy rennekamp <[email protected]>

* chore(docs): add code guidelines (#1819)

* code guidelines

* add resources

* Update docs/code-guidelines.md

Co-authored-by: billy rennekamp <[email protected]>

* git guidelines

* small fixes and final steps

Co-authored-by: billy rennekamp <[email protected]>

* Update ko genesis.md (#1964)

* offboarding (#1969)

* chore(deps): bump actions/cache from 3.0.10 to 3.2.0 (#1968)

Bumps [actions/cache](https://github.com/actions/cache) from 3.0.10 to 3.2.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v3.0.10...v3.2.0)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: fix global fee link (#1978)

* chore(deps): bump github.com/gravity-devs/liquidity from 1.5.1 to 1.5.3 (#1981)

Bumps [github.com/gravity-devs/liquidity](https://github.com/gravity-devs/liquidity) from 1.5.1 to 1.5.3.
- [Release notes](https://github.com/gravity-devs/liquidity/releases)
- [Changelog](https://github.com/Gravity-Devs/liquidity/blob/master/CHANGELOG.md)
- [Commits](Gravity-Devs/liquidity@v1.5.1...v1.5.3)

---
updated-dependencies:
- dependency-name: github.com/gravity-devs/liquidity
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix: minor typos (#1984)

Fix: minor typos

* Migrations for quicksilver issue (#1976)

* prepare v8 release (backport #1860) (#1867)

* prepare v8 release (#1860)

* chore: changelog

* chore: update changelog

* chore: add changelog for v7.0.3

* chore: add v7.1.0 to changelog

Co-authored-by: Yaru Wang <[email protected]>
(cherry picked from commit f0397fd)

# Conflicts:
#	CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: billy rennekamp <[email protected]>

* Added migrations for quicksilver stuck fund fix

* Migrations for quicksilver

* Check if balance of the refund addess is positive

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: billy rennekamp <[email protected]>
Co-authored-by: lg <[email protected]>

* test: remove unused const (#1988)

* test: remove unused const

* fix: lint

* Changelog for V8 (#1982)

* Update changelog for v8

* Update changelog for v8

* Update changelog

* Make requested changes

* Update date

* Point to informal's fork of tendermint (#1990)

* fix: remove ica controller params setup from upgrade handler (#1989)

Signed-off-by: Yaru Wang <[email protected]>

* Update codeowners (#1993)

* preparing for v8.0.0-rc1 release (#1994)

* prepare v8 release (backport #1860) (#1867)

* prepare v8 release (#1860)

* chore: changelog

* chore: update changelog

* chore: add changelog for v7.0.3

* chore: add v7.1.0 to changelog

Co-authored-by: Yaru Wang <[email protected]>
(cherry picked from commit f0397fd)

# Conflicts:
#	CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: billy rennekamp <[email protected]>

* docs: update changelog

Signed-off-by: Yaru Wang <[email protected]>

* docs: update docs

Signed-off-by: Yaru Wang <[email protected]>

Signed-off-by: Yaru Wang <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: billy rennekamp <[email protected]>

* docs: changelog for v8.0.0-rc1 (#1997)

Signed-off-by: Yaru Wang <[email protected]>

Signed-off-by: Yaru Wang <[email protected]>

* fix: correct ica wiring and update pfm fixes for v8 upgrade (#2008)

* fix: remove duplicates of ica module

* Remove ICAController

* Add back ica new module config

* Move migration run to end of upgrade

* Update strangelove

* Fix pfm

* Add sdk logging

* Add fix for pfm spelling mistake

* Update ugrade handler logging, update pfm config

* Fix linter

* Update pfm

* Update TransferKeeper to pass ChannelKeeper instead of RouterKeeper

* Update pfm config

* Update

* Fix pfm again

Co-authored-by: lg <[email protected]>

* Update changelog for rc2 (#2022)

* Update v8 backport rules (#2025)

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Yaru Wang <[email protected]>
Co-authored-by: Petr Ivanov <[email protected]>
Co-authored-by: Petr Ivanov <[email protected]>
Co-authored-by: Danilo Pantani <[email protected]>
Co-authored-by: billy rennekamp <[email protected]>
Co-authored-by: ZorroZ77 <[email protected]>
Co-authored-by: Yaru Wang <[email protected]>
Co-authored-by: yaruwangway <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jacob Gadikian <[email protected]>
Co-authored-by: Yongwoo Lee <[email protected]>
Co-authored-by: Giancarlos Salas <[email protected]>
Co-authored-by: Andrew Gouin <[email protected]>
Co-authored-by: Milan Mulji <[email protected]>
Co-authored-by: Emmanuel T Odeke <[email protected]>
Co-authored-by: Lexa Michaelides <[email protected]>
Co-authored-by: Reece Williams <[email protected]>
Co-authored-by: Marko <[email protected]>
Co-authored-by: Marko Baricevic <[email protected]>
Co-authored-by: GwangIl-Park <[email protected]>
Co-authored-by: omahs <[email protected]>
Co-authored-by: stana-ethernal <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants