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

Zero out client state before processing upgraded client proof #1530

Conversation

chatton
Copy link
Contributor

@chatton chatton commented Jun 13, 2022

Description

closes: #292

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@@ -452,9 +452,6 @@ func (suite *TendermintTestSuite) TestVerifyUpgrade() {
cs := suite.chainA.GetClientState(path.EndpointA.ClientID)
clientStore := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID)

// Call ZeroCustomFields on upgraded clients to clear any client-chosen parameters in test-case upgradedClient
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this caused a test an existing test case to pass unsuccessful upgrade: committed client does not have zeroed custom fields, this test now passes due to the zeroing in VerifyUpgradeAndUpdateState

Copy link
Contributor

@charleenfei charleenfei left a comment

Choose a reason for hiding this comment

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

i would add some document the reasoning behind this change otherwise lgtm :)

CHANGELOG.md Outdated
@@ -81,6 +81,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (modules/core/04-channel) [\#1130](https://github.com/cosmos/ibc-go/pull/1130) Call `packet.GetSequence()` rather than passing func in `WriteAcknowledgement` log output
* (apps/29-fee) [\#1278](https://github.com/cosmos/ibc-go/pull/1278) The URI path for the query to get all incentivized packets for a specific channel did not follow the same format as the rest of queries.
* (apps/29-fee)[\#1343](https://github.com/cosmos/ibc-go/pull/1523) Fixed an issue where a bad refund address would prevent channel closure.
* (07-tendermint) [\#1530](https://github.com/cosmos/ibc-go/pull/1530) Submitted client state is zeroed out before checking the proof.
Copy link
Contributor

Choose a reason for hiding this comment

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

i think we should document the reasoning behind #291 here

@@ -18,7 +18,7 @@ import (
// in client state that must be the same across all valid Tendermint clients for the new chain.
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe add a comment that zeroing out the submitted client prevents the proposal from containing information governance is not actually voting on, see previous CHANGELOG comment

@chatton chatton changed the base branch from main to 02-client-refactor June 14, 2022 07:58
@chatton chatton changed the base branch from 02-client-refactor to main June 14, 2022 08:02
Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

Should this also be targeted for 02-client-refactor branch?

@chatton chatton changed the title cian/issue#292-zero-out-client-state-before-processing-upgraded-client-proof Zero out client state before processing upgraded client proof Jun 14, 2022
@chatton
Copy link
Contributor Author

chatton commented Jun 14, 2022

@damiannolan changing the base branch introduced a massive amount of merge conflicts, I think we can leave this PR open and once @colin-axner returns we can discuss if it needs to be included in the client refactor or if we can just merge to main.

@chatton
Copy link
Contributor Author

chatton commented Jul 8, 2022

Closing in favour of: #1674

@chatton chatton closed this Jul 8, 2022
@chatton chatton deleted the cian/issue#292-zero-out-client-state-before-processing-upgraded-client-proof branch December 19, 2023 11:39
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.

Zero out client state before processing upgraded client proof
4 participants