Commit e2b70c12 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

l2geth: remove miner panic (#915)

parent 1bd79659
---
'@eth-optimism/l2geth': patch
---
Don't panic on a monotonicity violation
...@@ -872,12 +872,13 @@ func (w *worker) commitNewTx(tx *types.Transaction) error { ...@@ -872,12 +872,13 @@ func (w *worker) commitNewTx(tx *types.Transaction) error {
if tx.QueueOrigin().Uint64() == uint64(types.QueueOriginSequencer) { if tx.QueueOrigin().Uint64() == uint64(types.QueueOriginSequencer) {
tx.SetL1Timestamp(parent.Time()) tx.SetL1Timestamp(parent.Time())
prev := parent.Transactions() prev := parent.Transactions()
if len(prev) != 1 { if len(prev) == 1 {
panic("Cannot recover L1BlockNumber") tx.SetL1BlockNumber(prev[0].L1BlockNumber().Uint64())
} else {
log.Error("Cannot recover L1 Blocknumber")
} }
tx.SetL1BlockNumber(prev[0].L1BlockNumber().Uint64())
} else { } else {
panic("Monotonicity violation") log.Error("Cannot recover from monotonicity violation")
} }
} }
......
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