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

fix: remove delegator addess from MsgCreateValidator #14567

Merged
merged 25 commits into from
Jan 17, 2023

Conversation

0xmuralik
Copy link
Contributor

Description

Remove delegator address field from MsgCreateValidator and other related checks, as one cannot create a validator on behalf of other address (i.e. both delegator and validator address are always same while creating a new validator).

Closes: #4595


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@0xmuralik 0xmuralik requested a review from a team as a code owner January 10, 2023 10:21
@likhita-809 likhita-809 changed the title remove delegator addess from MsgCreateValidator fix: remove delegator addess from MsgCreateValidator Jan 10, 2023
Copy link
Contributor

@alexanderbez alexanderbez 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 the contrib @0xmuralik! As others have pointed out, we cannot remove fields from Proto schemas. Rather, you must explicitly mark them as deprecated and then you can remove/modify all associated business logic.

@@ -88,17 +81,10 @@ func (msg MsgCreateValidator) GetSignBytes() []byte {
// ValidateBasic implements the sdk.Msg interface.
func (msg MsgCreateValidator) ValidateBasic() error {
Copy link
Member

@julienrbrt julienrbrt Jan 11, 2023

Choose a reason for hiding this comment

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

Given that the field is deprecated, we may want to return an error when it is being used?
This makes it state breaking however. But we've done that from bank multisend (going from multiples inputs to only one supported)

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can ignore the value without giving error?

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Left one comment on making the docs clearer, but other LGTM!

proto/cosmos/staking/v1beta1/tx.proto Outdated Show resolved Hide resolved
Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

utACK

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

lgtm, can you add a changelog entry as well?

@alexanderbez
Copy link
Contributor

Nice! Thanks for the contribution! Once a changelog entry is in, we'll merge 🙌

@atheeshp atheeshp merged commit 7b8ab8e into cosmos:main Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove DelegatorAddress from Msg CreateValidator