Problem Statement / Feature Objective
Attestation inclusion delay is defined as the number of slots between the attestation's assigned slot and the slot in which it is included in a beacon block. When a slot is skipped (no beacon block produced), the inclusion delay counter does not increment, causing the delay to be under-counted. This results in incorrect attestation rewards (too high) for attestations included after skipped slots and undermines the fork-choice rule.
Technical Invariants & Bounds
- Inclusion delay reward: max at delay = 1, linearly decreases to 0 at delay = 32.
- MIN_ATTESTATION_INCLUSION_DELAY = 1 slot.
- A skipped slot produces no beacon block; the next proposer includes attestations.
- Delays must be counted in wall-clock slots, not block-producing slots.
- Fork-choice uses inclusion delay to weight branches.
Codebase Navigation Guide
- src/attestation/inclusion-tracker.rs - compute_inclusion_delay() and update_delay_rewards().
- src/consensus/fork-choice.rs - branch_weighting that consumes inclusion delay.
- src/state/block-processor.rs - process_block() that calls into inclusion tracker.
- tests/attestation/inclusion_delay_test.rs - delay computation tests.
Implementation Blueprint
- In src/attestation/inclusion-tracker.rs, change compute_inclusion_delay() to use (block_slot - attestation_slot) directly instead of counting only slots with blocks.
- Add a helper fn wall_slots_between(start: Slot, end: Slot) -> u64 that simply returns end - start.
- Update the reward calculation in update_delay_rewards() to use wall-clock delay.
- Add a test case: attestation in slot 10, included in block at slot 15 with slots 12-14 skipped; assert delay = 5, not 2.
- Verify fork-choice branch_weighting produces the same total weight regardless of skipped slot distribution.
Problem Statement / Feature Objective
Attestation inclusion delay is defined as the number of slots between the attestation's assigned slot and the slot in which it is included in a beacon block. When a slot is skipped (no beacon block produced), the inclusion delay counter does not increment, causing the delay to be under-counted. This results in incorrect attestation rewards (too high) for attestations included after skipped slots and undermines the fork-choice rule.
Technical Invariants & Bounds
Codebase Navigation Guide
Implementation Blueprint