From dcedebff24b7622c2f078b87ac92b4f013366068 Mon Sep 17 00:00:00 2001 From: danielsanchezq Date: Mon, 15 Jan 2024 11:32:26 +0100 Subject: [PATCH] Prune older than grandparent block --- nomos-services/carnot-consensus/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nomos-services/carnot-consensus/src/lib.rs b/nomos-services/carnot-consensus/src/lib.rs index 9c51862f..71da6a67 100644 --- a/nomos-services/carnot-consensus/src/lib.rs +++ b/nomos-services/carnot-consensus/src/lib.rs @@ -642,6 +642,10 @@ where committee_membership.on_new_block_received(&original_block) }, ); + // prune old blocks, older than grand parent + new_state.prune_older_blocks_by_view( + new_state.latest_committed_view().prev().prev(), + ); } else { task_manager.push(block.view, async move { if let Some(block) = stream.next().await {