Skip to content

Commit b3bf7f2

Browse files
apollo_consensus_orchestrator: bind parent block fee_proposal_fri in blob commitment
1 parent 8596488 commit b3bf7f2

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,15 @@ impl SequencerConsensusContext {
575575
self.wait_for_block_hash(height).await;
576576
}
577577

578+
// The parent block's `fee_proposal_fri` is needed to reconstruct its V0_14_3 commitment
579+
// (`Poseidon(partial_block_hash, fee_proposal_fri)`). It is read from the in-memory
580+
// `fee_proposals_window`, which mirrors `BlockHeaderWithoutHash` storage. `None` means the
581+
// parent is pre-V0_14_3 (or, near genesis, is absent from the window).
582+
let parent_fee_proposal = height
583+
.prev()
584+
.and_then(|parent_height| self.fee_proposals_window.get(&parent_height).copied())
585+
.flatten();
586+
578587
if let Err(e) = self
579588
.deps
580589
.cende_ambassador
@@ -600,13 +609,9 @@ impl SequencerConsensusContext {
600609
compiled_class_hashes_for_migration: central_objects
601610
.compiled_class_hashes_for_migration,
602611
proposal_commitment: commitment,
603-
// TODO(AndrewL): plumb the parent block's `fee_proposal_fri` here once
604-
// `central_objects.parent_proposal_commitment` carries it (or read from
605-
// BlockHeaderWithoutHash storage). Today we pass `None`, which means
606-
// pre-V0_14_3 commitments — correct for pre-V0_14_3 deployments only.
607612
parent_proposal_commitment: central_objects
608613
.parent_proposal_commitment
609-
.map(|c| proposal_commitment_from(c.partial_block_hash, None)),
614+
.map(|c| proposal_commitment_from(c.partial_block_hash, parent_fee_proposal)),
610615
recent_block_hashes: self.collect_recent_block_hashes(height).await,
611616
})
612617
.await

0 commit comments

Comments
 (0)