[SVM] Move RuntimeConfig to program-runtime (#96)
RuntimeConfig doesn't use anything SVM specific and logically belongs in program runtime rather than SVM. This change moves the definition of RuntimeConfig struct from the SVM crate to program-runtime and adjusts `use` statements accordingly.
This commit is contained in:
parent
42e8309c34
commit
ba43f74dcf
|
@ -177,7 +177,6 @@ dependencies = [
|
|||
"solana-stake-program",
|
||||
"solana-storage-bigtable",
|
||||
"solana-streamer",
|
||||
"solana-svm",
|
||||
"solana-transaction-status",
|
||||
"solana-unified-scheduler-pool",
|
||||
"solana-version",
|
||||
|
@ -233,6 +232,7 @@ dependencies = [
|
|||
"solana-net-utils",
|
||||
"solana-perf",
|
||||
"solana-poh",
|
||||
"solana-program-runtime",
|
||||
"solana-rpc",
|
||||
"solana-rpc-client",
|
||||
"solana-rpc-client-api",
|
||||
|
@ -241,7 +241,6 @@ dependencies = [
|
|||
"solana-send-transaction-service",
|
||||
"solana-storage-bigtable",
|
||||
"solana-streamer",
|
||||
"solana-svm",
|
||||
"solana-test-validator",
|
||||
"solana-tpu-client",
|
||||
"solana-unified-scheduler-pool",
|
||||
|
@ -7345,7 +7344,6 @@ dependencies = [
|
|||
"solana-runtime",
|
||||
"solana-sdk",
|
||||
"solana-streamer",
|
||||
"solana-svm",
|
||||
"solana-tpu-client",
|
||||
"tokio",
|
||||
]
|
||||
|
|
|
@ -74,6 +74,7 @@ use {
|
|||
poh_recorder::PohRecorder,
|
||||
poh_service::{self, PohService},
|
||||
},
|
||||
solana_program_runtime::runtime_config::RuntimeConfig,
|
||||
solana_rpc::{
|
||||
max_slots::MaxSlots,
|
||||
optimistically_confirmed_bank_tracker::{
|
||||
|
@ -116,7 +117,6 @@ use {
|
|||
},
|
||||
solana_send_transaction_service::send_transaction_service,
|
||||
solana_streamer::{socket::SocketAddrSpace, streamer::StakedNodes},
|
||||
solana_svm::runtime_config::RuntimeConfig,
|
||||
solana_turbine::{self, broadcast_stage::BroadcastStageType},
|
||||
solana_unified_scheduler_pool::DefaultSchedulerPool,
|
||||
solana_vote_program::vote_state,
|
||||
|
|
|
@ -16,6 +16,7 @@ use {
|
|||
snapshot_packager_service::SnapshotPackagerService,
|
||||
},
|
||||
solana_gossip::{cluster_info::ClusterInfo, contact_info::ContactInfo},
|
||||
solana_program_runtime::runtime_config::RuntimeConfig,
|
||||
solana_runtime::{
|
||||
accounts_background_service::{
|
||||
AbsRequestHandlers, AbsRequestSender, AccountsBackgroundService, DroppedSlotsReceiver,
|
||||
|
@ -39,7 +40,6 @@ use {
|
|||
timing::timestamp,
|
||||
},
|
||||
solana_streamer::socket::SocketAddrSpace,
|
||||
solana_svm::runtime_config::RuntimeConfig,
|
||||
std::{
|
||||
mem::ManuallyDrop,
|
||||
sync::{
|
||||
|
|
|
@ -18,6 +18,7 @@ use {
|
|||
snapshot_packager_service::SnapshotPackagerService,
|
||||
},
|
||||
solana_gossip::{cluster_info::ClusterInfo, contact_info::ContactInfo},
|
||||
solana_program_runtime::runtime_config::RuntimeConfig,
|
||||
solana_runtime::{
|
||||
accounts_background_service::{
|
||||
AbsRequestHandlers, AbsRequestSender, AccountsBackgroundService,
|
||||
|
@ -50,7 +51,6 @@ use {
|
|||
timing::timestamp,
|
||||
},
|
||||
solana_streamer::socket::SocketAddrSpace,
|
||||
solana_svm::runtime_config::RuntimeConfig,
|
||||
std::{
|
||||
collections::HashSet,
|
||||
fs,
|
||||
|
|
|
@ -44,7 +44,6 @@ solana-sdk = { workspace = true }
|
|||
solana-stake-program = { workspace = true }
|
||||
solana-storage-bigtable = { workspace = true }
|
||||
solana-streamer = { workspace = true }
|
||||
solana-svm = { workspace = true }
|
||||
solana-transaction-status = { workspace = true }
|
||||
solana-unified-scheduler-pool = { workspace = true }
|
||||
solana-version = { workspace = true }
|
||||
|
|
|
@ -12,8 +12,8 @@ use {
|
|||
blockstore_processor::ProcessOptions,
|
||||
use_snapshot_archives_at_startup::{self, UseSnapshotArchivesAtStartup},
|
||||
},
|
||||
solana_program_runtime::runtime_config::RuntimeConfig,
|
||||
solana_sdk::clock::Slot,
|
||||
solana_svm::runtime_config::RuntimeConfig,
|
||||
std::{
|
||||
collections::HashSet,
|
||||
path::{Path, PathBuf},
|
||||
|
|
|
@ -27,7 +27,10 @@ use {
|
|||
},
|
||||
solana_measure::{measure, measure::Measure},
|
||||
solana_metrics::datapoint_error,
|
||||
solana_program_runtime::timings::{ExecuteTimingType, ExecuteTimings, ThreadExecuteTimings},
|
||||
solana_program_runtime::{
|
||||
runtime_config::RuntimeConfig,
|
||||
timings::{ExecuteTimingType, ExecuteTimings, ThreadExecuteTimings},
|
||||
},
|
||||
solana_rayon_threadlimit::{get_max_thread_count, get_thread_count},
|
||||
solana_runtime::{
|
||||
accounts_background_service::{AbsRequestSender, SnapshotRequestKind},
|
||||
|
@ -54,12 +57,9 @@ use {
|
|||
VersionedTransaction,
|
||||
},
|
||||
},
|
||||
solana_svm::{
|
||||
runtime_config::RuntimeConfig,
|
||||
transaction_results::{
|
||||
solana_svm::transaction_results::{
|
||||
TransactionExecutionDetails, TransactionExecutionResult, TransactionResults,
|
||||
},
|
||||
},
|
||||
solana_transaction_status::token_balances::TransactionTokenBalancesSet,
|
||||
solana_vote::{vote_account::VoteAccountsHashMap, vote_sender_types::ReplayVoteSender},
|
||||
std::{
|
||||
|
|
|
@ -17,6 +17,7 @@ pub mod loaded_programs;
|
|||
pub mod log_collector;
|
||||
pub mod message_processor;
|
||||
pub mod prioritization_fee;
|
||||
pub mod runtime_config;
|
||||
pub mod stable_log;
|
||||
pub mod sysvar_cache;
|
||||
pub mod timings;
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
use crate::compute_budget::ComputeBudget;
|
||||
|
||||
#[cfg(RUSTC_WITH_SPECIALIZATION)]
|
||||
impl ::solana_frozen_abi::abi_example::AbiExample for RuntimeConfig {
|
||||
fn example() -> Self {
|
||||
// RuntimeConfig is not Serialize so just rely on Default.
|
||||
RuntimeConfig::default()
|
||||
}
|
||||
}
|
||||
|
||||
/// Encapsulates flags that can be used to tweak the runtime behavior.
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct RuntimeConfig {
|
||||
pub compute_budget: Option<ComputeBudget>,
|
||||
pub log_messages_bytes_limit: Option<usize>,
|
||||
pub transaction_account_lock_limit: Option<usize>,
|
||||
}
|
|
@ -17,7 +17,8 @@ use {
|
|||
solana_bpf_loader_program::serialization::serialize_parameters,
|
||||
solana_program_runtime::{
|
||||
compute_budget::ComputeBudget, ic_msg, invoke_context::BuiltinFunctionWithContext,
|
||||
loaded_programs::LoadedProgram, stable_log, timings::ExecuteTimings,
|
||||
loaded_programs::LoadedProgram, runtime_config::RuntimeConfig, stable_log,
|
||||
timings::ExecuteTimings,
|
||||
},
|
||||
solana_runtime::{
|
||||
accounts_background_service::{AbsRequestSender, SnapshotRequestKind},
|
||||
|
@ -45,7 +46,6 @@ use {
|
|||
stable_layout::stable_instruction::StableInstruction,
|
||||
sysvar::{Sysvar, SysvarId},
|
||||
},
|
||||
solana_svm::runtime_config::RuntimeConfig,
|
||||
solana_vote_program::vote_state::{self, VoteState, VoteStateVersions},
|
||||
std::{
|
||||
cell::RefCell,
|
||||
|
|
|
@ -117,6 +117,7 @@ dependencies = [
|
|||
"solana-net-utils",
|
||||
"solana-perf",
|
||||
"solana-poh",
|
||||
"solana-program-runtime",
|
||||
"solana-rpc",
|
||||
"solana-rpc-client",
|
||||
"solana-rpc-client-api",
|
||||
|
@ -125,7 +126,6 @@ dependencies = [
|
|||
"solana-send-transaction-service",
|
||||
"solana-storage-bigtable",
|
||||
"solana-streamer",
|
||||
"solana-svm",
|
||||
"solana-test-validator",
|
||||
"solana-tpu-client",
|
||||
"solana-unified-scheduler-pool",
|
||||
|
@ -6393,7 +6393,6 @@ dependencies = [
|
|||
"solana-runtime",
|
||||
"solana-sdk",
|
||||
"solana-streamer",
|
||||
"solana-svm",
|
||||
"solana-tpu-client",
|
||||
"tokio",
|
||||
]
|
||||
|
|
|
@ -99,6 +99,7 @@ use {
|
|||
compute_budget_processor::process_compute_budget_instructions,
|
||||
invoke_context::BuiltinFunctionWithContext,
|
||||
loaded_programs::{LoadedProgram, LoadedProgramType, LoadedPrograms},
|
||||
runtime_config::RuntimeConfig,
|
||||
timings::{ExecuteTimingType, ExecuteTimings},
|
||||
},
|
||||
solana_sdk::{
|
||||
|
@ -163,7 +164,6 @@ use {
|
|||
solana_svm::{
|
||||
account_loader::{TransactionCheckResult, TransactionLoadResult},
|
||||
account_overrides::AccountOverrides,
|
||||
runtime_config::RuntimeConfig,
|
||||
transaction_error_metrics::TransactionErrorMetrics,
|
||||
transaction_processor::{
|
||||
TransactionBatchProcessor, TransactionLogMessages, TransactionProcessingCallback,
|
||||
|
|
|
@ -31,6 +31,7 @@ mod tests {
|
|||
epoch_accounts_hash::EpochAccountsHash,
|
||||
stake_rewards::StakeReward,
|
||||
},
|
||||
solana_program_runtime::runtime_config::RuntimeConfig,
|
||||
solana_sdk::{
|
||||
epoch_schedule::EpochSchedule,
|
||||
genesis_config::create_genesis_config,
|
||||
|
@ -38,7 +39,6 @@ mod tests {
|
|||
pubkey::Pubkey,
|
||||
signature::{Keypair, Signer},
|
||||
},
|
||||
solana_svm::runtime_config::RuntimeConfig,
|
||||
std::{
|
||||
io::{Cursor, Read, Write},
|
||||
num::NonZeroUsize,
|
||||
|
|
|
@ -27,6 +27,7 @@ use {
|
|||
epoch_accounts_hash::EpochAccountsHash,
|
||||
},
|
||||
solana_measure::measure::Measure,
|
||||
solana_program_runtime::runtime_config::RuntimeConfig,
|
||||
solana_sdk::{
|
||||
clock::{Epoch, Slot, UnixTimestamp},
|
||||
deserialize_utils::default_on_eof,
|
||||
|
@ -39,7 +40,6 @@ use {
|
|||
pubkey::Pubkey,
|
||||
rent_collector::RentCollector,
|
||||
},
|
||||
solana_svm::runtime_config::RuntimeConfig,
|
||||
std::{
|
||||
collections::{HashMap, HashSet},
|
||||
io::{self, BufReader, BufWriter, Read, Write},
|
||||
|
|
|
@ -37,6 +37,7 @@ use {
|
|||
utils::delete_contents_of_path,
|
||||
},
|
||||
solana_measure::{measure, measure::Measure},
|
||||
solana_program_runtime::runtime_config::RuntimeConfig,
|
||||
solana_sdk::{
|
||||
clock::Slot,
|
||||
feature_set,
|
||||
|
@ -45,7 +46,6 @@ use {
|
|||
pubkey::Pubkey,
|
||||
slot_history::{Check, SlotHistory},
|
||||
},
|
||||
solana_svm::runtime_config::RuntimeConfig,
|
||||
std::{
|
||||
collections::HashSet,
|
||||
fs,
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
pub mod account_loader;
|
||||
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;
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
use solana_program_runtime::compute_budget::ComputeBudget;
|
||||
|
||||
/// Encapsulates flags that can be used to tweak the runtime behavior.
|
||||
#[derive(AbiExample, Debug, Default, Clone)]
|
||||
pub struct RuntimeConfig {
|
||||
pub compute_budget: Option<ComputeBudget>,
|
||||
pub log_messages_bytes_limit: Option<usize>,
|
||||
pub transaction_account_lock_limit: Option<usize>,
|
||||
}
|
|
@ -4,7 +4,6 @@ use {
|
|||
load_accounts, LoadedTransaction, TransactionCheckResult, TransactionLoadResult,
|
||||
},
|
||||
account_overrides::AccountOverrides,
|
||||
runtime_config::RuntimeConfig,
|
||||
transaction_account_state_info::TransactionAccountStateInfo,
|
||||
transaction_error_metrics::TransactionErrorMetrics,
|
||||
transaction_results::{
|
||||
|
@ -23,6 +22,7 @@ use {
|
|||
},
|
||||
log_collector::LogCollector,
|
||||
message_processor::MessageProcessor,
|
||||
runtime_config::RuntimeConfig,
|
||||
sysvar_cache::SysvarCache,
|
||||
timings::{ExecuteDetailsTimings, ExecuteTimingType, ExecuteTimings},
|
||||
},
|
||||
|
|
|
@ -32,7 +32,6 @@ solana-rpc-client = { workspace = true }
|
|||
solana-runtime = { workspace = true }
|
||||
solana-sdk = { workspace = true }
|
||||
solana-streamer = { workspace = true }
|
||||
solana-svm = { workspace = true }
|
||||
solana-tpu-client = { workspace = true }
|
||||
tokio = { workspace = true, features = ["full"] }
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ use {
|
|||
create_new_tmp_ledger,
|
||||
},
|
||||
solana_net_utils::PortRange,
|
||||
solana_program_runtime::compute_budget::ComputeBudget,
|
||||
solana_program_runtime::{compute_budget::ComputeBudget, runtime_config::RuntimeConfig},
|
||||
solana_rpc::{rpc::JsonRpcConfig, rpc_pubsub_service::PubSubConfig},
|
||||
solana_rpc_client::{nonblocking, rpc_client::RpcClient},
|
||||
solana_runtime::{
|
||||
|
@ -54,7 +54,6 @@ use {
|
|||
signature::{read_keypair_file, write_keypair_file, Keypair, Signer},
|
||||
},
|
||||
solana_streamer::socket::SocketAddrSpace,
|
||||
solana_svm::runtime_config::RuntimeConfig,
|
||||
solana_tpu_client::tpu_client::{
|
||||
DEFAULT_TPU_CONNECTION_POOL_SIZE, DEFAULT_TPU_ENABLE_UDP, DEFAULT_TPU_USE_QUIC,
|
||||
},
|
||||
|
|
|
@ -49,6 +49,7 @@ solana-metrics = { workspace = true }
|
|||
solana-net-utils = { workspace = true }
|
||||
solana-perf = { workspace = true }
|
||||
solana-poh = { workspace = true }
|
||||
solana-program-runtime = { workspace = true }
|
||||
solana-rpc = { workspace = true }
|
||||
solana-rpc-client = { workspace = true }
|
||||
solana-rpc-client-api = { workspace = true }
|
||||
|
@ -57,7 +58,6 @@ solana-sdk = { workspace = true }
|
|||
solana-send-transaction-service = { workspace = true }
|
||||
solana-storage-bigtable = { workspace = true }
|
||||
solana-streamer = { workspace = true }
|
||||
solana-svm = { workspace = true }
|
||||
solana-test-validator = { workspace = true }
|
||||
solana-tpu-client = { workspace = true }
|
||||
solana-unified-scheduler-pool = { workspace = true }
|
||||
|
|
|
@ -47,6 +47,7 @@ use {
|
|||
},
|
||||
solana_perf::recycler::enable_recycler_warming,
|
||||
solana_poh::poh_service,
|
||||
solana_program_runtime::runtime_config::RuntimeConfig,
|
||||
solana_rpc::{
|
||||
rpc::{JsonRpcConfig, RpcBigtableConfig},
|
||||
rpc_pubsub_service::PubSubConfig,
|
||||
|
@ -67,7 +68,6 @@ use {
|
|||
},
|
||||
solana_send_transaction_service::send_transaction_service,
|
||||
solana_streamer::socket::SocketAddrSpace,
|
||||
solana_svm::runtime_config::RuntimeConfig,
|
||||
solana_tpu_client::tpu_client::DEFAULT_TPU_ENABLE_UDP,
|
||||
std::{
|
||||
collections::{HashSet, VecDeque},
|
||||
|
|
Loading…
Reference in New Issue