SVM: move transaction_results from accounts-db to SVM (#35183)
SVM: Remove accounts-db deps in accounts_loader tests
This commit is contained in:
parent
a1c39a3c22
commit
0acee67891
|
@ -5250,6 +5250,7 @@ dependencies = [
|
|||
"solana-rayon-threadlimit",
|
||||
"solana-sdk",
|
||||
"solana-stake-program",
|
||||
"solana-svm",
|
||||
"solana-system-program",
|
||||
"solana-vote-program",
|
||||
"static_assertions",
|
||||
|
@ -5348,12 +5349,12 @@ dependencies = [
|
|||
"bincode",
|
||||
"crossbeam-channel",
|
||||
"futures 0.3.30",
|
||||
"solana-accounts-db",
|
||||
"solana-banks-interface",
|
||||
"solana-client",
|
||||
"solana-runtime",
|
||||
"solana-sdk",
|
||||
"solana-send-transaction-service",
|
||||
"solana-svm",
|
||||
"tarpc",
|
||||
"tokio",
|
||||
"tokio-serde",
|
||||
|
@ -6803,6 +6804,7 @@ dependencies = [
|
|||
"solana-stake-program",
|
||||
"solana-storage-bigtable",
|
||||
"solana-streamer",
|
||||
"solana-svm",
|
||||
"solana-tpu-client",
|
||||
"solana-transaction-status",
|
||||
"solana-version",
|
||||
|
@ -7231,7 +7233,6 @@ dependencies = [
|
|||
"log",
|
||||
"percentage",
|
||||
"rustc_version 0.4.0",
|
||||
"solana-accounts-db",
|
||||
"solana-bpf-loader-program",
|
||||
"solana-frozen-abi",
|
||||
"solana-frozen-abi-macro",
|
||||
|
|
|
@ -55,6 +55,7 @@ solana-program-runtime = { workspace = true }
|
|||
solana-rayon-threadlimit = { workspace = true }
|
||||
solana-sdk = { workspace = true }
|
||||
solana-stake-program = { workspace = true }
|
||||
solana-svm = { workspace = true }
|
||||
solana-system-program = { workspace = true }
|
||||
solana-vote-program = { workspace = true }
|
||||
static_assertions = { workspace = true }
|
||||
|
|
|
@ -7,7 +7,6 @@ use {
|
|||
accounts_index::{IndexKey, ScanConfig, ScanError, ScanResult, ZeroLamport},
|
||||
ancestors::Ancestors,
|
||||
storable_accounts::StorableAccounts,
|
||||
transaction_results::TransactionExecutionResult,
|
||||
},
|
||||
dashmap::DashMap,
|
||||
log::*,
|
||||
|
@ -23,10 +22,12 @@ use {
|
|||
},
|
||||
nonce_info::{NonceFull, NonceInfo},
|
||||
pubkey::Pubkey,
|
||||
rent_debits::RentDebits,
|
||||
slot_hashes::SlotHashes,
|
||||
transaction::{Result, SanitizedTransaction, TransactionAccountLocks, TransactionError},
|
||||
transaction_context::{IndexOfAccount, TransactionAccount},
|
||||
transaction_context::TransactionAccount,
|
||||
},
|
||||
solana_svm::{
|
||||
account_loader::TransactionLoadResult, transaction_results::TransactionExecutionResult,
|
||||
},
|
||||
std::{
|
||||
cmp::Reverse,
|
||||
|
@ -98,19 +99,6 @@ pub struct Accounts {
|
|||
pub(crate) account_locks: Mutex<AccountLocks>,
|
||||
}
|
||||
|
||||
// for the load instructions
|
||||
pub type TransactionRent = u64;
|
||||
pub type TransactionProgramIndices = Vec<Vec<IndexOfAccount>>;
|
||||
#[derive(PartialEq, Eq, Debug, Clone)]
|
||||
pub struct LoadedTransaction {
|
||||
pub accounts: Vec<TransactionAccount>,
|
||||
pub program_indices: TransactionProgramIndices,
|
||||
pub rent: TransactionRent,
|
||||
pub rent_debits: RentDebits,
|
||||
}
|
||||
|
||||
pub type TransactionLoadResult = (Result<LoadedTransaction>, Option<NonceFull>);
|
||||
|
||||
pub enum AccountAddressFilter {
|
||||
Exclude, // exclude all addresses matching the filter
|
||||
Include, // only include addresses matching the filter
|
||||
|
@ -804,7 +792,6 @@ fn prepare_if_nonce_account(
|
|||
mod tests {
|
||||
use {
|
||||
super::*,
|
||||
crate::transaction_results::{DurableNonceFee, TransactionExecutionDetails},
|
||||
assert_matches::assert_matches,
|
||||
solana_program_runtime::loaded_programs::LoadedProgramsForTxBatch,
|
||||
solana_sdk::{
|
||||
|
@ -814,10 +801,15 @@ mod tests {
|
|||
instruction::{CompiledInstruction, InstructionError},
|
||||
message::{Message, MessageHeader},
|
||||
native_loader, nonce, nonce_account,
|
||||
rent_debits::RentDebits,
|
||||
signature::{keypair_from_seed, signers::Signers, Keypair, Signer},
|
||||
system_instruction, system_program,
|
||||
transaction::{Transaction, MAX_TX_ACCOUNT_LOCKS},
|
||||
},
|
||||
solana_svm::{
|
||||
account_loader::LoadedTransaction,
|
||||
transaction_results::{DurableNonceFee, TransactionExecutionDetails},
|
||||
},
|
||||
std::{
|
||||
borrow::Cow,
|
||||
sync::atomic::{AtomicBool, AtomicU64, Ordering},
|
||||
|
|
|
@ -40,7 +40,6 @@ pub mod sorted_storages;
|
|||
pub mod stake_rewards;
|
||||
pub mod storable_accounts;
|
||||
pub mod tiered_storage;
|
||||
pub mod transaction_results;
|
||||
pub mod utils;
|
||||
mod verify_accounts_hash_in_background;
|
||||
pub mod waitable_condvar;
|
||||
|
|
|
@ -13,12 +13,12 @@ edition = { workspace = true }
|
|||
bincode = { workspace = true }
|
||||
crossbeam-channel = { workspace = true }
|
||||
futures = { workspace = true }
|
||||
solana-accounts-db = { workspace = true }
|
||||
solana-banks-interface = { workspace = true }
|
||||
solana-client = { workspace = true }
|
||||
solana-runtime = { workspace = true }
|
||||
solana-sdk = { workspace = true }
|
||||
solana-send-transaction-service = { workspace = true }
|
||||
solana-svm = { workspace = true }
|
||||
tarpc = { workspace = true, features = ["full"] }
|
||||
tokio = { workspace = true, features = ["full"] }
|
||||
tokio-serde = { workspace = true, features = ["bincode"] }
|
||||
|
|
|
@ -2,7 +2,6 @@ use {
|
|||
bincode::{deserialize, serialize},
|
||||
crossbeam_channel::{unbounded, Receiver, Sender},
|
||||
futures::{future, prelude::stream::StreamExt},
|
||||
solana_accounts_db::transaction_results::TransactionExecutionResult,
|
||||
solana_banks_interface::{
|
||||
Banks, BanksRequest, BanksResponse, BanksTransactionResultWithMetadata,
|
||||
BanksTransactionResultWithSimulation, TransactionConfirmationStatus, TransactionMetadata,
|
||||
|
@ -30,6 +29,7 @@ use {
|
|||
send_transaction_service::{SendTransactionService, TransactionInfo},
|
||||
tpu_info::NullTpuInfo,
|
||||
},
|
||||
solana_svm::transaction_results::TransactionExecutionResult,
|
||||
std::{
|
||||
convert::TryFrom,
|
||||
io,
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
use {
|
||||
super::leader_slot_timing_metrics::LeaderExecuteAndCommitTimings,
|
||||
itertools::Itertools,
|
||||
solana_accounts_db::{
|
||||
accounts::TransactionLoadResult,
|
||||
transaction_results::{TransactionExecutionResult, TransactionResults},
|
||||
},
|
||||
solana_ledger::{
|
||||
blockstore_processor::TransactionStatusSender, token_balances::collect_token_balances,
|
||||
},
|
||||
|
@ -16,6 +12,10 @@ use {
|
|||
transaction_batch::TransactionBatch,
|
||||
},
|
||||
solana_sdk::{hash::Hash, pubkey::Pubkey, saturating_add_assign},
|
||||
solana_svm::{
|
||||
account_loader::TransactionLoadResult,
|
||||
transaction_results::{TransactionExecutionResult, TransactionResults},
|
||||
},
|
||||
solana_transaction_status::{
|
||||
token_balances::TransactionTokenBalancesSet, TransactionTokenBalance,
|
||||
},
|
||||
|
|
|
@ -20,9 +20,6 @@ use {
|
|||
accounts_index::AccountSecondaryIndexes,
|
||||
accounts_update_notifier_interface::AccountsUpdateNotifier,
|
||||
epoch_accounts_hash::EpochAccountsHash,
|
||||
transaction_results::{
|
||||
TransactionExecutionDetails, TransactionExecutionResult, TransactionResults,
|
||||
},
|
||||
},
|
||||
solana_cost_model::cost_model::CostModel,
|
||||
solana_entry::entry::{
|
||||
|
@ -57,7 +54,12 @@ use {
|
|||
VersionedTransaction,
|
||||
},
|
||||
},
|
||||
solana_svm::runtime_config::RuntimeConfig,
|
||||
solana_svm::{
|
||||
runtime_config::RuntimeConfig,
|
||||
transaction_results::{
|
||||
TransactionExecutionDetails, TransactionExecutionResult, TransactionResults,
|
||||
},
|
||||
},
|
||||
solana_transaction_status::token_balances::TransactionTokenBalancesSet,
|
||||
solana_vote::{vote_account::VoteAccountsHashMap, vote_sender_types::ReplayVoteSender},
|
||||
std::{
|
||||
|
|
|
@ -4621,6 +4621,7 @@ dependencies = [
|
|||
"solana-rayon-threadlimit",
|
||||
"solana-sdk",
|
||||
"solana-stake-program",
|
||||
"solana-svm",
|
||||
"solana-system-program",
|
||||
"solana-vote-program",
|
||||
"static_assertions",
|
||||
|
@ -4681,12 +4682,12 @@ dependencies = [
|
|||
"bincode",
|
||||
"crossbeam-channel",
|
||||
"futures 0.3.30",
|
||||
"solana-accounts-db",
|
||||
"solana-banks-interface",
|
||||
"solana-client",
|
||||
"solana-runtime",
|
||||
"solana-sdk",
|
||||
"solana-send-transaction-service",
|
||||
"solana-svm",
|
||||
"tarpc",
|
||||
"tokio",
|
||||
"tokio-serde",
|
||||
|
@ -5559,6 +5560,7 @@ dependencies = [
|
|||
"solana-stake-program",
|
||||
"solana-storage-bigtable",
|
||||
"solana-streamer",
|
||||
"solana-svm",
|
||||
"solana-tpu-client",
|
||||
"solana-transaction-status",
|
||||
"solana-version",
|
||||
|
@ -5727,6 +5729,7 @@ dependencies = [
|
|||
"solana-sbf-rust-realloc",
|
||||
"solana-sbf-rust-realloc-invoke",
|
||||
"solana-sdk",
|
||||
"solana-svm",
|
||||
"solana-transaction-status",
|
||||
"solana_rbpf",
|
||||
"walkdir",
|
||||
|
@ -6305,7 +6308,6 @@ dependencies = [
|
|||
"log",
|
||||
"percentage",
|
||||
"rustc_version",
|
||||
"solana-accounts-db",
|
||||
"solana-bpf-loader-program",
|
||||
"solana-frozen-abi",
|
||||
"solana-frozen-abi-macro",
|
||||
|
|
|
@ -48,6 +48,7 @@ solana-sdk = { path = "../../sdk", version = "=1.19.0" }
|
|||
solana-transaction-status = { path = "../../transaction-status", version = "=1.19.0" }
|
||||
solana-validator = { path = "../../validator", version = "=1.19.0" }
|
||||
solana-zk-token-sdk = { path = "../../zk-token-sdk", version = "=1.19.0" }
|
||||
solana-svm = { path = "../../svm", version = "=1.19.0" }
|
||||
solana_rbpf = "=0.8.0"
|
||||
static_assertions = "1.1.0"
|
||||
thiserror = "1.0"
|
||||
|
@ -96,6 +97,7 @@ solana-sbf-rust-invoke = { workspace = true }
|
|||
solana-sbf-rust-realloc = { workspace = true, features = ["default"] }
|
||||
solana-sbf-rust-realloc-invoke = { workspace = true }
|
||||
solana-sdk = { workspace = true }
|
||||
solana-svm = { workspace = true }
|
||||
solana-transaction-status = { workspace = true }
|
||||
solana_rbpf = { workspace = true }
|
||||
|
||||
|
|
|
@ -15,10 +15,6 @@ use {
|
|||
solana_account_decoder::parse_bpf_loader::{
|
||||
parse_bpf_upgradeable_loader, BpfUpgradeableLoaderAccountType,
|
||||
},
|
||||
solana_accounts_db::transaction_results::{
|
||||
DurableNonceFee, InnerInstruction, TransactionExecutionDetails, TransactionExecutionResult,
|
||||
TransactionResults,
|
||||
},
|
||||
solana_ledger::token_balances::collect_token_balances,
|
||||
solana_program_runtime::{
|
||||
compute_budget::ComputeBudget,
|
||||
|
@ -52,6 +48,10 @@ use {
|
|||
sysvar::{self, clock},
|
||||
transaction::VersionedTransaction,
|
||||
},
|
||||
solana_svm::transaction_results::{
|
||||
DurableNonceFee, InnerInstruction, TransactionExecutionDetails, TransactionExecutionResult,
|
||||
TransactionResults,
|
||||
},
|
||||
solana_transaction_status::{
|
||||
map_inner_instructions, ConfirmedTransactionWithStatusMeta, TransactionStatusMeta,
|
||||
TransactionWithStatusMeta, VersionedTransactionWithStatusMeta,
|
||||
|
|
|
@ -48,6 +48,7 @@ solana-send-transaction-service = { workspace = true }
|
|||
solana-stake-program = { workspace = true }
|
||||
solana-storage-bigtable = { workspace = true }
|
||||
solana-streamer = { workspace = true }
|
||||
solana-svm = { workspace = true }
|
||||
solana-tpu-client = { workspace = true }
|
||||
solana-transaction-status = { workspace = true }
|
||||
solana-version = { workspace = true }
|
||||
|
|
|
@ -2,11 +2,11 @@ use {
|
|||
crate::transaction_notifier_interface::TransactionNotifierArc,
|
||||
crossbeam_channel::{Receiver, RecvTimeoutError},
|
||||
itertools::izip,
|
||||
solana_accounts_db::transaction_results::{DurableNonceFee, TransactionExecutionDetails},
|
||||
solana_ledger::{
|
||||
blockstore::Blockstore,
|
||||
blockstore_processor::{TransactionStatusBatch, TransactionStatusMessage},
|
||||
},
|
||||
solana_svm::transaction_results::{DurableNonceFee, TransactionExecutionDetails},
|
||||
solana_transaction_status::{
|
||||
extract_and_fmt_memos, map_inner_instructions, Reward, TransactionStatusMeta,
|
||||
},
|
||||
|
|
|
@ -71,7 +71,7 @@ use {
|
|||
},
|
||||
serde::Serialize,
|
||||
solana_accounts_db::{
|
||||
accounts::{AccountAddressFilter, Accounts, PubkeyAccountSlot, TransactionLoadResult},
|
||||
accounts::{AccountAddressFilter, Accounts, PubkeyAccountSlot},
|
||||
accounts_db::{
|
||||
AccountShrinkThreshold, AccountStorageEntry, AccountsDb, AccountsDbConfig,
|
||||
CalcAccountsHashDataSource, VerifyAccountsHashAndLamportsConfig,
|
||||
|
@ -89,9 +89,6 @@ use {
|
|||
sorted_storages::SortedStorages,
|
||||
stake_rewards::StakeReward,
|
||||
storable_accounts::StorableAccounts,
|
||||
transaction_results::{
|
||||
TransactionExecutionDetails, TransactionExecutionResult, TransactionResults,
|
||||
},
|
||||
},
|
||||
solana_bpf_loader_program::syscalls::create_program_runtime_environment_v1,
|
||||
solana_cost_model::cost_tracker::CostTracker,
|
||||
|
@ -160,13 +157,16 @@ use {
|
|||
self, InflationPointCalculationEvent, PointValue, StakeStateV2,
|
||||
},
|
||||
solana_svm::{
|
||||
account_loader::TransactionCheckResult,
|
||||
account_loader::{TransactionCheckResult, TransactionLoadResult},
|
||||
account_overrides::AccountOverrides,
|
||||
runtime_config::RuntimeConfig,
|
||||
transaction_error_metrics::TransactionErrorMetrics,
|
||||
transaction_processor::{
|
||||
TransactionBatchProcessor, TransactionLogMessages, TransactionProcessingCallback,
|
||||
},
|
||||
transaction_results::{
|
||||
TransactionExecutionDetails, TransactionExecutionResult, TransactionResults,
|
||||
},
|
||||
},
|
||||
solana_system_program::{get_system_account_kind, SystemAccountKind},
|
||||
solana_vote::vote_account::{VoteAccount, VoteAccounts, VoteAccountsHashMap},
|
||||
|
|
|
@ -35,7 +35,6 @@ use {
|
|||
ancestors::Ancestors,
|
||||
inline_spl_token,
|
||||
partitioned_rewards::TestPartitionedEpochRewards,
|
||||
transaction_results::DurableNonceFee,
|
||||
},
|
||||
solana_logger,
|
||||
solana_program_runtime::{
|
||||
|
@ -110,7 +109,7 @@ use {
|
|||
solana_stake_program::stake_state::{self, StakeStateV2},
|
||||
solana_svm::{
|
||||
account_loader::load_accounts, transaction_account_state_info::TransactionAccountStateInfo,
|
||||
transaction_error_metrics::TransactionErrorMetrics,
|
||||
transaction_error_metrics::TransactionErrorMetrics, transaction_results::DurableNonceFee,
|
||||
},
|
||||
solana_vote_program::{
|
||||
vote_instruction,
|
||||
|
|
|
@ -7,8 +7,8 @@ use {
|
|||
solana_sdk::{pubkey::Pubkey, signature::Signer},
|
||||
};
|
||||
use {
|
||||
solana_accounts_db::transaction_results::TransactionResults,
|
||||
solana_sdk::transaction::SanitizedTransaction,
|
||||
solana_svm::transaction_results::TransactionResults,
|
||||
solana_vote::{vote_parser, vote_sender_types::ReplayVoteSender},
|
||||
};
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ edition = { workspace = true }
|
|||
itertools = { workspace = true }
|
||||
log = { workspace = true }
|
||||
percentage = { workspace = true }
|
||||
solana-accounts-db = { workspace = true }
|
||||
solana-bpf-loader-program = { workspace = true }
|
||||
solana-frozen-abi = { workspace = true }
|
||||
solana-frozen-abi-macro = { workspace = true }
|
||||
|
@ -29,7 +28,6 @@ crate-type = ["lib"]
|
|||
name = "solana_svm"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-accounts-db = { workspace = true, features = ["dev-context-only-utils"] }
|
||||
solana-logger = { workspace = true }
|
||||
solana-sdk = { workspace = true, features = ["dev-context-only-utils"] }
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ use {
|
|||
},
|
||||
itertools::Itertools,
|
||||
log::warn,
|
||||
solana_accounts_db::accounts::{LoadedTransaction, TransactionLoadResult, TransactionRent},
|
||||
solana_program_runtime::{
|
||||
compute_budget_processor::process_compute_budget_instructions,
|
||||
loaded_programs::LoadedProgramsForTxBatch,
|
||||
|
@ -29,12 +28,24 @@ use {
|
|||
saturating_add_assign,
|
||||
sysvar::{self, instructions::construct_instructions_data},
|
||||
transaction::{self, Result, SanitizedTransaction, TransactionError},
|
||||
transaction_context::IndexOfAccount,
|
||||
transaction_context::{IndexOfAccount, TransactionAccount},
|
||||
},
|
||||
solana_system_program::{get_system_account_kind, SystemAccountKind},
|
||||
std::{collections::HashMap, num::NonZeroUsize},
|
||||
};
|
||||
|
||||
// for the load instructions
|
||||
pub type TransactionRent = u64;
|
||||
pub type TransactionProgramIndices = Vec<Vec<IndexOfAccount>>;
|
||||
#[derive(PartialEq, Eq, Debug, Clone)]
|
||||
pub struct LoadedTransaction {
|
||||
pub accounts: Vec<TransactionAccount>,
|
||||
pub program_indices: TransactionProgramIndices,
|
||||
pub rent: TransactionRent,
|
||||
pub rent_debits: RentDebits,
|
||||
}
|
||||
|
||||
pub type TransactionLoadResult = (Result<LoadedTransaction>, Option<NonceFull>);
|
||||
pub type TransactionCheckResult = (transaction::Result<()>, Option<NoncePartial>, Option<u64>);
|
||||
|
||||
pub fn load_accounts<CB: TransactionProcessingCallback>(
|
||||
|
|
|
@ -8,6 +8,7 @@ pub mod runtime_config;
|
|||
pub mod transaction_account_state_info;
|
||||
pub mod transaction_error_metrics;
|
||||
pub mod transaction_processor;
|
||||
pub mod transaction_results;
|
||||
|
||||
#[macro_use]
|
||||
extern crate solana_metrics;
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
use {
|
||||
crate::{
|
||||
account_loader::{load_accounts, TransactionCheckResult},
|
||||
account_loader::{
|
||||
load_accounts, LoadedTransaction, TransactionCheckResult, TransactionLoadResult,
|
||||
},
|
||||
account_overrides::AccountOverrides,
|
||||
runtime_config::RuntimeConfig,
|
||||
transaction_account_state_info::TransactionAccountStateInfo,
|
||||
transaction_error_metrics::TransactionErrorMetrics,
|
||||
},
|
||||
log::debug,
|
||||
percentage::Percentage,
|
||||
solana_accounts_db::{
|
||||
accounts::{LoadedTransaction, TransactionLoadResult},
|
||||
transaction_results::{
|
||||
DurableNonceFee, TransactionExecutionDetails, TransactionExecutionResult,
|
||||
},
|
||||
},
|
||||
log::debug,
|
||||
percentage::Percentage,
|
||||
solana_measure::measure::Measure,
|
||||
solana_program_runtime::{
|
||||
compute_budget::ComputeBudget,
|
||||
|
|
Loading…
Reference in New Issue