Skip to content

Commit 00f866f

Browse files
nit inline
1 parent 4893526 commit 00f866f

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

consensus/src/marshal/standard/inline.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,19 @@ where
241241
.spawn(move |runtime_context| async move {
242242
// On leader recovery, marshal may already hold a verified block
243243
// for this round (persisted by a pre-crash propose whose
244-
// notarize vote never reached the journal). The parent context
245-
// recovered by simplex may differ from the one the cached block
246-
// was built against, so the stored block is not safe to reuse
244+
// notarize vote never reached the journal).
245+
//
246+
// The parent context recovered by simplex may differ from the one
247+
// the cached block was built against, so the stored block is not safe to reuse
247248
// and building a fresh block would land on the same prunable
248-
// archive index and be silently dropped. Skip this view and let
249-
// the voter nullify it via timeout.
250-
if marshal.get_verified(consensus_context.round).await.is_some() {
249+
// archive index and be silently dropped.
250+
//
251+
// Skip this view and let the voter nullify it via timeout.
252+
if marshal
253+
.get_verified(consensus_context.round)
254+
.await
255+
.is_some()
256+
{
251257
debug!(
252258
round = ?consensus_context.round,
253259
"skipping proposal: verified block already exists for round on restart"
@@ -1203,12 +1209,10 @@ mod tests {
12031209
leader: me.clone(),
12041210
parent: (View::zero(), genesis.digest()),
12051211
};
1206-
let stale_block =
1207-
B::new::<Sha256>(ctx.clone(), genesis.digest(), Height::new(1), 100);
1212+
let stale_block = B::new::<Sha256>(ctx.clone(), genesis.digest(), Height::new(1), 100);
12081213
assert!(marshal.verified(round, stale_block).await);
12091214

1210-
let fresh_block =
1211-
B::new::<Sha256>(ctx.clone(), genesis.digest(), Height::new(1), 200);
1215+
let fresh_block = B::new::<Sha256>(ctx.clone(), genesis.digest(), Height::new(1), 200);
12121216

12131217
let mock_app: MockVerifyingApp<B, S> =
12141218
MockVerifyingApp::new(genesis.clone()).with_propose_result(fresh_block);

0 commit comments

Comments
 (0)