The function l1Inclusion() in algo.go calls OptimisticAt() on the ChainContainer to obtain the L1 block that each L2 head was derived from:
|
_, l1Block, err := chain.OptimisticAt(i.ctx, ts) |
|
if err != nil { |
|
i.log.Error("failed to get L1 inclusion for L2 block", "chainID", chainID, "timestamp", ts, "err", err) |
|
return eth.BlockID{}, fmt.Errorf("chain %s: failed to get L1 inclusion: %w", chainID, err) |
|
} |
However, if there has been a reorg between fetching the L2 blocks and calling this function, this information might be incorrect, as the L2 block at the given timestamp might have changed. Instead, the L1 inclusion should be calculated using the L1 heads already retrieved previously by observeRound().
The function
l1Inclusion()inalgo.gocallsOptimisticAt()on theChainContainerto obtain the L1 block that each L2 head was derived from:_audits_Ethereum-optimism_optimism_interopv2/op-supernode/supernode/activity/interop/algo.go
Lines 41 to 45 in bd29b7d
However, if there has been a reorg between fetching the L2 blocks and calling this function, this information might be incorrect, as the L2 block at the given timestamp might have changed. Instead, the L1 inclusion should be calculated using the L1 heads already retrieved previously by
observeRound().