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

[Bug]: x/staking param validation assumes denom name of 'stake' #22645

Closed
1 task done
PoisonPhang opened this issue Nov 25, 2024 · 1 comment · Fixed by #22646
Closed
1 task done

[Bug]: x/staking param validation assumes denom name of 'stake' #22645

PoisonPhang opened this issue Nov 25, 2024 · 1 comment · Fixed by #22646
Labels

Comments

@PoisonPhang
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

When the staking params are validated validateKeyRotationFee assumes the denom is 'stake' or whatever DefaultBondDenom is set to. For chains setting this to anything other than 'stake' this will fail.

func validateKeyRotationFee(i interface{}) error {
v, ok := i.(sdk.Coin)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}
if v.IsNil() {
return fmt.Errorf("cons pubkey rotation fee cannot be nil: %s", v)
}
if v.IsLTE(sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)) {
return fmt.Errorf("cons pubkey rotation fee cannot be negative or zero: %s", v)
}
return nil
}

Cosmos SDK Version

main, v0.52.0-beta.2

How to reproduce?

Validate a genesis where the staking denoms are set to something other than 'stake'

@julienrbrt
Copy link
Member

Good catch! Thanks for opening this issue.

PoisonPhang added a commit to unionlabs/union that referenced this issue Nov 25, 2024
Updates the Cosmos SDK ref to include fixes that force the bn254 keytype
to be the default for all changes.

To view changes to the SDK, see here:

unionlabs/cosmos-sdk@8fe64ac

Also fixes this
cosmos/cosmos-sdk#22645
@github-project-automation github-project-automation bot moved this from 📋 Backlog to 🥳 Done in Cosmos-SDK Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🥳 Done
Development

Successfully merging a pull request may close this issue.

2 participants