From 10defb161f755097bc95501b08742d202eb567da Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Tue, 6 Feb 2024 11:15:48 -0800 Subject: [PATCH] SVM: Move TransactionErrorMetrics to SVM folder (#35112) --- accounts-db/src/lib.rs | 1 - core/src/banking_stage/consume_worker.rs | 3 +-- core/src/banking_stage/consumer.rs | 9 ++++----- core/src/banking_stage/leader_slot_metrics.rs | 2 +- .../transaction_scheduler/scheduler_controller.rs | 5 +++-- .../src/banking_stage/unprocessed_transaction_storage.rs | 3 +-- runtime/src/bank.rs | 2 +- runtime/src/bank/tests.rs | 2 +- runtime/src/svm/account_loader.rs | 2 +- runtime/src/svm/mod.rs | 1 + .../src => runtime/src/svm}/transaction_error_metrics.rs | 0 runtime/src/svm/transaction_processor.rs | 2 +- 12 files changed, 15 insertions(+), 17 deletions(-) rename {accounts-db/src => runtime/src/svm}/transaction_error_metrics.rs (100%) diff --git a/accounts-db/src/lib.rs b/accounts-db/src/lib.rs index ce9908f105..deec44048f 100644 --- a/accounts-db/src/lib.rs +++ b/accounts-db/src/lib.rs @@ -43,7 +43,6 @@ pub mod sorted_storages; pub mod stake_rewards; pub mod storable_accounts; pub mod tiered_storage; -pub mod transaction_error_metrics; pub mod transaction_results; pub mod utils; mod verify_accounts_hash_in_background; diff --git a/core/src/banking_stage/consume_worker.rs b/core/src/banking_stage/consume_worker.rs index 7744a399e5..930a9e8a47 100644 --- a/core/src/banking_stage/consume_worker.rs +++ b/core/src/banking_stage/consume_worker.rs @@ -5,9 +5,8 @@ use { scheduler_messages::{ConsumeWork, FinishedConsumeWork}, }, crossbeam_channel::{Receiver, RecvError, SendError, Sender}, - solana_accounts_db::transaction_error_metrics::TransactionErrorMetrics, solana_poh::leader_bank_notifier::LeaderBankNotifier, - solana_runtime::bank::Bank, + solana_runtime::{bank::Bank, svm::transaction_error_metrics::TransactionErrorMetrics}, solana_sdk::timing::AtomicInterval, std::{ sync::{ diff --git a/core/src/banking_stage/consumer.rs b/core/src/banking_stage/consumer.rs index e7016b0bbb..526acb5770 100644 --- a/core/src/banking_stage/consumer.rs +++ b/core/src/banking_stage/consumer.rs @@ -9,10 +9,7 @@ use { BankingStageStats, }, itertools::Itertools, - solana_accounts_db::{ - transaction_error_metrics::TransactionErrorMetrics, - transaction_results::TransactionCheckResult, - }, + solana_accounts_db::transaction_results::TransactionCheckResult, solana_ledger::token_balances::collect_token_balances, solana_measure::{measure::Measure, measure_us}, solana_poh::poh_recorder::{ @@ -25,7 +22,9 @@ use { solana_runtime::{ bank::{Bank, LoadAndExecuteTransactionsOutput}, compute_budget_details::GetComputeBudgetDetails, - svm::account_loader::validate_fee_payer, + svm::{ + account_loader::validate_fee_payer, transaction_error_metrics::TransactionErrorMetrics, + }, transaction_batch::TransactionBatch, }, solana_sdk::{ diff --git a/core/src/banking_stage/leader_slot_metrics.rs b/core/src/banking_stage/leader_slot_metrics.rs index 1e250c5b69..33b6e7a55a 100644 --- a/core/src/banking_stage/leader_slot_metrics.rs +++ b/core/src/banking_stage/leader_slot_metrics.rs @@ -5,8 +5,8 @@ use { InsertPacketBatchSummary, UnprocessedTransactionStorage, }, }, - solana_accounts_db::transaction_error_metrics::*, solana_poh::poh_recorder::BankStart, + solana_runtime::svm::transaction_error_metrics::*, solana_sdk::{clock::Slot, saturating_add_assign}, std::time::Instant, }; diff --git a/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs b/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs index 3944790425..df58ccdaa3 100644 --- a/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs +++ b/core/src/banking_stage/transaction_scheduler/scheduler_controller.rs @@ -18,10 +18,11 @@ use { }, crossbeam_channel::RecvTimeoutError, itertools::MinMaxResult, - solana_accounts_db::transaction_error_metrics::TransactionErrorMetrics, solana_cost_model::cost_model::CostModel, solana_measure::measure_us, - solana_runtime::{bank::Bank, bank_forks::BankForks}, + solana_runtime::{ + bank::Bank, bank_forks::BankForks, svm::transaction_error_metrics::TransactionErrorMetrics, + }, solana_sdk::{ clock::MAX_PROCESSING_AGE, saturating_add_assign, timing::AtomicInterval, transaction::SanitizedTransaction, diff --git a/core/src/banking_stage/unprocessed_transaction_storage.rs b/core/src/banking_stage/unprocessed_transaction_storage.rs index 3ed633d982..65a5b09f96 100644 --- a/core/src/banking_stage/unprocessed_transaction_storage.rs +++ b/core/src/banking_stage/unprocessed_transaction_storage.rs @@ -17,9 +17,8 @@ use { }, itertools::Itertools, min_max_heap::MinMaxHeap, - solana_accounts_db::transaction_error_metrics::TransactionErrorMetrics, solana_measure::{measure, measure_us}, - solana_runtime::bank::Bank, + solana_runtime::{bank::Bank, svm::transaction_error_metrics::TransactionErrorMetrics}, solana_sdk::{ clock::FORWARD_TRANSACTIONS_TO_LEADER_AT_SLOT_OFFSET, feature_set::FeatureSet, hash::Hash, saturating_add_assign, transaction::SanitizedTransaction, diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 9c97632f5b..d035eb773f 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -61,6 +61,7 @@ use { svm::{ account_overrides::AccountOverrides, runtime_config::RuntimeConfig, + transaction_error_metrics::TransactionErrorMetrics, transaction_processor::{ TransactionBatchProcessor, TransactionLogMessages, TransactionProcessingCallback, }, @@ -100,7 +101,6 @@ use { sorted_storages::SortedStorages, stake_rewards::{RewardInfo, StakeReward}, storable_accounts::StorableAccounts, - transaction_error_metrics::TransactionErrorMetrics, transaction_results::{ TransactionCheckResult, TransactionExecutionDetails, TransactionExecutionResult, TransactionResults, diff --git a/runtime/src/bank/tests.rs b/runtime/src/bank/tests.rs index fca911f93d..75d4a24463 100644 --- a/runtime/src/bank/tests.rs +++ b/runtime/src/bank/tests.rs @@ -21,6 +21,7 @@ use { svm::{ account_loader::load_accounts, transaction_account_state_info::TransactionAccountStateInfo, + transaction_error_metrics::TransactionErrorMetrics, }, }, assert_matches::assert_matches, @@ -41,7 +42,6 @@ use { nonce_info::NonceFull, partitioned_rewards::TestPartitionedEpochRewards, rent_collector::RENT_EXEMPT_RENT_EPOCH, - transaction_error_metrics::TransactionErrorMetrics, transaction_results::DurableNonceFee, }, solana_logger, diff --git a/runtime/src/svm/account_loader.rs b/runtime/src/svm/account_loader.rs index 4b093c75ea..19f5999241 100644 --- a/runtime/src/svm/account_loader.rs +++ b/runtime/src/svm/account_loader.rs @@ -1,6 +1,7 @@ use { crate::svm::{ account_overrides::AccountOverrides, account_rent_state::RentState, + transaction_error_metrics::TransactionErrorMetrics, transaction_processor::TransactionProcessingCallback, }, itertools::Itertools, @@ -10,7 +11,6 @@ use { nonce_info::NonceFull, rent_collector::{RentCollector, RENT_EXEMPT_RENT_EPOCH}, rent_debits::RentDebits, - transaction_error_metrics::TransactionErrorMetrics, transaction_results::TransactionCheckResult, }, solana_program_runtime::{ diff --git a/runtime/src/svm/mod.rs b/runtime/src/svm/mod.rs index bec00cfd13..441989781d 100644 --- a/runtime/src/svm/mod.rs +++ b/runtime/src/svm/mod.rs @@ -3,4 +3,5 @@ pub mod account_overrides; pub mod account_rent_state; pub mod runtime_config; pub mod transaction_account_state_info; +pub mod transaction_error_metrics; pub mod transaction_processor; diff --git a/accounts-db/src/transaction_error_metrics.rs b/runtime/src/svm/transaction_error_metrics.rs similarity index 100% rename from accounts-db/src/transaction_error_metrics.rs rename to runtime/src/svm/transaction_error_metrics.rs diff --git a/runtime/src/svm/transaction_processor.rs b/runtime/src/svm/transaction_processor.rs index e72caca4d3..9768fb40e8 100644 --- a/runtime/src/svm/transaction_processor.rs +++ b/runtime/src/svm/transaction_processor.rs @@ -2,6 +2,7 @@ use { crate::svm::{ account_loader::load_accounts, account_overrides::AccountOverrides, runtime_config::RuntimeConfig, transaction_account_state_info::TransactionAccountStateInfo, + transaction_error_metrics::TransactionErrorMetrics, }, log::debug, percentage::Percentage, @@ -9,7 +10,6 @@ use { accounts::{LoadedTransaction, TransactionLoadResult}, accounts_file::MatchAccountOwnerError, rent_collector::RentCollector, - transaction_error_metrics::TransactionErrorMetrics, transaction_results::{ DurableNonceFee, TransactionCheckResult, TransactionExecutionDetails, TransactionExecutionResult,