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

feat(connection): migrate connection params #3650

Merged

Conversation

DimitrisJim
Copy link
Contributor

Description

closes: #3501

Commit Message / Changelog Entry

feat(connection): migrate connection params

see the guidelines for commit messages. (view raw markdown for examples)


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 and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

@DimitrisJim DimitrisJim linked an issue May 24, 2023 that may be closed by this pull request
@DimitrisJim
Copy link
Contributor Author

DimitrisJim commented May 24, 2023

leaving this as a draft until #3640 is merged.

@codecov-commenter
Copy link

codecov-commenter commented May 24, 2023

Codecov Report

Merging #3650 (1925102) into main (d751bc9) will decrease coverage by 0.06%.
The diff coverage is 66.19%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3650      +/-   ##
==========================================
- Coverage   78.80%   78.74%   -0.06%     
==========================================
  Files         187      187              
  Lines       12846    12888      +42     
==========================================
+ Hits        10123    10149      +26     
- Misses       2292     2308      +16     
  Partials      431      431              
Impacted Files Coverage Δ
modules/core/03-connection/types/keys.go 100.00% <ø> (ø)
modules/core/03-connection/types/params.go 100.00% <ø> (+21.73%) ⬆️
modules/core/keeper/keeper.go 91.66% <ø> (ø)
modules/core/module.go 44.30% <0.00%> (-3.00%) ⬇️
modules/core/03-connection/types/params_legacy.go 33.33% <33.33%> (ø)
modules/core/03-connection/keeper/migrations.go 57.14% <66.66%> (+17.14%) ⬆️
modules/core/03-connection/types/msgs.go 84.07% <66.66%> (-1.41%) ⬇️
modules/core/03-connection/keeper/keeper.go 90.37% <89.47%> (+0.93%) ⬆️
modules/core/03-connection/keeper/verify.go 79.22% <100.00%> (ø)
modules/core/03-connection/types/codec.go 100.00% <100.00%> (ø)
... and 1 more

@DimitrisJim DimitrisJim force-pushed the jim/3501-migrate-03-connection-params-to-be-self-managed branch 9 times, most recently from 812e67f to b1c4e69 Compare May 30, 2023 17:48
@DimitrisJim DimitrisJim marked this pull request as ready for review May 30, 2023 17:49
Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

I think looks good, @DimitrisJim! I just left a couple of comments.

modules/core/03-connection/types/msgs.go Outdated Show resolved Hide resolved
@DimitrisJim DimitrisJim force-pushed the jim/3501-migrate-03-connection-params-to-be-self-managed branch from b1c4e69 to 1cb9375 Compare May 31, 2023 07:03
@@ -73,6 +73,7 @@ func (s *E2ETestSuite) InitGRPCClients(chain *cosmos.CosmosChain) {

s.grpcClients[chain.Config().ChainID] = GRPCClients{
ClientQueryClient: clienttypes.NewQueryClient(grpcConn),
ConnectionQueryClient: connectiontypes.NewQueryClient(grpcConn),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the wonders of allowing default initialization.

Copy link
Contributor

Choose a reason for hiding this comment

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

I just stumbled upon this error when running the v7.1 upgrade test. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Multiple victims of this unforgiving language design

@DimitrisJim DimitrisJim force-pushed the jim/3501-migrate-03-connection-params-to-be-self-managed branch from 0364f34 to be0461b Compare May 31, 2023 08:32
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.

Looks really good so far. Just left a couple of comments :)

modules/core/keeper/keeper.go Outdated Show resolved Hide resolved
proto/ibc/core/connection/v1/tx.proto Outdated Show resolved Hide resolved
e2e/tests/core/03-connection/connection_test.go Outdated Show resolved Hide resolved
@DimitrisJim DimitrisJim force-pushed the jim/3501-migrate-03-connection-params-to-be-self-managed branch 3 times, most recently from acbc432 to 4ef0dc9 Compare June 1, 2023 08:52
@DimitrisJim DimitrisJim force-pushed the jim/3501-migrate-03-connection-params-to-be-self-managed branch from 4ef0dc9 to adb29be Compare June 1, 2023 10:24
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.

Looks good to me! Great work @DimitrisJim 🙏

modules/core/keeper/msg_server.go Outdated Show resolved Hide resolved
@DimitrisJim DimitrisJim force-pushed the jim/3501-migrate-03-connection-params-to-be-self-managed branch from b3e9af6 to 52e6730 Compare June 1, 2023 16:27
Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

Great work, @DimitrisJim!

@DimitrisJim DimitrisJim force-pushed the jim/3501-migrate-03-connection-params-to-be-self-managed branch from e1d60fe to 1925102 Compare June 2, 2023 10:16
@DimitrisJim DimitrisJim merged commit 96808eb into main Jun 2, 2023
@DimitrisJim DimitrisJim deleted the jim/3501-migrate-03-connection-params-to-be-self-managed branch June 2, 2023 11:58
if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil {
return errorsmod.Wrapf(ibcerrors.ErrInvalidAddress, "string could not be parsed as address: %v", err)
}
return msg.Params.Validate()
Copy link
Contributor

Choose a reason for hiding this comment

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

Params.Validate() returns a fmt.Errorf error, this will result in the default SDK internal error code of 1 since no registered error is returned. Previously this validation was only called in InitGenesis where you don't need to return sdk registered errors, we may want to update this now?

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.

Migrate 03-connection params to be self managed
5 participants