diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 26027734470fef..7c785407a212eb 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -33,6 +33,8 @@ //! It offers a high-level API that signs transactions //! on behalf of the caller, and a low-level API for when they have //! already been signed and verified. +#[cfg(feature = "dev-context-only-utils")] +use solana_accounts_db::accounts_db::ACCOUNTS_DB_CONFIG_FOR_BENCHMARKS; #[allow(deprecated)] use solana_sdk::recent_blockhashes_account; pub use solana_sdk::reward_type::RewardType; @@ -76,7 +78,7 @@ use { accounts_db::{ AccountShrinkThreshold, AccountStorageEntry, AccountsDb, AccountsDbConfig, CalcAccountsHashDataSource, VerifyAccountsHashAndLamportsConfig, - ACCOUNTS_DB_CONFIG_FOR_BENCHMARKS, ACCOUNTS_DB_CONFIG_FOR_TESTING, + ACCOUNTS_DB_CONFIG_FOR_TESTING, }, accounts_hash::{ AccountHash, AccountsHash, CalcAccountsHashConfig, HashStats, IncrementalAccountsHash, @@ -952,10 +954,6 @@ pub(super) enum RewardInterval { } impl Bank { - pub fn new_for_benches(genesis_config: &GenesisConfig) -> Self { - Self::new_with_paths_for_benches(genesis_config, Vec::new()) - } - /// Intended for use by tests only. /// create new bank with the given configs. pub fn new_with_runtime_config_for_tests( @@ -1067,24 +1065,6 @@ impl Bank { ) } - /// Intended for use by benches only. - /// create new bank with the given config and paths. - pub fn new_with_paths_for_benches(genesis_config: &GenesisConfig, paths: Vec) -> Self { - Self::new_with_paths( - genesis_config, - Arc::::default(), - paths, - None, - None, - AccountSecondaryIndexes::default(), - AccountShrinkThreshold::default(), - false, - Some(ACCOUNTS_DB_CONFIG_FOR_BENCHMARKS), - None, - Arc::default(), - ) - } - #[allow(clippy::too_many_arguments)] pub fn new_with_paths( genesis_config: &GenesisConfig, @@ -8252,6 +8232,28 @@ impl Bank { ) } + pub fn new_for_benches(genesis_config: &GenesisConfig) -> Self { + Self::new_with_paths_for_benches(genesis_config, Vec::new()) + } + + /// Intended for use by benches only. + /// create new bank with the given config and paths. + pub fn new_with_paths_for_benches(genesis_config: &GenesisConfig, paths: Vec) -> Self { + Self::new_with_paths( + genesis_config, + Arc::::default(), + paths, + None, + None, + AccountSecondaryIndexes::default(), + AccountShrinkThreshold::default(), + false, + Some(ACCOUNTS_DB_CONFIG_FOR_BENCHMARKS), + None, + Arc::default(), + ) + } + /// Prepare a transaction batch from a list of legacy transactions. Used for tests only. pub fn prepare_batch_for_tests(&self, txs: Vec) -> TransactionBatch { let transaction_account_lock_limit = self.get_transaction_account_lock_limit();