EIP-7658 · Stagnant · Core · 2024-03-21
EIP-7658: Light client data backfill
Proposes recording the best sync-committee signature of each period in the BeaconState, so beacon nodes can backfill and prove canonical light client data for past periods.
What problem does it solve?
Since Altair, beacon nodes produce light client data: small updates signed by the sync committee that let a light client follow the chain without downloading full blocks. The existing sync protocol only works forward: a node creates this data as it follows new blocks.
Producing it for the past is hard. A node needs the matching BeaconState and SignedBeaconBlock, but states before the node's checkpoint are not available and blocks are only kept on the p2p network for a limited time. There is also no single agreed answer for which update is "the best" for a given ~27-hour sync committee period, so archives such as the Portal Network cannot serve a consistent, verifiable set of historical updates.
How it works
The EIP adds a minimal amount of tracking to the consensus state:
- A new container
SyncData { sync_aggregate, signature_slot }. - Three new
BeaconStatefields:previous_best_sync_data,current_best_sync_dataandparent_block_has_sync_committee_finality. - On every block (
process_best_sync_data, run before the block header is processed), the node compares the block'sSyncAggregatewith the current best for this period, using a subset of the existing light-clientis_better_updateranking:- a 2/3 supermajority of participants beats no supermajority;
- without supermajority, more participants wins;
- data where the next sync committee is finalized beats data where it is not;
- otherwise more participants wins;
- ties go to the lower
signature_slot.
- At each sync committee period boundary,
current_best_sync_datamoves toprevious_best_sync_dataand the current slot is reset.
Because the choice is now part of the state root, anyone can later prove with a Merkle proof that a given LightClientUpdate for a past period is the canonical, optimal one. The rationale sketches a backfill protocol that combines this with historical_summaries proofs to rebuild LightClientBootstrap and update data for old periods.
Sample code
The new container and state fields (consensus-spec Python):
class SyncData(Container):
sync_aggregate: SyncAggregate # sync committee aggregate signature
signature_slot: Slot # slot at which it was created
class BeaconState(Container):
...
previous_best_sync_data: SyncData
current_best_sync_data: SyncData
parent_block_has_sync_committee_finality: bool
def process_block(state: BeaconState, block: BeaconBlock) -> None:
process_best_sync_data(state, block) # new, before the header is overwritten
process_block_header(state, block)
...
Things to know
- Status is Stagnant. It has not been scheduled for a consensus upgrade.
- It needs a hard fork. Only light client data after that fork could be proven canonical this way; earlier periods could at best be pinned by a hash once finalized.
- No new
LightClientUpdatestructures are stored in state, only the chosen signature and its slot, keeping the state growth small. - It complements other history work such as EIP-7643 (a fixed root for pre-Merge history) and EIP-4444 (history expiry), which increase reliance on archives that must serve verifiable data.