Make minimum warmup period 32 slots long (#4031)

* Make minimum warmup period 32 slots long

* PR fixes
This commit is contained in:
carllin
2019-04-29 15:26:52 -07:00
committed by GitHub
parent bae0aadafa
commit 73f250f03a
8 changed files with 69 additions and 42 deletions

View File

@@ -10,6 +10,7 @@ use crate::gossip_service::discover_nodes;
use crate::locktower::VOTE_THRESHOLD_DEPTH;
use crate::poh_service::PohServiceConfig;
use solana_client::thin_client::create_client;
use solana_runtime::bank::MINIMUM_SLOT_LENGTH;
use solana_sdk::client::SyncClient;
use solana_sdk::hash::Hash;
use solana_sdk::signature::{Keypair, KeypairUtil, Signature};
@@ -147,21 +148,23 @@ pub fn kill_entry_and_spend_and_verify_rest(
entry_point_info: &ContactInfo,
funding_keypair: &Keypair,
nodes: usize,
slot_millis: u64,
) {
solana_logger::setup();
let cluster_nodes = discover_nodes(&entry_point_info.gossip, nodes).unwrap();
assert!(cluster_nodes.len() >= nodes);
let client = create_client(entry_point_info.client_facing_addr(), FULLNODE_PORT_RANGE);
let first_two_epoch_slots = MINIMUM_SLOT_LENGTH * 3;
info!("sleeping for 2 leader fortnights");
sleep(Duration::from_millis(
SLOT_MILLIS * NUM_CONSECUTIVE_LEADER_SLOTS * 2,
slot_millis * first_two_epoch_slots as u64,
));
info!("done sleeping for 2 fortnights");
info!("done sleeping for first 2 warmup epochs");
info!("killing entry point");
assert!(client.fullnode_exit().unwrap());
info!("sleeping for 2 leader fortnights");
info!("sleeping for some time");
sleep(Duration::from_millis(
SLOT_MILLIS * NUM_CONSECUTIVE_LEADER_SLOTS,
slot_millis * NUM_CONSECUTIVE_LEADER_SLOTS,
));
info!("done sleeping for 2 fortnights");
for ingress_node in &cluster_nodes {