-
Notifications
You must be signed in to change notification settings - Fork 341
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(sequencers): incorrect sorting mechanism allows manipulation of proposer selection #1292
fix(sequencers): incorrect sorting mechanism allows manipulation of proposer selection #1292
Conversation
} | ||
// validate bond requirement | ||
minBond := k.GetParams(ctx).MinBond | ||
if !msg.Bond.IsGTE(minBond) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see we removed the check if the bond denom
is the same as the minBond denom
. in that case where do we enforce someone doesn't bond other token denom vs the bond denom defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's checked in IsGTE
// IsGTE returns true if they are the same type and the receiver is
// an equal or greater value
@@ -55,45 +49,63 @@ func (suite *SequencerTestSuite) TestMinBond() { | |||
bond: sdk.NewCoin(bond.Denom, bond.Amount.Quo(sdk.NewInt(2))), | |||
expectedError: types.ErrInsufficientBond, | |||
}, | |||
{ | |||
name: "wrong bond denom", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also this test seems to test the wrong thing - i.e fail on invalid coin denom vs valid but not what we expected (i.e wrong denom).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed the test a bit
Description
Closes #1291
This PR does the following:
MinBond
param to be > 0 (instead >= 0 currently)