Skip to content
This repository was archived by the owner on Nov 30, 2021. It is now read-only.

Commit 7f648d2

Browse files
authored
ante: update nonce check (#550)
1 parent cee4c5f commit 7f648d2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ Ref: https://keepachangelog.com/en/1.0.0/
3535

3636
# Changelog
3737

38+
## Unreleased
39+
40+
### Bug fixes
41+
42+
* (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.
43+
3844
## [v0.2.0] - 2020-09-24
3945

4046
### State Machine Breaking

app/ante/eth.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,10 @@ func (nvd NonceVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim
253253
}
254254

255255
seq := acc.GetSequence()
256-
if msgEthTx.Data.AccountNonce != seq {
256+
// if multiple transactions are submitted in succession with increasing nonces,
257+
// all will be rejected except the first, since the first needs to be included in a block
258+
// before the sequence increments
259+
if msgEthTx.Data.AccountNonce < seq {
257260
return ctx, sdkerrors.Wrapf(
258261
sdkerrors.ErrInvalidSequence,
259262
"invalid nonce; got %d, expected %d", msgEthTx.Data.AccountNonce, seq,

0 commit comments

Comments
 (0)