Skip to content

Commit e075ce8

Browse files
committed
Document why get_attestation_target_with_checkpoints uses pre-import head
1 parent a9d2bf0 commit e075ce8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

crates/blockchain/src/store.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,11 @@ pub fn get_attestation_target(store: &Store) -> Checkpoint {
644644
///
645645
/// This is needed by the proposer, whose block hasn't been imported yet but whose
646646
/// state transition may have advanced justification/finalization.
647+
///
648+
/// Note: the walk-back still starts from `store.head()` (the pre-import head), not
649+
/// the new block. This is correct because the new block is only 1 slot ahead — the
650+
/// walk-back immediately reaches the same chain. The important fix is using the
651+
/// post-state justified/finalized for the justifiability check and clamping guard.
647652
pub fn get_attestation_target_with_checkpoints(
648653
store: &Store,
649654
justified: Checkpoint,

0 commit comments

Comments
 (0)