Skip to content

Commit 4893526

Browse files
fix deferred
1 parent 38115b7 commit 4893526

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

consensus/src/marshal/standard/deferred.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,15 @@ where
310310
.spawn(move |runtime_context| async move {
311311
// On leader recovery, marshal may already hold a verified block
312312
// for this round (persisted by a pre-crash propose whose
313-
// notarize vote never reached the journal). Building a fresh
314-
// block would land on the same prunable archive index and be
315-
// silently dropped, so the stored block is the only proposal
316-
// we can broadcast for this round. The recovered block is
317-
// safe to reuse only if its embedded context matches the
318-
// context simplex just recovered. Otherwise the cached block
319-
// was built against a different parent and cannot be
313+
// notarize vote never reached the journal).
314+
//
315+
// Building a fresh block would land on the same prunable archive
316+
// index and be silently dropped, so the stored block is the only proposal
317+
// we can broadcast for this round.
318+
//
319+
// The recovered block is safe to reuse only if its embedded
320+
// context matches the context simplex just recovered. Otherwise the
321+
// cached block was built against a different parent and cannot be
320322
// broadcast under the current header, so drop the receiver
321323
// and let the voter nullify the view via timeout.
322324
if let Some(block) = marshal.get_verified(consensus_context.round).await {
@@ -1213,8 +1215,7 @@ mod tests {
12131215
leader: me.clone(),
12141216
parent: (View::zero(), genesis.digest()),
12151217
};
1216-
let stale_block =
1217-
B::new::<Sha256>(stale_ctx, genesis.digest(), Height::new(1), 100);
1218+
let stale_block = B::new::<Sha256>(stale_ctx, genesis.digest(), Height::new(1), 100);
12181219
assert!(marshal.verified(round, stale_block).await);
12191220

12201221
// Simulate a replay where parent selection now points to a

0 commit comments

Comments
 (0)