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: add proposal simulator interface function and tests #4466

Conversation

charleenfei
Copy link
Contributor

Description

closes: #3151


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.

@charleenfei charleenfei added the v8 label Aug 25, 2023
@charleenfei charleenfei marked this pull request as ready for review August 28, 2023 12:11
// Simulation operation weights constants
const (
DefaultWeightMsgUpdateParams int = 100
OpWeightMsgUpdateParams = "op_weight_msg_update_params" // #nosec
Copy link
Contributor

Choose a reason for hiding this comment

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

is // #nosec a directive of sorts? any clue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea, i had to add it bc otherwise the linter thought i was sharing secrets 🙃

Copy link
Member

@damiannolan damiannolan Sep 4, 2023

Choose a reason for hiding this comment

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

that's a yikes from me

Copy link
Contributor

Choose a reason for hiding this comment

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

yikes++

@charleenfei charleenfei force-pushed the charly/issue#3151-support-proposalmsgs-interface-function branch from 95e4ff5 to 3aac9c1 Compare September 1, 2023 11:48
@charleenfei charleenfei changed the base branch from main to feat/govv1 September 1, 2023 11:49
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.

Nice! Looks good, do we need to add these for transfer? or they are already there?

@charleenfei
Copy link
Contributor Author

aha, i forgot about the UpdateParams gov-gated transfer message. will update this PR!

@charleenfei charleenfei marked this pull request as draft September 4, 2023 15:28
@charleenfei charleenfei marked this pull request as ready for review September 5, 2023 12:46
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.

Thanks, @charleenfei. Left a couple of questions.❓

func SimulateMsgUpdateParams(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) sdk.Msg {
var authority sdk.AccAddress = address.Module("gov")
params := types.DefaultParams()
params.HostEnabled = false
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we randomise this value as SDK does?

Copy link
Contributor Author

@charleenfei charleenfei Sep 7, 2023

Choose a reason for hiding this comment

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

sure, we can do this! I guess I just wanted to keep it one value to make testing easier 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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 the purpose of simulations is that it performs random operations, we don't utilize simulations so this is mostly for chains which run sdk simulations

modules/apps/transfer/simulation/proposals.go Show resolved Hide resolved
modules/core/simulation/proposals.go Show resolved Hide resolved
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.

Nice work. Thank you, @charleenfei.

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @charleenfei

func SimulateMsgUpdateParams(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) sdk.Msg {
var authority sdk.AccAddress = address.Module("gov")
params := types.DefaultParams()
params.HostEnabled = false
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 the purpose of simulations is that it performs random operations, we don't utilize simulations so this is mostly for chains which run sdk simulations

@colin-axner
Copy link
Contributor

this can target main? unless you are planning on adding the new proposal msg types as well?

@charleenfei charleenfei merged commit c4f947e into feat/govv1 Sep 7, 2023
50 checks passed
@charleenfei charleenfei deleted the charly/issue#3151-support-proposalmsgs-interface-function branch September 7, 2023 15:09
@charleenfei charleenfei restored the charly/issue#3151-support-proposalmsgs-interface-function branch September 7, 2023 15:09
@charleenfei charleenfei deleted the charly/issue#3151-support-proposalmsgs-interface-function branch September 7, 2023 15:10
colin-axner added a commit that referenced this pull request Sep 13, 2023
…and `MsgIBCSoftwareUpgrade`. The legacy proposal types `ClientUpdateProposal` and `UpgradeClientProposal` have been removed. (#4620)

* Add proto message, implement sdk.Msg for Recover Client. (#4494)

* Add proto message for Recover client, implement sdk.Message interface.

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

Co-authored-by: Damian Nolan <[email protected]>

* Apply suggestions from code review

Co-authored-by: Charly <[email protected]>

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

---------

Co-authored-by: Damian Nolan <[email protected]>
Co-authored-by: Charly <[email protected]>

* add protos, msgs, keeper handler to upgrade clients using v1 governance proposals (#4436)

* add protos and keeper function placeholder

* add keeper functions/tests, msgs and tests

* update to 0.47.5 release branch

* Move signer as last proto field. (#4510)

* msg server function and tests for MsgScheduleIBCClientUpgrade (#4442)

* Add 02-client implementation for Recover client. (#4499)

* Add 02-client implementation for Recover client.

* Partially address feedback.

* Docu RecoverClient, add label, re-use error.

* Add implementation for recover client on message server. (#4503)

* 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. (#4522)

* 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 <[email protected]>

* Add auth flag.

---------

Co-authored-by: Damian Nolan <[email protected]>

* rename command

* docs: fixed broken links (#4571)

* Add e2e test for recovering a client. (#4543)

Co-authored-by: Colin Axnér <[email protected]>

* feat: add unpacket inerfaces message assertion (#4588)

* add cli for MsgIBCSoftwareUpgrade (#4558)

* docs: use MsgRecoverClient in docs (#4580)

* docs: recover client update

* Update docs/ibc/proposals.md

* Apply suggestions from code review

Co-authored-by: Carlos Rodriguez <[email protected]>

---------

Co-authored-by: Carlos Rodriguez <[email protected]>

* refactor: remove legacy client update proposal (#4581)

* refactor: remove legacy client update proposal

* e2e: swap from ClientUpdateProposal e2e to RecoverClient

* refactor: remove unused events

* feat: add proposal simulator interface function and tests (#4466)

Co-authored-by: colin axner <[email protected]>

* refactor!: remove UpgradeProposal type (#4602)

* create separate event emission for ibc software upgrades vs an upgraded client (#4594)

* add new event type

* update event name

* fix build

* remove: legacy event emissions

* remove: unnecessary assignments, apply suggestion from code review

* e2e: schedule IBC software upgrade (#4585)

* 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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Damian Nolan <[email protected]>
Co-authored-by: colin axnér <[email protected]>
Co-authored-by: Sishir Giri <[email protected]>
Co-authored-by: srdtrk <[email protected]>
Co-authored-by: Cian Hatton <[email protected]>
Co-authored-by: Julien Robert <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: sontrinh16 <[email protected]>
Co-authored-by: catShaark <[email protected]>
Co-authored-by: khanh-notional <[email protected]>

* chore: docs for MsgIBCSoftwareUpgrade (#4601)

* chore: update docs for UpgradeProposal -> MsgIBCSoftwareUpgrade

* chore: anticipate link change

* fix event docs

* refactor: s.Assert -> s.Require

* Apply suggestions from code review

Co-authored-by: Damian Nolan <[email protected]>

* make proto-all

* chore: update compiler assertion

* refactor: ordering, order as follows: create, update, upgrade, misbheaviour, recover, ibcsoftwareupgrade, update params

* refactor: simplify ibc software upgrade emitted event

* lint lint lint

* Apply suggestions from code review

Co-authored-by: Charly <[email protected]>

* review of feat/govv1

* pr nits

* fix tests for error wrapping

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Damian Nolan <[email protected]>
Co-authored-by: Charly <[email protected]>
Co-authored-by: Charly <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
Co-authored-by: srdtrk <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sishir Giri <[email protected]>
Co-authored-by: Cian Hatton <[email protected]>
Co-authored-by: Julien Robert <[email protected]>
Co-authored-by: sontrinh16 <[email protected]>
Co-authored-by: catShaark <[email protected]>
Co-authored-by: khanh-notional <[email protected]>
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.

Support ProposalMsgs interface function
6 participants