• Joshua Gutow's avatar
    op-node: Prefer following seq drift instead of conf depth (#3861) · 9940c8cd
    Joshua Gutow authored
    * op-node: Prefer following seq drift instead of conf depth
    
    We found a log on a testnet where a batch was rejected because it's
    timestamp was greater than the origin timestamp + sequencer drift.
    I looked into origin selection and determined we produce empty blocks
    if the block time is ahead of the origin + seq drift; however if there
    is a next origin, it is not enough to produce an empty block, we must
    change the origin.
    
    I hypothesize that this occurred because the L1 head that the node was
    looking at was lagging. That would cause the node to keep using an
    old origin even if the timestamp was past the max drift. I added
    a unit test which shows this case & would fail without this fix
    being applied.
    
    * op-node: Don't immediately attempt to advance origin
    
    If the current origin is past the sequencer drift, it needs to
    ignore the conf depth staying, but does still need to check next
    L2 block time against the next origin time.
    
    I've also added a test for this case.
    9940c8cd
origin_selector.go 3.4 KB