Skip to content

Commit

Permalink
priograph scheduler: move transaction_id_generator to new crate
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Oct 25, 2024
1 parent 4cb1d54 commit 062cf8d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion core/src/banking_stage/transaction_scheduler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pub(crate) mod scheduler_controller;
pub(crate) mod scheduler_error;
mod scheduler_metrics;
mod thread_aware_account_locks;
mod transaction_id_generator;
mod transaction_priority_id;
mod transaction_state;
mod transaction_state_container;
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use {
scheduler_metrics::{
SchedulerCountMetrics, SchedulerLeaderDetectionMetrics, SchedulerTimingMetrics,
},
transaction_id_generator::TransactionIdGenerator,
transaction_state::SanitizedTransactionTTL,
transaction_state_container::TransactionStateContainer,
},
Expand All @@ -26,7 +25,9 @@ use {
solana_accounts_db::account_locks::validate_account_locks,
solana_cost_model::cost_model::CostModel,
solana_measure::measure_us,
solana_prio_graph_scheduler::scheduler_messages::MaxAge,
solana_prio_graph_scheduler::{
scheduler_messages::MaxAge, transaction_id_generator::TransactionIdGenerator,
},
solana_runtime::{bank::Bank, bank_forks::BankForks},
solana_runtime_transaction::instructions_processor::process_compute_budget_instructions,
solana_sdk::{
Expand Down
1 change: 1 addition & 0 deletions prio-graph-scheduler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
pub mod batch_id_generator;
pub mod scheduler_messages;
pub mod transaction_id_generator;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use solana_prio_graph_scheduler::scheduler_messages::TransactionId;
use crate::scheduler_messages::TransactionId;

/// Simple reverse-sequential ID generator for `TransactionId`s.
/// These IDs uniquely identify transactions during the scheduling process.
Expand All @@ -13,6 +13,7 @@ impl Default for TransactionIdGenerator {
}

impl TransactionIdGenerator {
#[allow(clippy::should_implement_trait)]
pub fn next(&mut self) -> TransactionId {
let id = self.next_id;
self.next_id = self.next_id.wrapping_sub(1);
Expand Down

0 comments on commit 062cf8d

Please sign in to comment.