Revert "Remove deprecated slow epoch boundary methods (backport #21568) (#21595)"

This reverts commit b6d040b0d7.
This commit is contained in:
Trent Nelson
2021-12-13 08:48:38 -07:00
committed by Tao Zhu
parent 4f28ed1044
commit 77a3adb5a6
8 changed files with 511 additions and 24 deletions

View File

@@ -132,6 +132,7 @@ pub struct ReplayStageConfig {
pub cache_block_meta_sender: Option<CacheBlockMetaSender>,
pub bank_notification_sender: Option<BankNotificationSender>,
pub wait_for_vote_to_start_leader: bool,
pub disable_epoch_boundary_optimization: bool,
}
#[derive(Default)]
@@ -333,6 +334,7 @@ impl ReplayStage {
cache_block_meta_sender,
bank_notification_sender,
wait_for_vote_to_start_leader,
disable_epoch_boundary_optimization,
} = config;
trace!("replay stage");
@@ -697,6 +699,7 @@ impl ReplayStage {
&retransmit_slots_sender,
&mut skipped_slots_info,
has_new_vote_been_rooted,
disable_epoch_boundary_optimization,
);
let poh_bank = poh_recorder.lock().unwrap().bank();
@@ -1087,6 +1090,7 @@ impl ReplayStage {
retransmit_slots_sender: &RetransmitSlotsSender,
skipped_slots_info: &mut SkippedSlotsInfo,
has_new_vote_been_rooted: bool,
disable_epoch_boundary_optimization: bool,
) {
// all the individual calls to poh_recorder.lock() are designed to
// increase granularity, decrease contention
@@ -1204,7 +1208,10 @@ impl ReplayStage {
root_slot,
my_pubkey,
rpc_subscriptions,
NewBankOptions { vote_only_bank },
NewBankOptions {
vote_only_bank,
disable_epoch_boundary_optimization,
},
);
let tpu_bank = bank_forks.write().unwrap().insert(tpu_bank);

View File

@@ -98,6 +98,7 @@ pub struct TvuConfig {
pub rocksdb_max_compaction_jitter: Option<u64>,
pub wait_for_vote_to_start_leader: bool,
pub accounts_shrink_ratio: AccountShrinkThreshold,
pub disable_epoch_boundary_optimization: bool,
}
impl Tvu {
@@ -281,6 +282,7 @@ impl Tvu {
cache_block_meta_sender,
bank_notification_sender,
wait_for_vote_to_start_leader: tvu_config.wait_for_vote_to_start_leader,
disable_epoch_boundary_optimization: tvu_config.disable_epoch_boundary_optimization,
};
let (voting_sender, voting_receiver) = channel();

View File

@@ -154,6 +154,7 @@ pub struct ValidatorConfig {
pub validator_exit: Arc<RwLock<Exit>>,
pub no_wait_for_vote_to_start_leader: bool,
pub accounts_shrink_ratio: AccountShrinkThreshold,
pub disable_epoch_boundary_optimization: bool,
}
impl Default for ValidatorConfig {
@@ -212,6 +213,7 @@ impl Default for ValidatorConfig {
validator_exit: Arc::new(RwLock::new(Exit::default())),
no_wait_for_vote_to_start_leader: true,
accounts_shrink_ratio: AccountShrinkThreshold::default(),
disable_epoch_boundary_optimization: false,
}
}
}
@@ -808,6 +810,7 @@ impl Validator {
rocksdb_max_compaction_jitter: config.rocksdb_compaction_interval,
wait_for_vote_to_start_leader,
accounts_shrink_ratio: config.accounts_shrink_ratio,
disable_epoch_boundary_optimization: config.disable_epoch_boundary_optimization,
},
&max_slots,
&cost_model,