Skip to content

Commit

Permalink
Reword a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Dec 15, 2024
1 parent 60ab423 commit da5c6a8
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1440,17 +1440,17 @@ impl Validator {
Arc::new(crate::cluster_slots_service::cluster_slots::ClusterSlots::default());

// bank_forks could be write-locked temporarily here, if unified scheduler is enabled for
// block production. That's because the started ReplayStage inside Tvu could immediately
// try to insert a tpu bank into bank_forks, like with local development clusters
// consisting of a single staked node. Such insertion could be blocked with the lock held
// by unified scheduler until it's fully setup by the banking stage. This is needed,
// because completion of insertion needs to strictly correspond with the initiation of
// producing blocks in unified scheduler.
// As a consequence of this, there's a corner case where the banking stage hasn't called
// register_banking_stage() yet for unified scheduler because Tpu setup follows Tvu setup.
// This means any setup which accesses bank_forks must be done before or after the short
// duration of Tvu setup and Tpu setup to avoid deadlocks. So, RootBankCache must be setup
// here in advance as being one of such setups.
// block production. That's because ReplayStage started inside Tvu could immediately try to
// insert a tpu bank into bank_forks, like with local development clusters consisting of a
// single staked node. Such insertion could be blocked with the lock held by unified
// scheduler until it's fully setup by the banking stage. This is intentional because
// completion of insertion needs to strictly correspond with the initiation of producing
// blocks in unified scheduler. Because Tpu setup follows Tvu setup, there's a corner case
// where the banking stage hasn't yet called register_banking_stage() to finish the unified
// scheduler setup.
// This means any setup which accesses bank_forks must be done before
// or after the short duration of Tvu and Tpu setups to avoid deadlocks. So,
// RootBankCache needs to be created here in advance as being one of such setups.
let root_bank_cache = RootBankCache::new(bank_forks.clone());
let tvu = Tvu::new(
vote_account,
Expand Down

0 comments on commit da5c6a8

Please sign in to comment.