ethereum-optimism / ethereum-optimism/optimism
op-batcher: frame cursor rewind may not always work
- Dominant language
- Go
- Stars
- 6.5k
- Forks
- 4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 145
Description
If a tx fails (due to context timeout, gas estimation failing, incorrect nonce), then the batcher will rewind the frame cursor of the affected channel, so that the frame(s) are resent on chain. However, this mechanism may not always work, since there could be channels with frames in txs already in the mempool with a nonce higher than the original tx which failed, but lower than the newly submitted tx.
This might lead to a nonce gap, we need to check how the txmgr handles this situation to be sure. It might also lead to out of order frames, violating Holocene derivation rules and causing a safe chain halt. The batcher in theory would detect that and reset everything, but we should check.
We might need to rewind frames of all channels behind the affected channel too, depending on how the txmgr handles nonces.
Improving existing tests for this functionality, to include multiple channels, would be a great starting point.
Contributor guide
Research direction
Start with the existing op-batcher frame-cursor rewind tests and inspect how txmgr handles failed transactions, pending nonces, and nonce gaps. Extend the tests to cover multiple channels and define done as correctly rewinding any channels needed to prevent nonce gaps, out-of-order frames, or a safe-chain halt.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- blockchain
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100