ante: update nonce check (#550)
This commit is contained in:
parent
cee4c5f31f
commit
7f648d2c55
@ -35,6 +35,12 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
|||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
* (app/ante) [\#550](https://github.com/ChainSafe/ethermint/pull/550) Update ante handler nonce verification to accept any nonce greater than or equal to the expected nonce to allow to successive transactions.
|
||||||
|
|
||||||
## [v0.2.0] - 2020-09-24
|
## [v0.2.0] - 2020-09-24
|
||||||
|
|
||||||
### State Machine Breaking
|
### State Machine Breaking
|
||||||
|
@ -253,7 +253,10 @@ func (nvd NonceVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim
|
|||||||
}
|
}
|
||||||
|
|
||||||
seq := acc.GetSequence()
|
seq := acc.GetSequence()
|
||||||
if msgEthTx.Data.AccountNonce != seq {
|
// if multiple transactions are submitted in succession with increasing nonces,
|
||||||
|
// all will be rejected except the first, since the first needs to be included in a block
|
||||||
|
// before the sequence increments
|
||||||
|
if msgEthTx.Data.AccountNonce < seq {
|
||||||
return ctx, sdkerrors.Wrapf(
|
return ctx, sdkerrors.Wrapf(
|
||||||
sdkerrors.ErrInvalidSequence,
|
sdkerrors.ErrInvalidSequence,
|
||||||
"invalid nonce; got %d, expected %d", msgEthTx.Data.AccountNonce, seq,
|
"invalid nonce; got %d, expected %d", msgEthTx.Data.AccountNonce, seq,
|
||||||
|
Loading…
Reference in New Issue
Block a user