The "L1 Header Hash History" feature allows direct access to recent L1 header hash on L2.
It is useful for two primary applications:
Random number generator.
Verification of L1 state on L2.
This feature is similar to the recent EIP-2935arrow-up-right, which finally lands after 5 years.
We implemented it by extending the L1Block a bit herearrow-up-right, which is used by OP Stack to store information about L1 block.
When L1 block information is saved, it is now also stored in one slot of the 8192-window buffer.
The slot for block N can be computed as:
N
N % HISTORY_SIZE
The stored block hash can be retrieved by calling the blockHash(uint256 _historyNumber)arrow-up-right method.
blockHash(uint256 _historyNumber)
Last updated 11 months ago