Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumps solana-sbpf to v0.9.0 #3830

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 26 additions & 33 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ solana-rpc-client-api = { path = "rpc-client-api", version = "=2.2.0" }
solana-rpc-client-nonce-utils = { path = "rpc-client-nonce-utils", version = "=2.2.0" }
solana-runtime = { path = "runtime", version = "=2.2.0" }
solana-runtime-transaction = { path = "runtime-transaction", version = "=2.2.0" }
solana-sbpf = "=0.9.0"
solana-sdk = { path = "sdk", version = "=2.2.0" }
solana-sdk-ids = { path = "sdk/sdk-ids", version = "=2.2.0" }
solana-sdk-macro = { path = "sdk/macro", version = "=2.2.0" }
Expand Down Expand Up @@ -612,7 +613,6 @@ solana-zk-keygen = { path = "zk-keygen", version = "=2.2.0" }
solana-zk-sdk = { path = "zk-sdk", version = "=2.2.0" }
solana-zk-token-proof-program = { path = "programs/zk-token-proof", version = "=2.2.0" }
solana-zk-token-sdk = { path = "zk-token-sdk", version = "=2.2.0" }
solana_rbpf = "=0.8.5"
spl-associated-token-account = "=6.0.0"
spl-instruction-padding = "0.3"
spl-memo = "=6.0.0"
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ solana-remote-wallet = { workspace = true, features = ["default"] }
solana-rpc-client = { workspace = true, features = ["default"] }
solana-rpc-client-api = { workspace = true }
solana-rpc-client-nonce-utils = { workspace = true, features = ["clap"] }
solana-sbpf = { workspace = true }
solana-sdk = { workspace = true }
solana-streamer = { workspace = true }
solana-tps-client = { workspace = true }
Expand All @@ -56,7 +57,6 @@ solana-transaction-status = { workspace = true }
solana-udp-client = { workspace = true }
solana-version = { workspace = true }
solana-vote-program = { workspace = true }
solana_rbpf = { workspace = true }
spl-memo = { workspace = true, features = ["no-entrypoint"] }
thiserror = { workspace = true }
tiny-bip39 = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion cli/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ use {
solana_compute_budget::compute_budget::ComputeBudget,
solana_feature_set::{FeatureSet, FEATURE_NAMES},
solana_program_runtime::invoke_context::InvokeContext,
solana_rbpf::{elf::Executable, verifier::RequisiteVerifier},
solana_remote_wallet::remote_wallet::RemoteWalletManager,
solana_rpc_client::rpc_client::RpcClient,
solana_rpc_client_api::{
Expand All @@ -52,6 +51,7 @@ use {
request::MAX_MULTIPLE_ACCOUNTS,
},
solana_rpc_client_nonce_utils::blockhash_query::BlockhashQuery,
solana_sbpf::{elf::Executable, verifier::RequisiteVerifier},
solana_sdk::{
account::Account,
account_utils::StateMut,
Expand Down
2 changes: 1 addition & 1 deletion cli/src/program_v4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ use {
},
solana_compute_budget::compute_budget::ComputeBudget,
solana_program_runtime::invoke_context::InvokeContext,
solana_rbpf::{elf::Executable, verifier::RequisiteVerifier},
solana_remote_wallet::remote_wallet::RemoteWalletManager,
solana_rpc_client::rpc_client::RpcClient,
solana_rpc_client_api::{
config::{RpcAccountInfoConfig, RpcProgramAccountsConfig},
filter::{Memcmp, RpcFilterType},
request::MAX_MULTIPLE_ACCOUNTS,
},
solana_sbpf::{elf::Executable, verifier::RequisiteVerifier},
solana_sdk::{
account::Account,
feature_set::{FeatureSet, FEATURE_NAMES},
Expand Down
2 changes: 1 addition & 1 deletion ledger-tool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ solana-program-runtime = { workspace = true }
solana-rpc = { workspace = true }
solana-runtime = { workspace = true, features = ["dev-context-only-utils"] }
solana-runtime-transaction = { workspace = true }
solana-sbpf = { workspace = true, features = ["debugger"] }
solana-sdk = { workspace = true, features = ["openssl-vendored"] }
solana-stake-program = { workspace = true }
solana-storage-bigtable = { workspace = true }
Expand All @@ -56,7 +57,6 @@ solana-type-overrides = { workspace = true }
solana-unified-scheduler-pool = { workspace = true }
solana-version = { workspace = true }
solana-vote-program = { workspace = true }
solana_rbpf = { workspace = true, features = ["debugger"] }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["full"] }

Expand Down
4 changes: 2 additions & 2 deletions ledger-tool/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ use {
},
with_mock_invoke_context,
},
solana_rbpf::{
solana_runtime::bank::Bank,
solana_sbpf::{
assembler::assemble, elf::Executable, static_analysis::Analysis,
verifier::RequisiteVerifier,
},
solana_runtime::bank::Bank,
solana_sdk::{
account::{create_account_shared_data_for_test, AccountSharedData},
account_utils::StateMut,
Expand Down
4 changes: 2 additions & 2 deletions program-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ solana-metrics = { workspace = true }
solana-precompiles = { workspace = true }
solana-pubkey = { workspace = true }
solana-rent = { workspace = true }
solana-sbpf = { workspace = true }
solana-sdk-ids = { workspace = true }
solana-slot-hashes = { workspace = true }
solana-stable-layout = { workspace = true }
Expand All @@ -49,7 +50,6 @@ solana-sysvar-id = { workspace = true }
solana-timings = { workspace = true }
solana-transaction-context = { workspace = true }
solana-type-overrides = { workspace = true }
solana_rbpf = { workspace = true }
thiserror = { workspace = true }

[dev-dependencies]
Expand All @@ -76,7 +76,7 @@ frozen-abi = [
]
shuttle-test = [
"solana-type-overrides/shuttle-test",
"solana_rbpf/shuttle-test",
"solana-sbpf/shuttle-test",
]

[lints]
Expand Down
12 changes: 6 additions & 6 deletions program-runtime/src/invoke_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use {
solana_measure::measure::Measure,
solana_precompiles::Precompile,
solana_pubkey::Pubkey,
solana_rbpf::{
solana_sbpf::{
ebpf::MM_HEAP_START,
error::{EbpfError, ProgramResult},
memory_region::MemoryMapping,
Expand Down Expand Up @@ -49,7 +49,7 @@ pub type BuiltinFunctionWithContext = BuiltinFunction<InvokeContext<'static>>;
#[macro_export]
macro_rules! declare_process_instruction {
($process_instruction:ident, $cu_to_consume:expr, |$invoke_context:ident| $inner:tt) => {
$crate::solana_rbpf::declare_builtin_function!(
$crate::solana_sbpf::declare_builtin_function!(
$process_instruction,
fn rust(
invoke_context: &mut $crate::invoke_context::InvokeContext,
Expand All @@ -58,7 +58,7 @@ macro_rules! declare_process_instruction {
_arg2: u64,
_arg3: u64,
_arg4: u64,
_memory_mapping: &mut $crate::solana_rbpf::memory_region::MemoryMapping,
_memory_mapping: &mut $crate::solana_sbpf::memory_region::MemoryMapping,
) -> std::result::Result<u64, Box<dyn std::error::Error>> {
fn process_instruction_inner(
$invoke_context: &mut $crate::invoke_context::InvokeContext,
Expand Down Expand Up @@ -536,7 +536,7 @@ impl<'a> InvokeContext<'a> {
.ok_or(InstructionError::UnsupportedProgramId)?;
let function = match &entry.program {
ProgramCacheEntryType::Builtin(program) => program
.get_function_registry()
.get_function_registry(SBPFVersion::V0)
.lookup_by_key(ENTRYPOINT_KEY)
.map(|(_name, function)| function),
_ => None,
Expand All @@ -555,13 +555,13 @@ impl<'a> InvokeContext<'a> {
// For now, only built-ins are invoked from here, so the VM and its Config are irrelevant.
let mock_config = Config::default();
let empty_memory_mapping =
MemoryMapping::new(Vec::new(), &mock_config, &SBPFVersion::V1).unwrap();
MemoryMapping::new(Vec::new(), &mock_config, SBPFVersion::V1).unwrap();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be V0?

let mut vm = EbpfVm::new(
self.program_cache_for_tx_batch
.environments
.program_runtime_v2
.clone(),
&SBPFVersion::V1,
SBPFVersion::V0,
// Removes lifetime tracking
unsafe { std::mem::transmute::<&mut InvokeContext, &mut InvokeContext>(self) },
empty_memory_mapping,
Expand Down
2 changes: 1 addition & 1 deletion program-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#[macro_use]
extern crate solana_metrics;

pub use solana_rbpf;
pub use solana_sbpf;
pub mod invoke_context;
pub mod loaded_programs;
pub mod mem_pool;
Expand Down
4 changes: 2 additions & 2 deletions program-runtime/src/loaded_programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use {
solana_clock::{Epoch, Slot},
solana_measure::measure::Measure,
solana_pubkey::Pubkey,
solana_rbpf::{
solana_sbpf::{
elf::Executable,
program::{BuiltinProgram, FunctionRegistry},
verifier::RequisiteVerifier,
Expand Down Expand Up @@ -1370,7 +1370,7 @@ mod tests {
percentage::Percentage,
solana_clock::Slot,
solana_pubkey::Pubkey,
solana_rbpf::{elf::Executable, program::BuiltinProgram},
solana_sbpf::{elf::Executable, program::BuiltinProgram},
std::{
fs::File,
io::Read,
Expand Down
2 changes: 1 addition & 1 deletion program-runtime/src/mem_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use {
compute_budget::{MAX_CALL_DEPTH, MAX_INSTRUCTION_STACK_DEPTH, STACK_FRAME_SIZE},
compute_budget_limits::{MAX_HEAP_FRAME_BYTES, MIN_HEAP_FRAME_BYTES},
},
solana_rbpf::{aligned_memory::AlignedMemory, ebpf::HOST_ALIGN},
solana_sbpf::{aligned_memory::AlignedMemory, ebpf::HOST_ALIGN},
std::array,
};

Expand Down
2 changes: 1 addition & 1 deletion program-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ solana-log-collector = { workspace = true }
solana-logger = { workspace = true }
solana-program-runtime = { workspace = true }
solana-runtime = { workspace = true }
solana-sbpf = { workspace = true }
solana-sdk = { workspace = true }
solana-svm = { workspace = true }
solana-timings = { workspace = true }
solana-vote-program = { workspace = true }
solana_rbpf = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["full"] }

Expand Down
Loading
Loading