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

ensure latest height revision number matches chain id revision number #241

Merged
merged 7 commits into from
Jul 7, 2021

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented Jul 7, 2021

Description

closes: #240


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

Copy link
Member

@AdityaSripal AdityaSripal left a comment

Choose a reason for hiding this comment

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

Just a couple nits

Comment on lines 126 to 132
return sdkerrors.Wrapf(ErrInvalidHeaderHeight, "tendermint revision height cannot be zero")
return sdkerrors.Wrapf(ErrInvalidHeaderHeight, "latest height revision height cannot be zero")
Copy link
Member

Choose a reason for hiding this comment

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

I would say this should remain. No tendermint height should start at 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add back the tendermint part but the latest height makes things more specific since the frozen height also contains a revision height

@@ -657,7 +657,7 @@ func (suite *KeeperTestSuite) TestUpgradeClient() {
name: "successful upgrade",
setup: func() {

upgradedClient = ibctmtypes.NewClientState("newChainId", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false)
upgradedClient = ibctmtypes.NewClientState("newChainId-1", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false)
Copy link
Member

Choose a reason for hiding this comment

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

Why don't you create the variable for these tests as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, there was only 2 of them so didn't feel as necessary

@colin-axner colin-axner enabled auto-merge (squash) July 7, 2021 13:23
@colin-axner colin-axner merged commit d759eb4 into main Jul 7, 2021
@colin-axner colin-axner deleted the colin/240-client-validate branch July 7, 2021 13:25
colin-axner added a commit that referenced this pull request Jul 7, 2021
…#241)

* ensure latest height revision number matches chain id revision number

fix tests as well

* add changelog

* Update modules/light-clients/07-tendermint/types/client_state_test.go

* Update modules/light-clients/07-tendermint/types/client_state_test.go

* address review suggestions
colin-axner added a commit that referenced this pull request Jul 7, 2021
* Fix/channel open/close events (#220)

* fix: moving  event to keeper function instead of rpc handler

* refactor: removing unnecessary handler

* refactor: delete channel handler file

* Apply suggestions from code review

Co-authored-by: Aditya <adityasripal@gmail.com>

* ibc: fix metrics (#223)

* add missing changelog entries (#230)

* add missing changelog entries

* add missing entry

* Fix missing events in OnRecvPacket (#233)

* fix to set events to the original context

* Update modules/core/keeper/msg_server.go

Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* bump SDK dependency to v0.43.0-rc0 (#229)

Co-authored-by: Aditya <adityasripal@gmail.com>

* Sentinel Root Fix (#234)

* fix sentinel value

* add godoc and test

* fix grammar

* add changelog

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* export connection params (#242)

* ensure latest height revision number matches chain id revision number (#241)

* ensure latest height revision number matches chain id revision number

fix tests as well

* add changelog

* Update modules/light-clients/07-tendermint/types/client_state_test.go

* Update modules/light-clients/07-tendermint/types/client_state_test.go

* address review suggestions

* fix merge conflict

Co-authored-by: Sean King <seantking@users.noreply.github.com>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Jun Kimura <junkxdev@gmail.com>
CosmosCar pushed a commit to caelus-labs/ibc-go that referenced this pull request Nov 6, 2023
Fill in all the missing fields of Status() ROC for compatibility with Tendermint RPC.
Fixes cosmos#241.
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.

Tendermint client state does not enforce chain id revision number to match latest height revision number
2 participants