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: migration to gov v1 #4620

Merged
merged 46 commits into from
Sep 13, 2023
Merged

feat: migration to gov v1 #4620

merged 46 commits into from
Sep 13, 2023

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented Sep 11, 2023

Description

closes: #1282

Commit Message / Changelog Entry

refactor!: migrate to gov v1 via the additions of `MsgRecoverClient` and `MsgIBCSoftwareUpgrade`. The legacy proposal types `ClientUpdateProposal` and `UpgradeClientProposal` have been removed.

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 and others added 20 commits August 29, 2023 12:39
* Add proto message for Recover client, implement sdk.Message interface.

* Update modules/core/02-client/types/msgs.go

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* Apply suggestions from code review

Co-authored-by: Charly <charly@interchain.io>

* Remove gogoproto false for cmp, lint, move ibctesting address inline.

---------

Co-authored-by: Damian Nolan <damiannolan@gmail.com>
Co-authored-by: Charly <charly@interchain.io>
…ce proposals (#4436)

* add protos and keeper function placeholder

* add keeper functions/tests, msgs and tests
* Add 02-client implementation for Recover client.

* Partially address feedback.

* Docu RecoverClient, add label, re-use error.
* Add message server handler for recovering a client

* Don't assign to deprecated attrs, clean up unused fields.

* Further clean-up, remove declaration of unmutated vars.
* Add cmd for submitting a recover client prop.

* Bump cosmossdk in e2e.

* Use govtypes.ModuleName, rename old govtypes to govv1beta1

* Update modules/core/02-client/client/cli/tx.go

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* Add auth flag.

---------

Co-authored-by: Damian Nolan <damiannolan@gmail.com>
Co-authored-by: Colin Axnér <25233464+colin-axner@users.noreply.github.com>
* docs: recover client update

* Update docs/ibc/proposals.md

* Apply suggestions from code review

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>

---------

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
* refactor: remove legacy client update proposal

* e2e: swap from ClientUpdateProposal e2e to RecoverClient

* refactor: remove unused events
Co-authored-by: colin axner <25233464+colin-axner@users.noreply.github.com>
…ed client (#4594)

* add new event type

* update event name
@colin-axner colin-axner self-assigned this Sep 11, 2023
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.

Dropping a green check! All in all, pretty clean and easy to review! I only left some nits.
I can ack any follow up commits if needs be but looks good to me! 🚀

docs/ibc/proposals.md Outdated Show resolved Hide resolved
modules/apps/27-interchain-accounts/module.go Outdated Show resolved Hide resolved
modules/apps/transfer/module.go Outdated Show resolved Hide resolved
modules/core/02-client/keeper/client_test.go Outdated Show resolved Hide resolved
modules/core/module.go Outdated Show resolved Hide resolved
proto/ibc/core/client/v1/tx.proto Outdated Show resolved Hide resolved
proto/ibc/core/client/v1/tx.proto Outdated Show resolved Hide resolved
colin-axner and others added 3 commits September 11, 2023 13:20
* wip e2e test

* query proposal

* update upgrade height in plan

* rm unnecessary wait/authority

* rm test artifact from merge

* add checks for scheduled plan

* hook up upgrade query client

* plan height

* pr fixes

* update test

* import space

* update newchainID value

* update clientID upgrade

* linter

* gci

* rm unnecessary event

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Sishir Giri <sis1001@berkeley.edu>
Co-authored-by: srdtrk <59252793+srdtrk@users.noreply.github.com>
Co-authored-by: Cian Hatton <cian@interchain.io>
Co-authored-by: Julien Robert <julien@rbrt.fr>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Co-authored-by: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com>
Co-authored-by: sontrinh16 <trinhleson2000@gmail.com>
Co-authored-by: catShaark <gundamaster5@gmail.com>
Co-authored-by: khanh-notional <50263489+catShaark@users.noreply.github.com>
* chore: update docs for UpgradeProposal -> MsgIBCSoftwareUpgrade

* chore: anticipate link change

* fix event docs
@colin-axner
Copy link
Contributor Author

I noticed the ordering of the msgs is inconsistent, I will update as follows:

CreateClient
UpdateClient
UpgradeClient
SubmitMisbehaviour
RecoverClient
IBCSoftwareUpgrade
UpdateParams

@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2023

Codecov Report

Merging #4620 (fd6bfd1) into main (e192899) will increase coverage by 0.16%.
Report is 4 commits behind head on main.
The diff coverage is 93.36%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4620      +/-   ##
==========================================
+ Coverage   79.27%   79.44%   +0.16%     
==========================================
  Files         188      188              
  Lines       13046    13109      +63     
==========================================
+ Hits        10342    10414      +72     
+ Misses       2270     2265       -5     
+ Partials      434      430       -4     
Files Changed Coverage Δ
modules/apps/27-interchain-accounts/module.go 47.52% <0.00%> (-0.97%) ⬇️
modules/apps/29-fee/keeper/msg_server.go 97.14% <ø> (ø)
modules/apps/transfer/module.go 46.55% <0.00%> (-1.67%) ⬇️
modules/core/module.go 39.02% <0.00%> (-0.98%) ⬇️
modules/core/02-client/keeper/keeper.go 81.42% <62.50%> (-1.15%) ⬇️
modules/core/02-client/types/msgs.go 78.44% <93.75%> (+3.99%) ⬆️
...pps/27-interchain-accounts/simulation/proposals.go 100.00% <100.00%> (ø)
modules/apps/transfer/simulation/proposals.go 100.00% <100.00%> (ø)
modules/core/02-client/keeper/client.go 94.07% <100.00%> (+2.18%) ⬆️
modules/core/02-client/keeper/events.go 88.46% <100.00%> (ø)
... and 3 more

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.

ACK latest 👍

Thanks @colin-axner! And thank you to @charleenfei and @DimitrisJim for their work on the feat branch! ❤️

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.

thanks for opening this and fixing up conflicts @colin-axner !

docs/ibc/upgrades/quick-guide.md Outdated Show resolved Hide resolved
docs/ibc/events.md Outdated Show resolved Hide resolved
Co-authored-by: Charly <charly@interchain.io>
@colin-axner colin-axner added the v8 label Sep 11, 2023
@colin-axner
Copy link
Contributor Author

self ACK on the changes

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 everyone getting this migration done.

Bye bye, auf Wiedersehen, adios v1beta1 proposals, we will miss you... not! 💔

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

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

LGTM! Most of the comments I left are nits and can be safely ignored, there are just a few questions.

Great work on this everyone ❤️

e2e/tests/core/02-client/client_test.go Outdated Show resolved Hide resolved
e2e/testsuite/grpc_query.go Outdated Show resolved Hide resolved
e2e/tests/core/02-client/client_test.go Outdated Show resolved Hide resolved
e2e/tests/core/02-client/client_test.go Show resolved Hide resolved
e2e/testsuite/grpc_query.go Outdated Show resolved Hide resolved
@@ -242,97 +245,145 @@ func NewUpgradeClientCmd() *cobra.Command {
return cmd
}

// NewCmdSubmitUpdateClientProposal implements a command handler for submitting an update IBC client proposal transaction.
func NewCmdSubmitUpdateClientProposal() *cobra.Command {
// newSubmitRecoverClientProposalCmd defines the command to recover an IBC light client
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// newSubmitRecoverClientProposalCmd defines the command to recover an IBC light client
// newSubmitRecoverClientProposalCmd defines the command to recover an IBC light client.

modules/core/02-client/client/cli/tx.go Outdated Show resolved Hide resolved
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper))

AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper))
Copy link
Contributor

Choose a reason for hiding this comment

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

@damiannolan brought this up in the docs review, is the NewParamChangeProposalHandler still required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably not. maybe we can remove in a followup since it should have been removed with param migration?

Copy link
Contributor

Choose a reason for hiding this comment

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

can hold off on merging #4628 until then I think

}

if err = k.ClientKeeper.ScheduleIBCSoftwareUpgrade(ctx, msg.Plan, upgradedClientState); err != nil {
return nil, errorsmod.Wrapf(err, "cannot schedule IBC client upgrade")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return nil, errorsmod.Wrapf(err, "cannot schedule IBC client upgrade")
return nil, errorsmod.Wrap(err, "cannot schedule IBC client upgrade")

I believe Wrapf expects format args

modules/core/02-client/keeper/client.go Outdated Show resolved Hide resolved
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 governance proposals from v1beta1 to v1
8 participants