Skip to content

fix: remove delegator addess from MsgCreateValidator#14567

Merged
atheeshp merged 25 commits into
cosmos:mainfrom
0xbala-k:murali/staking
Jan 17, 2023
Merged

fix: remove delegator addess from MsgCreateValidator#14567
atheeshp merged 25 commits into
cosmos:mainfrom
0xbala-k:murali/staking

Conversation

@0xbala-k
Copy link
Copy Markdown
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)

@0xbala-k 0xbala-k requested a review from a team 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
Comment thread proto/cosmos/staking/v1beta1/tx.proto
Comment thread proto/cosmos/staking/v1beta1/tx.proto Outdated
Copy link
Copy Markdown
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.

@0xbala-k 0xbala-k requested review from alexanderbez, julienrbrt and tac0turtle and removed request for alexanderbez, julienrbrt and tac0turtle January 11, 2023 05:04
Comment thread x/staking/types/msg.go
@@ -88,17 +81,10 @@ func (msg MsgCreateValidator) GetSignBytes() []byte {
// ValidateBasic implements the sdk.Msg interface.
func (msg MsgCreateValidator) ValidateBasic() error {
Copy link
Copy Markdown
Contributor

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

Comment thread proto/cosmos/staking/v1beta1/tx.proto Outdated
Copy link
Copy Markdown
Contributor

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

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

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

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