EIP-7045 · Final · Core · 2023-05-18
EIP-7045: Increase max attestation inclusion slot
Lets beacon-chain attestations be included until the end of the epoch after the one they were made in, strengthening LMD-GHOST security and enabling a fast confirmation rule; shipped in Deneb.
What problem does it solve?
Validators publish attestations (votes) every epoch, and block proposers include them in blocks. Before this change, an attestation made in slot s could only be included up to slot s + SLOTS_PER_EPOCH (32 slots later on mainnet). This sliding one-epoch window was chosen in Phase 0 because it gave every attestation the same amount of time.
Later research showed that the alternative, allowing inclusion through the current and the next epoch, is what the LMD-GHOST fork-choice security proofs need. It also enables a new confirmation rule that can treat blocks as confirmed after roughly 3-4 slots in normal mainnet conditions.
How it works
The max inclusion slot changes from "attestation slot + 32" to "the last slot of epoch N+1", where N is the epoch containing the attestation's slot. Attestations made early in an epoch now get a longer window than those made late in it.
This is a consensus-layer change only. It was included in the Deneb consensus upgrade, which activated together with Cancun as Dencun on mainnet. The execution layer is unchanged. The concrete changes:
process_attestation: the upper bound on the slot is removed. Validity now comes from the minimum inclusion delay plus the rule that the attestation's target epoch is the current or previous epoch.get_attestation_participation_flag_indices:TIMELY_TARGET_FLAGis set regardless ofinclusion_delay, so a late but valid attestation with a correct target vote still earns a non-zero reward. That keeps proposers motivated to include them.- P2P gossip for attestations and aggregates is widened to propagate during the extended range.
The fork timestamp listed in the spec for mainnet is 1710338135.
Sample code
Simplified before/after of the inclusion check (consensus-spec style Python):
# Before (Altair..Capella)
assert data.target.epoch in (get_previous_epoch(state), get_current_epoch(state))
assert data.slot + MIN_ATTESTATION_INCLUSION_DELAY <= state.slot <= data.slot + SLOTS_PER_EPOCH
# After (Deneb, EIP-7045): no upper slot bound;
# the target-epoch check alone limits inclusion to the end of epoch N+1
assert data.target.epoch in (get_previous_epoch(state), get_current_epoch(state))
assert data.slot + MIN_ATTESTATION_INCLUSION_DELAY <= state.slot
And the reward-flag change:
# Before
if is_matching_target and inclusion_delay <= SLOTS_PER_EPOCH:
participation_flag_indices.append(TIMELY_TARGET_FLAG_INDEX)
# After (Deneb)
if is_matching_target:
participation_flag_indices.append(TIMELY_TARGET_FLAG_INDEX)
Things to know
- Status: Final, live on mainnet since the Deneb upgrade. It required a hard fork because it changes block validity rules.
- The source and head timeliness flags are unchanged. Only the target reward is decoupled from inclusion delay, so late attestations still earn less in total than timely ones.
- Validators do not need to change anything. Client software handles the wider window.
- Other consensus-side changes in the same upgrade include EIP-7044 (perpetually valid voluntary exits) and EIP-7514 (max epoch churn limit); EIP-4844 blobs were the headline feature of Dencun.