From 2d48d49c6de063cf4fb19677d7ec049bf5719ae5 Mon Sep 17 00:00:00 2001 From: Lukasz Rzasik Date: Tue, 22 Oct 2024 17:11:15 +0200 Subject: [PATCH] Remove unused code in `parent_leaf_and_state` --- crates/task-impls/src/helpers.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/crates/task-impls/src/helpers.rs b/crates/task-impls/src/helpers.rs index cd4bf5b3cd..268b43b2d3 100644 --- a/crates/task-impls/src/helpers.rs +++ b/crates/task-impls/src/helpers.rs @@ -415,24 +415,7 @@ pub(crate) async fn parent_leaf_and_state( .get(&leaf_commitment) .context("Failed to find high QC of parent")?; - let reached_decided = leaf.view_number() == consensus_reader.last_decided_view(); - let parent_leaf = leaf.clone(); - let original_parent_hash = parent_leaf.commit(upgrade_lock).await; - let mut next_parent_hash = original_parent_hash; - - // Walk back until we find a decide - if !reached_decided { - debug!("We have not reached decide"); - while let Some(next_parent_leaf) = consensus_reader.saved_leaves().get(&next_parent_hash) { - if next_parent_leaf.view_number() <= consensus_reader.last_decided_view() { - break; - } - next_parent_hash = next_parent_leaf.parent_commitment(); - } - // TODO do some sort of sanity check on the view number that it matches decided - } - - Ok((parent_leaf, Arc::clone(state))) + Ok((leaf.clone(), Arc::clone(state))) } /// Validate the state and safety and liveness of a proposal then emit