use highest staked node as bootstrap leader, remove bootstrap_leader from genesis_block (#4635)

* use highest staked node as bootstrap leader, remove bootstrap_leader from genesis_block

* clippy

* fixup

* fixup
This commit is contained in:
Rob Walker
2019-06-11 11:44:58 -07:00
committed by GitHub
parent 6dbba86cc6
commit 3217a1d70c
7 changed files with 45 additions and 14 deletions

View File

@ -391,7 +391,7 @@ impl Locktower {
let mut lockouts = VoteState::default();
if let Some(iter) = bank.epoch_vote_accounts(current_epoch) {
for (delegate_pubkey, (_, account)) in iter {
if *delegate_pubkey == bank.collector_id() {
if delegate_pubkey == bank.collector_id() {
let state = VoteState::deserialize(&account.data).expect("votes");
if lockouts.votes.len() < state.votes.len() {
lockouts = state;

View File

@ -388,7 +388,7 @@ impl ReplayStage {
for bank_slot in &active_banks {
let bank = bank_forks.read().unwrap().get(*bank_slot).unwrap().clone();
*ticks_per_slot = bank.ticks_per_slot();
if bank.collector_id() != *my_pubkey {
if bank.collector_id() != my_pubkey {
Self::replay_blocktree_into_bank(&bank, &blocktree, progress)?;
}
let max_tick_height = (*bank_slot + 1) * bank.ticks_per_slot() - 1;
@ -567,7 +567,7 @@ impl ReplayStage {
) {
bank.freeze();
info!("bank frozen {}", bank.slot());
if let Err(e) = slot_full_sender.send((bank.slot(), bank.collector_id())) {
if let Err(e) = slot_full_sender.send((bank.slot(), *bank.collector_id())) {
trace!("{} slot_full alert failed: {:?}", my_pubkey, e);
}
}