Commit 33acb7c6 authored by Kelvin Fichter's avatar Kelvin Fichter

feat(l2g): properly return NonceTooHigh

Has the Sequencer properly return NonceTooHigh when the nonce on a
transaction is higher than the nonce of the account. NonceTooHigh is not
typically in this codepath, but here it makes sense because there is no
mempool and the txn is being rejected outright.
parent 9be79339
---
'@eth-optimism/l2geth': patch
---
Has l2geth return a NonceToHigh response if the txn nonce is greater than the expected nonce.
......@@ -555,8 +555,10 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
}
// Ensure the transaction adheres to nonce ordering
if rcfg.UsingOVM {
if pool.currentState.GetNonce(from) != tx.Nonce() {
if pool.currentState.GetNonce(from) > tx.Nonce() {
return ErrNonceTooLow
} else if pool.currentState.GetNonce(from) < tx.Nonce() {
return ErrNonceTooHigh
}
} else {
if pool.currentState.GetNonce(from) > tx.Nonce() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment