Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused code in parent_leaf_and_state #3785

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions crates/task-impls/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,24 +415,7 @@ pub(crate) async fn parent_leaf_and_state<TYPES: NodeType, V: Versions>(
.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
Expand Down