Skip to content

Commit

Permalink
program-runtime: hoist MessageProcessor up to SVM (solana-labs#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec authored Apr 4, 2024
1 parent dcc195e commit 526979d
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
4 changes: 3 additions & 1 deletion Cargo.lock

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

3 changes: 1 addition & 2 deletions program-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ num-derive = { workspace = true }
num-traits = { workspace = true }
percentage = { workspace = true }
rand = { workspace = true }
serde = { workspace = true, features = ["derive", "rc"] }
solana-frozen-abi = { workspace = true }
solana-frozen-abi-macro = { workspace = true }
solana-measure = { workspace = true }
Expand All @@ -32,7 +31,7 @@ thiserror = { workspace = true }

[dev-dependencies]
assert_matches = { workspace = true }
libsecp256k1 = { workspace = true }
serde = { workspace = true }
solana-logger = { workspace = true }
solana-sdk = { workspace = true, features = ["dev-context-only-utils"] }
test-case = { workspace = true }
Expand Down
1 change: 0 additions & 1 deletion program-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub mod compute_budget_processor;
pub mod invoke_context;
pub mod loaded_programs;
pub mod log_collector;
pub mod message_processor;
pub mod prioritization_fee;
pub mod runtime_config;
pub mod stable_log;
Expand Down
2 changes: 1 addition & 1 deletion programs/sbf/Cargo.lock

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

3 changes: 3 additions & 0 deletions svm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ edition = { workspace = true }
itertools = { workspace = true }
log = { workspace = true }
percentage = { workspace = true }
serde = { workspace = true, features = ["derive", "rc"] }
solana-bpf-loader-program = { workspace = true }
solana-frozen-abi = { workspace = true }
solana-frozen-abi-macro = { workspace = true }
Expand All @@ -29,6 +30,8 @@ name = "solana_svm"

[dev-dependencies]
bincode = { workspace = true }
libsecp256k1 = { workspace = true }
rand = { workspace = true }
solana-logger = { workspace = true }
solana-sdk = { workspace = true, features = ["dev-context-only-utils"] }

Expand Down
1 change: 1 addition & 0 deletions svm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
pub mod account_loader;
pub mod account_overrides;
pub mod account_rent_state;
pub mod message_processor;
pub mod transaction_account_state_info;
pub mod transaction_error_metrics;
pub mod transaction_processor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use {
crate::{
serde::{Deserialize, Serialize},
solana_measure::measure::Measure,
solana_program_runtime::{
invoke_context::InvokeContext,
timings::{ExecuteDetailsTimings, ExecuteTimings},
},
serde::{Deserialize, Serialize},
solana_measure::measure::Measure,
solana_sdk::{
account::WritableAccount,
message::SanitizedMessage,
Expand Down Expand Up @@ -34,7 +34,6 @@ impl MessageProcessor {
/// For each instruction it calls the program entrypoint method and verifies that the result of
/// the call does not violate the bank's accounting rules.
/// The accounts are committed back to the bank only if every instruction succeeds.
#[allow(clippy::too_many_arguments)]
pub fn process_message(
message: &SanitizedMessage,
program_indices: &[Vec<IndexOfAccount>],
Expand Down Expand Up @@ -146,11 +145,10 @@ impl MessageProcessor {
mod tests {
use {
super::*,
crate::{
solana_program_runtime::{
compute_budget::ComputeBudget,
declare_process_instruction,
loaded_programs::{LoadedProgram, LoadedProgramsForTxBatch},
message_processor::MessageProcessor,
sysvar_cache::SysvarCache,
},
solana_sdk::{
Expand Down
2 changes: 1 addition & 1 deletion svm/src/transaction_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use {
load_accounts, LoadedTransaction, TransactionCheckResult, TransactionLoadResult,
},
account_overrides::AccountOverrides,
message_processor::MessageProcessor,
transaction_account_state_info::TransactionAccountStateInfo,
transaction_error_metrics::TransactionErrorMetrics,
transaction_results::{
Expand All @@ -22,7 +23,6 @@ use {
ProgramRuntimeEnvironments, DELAY_VISIBILITY_SLOT_OFFSET,
},
log_collector::LogCollector,
message_processor::MessageProcessor,
runtime_config::RuntimeConfig,
sysvar_cache::SysvarCache,
timings::{ExecuteDetailsTimings, ExecuteTimingType, ExecuteTimings},
Expand Down

0 comments on commit 526979d

Please sign in to comment.