EIP-7658 Light client data backfill
No call decision · Networking & nodes · EIP status Stagnant · created 2024-03-21
Records the optimal signature data for each sync committee period in the BeaconState, making it possible to prove that light client data from past points in time is also canonical and optimal.
Why it is needed
Light clients pick up the sync committee signatures relayed by beacon nodes and sync to the current point in time. However, this protocol only moves forward and has no way to sync backward into the past. Reconstructing past data requires the BeaconState and SignedBeaconBlock from that time, but BeaconState does not exist before the checkpoint from which a node first synced, and SignedBeaconBlock is only kept on libp2p for a short period. Furthermore, nodes can disagree on which participation signature was best for a given sync committee period, making it hard for archive services like the Portal Network, where multiple backends must serve the same historical data, to guarantee consistency. This EIP records which signature is canonical and optimal directly in the chain state, so that anyone can reconstruct and prove historical data with the same result.
What changes
Today
- The light client sync protocol only works going forward and cannot sync backward to reconstruct historical data
- SignedBeaconBlock has a short libp2p retention period, making past blocks hard to obtain
- There is no agreed standard for which signature is optimal in each sync committee period, so archive backends can return different data
After EIP-7658
- Record the optimal signature data for the previous and current sync committee periods in BeaconState (previous_best_sync_data, current_best_sync_data)
- Update the optimal data on every block based on participant count, finality, and signature_slot, and move current to previous at period boundaries
- This record lets anyone produce a Merkle proof that a past period's LightClientUpdate or LightClientBootstrap was canonical and optimal
Who is affected
- Light client: Data from past periods also becomes verifiable, enabling trusted syncing from any point in time.
- Archive services such as the Portal Network: They can consistently serve the same historical data even across different backend implementations.
- Client teams: Adding BeaconState fields and the process_best_sync_data logic must be implemented via a hard fork.
- Validators: Signing behavior itself does not change, but the change to state transition rules requires a hard fork to apply.
In depth
SyncData container and BeaconState extension
The new SyncData container holds sync_aggregate (the sync committee signature aggregate) and signature_slot (the slot in which that signature was produced). Starting from the activation fork, three fields are added to the end of BeaconState: previous_best_sync_data, current_best_sync_data, and parent_block_has_sync_committee_finality. These respectively record the optimal signature data for the previous and current sync committee periods, and whether sync committee finality had already been established as of the parent block.
Moving current to previous at period boundaries
process_sync_committee_updates is modified so that when the next epoch falls on an EPOCHS_PER_SYNC_COMMITTEE_PERIOD boundary, the current_best_sync_data accumulated so far is moved to previous_best_sync_data, and current_best_sync_data is reset to default_sync_data() (an empty bitvector, a G2_POINT_AT_INFINITY signature, and GENESIS_SLOT). parent_block_has_sync_committee_finality is also reset. This fixes the optimal data for the period that just ended in the previous field, so it no longer changes.
Updating the optimal signature data on every block
The new function process_best_sync_data is called before process_block_header. It only compares when the block's signature slot and the sync committee period of the parent block match, and it compares, in order, whether the participant count is at least two-thirds of the total (supermajority), whether the next sync committee's finality is secured, the participant count itself, and finally whether signature_slot is lower, storing the better of the two as current_best_sync_data.
Tracking sync committee finality
Once parent_block_has_sync_committee_finality becomes True, it stays True for the rest of the period. It first becomes True when state.finalized_checkpoint.epoch is after ALTAIR_FORK_EPOCH and the finalized checkpoint's sync committee period matches the period of the currently attested block header. This value is used as one of the comparison criteria in process_best_sync_data, giving priority to signatures with finality over those without.
Tie-breaking rules and reuse of is_better_update
The ranking comparison reuses the logic of the existing is_better_update function from consensus-specs as is. When participant count and finality are also tied and no clear winner exists, the tie-breaking rule specifies preferring the block with the lower signature_slot. This ensures every node viewing the same chain data always converges on the same result, deterministically leaving exactly one canonical signature.
How this could be used in a backfill protocol
The source text gives an example six-step procedure for serving historical period data. It proves that the entire period is finalized using the next period's LightClientUpdate, links each epoch's slot-0 block header via a Merkle proof from historical_summaries, and then constructs a LightClientBootstrap using current_sync_committee_branch. Only the last step depends on the state fields added by this EIP, proving via Merkle proof that the period's optimal sync_aggregate and signature_slot were selected as canonically optimal in BeaconState.
Need for a hard fork and limitations on pre-activation data
A hard fork is required because new state transition validation rules are added. Only light client data from after the activation fork can have its canonicality and optimality proven through this mechanism; data from before activation cannot be proven this way. However, it notes that once the fork transition block is finalized, the data before it no longer changes, so pinning it by hash and trusting it separately remains possible.
Current status: Stagnant
The status of this EIP is Stagnant. There has been no active discussion or decision on fork inclusion, and the specification content or adoption may change or be discontinued in the future.