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

[V0.12] Cherry pick some fixes from master branch #3414

Merged
merged 9 commits into from
Mar 21, 2019
4 changes: 4 additions & 0 deletions core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::sigverify_stage::VerifiedPackets;
use bincode::deserialize;
use solana_metrics::counter::Counter;
use solana_runtime::bank::{self, Bank, BankError};
use solana_sdk::pubkey::Pubkey;
use solana_sdk::timing::{self, duration_as_us, MAX_RECENT_BLOCKHASHES};
use solana_sdk::transaction::Transaction;
use std::net::UdpSocket;
Expand Down Expand Up @@ -439,6 +440,7 @@ pub fn create_test_recorder(
bank.slot(),
Some(4),
bank.ticks_per_slot(),
&Pubkey::default(),
);
let poh_recorder = Arc::new(Mutex::new(poh_recorder));
let poh_service = PohService::new(poh_recorder.clone(), &PohServiceConfig::default(), &exit);
Expand Down Expand Up @@ -653,6 +655,7 @@ mod tests {
bank.slot(),
None,
bank.ticks_per_slot(),
&Pubkey::default(),
);
let poh_recorder = Arc::new(Mutex::new(poh_recorder));

Expand Down Expand Up @@ -711,6 +714,7 @@ mod tests {
bank.slot(),
Some(4),
bank.ticks_per_slot(),
&pubkey,
);
let poh_recorder = Arc::new(Mutex::new(poh_recorder));

Expand Down
3 changes: 1 addition & 2 deletions core/src/blocktree_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,13 @@ pub fn process_blocktree(
warn!("entry0 not present");
return Err(BankError::LedgerVerificationFailed);
}
let entry0 = &entries[0];
let entry0 = entries.remove(0);
if !(entry0.is_tick() && entry0.verify(&last_entry_hash)) {
warn!("Ledger proof of history failed at entry0");
return Err(BankError::LedgerVerificationFailed);
}
last_entry_hash = entry0.hash;
entry_height += 1;
entries = entries.drain(1..).collect();
}

if !entries.is_empty() {
Expand Down
1 change: 1 addition & 0 deletions core/src/fullnode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ impl Fullnode {
bank.slot(),
leader_schedule_utils::next_leader_slot(&id, bank.slot(), &bank),
bank.ticks_per_slot(),
&id,
);
let poh_recorder = Arc::new(Mutex::new(poh_recorder));
let poh_service = PohService::new(poh_recorder.clone(), &config.tick_config, &exit);
Expand Down
Loading