removes redundant epoch stakes cache in retransmit (#14781)

Following d6d76219b, staked nodes computed from vote accounts are
already cached in runtime::Stakes, so the caching in retransmit_stage is
redundant.
This commit is contained in:
behzad nouri
2021-01-24 21:15:09 +00:00
committed by GitHub
parent 0d32a0e0f4
commit e1021d9f83
7 changed files with 22 additions and 44 deletions

View File

@@ -108,14 +108,13 @@ fn run_simulation(stakes: &[u64], fanout: usize) {
});
let c_info = cluster_info.clone_with_id(&cluster_info.id());
let staked_nodes = Arc::new(staked_nodes);
let shreds_len = 100;
let shuffled_peers: Vec<Vec<ContactInfo>> = (0..shreds_len as i32)
.map(|i| {
let mut seed = [0; 32];
seed[0..4].copy_from_slice(&i.to_le_bytes());
let (peers, stakes_and_index) =
cluster_info.sorted_retransmit_peers_and_stakes(Some(staked_nodes.clone()));
cluster_info.sorted_retransmit_peers_and_stakes(Some(&staked_nodes));
let (_, shuffled_stakes_and_indexes) = ClusterInfo::shuffle_peers_and_index(
&cluster_info.id(),
&peers,