optimism
optimism copied to clipboard
Insert unsafe blocks in order while performing EL sync
Geth is not able to cleanly handle gaps in blocks while performing EL sync. During snap sync it logs err chain gapped, during full sync, it will log chain reorg & return early out of newPayload / FCU.
The way to implement this is to use the unsafe payload queue and the request/response protocol to backfill missing unsafe payloads. We should only be doing this close to tip so the current request/response protocol will work. Just the native unsafe payload queue will help in the case the unsafe blocks are received out of order.
In the case that op-node is restarted while op-geth stays up, op-node may want to start inserting unsafe heads right after op-geth's current unsafe head (though IDK if there is a way to get that, maybe we have to use eth.syncing
instead.)