Skip to content

Commit

Permalink
SVM: Move SVM code to its own crate folder (solana-labs#35119)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgarg66 authored Feb 7, 2024
1 parent fddfc84 commit 46b9586
Show file tree
Hide file tree
Showing 40 changed files with 158 additions and 42 deletions.
28 changes: 28 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ members = [
"storage-bigtable/build-proto",
"storage-proto",
"streamer",
"svm",
"test-validator",
"thin-client",
"tokens",
Expand Down Expand Up @@ -373,6 +374,7 @@ solana-stake-program = { path = "programs/stake", version = "=1.18.0" }
solana-storage-bigtable = { path = "storage-bigtable", version = "=1.18.0" }
solana-storage-proto = { path = "storage-proto", version = "=1.18.0" }
solana-streamer = { path = "streamer", version = "=1.18.0" }
solana-svm = { path = "svm", version = "=1.18.0" }
solana-system-program = { path = "programs/system", version = "=1.18.0" }
solana-test-validator = { path = "test-validator", version = "=1.18.0" }
solana-thin-client = { path = "thin-client", version = "=1.18.0" }
Expand Down
1 change: 1 addition & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ solana-runtime = { workspace = true }
solana-sdk = { workspace = true }
solana-send-transaction-service = { workspace = true }
solana-streamer = { workspace = true }
solana-svm = { workspace = true }
solana-tpu-client = { workspace = true }
solana-transaction-status = { workspace = true }
solana-turbine = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion core/src/banking_stage/consume_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ use {
},
crossbeam_channel::{Receiver, RecvError, SendError, Sender},
solana_poh::leader_bank_notifier::LeaderBankNotifier,
solana_runtime::{bank::Bank, svm::transaction_error_metrics::TransactionErrorMetrics},
solana_runtime::bank::Bank,
solana_sdk::timing::AtomicInterval,
solana_svm::transaction_error_metrics::TransactionErrorMetrics,
std::{
sync::{
atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering},
Expand Down
6 changes: 3 additions & 3 deletions core/src/banking_stage/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ use {
solana_runtime::{
bank::{Bank, LoadAndExecuteTransactionsOutput},
compute_budget_details::GetComputeBudgetDetails,
svm::{
account_loader::validate_fee_payer, transaction_error_metrics::TransactionErrorMetrics,
},
transaction_batch::TransactionBatch,
},
solana_sdk::{
Expand All @@ -35,6 +32,9 @@ use {
timing::timestamp,
transaction::{self, AddressLoader, SanitizedTransaction, TransactionError},
},
solana_svm::{
account_loader::validate_fee_payer, transaction_error_metrics::TransactionErrorMetrics,
},
std::{
sync::{atomic::Ordering, Arc},
time::Instant,
Expand Down
2 changes: 1 addition & 1 deletion core/src/banking_stage/leader_slot_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use {
},
},
solana_poh::poh_recorder::BankStart,
solana_runtime::svm::transaction_error_metrics::*,
solana_sdk::{clock::Slot, saturating_add_assign},
solana_svm::transaction_error_metrics::*,
std::time::Instant,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ use {
itertools::MinMaxResult,
solana_cost_model::cost_model::CostModel,
solana_measure::measure_us,
solana_runtime::{
bank::Bank, bank_forks::BankForks, svm::transaction_error_metrics::TransactionErrorMetrics,
},
solana_runtime::{bank::Bank, bank_forks::BankForks},
solana_sdk::{
clock::MAX_PROCESSING_AGE, saturating_add_assign, timing::AtomicInterval,
transaction::SanitizedTransaction,
},
solana_svm::transaction_error_metrics::TransactionErrorMetrics,
std::{
sync::{Arc, RwLock},
time::Duration,
Expand Down
3 changes: 2 additions & 1 deletion core/src/banking_stage/unprocessed_transaction_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ use {
itertools::Itertools,
min_max_heap::MinMaxHeap,
solana_measure::{measure, measure_us},
solana_runtime::{bank::Bank, svm::transaction_error_metrics::TransactionErrorMetrics},
solana_runtime::bank::Bank,
solana_sdk::{
clock::FORWARD_TRANSACTIONS_TO_LEADER_AT_SLOT_OFFSET, feature_set::FeatureSet, hash::Hash,
saturating_add_assign, transaction::SanitizedTransaction,
},
solana_svm::transaction_error_metrics::TransactionErrorMetrics,
std::{
collections::HashMap,
sync::{atomic::Ordering, Arc},
Expand Down
2 changes: 1 addition & 1 deletion core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ use {
snapshot_config::SnapshotConfig,
snapshot_hash::StartingSnapshotHashes,
snapshot_utils::{self, clean_orphaned_account_snapshot_dirs},
svm::runtime_config::RuntimeConfig,
},
solana_sdk::{
clock::Slot,
Expand All @@ -116,6 +115,7 @@ 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,
Expand Down
2 changes: 1 addition & 1 deletion core/tests/epoch_accounts_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use {
snapshot_bank_utils,
snapshot_config::SnapshotConfig,
snapshot_utils,
svm::runtime_config::RuntimeConfig,
},
solana_sdk::{
clock::Slot,
Expand All @@ -39,6 +38,7 @@ use {
timing::timestamp,
},
solana_streamer::socket::SocketAddrSpace,
solana_svm::runtime_config::RuntimeConfig,
std::{
mem::ManuallyDrop,
sync::{
Expand Down
2 changes: 1 addition & 1 deletion core/tests/snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ use {
SnapshotVersion::{self, V1_2_0},
},
status_cache::MAX_CACHE_ENTRIES,
svm::runtime_config::RuntimeConfig,
},
solana_sdk::{
clock::Slot,
Expand All @@ -50,6 +49,7 @@ use {
timing::timestamp,
},
solana_streamer::socket::SocketAddrSpace,
solana_svm::runtime_config::RuntimeConfig,
std::{
collections::HashSet,
fs,
Expand Down
1 change: 1 addition & 0 deletions ledger-tool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ 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 }
Expand Down
2 changes: 1 addition & 1 deletion ledger-tool/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use {
blockstore_processor::ProcessOptions,
use_snapshot_archives_at_startup::{self, UseSnapshotArchivesAtStartup},
},
solana_runtime::svm::runtime_config::RuntimeConfig,
solana_sdk::clock::Slot,
solana_svm::runtime_config::RuntimeConfig,
std::{
collections::HashSet,
path::{Path, PathBuf},
Expand Down
1 change: 1 addition & 0 deletions ledger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ solana-sdk = { workspace = true }
solana-stake-program = { workspace = true }
solana-storage-bigtable = { workspace = true }
solana-storage-proto = { workspace = true }
solana-svm = { workspace = true }
solana-transaction-status = { workspace = true }
solana-vote = { workspace = true }
solana-vote-program = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/blockstore_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ use {
commitment::VOTE_THRESHOLD_SIZE,
installed_scheduler_pool::BankWithScheduler,
prioritization_fee_cache::PrioritizationFeeCache,
svm::runtime_config::RuntimeConfig,
transaction_batch::TransactionBatch,
},
solana_sdk::{
Expand All @@ -58,6 +57,7 @@ use {
VersionedTransaction,
},
},
solana_svm::runtime_config::RuntimeConfig,
solana_transaction_status::token_balances::TransactionTokenBalancesSet,
solana_vote::{vote_account::VoteAccountsHashMap, vote_sender_types::ReplayVoteSender},
std::{
Expand Down
1 change: 1 addition & 0 deletions program-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ solana-logger = { workspace = true }
solana-program-runtime = { workspace = true }
solana-runtime = { workspace = true }
solana-sdk = { workspace = true }
solana-svm = { workspace = true }
solana-vote-program = { workspace = true }
solana_rbpf = { workspace = true }
test-case = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion program-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use {
bank_forks::BankForks,
commitment::BlockCommitmentCache,
genesis_utils::{create_genesis_config_with_leader_ex, GenesisConfigInfo},
svm::runtime_config::RuntimeConfig,
},
solana_sdk::{
account::{create_account_shared_data_for_test, Account, AccountSharedData},
Expand All @@ -46,6 +45,7 @@ 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,
Expand Down
26 changes: 26 additions & 0 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,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-version = { workspace = true }
solana-vote = { workspace = true }
Expand Down
Loading

0 comments on commit 46b9586

Please sign in to comment.