From b161f6ce08342d5dab8b17f706a442d8dba9ac6e Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Thu, 25 Jan 2024 06:20:00 -0800 Subject: [PATCH] Create SVM folder as a placeholder for the relevant code (#34942) --- core/src/banking_stage/consumer.rs | 2 +- runtime/src/bank.rs | 2 +- runtime/src/bank/fee_distribution.rs | 2 +- runtime/src/bank/transaction_account_state_info.rs | 2 +- runtime/src/lib.rs | 2 +- runtime/src/{accounts/mod.rs => svm/account_loader.rs} | 6 ++---- runtime/src/{accounts => svm}/account_rent_state.rs | 0 runtime/src/svm/mod.rs | 2 ++ 8 files changed, 9 insertions(+), 9 deletions(-) rename runtime/src/{accounts/mod.rs => svm/account_loader.rs} (99%) rename runtime/src/{accounts => svm}/account_rent_state.rs (100%) create mode 100644 runtime/src/svm/mod.rs diff --git a/core/src/banking_stage/consumer.rs b/core/src/banking_stage/consumer.rs index 64b68889747633..d5dccca98a0fae 100644 --- a/core/src/banking_stage/consumer.rs +++ b/core/src/banking_stage/consumer.rs @@ -23,8 +23,8 @@ use { compute_budget_processor::process_compute_budget_instructions, timings::ExecuteTimings, }, solana_runtime::{ - accounts::validate_fee_payer, bank::{Bank, LoadAndExecuteTransactionsOutput}, + svm::account_loader::validate_fee_payer, transaction_batch::TransactionBatch, }, solana_sdk::{ diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index e6f188b66a8bdc..ecca773a401d09 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -59,6 +59,7 @@ use { }, stakes::{InvalidCacheEntryReason, Stakes, StakesCache, StakesEnum}, status_cache::{SlotDelta, StatusCache}, + svm::account_loader::load_accounts, transaction_batch::TransactionBatch, }, byteorder::{ByteOrder, LittleEndian}, @@ -282,7 +283,6 @@ pub struct BankRc { pub(crate) bank_id_generator: Arc, } -use crate::accounts::load_accounts; #[cfg(RUSTC_WITH_SPECIALIZATION)] use solana_frozen_abi::abi_example::AbiExample; diff --git a/runtime/src/bank/fee_distribution.rs b/runtime/src/bank/fee_distribution.rs index 0ad70efbf9ca6e..85d68c07fd7448 100644 --- a/runtime/src/bank/fee_distribution.rs +++ b/runtime/src/bank/fee_distribution.rs @@ -1,6 +1,6 @@ use { super::Bank, - crate::accounts::account_rent_state::RentState, + crate::svm::account_rent_state::RentState, log::{debug, warn}, solana_accounts_db::stake_rewards::RewardInfo, solana_sdk::{ diff --git a/runtime/src/bank/transaction_account_state_info.rs b/runtime/src/bank/transaction_account_state_info.rs index c09127a6f32bb3..259cd5142cf3ec 100644 --- a/runtime/src/bank/transaction_account_state_info.rs +++ b/runtime/src/bank/transaction_account_state_info.rs @@ -1,5 +1,5 @@ use { - crate::{accounts::account_rent_state::RentState, bank::Bank}, + crate::{bank::Bank, svm::account_rent_state::RentState}, solana_sdk::{ account::ReadableAccount, message::SanitizedMessage, diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index b0884a6f185c20..0612ac0cca74d2 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -4,7 +4,6 @@ #[macro_use] extern crate lazy_static; -pub mod accounts; pub mod accounts_background_service; pub mod bank; pub mod bank_client; @@ -37,6 +36,7 @@ pub mod stake_weighted_timestamp; pub mod stakes; pub mod static_ids; pub mod status_cache; +pub mod svm; pub mod transaction_batch; pub mod transaction_priority_details; diff --git a/runtime/src/accounts/mod.rs b/runtime/src/svm/account_loader.rs similarity index 99% rename from runtime/src/accounts/mod.rs rename to runtime/src/svm/account_loader.rs index 4bf09d94ffb7a1..8fa432db1556dc 100644 --- a/runtime/src/accounts/mod.rs +++ b/runtime/src/svm/account_loader.rs @@ -1,7 +1,5 @@ -pub mod account_rent_state; - use { - crate::{accounts::account_rent_state::RentState, bank::RewardInterval}, + crate::{bank::RewardInterval, svm::account_rent_state::RentState}, itertools::Itertools, log::warn, solana_accounts_db::{ @@ -42,7 +40,7 @@ use { }; #[allow(clippy::too_many_arguments)] -pub(super) fn load_accounts( +pub(crate) fn load_accounts( accounts_db: &AccountsDb, ancestors: &Ancestors, txs: &[SanitizedTransaction], diff --git a/runtime/src/accounts/account_rent_state.rs b/runtime/src/svm/account_rent_state.rs similarity index 100% rename from runtime/src/accounts/account_rent_state.rs rename to runtime/src/svm/account_rent_state.rs diff --git a/runtime/src/svm/mod.rs b/runtime/src/svm/mod.rs new file mode 100644 index 00000000000000..a863d370802e0e --- /dev/null +++ b/runtime/src/svm/mod.rs @@ -0,0 +1,2 @@ +pub mod account_loader; +pub mod account_rent_state;