diff --git a/crates/hotshot/src/tasks/task_state.rs b/crates/hotshot/src/tasks/task_state.rs index 6752aae43f..1df18f9b5e 100644 --- a/crates/hotshot/src/tasks/task_state.rs +++ b/crates/hotshot/src/tasks/task_state.rs @@ -72,7 +72,6 @@ impl, V: Versions> CreateTaskState cur_view: handle.cur_view().await, cur_epoch: handle.cur_epoch().await, quorum_membership: (*handle.hotshot.memberships).clone().into(), - network: Arc::clone(&handle.hotshot.network), vote_collectors: BTreeMap::default(), public_key: handle.public_key().clone(), private_key: handle.private_key().clone(), @@ -163,7 +162,6 @@ impl, V: Versions> CreateTaskState cur_view, next_view: cur_view, cur_epoch: handle.cur_epoch().await, - network: Arc::clone(&handle.hotshot.network), membership: (*handle.hotshot.memberships).clone().into(), public_key: handle.public_key().clone(), private_key: handle.private_key().clone(), @@ -191,7 +189,6 @@ impl, V: Versions> CreateTaskState consensus: OuterConsensus::new(handle.hotshot.consensus()), cur_view: handle.cur_view().await, cur_epoch: handle.cur_epoch().await, - network: Arc::clone(&handle.hotshot.network), membership: (*handle.hotshot.memberships).clone().into(), public_key: handle.public_key().clone(), private_key: handle.private_key().clone(), diff --git a/crates/hotshot/src/traits/election/randomized_committee_members.rs b/crates/hotshot/src/traits/election/randomized_committee_members.rs index 01f4ad6383..5c85ad9c07 100644 --- a/crates/hotshot/src/traits/election/randomized_committee_members.rs +++ b/crates/hotshot/src/traits/election/randomized_committee_members.rs @@ -317,32 +317,6 @@ impl Membership Ok(TYPES::SignatureKey::public_key(&res)) } - /// Index the vector of public keys with the current view number - fn lookup_da_leader( - &self, - view_number: TYPES::View, - epoch: ::Epoch, - ) -> Result { - let filter = self.make_da_quorum_filter(epoch); - let leader_vec: Vec<_> = self - .da_stake_table - .iter() - .enumerate() - .filter(|(idx, _)| filter.contains(idx)) - .map(|(_, v)| v.clone()) - .collect(); - - let mut rng: StdRng = rand::SeedableRng::seed_from_u64(*view_number); - - let randomized_view_number: u64 = rng.gen_range(0..=u64::MAX); - #[allow(clippy::cast_possible_truncation)] - let index = randomized_view_number as usize % leader_vec.len(); - - let res = leader_vec[index].clone(); - - Ok(TYPES::SignatureKey::public_key(&res)) - } - /// Get the total number of nodes in the committee fn total_nodes(&self, epoch: ::Epoch) -> usize { self.make_quorum_filter(epoch).len() diff --git a/crates/types/src/traits/election.rs b/crates/types/src/traits/election.rs index 2dbccda807..5b72ea4f84 100644 --- a/crates/types/src/traits/election.rs +++ b/crates/types/src/traits/election.rs @@ -95,21 +95,6 @@ pub trait Membership: Clone + Debug + Send + Sync { )) } - /// The DA leader of the committee for view `view_number` in `epoch`. - /// - /// Note: this function uses a HotShot-internal error type. - /// You should implement `lookup_leader`, rather than implementing this function directly. - /// - /// # Errors - /// Returns an error if the leader cannot be calculated. - fn da_leader(&self, view: TYPES::View, epoch: TYPES::Epoch) -> Result { - use utils::anytrace::*; - - self.lookup_da_leader(view, epoch).wrap().context(info!( - "Failed to get leader for view {view} in epoch {epoch}" - )) - } - /// The leader of the committee for view `view_number` in `epoch`. /// /// Note: There is no such thing as a DA leader, so any consumer