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

(cherry picked from commit 1334fb5)

# Conflicts:
#	core/src/banking_stage/latest_unprocessed_votes.rs
  • Loading branch information
AshwinSekar authored and mergify[bot] committed Sep 11, 2024
1 parent 1b4dfb3 commit 7a50e3e
Show file tree
Hide file tree
Showing 4 changed files with 367 additions and 24 deletions.
10 changes: 8 additions & 2 deletions core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,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 @@ -512,7 +515,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 @@ -103,6 +103,9 @@ impl Forwarder {
// 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 7a50e3e

Please sign in to comment.