Commit 709c85d6 authored by Mark Tyneway's avatar Mark Tyneway

l2geth: only accept txs with exact nonce

This PR makes it so that the sequencer will
only accept transactions if the nonce exactly
matches what is in the state. This is because the
mempool in upstream geth has different rules than
what l2geth needs.

This prevents issues with local nonce managers that
send transactions with a too large of nonce and
end up having all of the transactions revert since
the transaction is still accepted but reverts
in the OVM
parent 6112b7aa
---
'@eth-optimism/l2geth': patch
---
Prevents the sequencer from accepting transactions with a too high nonce
......@@ -560,8 +560,14 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
return ErrUnderpriced
}
// Ensure the transaction adheres to nonce ordering
if pool.currentState.GetNonce(from) > tx.Nonce() {
return ErrNonceTooLow
if vm.UsingOVM {
if pool.currentState.GetNonce(from) != tx.Nonce() {
return ErrNonceTooLow
}
} else {
if pool.currentState.GetNonce(from) > tx.Nonce() {
return ErrNonceTooLow
}
}
// Transactor should have enough funds to cover the costs
// cost == V + GP * GL
......
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