Skip to content

feat(connection): migrate connection params#3650

Merged
DimitrisJim merged 11 commits intomainfrom
jim/3501-migrate-03-connection-params-to-be-self-managed
Jun 2, 2023
Merged

feat(connection): migrate connection params#3650
DimitrisJim merged 11 commits intomainfrom
jim/3501-migrate-03-connection-params-to-be-self-managed

Conversation

@DimitrisJim
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

DimitrisJim commented May 24, 2023

leaving this as a draft until #3640 is merged.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 24, 2023

Codecov Report

❌ Patch coverage is 66.19718% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.74%. Comparing base (d751bc9) to head (6c0a635).
⚠️ Report is 1678 commits behind head on main.

Files with missing lines Patch % Lines
modules/core/03-connection/types/params_legacy.go 33.33% 8 Missing ⚠️
modules/core/module.go 0.00% 5 Missing and 1 partial ⚠️
modules/core/03-connection/types/msgs.go 66.66% 5 Missing ⚠️
modules/core/03-connection/keeper/migrations.go 66.66% 2 Missing and 1 partial ⚠️
modules/core/03-connection/keeper/keeper.go 89.47% 1 Missing and 1 partial ⚠️
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              
Files with missing lines Coverage Δ
modules/core/03-connection/keeper/verify.go 79.22% <100.00%> (ø)
modules/core/03-connection/types/codec.go 100.00% <100.00%> (ø)
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/keeper/msg_server.go 55.95% <100.00%> (+0.71%) ⬆️
modules/core/03-connection/keeper/keeper.go 90.37% <89.47%> (+0.93%) ⬆️
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/module.go 44.30% <0.00%> (-3.00%) ⬇️
... and 1 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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
Copy Markdown
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.

@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

s.grpcClients[chain.Config().ChainID] = GRPCClients{
ClientQueryClient: clienttypes.NewQueryClient(grpcConn),
ConnectionQueryClient: connectiontypes.NewQueryClient(grpcConn),
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

@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 :)

@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
Copy Markdown
Contributor

@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 🙏

@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
Copy Markdown
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
Copy Markdown
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