From c0c2d8aecea0b4ed8815714d61378ac92caa380a Mon Sep 17 00:00:00 2001 From: noot Date: Mon, 28 Sep 2020 15:02:38 -0400 Subject: [PATCH 1/4] update nonce check --- app/ante/eth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ante/eth.go b/app/ante/eth.go index 38ad814c6..e33132b91 100644 --- a/app/ante/eth.go +++ b/app/ante/eth.go @@ -253,7 +253,7 @@ func (nvd NonceVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim } seq := acc.GetSequence() - if msgEthTx.Data.AccountNonce != seq { + if msgEthTx.Data.AccountNonce < seq { return ctx, sdkerrors.Wrapf( sdkerrors.ErrInvalidSequence, "invalid nonce; got %d, expected %d", msgEthTx.Data.AccountNonce, seq, From de7f68cd4cf83999cfff2f40e20a95d6b37dc141 Mon Sep 17 00:00:00 2001 From: noot Date: Tue, 29 Sep 2020 10:09:33 -0400 Subject: [PATCH 2/4] add comment, update changelog --- CHANGELOG.md | 1 + app/ante/eth.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cfefed04..c7fb9fe92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (`x/evm`) [\#496](https://github.com/ChainSafe/ethermint/pull/496) Fix bugs on `journal.revert` and `CommitStateDB.Copy`. * (types) [\#480](https://github.com/ChainSafe/ethermint/pull/480) Update [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) coin type to `60` to satisfy [EIP84](https://github.com/ethereum/EIPs/issues/84). * (types) [\#513](https://github.com/ChainSafe/ethermint/pull/513) Fix simulated transaction bug that was causing a consensus error by unintentionally affecting the state. +* (app/ante) [\#550](https://github.com/ChainSafe/ethermint/pull/550) Update ante handler nonce verfication to accept any nonce greater than or equal to the expected nonce to allow to successive transactions. ## [v0.1.0] - 2020-08-23 diff --git a/app/ante/eth.go b/app/ante/eth.go index e33132b91..bad8243fa 100644 --- a/app/ante/eth.go +++ b/app/ante/eth.go @@ -253,6 +253,9 @@ func (nvd NonceVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim } seq := acc.GetSequence() + // 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( sdkerrors.ErrInvalidSequence, From efbb2794a5ae4ca27982e8a8cbb576b9bd5221c5 Mon Sep 17 00:00:00 2001 From: noot Date: Tue, 29 Sep 2020 10:26:40 -0400 Subject: [PATCH 3/4] update changelog --- CHANGELOG.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7fb9fe92..e7c903d07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ # 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 ### State Machine Breaking @@ -64,8 +70,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [\#501](https://github.com/ChainSafe/ethermint/pull/501) Fix bech32 encoding error by using the compressed ethereum secp256k1 public key. * (`x/evm`) [\#496](https://github.com/ChainSafe/ethermint/pull/496) Fix bugs on `journal.revert` and `CommitStateDB.Copy`. * (types) [\#480](https://github.com/ChainSafe/ethermint/pull/480) Update [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) coin type to `60` to satisfy [EIP84](https://github.com/ethereum/EIPs/issues/84). -* (types) [\#513](https://github.com/ChainSafe/ethermint/pull/513) Fix simulated transaction bug that was causing a consensus error by unintentionally affecting the state. -* (app/ante) [\#550](https://github.com/ChainSafe/ethermint/pull/550) Update ante handler nonce verfication to accept any nonce greater than or equal to the expected nonce to allow to successive transactions. +* (types) [\#513](https://github.com/ChainSafe/ethermint/pull/513) Fix simulated transaction bug that was causing a consensus error by unintentionally affecting the state. ## [v0.1.0] - 2020-08-23 From 17a4b8a68a50b6c03ec3e0cd8cf53499c45d1fca Mon Sep 17 00:00:00 2001 From: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Date: Tue, 29 Sep 2020 16:29:42 +0200 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7c903d07..92d4101e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,7 +70,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [\#501](https://github.com/ChainSafe/ethermint/pull/501) Fix bech32 encoding error by using the compressed ethereum secp256k1 public key. * (`x/evm`) [\#496](https://github.com/ChainSafe/ethermint/pull/496) Fix bugs on `journal.revert` and `CommitStateDB.Copy`. * (types) [\#480](https://github.com/ChainSafe/ethermint/pull/480) Update [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) coin type to `60` to satisfy [EIP84](https://github.com/ethereum/EIPs/issues/84). -* (types) [\#513](https://github.com/ChainSafe/ethermint/pull/513) Fix simulated transaction bug that was causing a consensus error by unintentionally affecting the state. +* (types) [\#513](https://github.com/ChainSafe/ethermint/pull/513) Fix simulated transaction bug that was causing a consensus error by unintentionally affecting the state. ## [v0.1.0] - 2020-08-23