Initialize BlockCommitmentCache slot and root on node boot (#11178)
* Initialize commitment-cache slot and root on node boot * Ignore long tests
This commit is contained in:
parent
b60ff70657
commit
b5a6a2f461
|
@ -270,7 +270,9 @@ impl Validator {
|
||||||
}
|
}
|
||||||
|
|
||||||
let cluster_info = Arc::new(ClusterInfo::new(node.info.clone(), keypair.clone()));
|
let cluster_info = Arc::new(ClusterInfo::new(node.info.clone(), keypair.clone()));
|
||||||
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::default()));
|
let mut block_commitment_cache = BlockCommitmentCache::default();
|
||||||
|
block_commitment_cache.initialize_slots(bank.slot());
|
||||||
|
let block_commitment_cache = Arc::new(RwLock::new(block_commitment_cache));
|
||||||
|
|
||||||
let subscriptions = Arc::new(RpcSubscriptions::new(
|
let subscriptions = Arc::new(RpcSubscriptions::new(
|
||||||
&exit,
|
&exit,
|
||||||
|
|
|
@ -472,6 +472,7 @@ fn run_kill_partition_switch_threshold<F>(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[ignore]
|
||||||
#[serial]
|
#[serial]
|
||||||
fn test_kill_partition_switch_threshold_no_progress() {
|
fn test_kill_partition_switch_threshold_no_progress() {
|
||||||
let max_switch_threshold_failure_pct = 1.0 - 2.0 * SWITCH_FORK_THRESHOLD;
|
let max_switch_threshold_failure_pct = 1.0 - 2.0 * SWITCH_FORK_THRESHOLD;
|
||||||
|
@ -500,6 +501,7 @@ fn test_kill_partition_switch_threshold_no_progress() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[ignore]
|
||||||
#[serial]
|
#[serial]
|
||||||
fn test_kill_partition_switch_threshold() {
|
fn test_kill_partition_switch_threshold() {
|
||||||
let max_switch_threshold_failure_pct = 1.0 - 2.0 * SWITCH_FORK_THRESHOLD;
|
let max_switch_threshold_failure_pct = 1.0 - 2.0 * SWITCH_FORK_THRESHOLD;
|
||||||
|
|
|
@ -187,6 +187,11 @@ impl BlockCommitmentCache {
|
||||||
pub fn set_highest_confirmed_root(&mut self, root: Slot) {
|
pub fn set_highest_confirmed_root(&mut self, root: Slot) {
|
||||||
self.commitment_slots.highest_confirmed_root = root;
|
self.commitment_slots.highest_confirmed_root = root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn initialize_slots(&mut self, slot: Slot) {
|
||||||
|
self.commitment_slots.slot = slot;
|
||||||
|
self.commitment_slots.root = slot;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Clone, Copy)]
|
#[derive(Default, Clone, Copy)]
|
||||||
|
|
Loading…
Reference in New Issue