ethereum-optimism / ethereum-optimism/specs

feat: Store historical block hashes to `L1Block`

Open
#243 12 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
178
Forks
206
Avg merge
5d 2h
Merged PRs (30d)
6

Description

**Is your feature request related to a problem? Please describe.**
When it comes to updating the L2, the `L1Block` is regularly called to update its' state values, including the L1 block hash. This hash is extremely valuable as a user can create a proof for any state of the L1 at the current block hash.

The issue arises when dealing with historical data. As we are only ever using the most-recent hash within `L1Block`, we are unable to prove L1 state at a historical point in time on-chain without deploying our own contract with manually-synced block hashes.

The value of a chain is derived by the value of its' state. Therefore, by having the ability to prove state at a particular time in the past, we open up cross-chain communication.

An example of what this can be used for is to prove L1 token voting power at a particular point in time.

**Describe the solution you'd like**
Have a mapping with `L1Block` to store historical hashes. The most simple way I've seen it done is through a [basic mapping](https://fraxscan.com/address/0xc0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d30015#code#F1#L61).

Contributor guide

Open the contributing guide

Research direction

Start by locating the L1Block contract and reviewing how its current L1 block hash is updated. Compare the proposed historical-hash mapping with the linked basic mapping example, then clarify storage, lookup, update, and proof behavior. Done means historical L1 state can be queried on-chain at a specified block hash, with tests covering that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
blockchain
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.