Use the accounts list from parents up to finalized bank for Account::load apis.
Borrow checker query the previous parents accounts cleanup! s/tree/parents Tests! Last_ids need to be inherited as well otherwise nothing works. new_from_parent
This commit is contained in:
committed by
Greg Fitzgerald
parent
6d67568037
commit
64f1d93cc3
10
src/bank.rs
10
src/bank.rs
@ -134,16 +134,6 @@ impl Bank {
|
|||||||
*sub = Some(subscriptions)
|
*sub = Some(subscriptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn copy_for_tpu(&self) -> Self {
|
|
||||||
Self {
|
|
||||||
accounts: self.accounts.copy_for_tpu(),
|
|
||||||
status_cache: RwLock::new(self.status_cache.read().unwrap().clone()),
|
|
||||||
last_id_queue: RwLock::new(self.last_id_queue.read().unwrap().clone()),
|
|
||||||
subscriptions: RwLock::new(None),
|
|
||||||
parent: self.parent.clone(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn process_genesis_block(&self, genesis_block: &GenesisBlock) {
|
pub fn process_genesis_block(&self, genesis_block: &GenesisBlock) {
|
||||||
assert!(genesis_block.mint_id != Pubkey::default());
|
assert!(genesis_block.mint_id != Pubkey::default());
|
||||||
assert!(genesis_block.bootstrap_leader_id != Pubkey::default());
|
assert!(genesis_block.bootstrap_leader_id != Pubkey::default());
|
||||||
|
@ -363,9 +363,10 @@ impl Fullnode {
|
|||||||
}
|
}
|
||||||
None => FullnodeReturnType::LeaderToLeaderRotation, // value doesn't matter here...
|
None => FullnodeReturnType::LeaderToLeaderRotation, // value doesn't matter here...
|
||||||
};
|
};
|
||||||
|
let mut new: Arc<Bank> = Arc::new(Bank::new_from_parent(self.bank.clone()));
|
||||||
|
std::mem::swap(&mut self.bank, &mut new);
|
||||||
self.node_services.tpu.switch_to_leader(
|
self.node_services.tpu.switch_to_leader(
|
||||||
&Arc::new(self.bank.copy_for_tpu()),
|
&self.bank,
|
||||||
PohServiceConfig::default(),
|
PohServiceConfig::default(),
|
||||||
self.tpu_sockets
|
self.tpu_sockets
|
||||||
.iter()
|
.iter()
|
||||||
|
Reference in New Issue
Block a user