optimism
optimism copied to clipboard
interop: cleanup `Safest` API
The Safest function, on ChainsDB and used by a few backend methods for the RPC, checks how safe a block is, returning the safety level.
It currently takes an index argument, thus potentially returning a different safety-level per log event.
This should be dropped, in favor of separate methods that handle the uncertainty of intra-block messaging (it doesn't mean that a log event is valid just because prior logs are valid, a later event might invalidate the block still).
Additionally, the Safest function should assert block-hashes more, to prevent reorg related race-conditions between safety checks. See https://github.com/ethereum-optimism/optimism/issues/11693