Skip to content

Commit

Permalink
banking_stage: do not insert legacy vote ixs, refactor & unstaked (#2888
Browse files Browse the repository at this point in the history
)

* banking_stage: do not insert legacy vote ixs, refactor & unstaked

* pr feedback: use matches instead of separate fn
  • Loading branch information
AshwinSekar authored Sep 11, 2024
1 parent 1184bc8 commit 1334fb5
Show file tree
Hide file tree
Showing 4 changed files with 297 additions and 58 deletions.
10 changes: 8 additions & 2 deletions core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,10 @@ impl BankingStage {
let batch_limit =
TOTAL_BUFFERED_PACKETS / ((num_threads - NUM_VOTE_PROCESSING_THREADS) as usize);
// Keeps track of extraneous vote transactions for the vote threads
let latest_unprocessed_votes = Arc::new(LatestUnprocessedVotes::new());
let latest_unprocessed_votes = {
let bank = bank_forks.read().unwrap().working_bank();
Arc::new(LatestUnprocessedVotes::new(&bank))
};

let decision_maker = DecisionMaker::new(cluster_info.id(), poh_recorder.clone());
let committer = Committer::new(
Expand Down Expand Up @@ -539,7 +542,10 @@ impl BankingStage {
// Once an entry has been recorded, its blockhash is registered with the bank.
let data_budget = Arc::new(DataBudget::default());
// Keeps track of extraneous vote transactions for the vote threads
let latest_unprocessed_votes = Arc::new(LatestUnprocessedVotes::new());
let latest_unprocessed_votes = {
let bank = bank_forks.read().unwrap().working_bank();
Arc::new(LatestUnprocessedVotes::new(&bank))
};

let decision_maker = DecisionMaker::new(cluster_info.id(), poh_recorder.clone());
let committer = Committer::new(
Expand Down
3 changes: 3 additions & 0 deletions core/src/banking_stage/forwarder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ impl<T: LikeClusterInfo> Forwarder<T> {
// load all accounts from address loader;
let current_bank = self.bank_forks.read().unwrap().working_bank();

// if we have crossed an epoch boundary, recache any state
unprocessed_transaction_storage.cache_epoch_boundary_info(&current_bank);

// sanitize and filter packets that are no longer valid (could be too old, a duplicate of something
// already processed), then add to forwarding buffer.
let filter_forwarding_result = unprocessed_transaction_storage
Expand Down
Loading

0 comments on commit 1334fb5

Please sign in to comment.