From 11ca9fe18e6ed4dd4c8ac534b312398fba953428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Mei=C3=9Fner?= Date: Thu, 11 May 2023 14:44:47 +0200 Subject: [PATCH] Bumps solana_rbpf to v0.4.0 --- Cargo.lock | 4 +- Cargo.toml | 2 +- cli/src/program.rs | 12 ++-- ledger-tool/src/program.rs | 10 ++-- program-runtime/src/builtin_program.rs | 2 +- program-runtime/src/loaded_programs.rs | 18 +++--- programs/bpf_loader/src/lib.rs | 44 +++++--------- programs/bpf_loader/src/syscalls/mod.rs | 77 +++++++++++++------------ programs/loader-v4/src/lib.rs | 14 +++-- programs/sbf/Cargo.lock | 4 +- programs/sbf/Cargo.toml | 2 +- programs/sbf/benches/bpf_loader.rs | 25 ++++---- 12 files changed, 102 insertions(+), 112 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 43da9621ab3907..cc61a53fd992d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7416,9 +7416,9 @@ dependencies = [ [[package]] name = "solana_rbpf" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb31627f86190e2d97f86988f1de1a757b530caa50694244d9d28812611b063" +checksum = "5c0820fa96c8e644159a308b338465d2a6314b0a71abc92ed3ecf9ad61c906e3" dependencies = [ "byteorder", "combine", diff --git a/Cargo.toml b/Cargo.toml index e40beab95fcc79..f99cc14cb03316 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -289,7 +289,7 @@ signal-hook = "0.3.15" smpl_jwt = "0.7.1" socket2 = "0.4.9" soketto = "0.7" -solana_rbpf = "=0.3.0" +solana_rbpf = "=0.4.0" solana-account-decoder = { path = "account-decoder", version = "=1.16.0" } solana-address-lookup-table-program = { path = "programs/address-lookup-table", version = "=1.16.0" } solana-banks-client = { path = "banks-client", version = "=1.16.0" } diff --git a/cli/src/program.rs b/cli/src/program.rs index 67f8c627b83fe0..3d5f72af0aa62c 100644 --- a/cli/src/program.rs +++ b/cli/src/program.rs @@ -24,7 +24,10 @@ use { tpu_client::{TpuClient, TpuClientConfig}, }, solana_program_runtime::{compute_budget::ComputeBudget, invoke_context::InvokeContext}, - solana_rbpf::{elf::Executable, verifier::RequisiteVerifier, vm::VerifiedExecutable}, + solana_rbpf::{ + elf::Executable, + verifier::{RequisiteVerifier, TautologyVerifier}, + }, solana_remote_wallet::remote_wallet::RemoteWalletManager, solana_rpc_client::rpc_client::RpcClient, solana_rpc_client_api::{ @@ -2026,10 +2029,11 @@ fn read_and_verify_elf(program_location: &str) -> Result, Box::from_elf(&program_data, loader) - .map_err(|err| format!("ELF error: {err}"))?; + let executable = + Executable::::from_elf(&program_data, loader) + .map_err(|err| format!("ELF error: {err}"))?; - let _ = VerifiedExecutable::::from_executable(executable) + let _ = Executable::::verified(executable) .map_err(|err| format!("ELF error: {err}"))?; Ok(program_data) diff --git a/ledger-tool/src/program.rs b/ledger-tool/src/program.rs index 04ed0ad809c21a..f1036d81e6ed50 100644 --- a/ledger-tool/src/program.rs +++ b/ledger-tool/src/program.rs @@ -22,7 +22,7 @@ use { }, solana_rbpf::{ assembler::assemble, elf::Executable, static_analysis::Analysis, - verifier::RequisiteVerifier, vm::VerifiedExecutable, + verifier::RequisiteVerifier, }, solana_runtime::{bank::Bank, runtime_config::RuntimeConfig}, solana_sdk::{ @@ -281,11 +281,11 @@ impl Debug for Output { // https://github.com/rust-lang/rust/issues/74465 struct LazyAnalysis<'a, 'b> { analysis: Option>, - executable: &'a Executable>, + executable: &'a Executable>, } impl<'a, 'b> LazyAnalysis<'a, 'b> { - fn new(executable: &'a Executable>) -> Self { + fn new(executable: &'a Executable>) -> Self { Self { analysis: None, executable, @@ -530,14 +530,14 @@ pub fn program(ledger_path: &Path, matches: &ArgMatches<'_>) { let executable = assemble::(std::str::from_utf8(contents.as_slice()).unwrap(), loader) .unwrap(); - VerifiedExecutable::::from_executable(executable) + Executable::::verified(executable) .map_err(|err| format!("Assembling executable failed: {err:?}")) } .unwrap(); #[cfg(all(not(target_os = "windows"), target_arch = "x86_64"))] verified_executable.jit_compile().unwrap(); - let mut analysis = LazyAnalysis::new(verified_executable.get_executable()); + let mut analysis = LazyAnalysis::new(&verified_executable); match action { Action::Cfg => { diff --git a/program-runtime/src/builtin_program.rs b/program-runtime/src/builtin_program.rs index b768436c96d7f0..9fd93f20911cc9 100644 --- a/program-runtime/src/builtin_program.rs +++ b/program-runtime/src/builtin_program.rs @@ -15,7 +15,7 @@ pub fn create_builtin( ) -> Arc { let mut program = BuiltInProgram::default(); program - .register_function_by_name("entrypoint", process_instruction) + .register_function(b"entrypoint", process_instruction) .unwrap(); Arc::new(LoadedProgram::new_builtin(name, 0, program)) } diff --git a/program-runtime/src/loaded_programs.rs b/program-runtime/src/loaded_programs.rs index 045a1baf357789..f8e53fe7043f83 100644 --- a/program-runtime/src/loaded_programs.rs +++ b/program-runtime/src/loaded_programs.rs @@ -6,11 +6,7 @@ use { log::{debug, log_enabled, trace}, percentage::PercentageInteger, solana_measure::measure::Measure, - solana_rbpf::{ - elf::Executable, - verifier::RequisiteVerifier, - vm::{BuiltInProgram, VerifiedExecutable}, - }, + solana_rbpf::{elf::Executable, verifier::RequisiteVerifier, vm::BuiltInProgram}, solana_sdk::{ bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable, clock::Slot, loader_v4, pubkey::Pubkey, saturating_add_assign, @@ -67,9 +63,9 @@ pub enum LoadedProgramType { DelayVisibility, /// Successfully verified but not currently compiled, used to track usage statistics when a compiled program is evicted from memory. Unloaded, - LegacyV0(VerifiedExecutable>), - LegacyV1(VerifiedExecutable>), - Typed(VerifiedExecutable>), + LegacyV0(Executable>), + LegacyV1(Executable>), + Typed(Executable>), #[cfg(test)] TestLoaded, Builtin(String, BuiltInProgram>), @@ -225,11 +221,11 @@ impl LoadedProgram { // Allowing mut here, since it may be needed for jit compile, which is under a config flag #[allow(unused_mut)] let mut program = if bpf_loader_deprecated::check_id(loader_key) { - LoadedProgramType::LegacyV0(VerifiedExecutable::from_executable(executable)?) + LoadedProgramType::LegacyV0(Executable::verified(executable)?) } else if bpf_loader::check_id(loader_key) || bpf_loader_upgradeable::check_id(loader_key) { - LoadedProgramType::LegacyV1(VerifiedExecutable::from_executable(executable)?) + LoadedProgramType::LegacyV1(Executable::verified(executable)?) } else if loader_v4::check_id(loader_key) { - LoadedProgramType::Typed(VerifiedExecutable::from_executable(executable)?) + LoadedProgramType::Typed(Executable::verified(executable)?) } else { panic!(); }; diff --git a/programs/bpf_loader/src/lib.rs b/programs/bpf_loader/src/lib.rs index 437621e8564419..100c99de4956ca 100644 --- a/programs/bpf_loader/src/lib.rs +++ b/programs/bpf_loader/src/lib.rs @@ -24,7 +24,7 @@ use { error::EbpfError, memory_region::{AccessType, MemoryCowCallback, MemoryMapping, MemoryRegion}, verifier::RequisiteVerifier, - vm::{ContextObject, EbpfVm, ProgramResult, VerifiedExecutable}, + vm::{ContextObject, EbpfVm, ProgramResult}, }, solana_sdk::{ account::WritableAccount, @@ -281,7 +281,7 @@ pub fn calculate_heap_cost(heap_size: u64, heap_cost: u64, enable_rounding_fix: /// Only used in macro, do not use directly! pub fn create_vm<'a, 'b>( - program: &'a VerifiedExecutable>, + program: &'a Executable>, regions: Vec, orig_account_lengths: Vec, invoke_context: &'a mut InvokeContext<'b>, @@ -292,7 +292,7 @@ pub fn create_vm<'a, 'b>( let heap_size = heap.len(); let accounts = Arc::clone(invoke_context.transaction_context.accounts()); let memory_mapping = create_memory_mapping( - program.get_executable(), + program, stack, heap, regions, @@ -333,7 +333,7 @@ pub fn create_vm<'a, 'b>( macro_rules! create_vm { ($vm:ident, $program:expr, $regions:expr, $orig_account_lengths:expr, $invoke_context:expr $(,)?) => { let invoke_context = &*$invoke_context; - let stack_size = $program.get_executable().get_config().stack_size(); + let stack_size = $program.get_config().stack_size(); let heap_size = invoke_context .get_compute_budget() .heap_size @@ -378,17 +378,14 @@ macro_rules! mock_create_vm { solana_rbpf::vm::Config::default(), )); let function_registry = solana_rbpf::vm::FunctionRegistry::default(); - let executable = solana_rbpf::elf::Executable::::from_text_bytes( - &[0x95, 0, 0, 0, 0, 0, 0, 0], - loader, - function_registry, - ) - .unwrap(); - let verified_executable = solana_rbpf::vm::VerifiedExecutable::< - solana_rbpf::verifier::RequisiteVerifier, + let executable = solana_rbpf::elf::Executable::< + solana_rbpf::verifier::TautologyVerifier, InvokeContext, - >::from_executable(executable) + >::from_text_bytes( + &[0x95, 0, 0, 0, 0, 0, 0, 0], loader, function_registry + ) .unwrap(); + let verified_executable = solana_rbpf::elf::Executable::verified(executable).unwrap(); $crate::create_vm!( $vm, &verified_executable, @@ -400,7 +397,7 @@ macro_rules! mock_create_vm { } fn create_memory_mapping<'a, 'b, C: ContextObject>( - executable: &'a Executable, + executable: &'a Executable, stack: &'b mut AlignedMemory<{ HOST_ALIGN }>, heap: &'b mut AlignedMemory<{ HOST_ALIGN }>, additional_regions: Vec, @@ -1522,7 +1519,7 @@ fn process_loader_instruction(invoke_context: &mut InvokeContext) -> Result<(), } fn execute<'a, 'b: 'a>( - executable: &'a VerifiedExecutable>, + executable: &'a Executable>, invoke_context: &'a mut InvokeContext<'b>, ) -> Result<(), Box> { let log_collector = invoke_context.get_log_collector(); @@ -1532,7 +1529,7 @@ fn execute<'a, 'b: 'a>( #[cfg(any(target_os = "windows", not(target_arch = "x86_64")))] let use_jit = false; #[cfg(all(not(target_os = "windows"), target_arch = "x86_64"))] - let use_jit = executable.get_executable().get_compiled_program().is_some(); + let use_jit = executable.get_compiled_program().is_some(); let bpf_account_data_direct_mapping = invoke_context .feature_set .is_active(&bpf_account_data_direct_mapping::id()); @@ -1566,7 +1563,7 @@ fn execute<'a, 'b: 'a>( // We dropped the lifetime tracking in the Executor by setting it to 'static, // thus we need to reintroduce the correct lifetime of InvokeContext here again. unsafe { - mem::transmute::<_, &'a VerifiedExecutable>>( + mem::transmute::<_, &'a Executable>>( executable, ) }, @@ -1735,7 +1732,7 @@ mod tests { invoke_context::mock_process_instruction, with_mock_invoke_context, }, solana_rbpf::{ - verifier::{Verifier, VerifierError}, + verifier::Verifier, vm::{Config, ContextObject, FunctionRegistry}, }, solana_sdk::{ @@ -1801,17 +1798,6 @@ mod tests { program_account } - struct TautologyVerifier {} - impl Verifier for TautologyVerifier { - fn verify( - _prog: &[u8], - _config: &Config, - _function_registry: &FunctionRegistry, - ) -> std::result::Result<(), VerifierError> { - Ok(()) - } - } - #[test] #[should_panic(expected = "LDDWCannotBeLast")] fn test_bpf_loader_check_load_dw() { diff --git a/programs/bpf_loader/src/syscalls/mod.rs b/programs/bpf_loader/src/syscalls/mod.rs index 4e671ba3b41715..3132cd9770c96b 100644 --- a/programs/bpf_loader/src/syscalls/mod.rs +++ b/programs/bpf_loader/src/syscalls/mod.rs @@ -135,7 +135,7 @@ fn consume_compute_meter(invoke_context: &InvokeContext, amount: u64) -> Result< macro_rules! register_feature_gated_function { ($result:expr, $is_feature_active:expr, $name:expr, $call:expr $(,)?) => { if $is_feature_active { - $result.register_function_by_name($name, $call) + $result.register_function($name, $call) } else { Ok(()) } @@ -152,6 +152,7 @@ pub fn create_loader<'a>( let config = Config { max_call_depth: compute_budget.max_call_depth, stack_frame_size: compute_budget.stack_frame_size, + enable_address_translation: true, enable_stack_frame_gaps: true, instruction_meter_checkpoint_distance: 10000, enable_instruction_meter: true, @@ -189,41 +190,41 @@ pub fn create_loader<'a>( let mut result = BuiltInProgram::new_loader(config); // Abort - result.register_function_by_name("abort", SyscallAbort::call)?; + result.register_function(b"abort", SyscallAbort::call)?; // Panic - result.register_function_by_name("sol_panic_", SyscallPanic::call)?; + result.register_function(b"sol_panic_", SyscallPanic::call)?; // Logging - result.register_function_by_name("sol_log_", SyscallLog::call)?; - result.register_function_by_name("sol_log_64_", SyscallLogU64::call)?; - result.register_function_by_name("sol_log_compute_units_", SyscallLogBpfComputeUnits::call)?; - result.register_function_by_name("sol_log_pubkey", SyscallLogPubkey::call)?; + result.register_function(b"sol_log_", SyscallLog::call)?; + result.register_function(b"sol_log_64_", SyscallLogU64::call)?; + result.register_function(b"sol_log_compute_units_", SyscallLogBpfComputeUnits::call)?; + result.register_function(b"sol_log_pubkey", SyscallLogPubkey::call)?; // Program defined addresses (PDA) - result.register_function_by_name( - "sol_create_program_address", + result.register_function( + b"sol_create_program_address", SyscallCreateProgramAddress::call, )?; - result.register_function_by_name( - "sol_try_find_program_address", + result.register_function( + b"sol_try_find_program_address", SyscallTryFindProgramAddress::call, )?; // Sha256 - result.register_function_by_name("sol_sha256", SyscallSha256::call)?; + result.register_function(b"sol_sha256", SyscallSha256::call)?; // Keccak256 - result.register_function_by_name("sol_keccak256", SyscallKeccak256::call)?; + result.register_function(b"sol_keccak256", SyscallKeccak256::call)?; // Secp256k1 Recover - result.register_function_by_name("sol_secp256k1_recover", SyscallSecp256k1Recover::call)?; + result.register_function(b"sol_secp256k1_recover", SyscallSecp256k1Recover::call)?; // Blake3 register_feature_gated_function!( result, blake3_syscall_enabled, - "sol_blake3", + b"sol_blake3", SyscallBlake3::call, )?; @@ -231,64 +232,64 @@ pub fn create_loader<'a>( register_feature_gated_function!( result, curve25519_syscall_enabled, - "sol_curve_validate_point", + b"sol_curve_validate_point", SyscallCurvePointValidation::call, )?; register_feature_gated_function!( result, curve25519_syscall_enabled, - "sol_curve_group_op", + b"sol_curve_group_op", SyscallCurveGroupOps::call, )?; register_feature_gated_function!( result, curve25519_syscall_enabled, - "sol_curve_multiscalar_mul", + b"sol_curve_multiscalar_mul", SyscallCurveMultiscalarMultiplication::call, )?; // Sysvars - result.register_function_by_name("sol_get_clock_sysvar", SyscallGetClockSysvar::call)?; - result.register_function_by_name( - "sol_get_epoch_schedule_sysvar", + result.register_function(b"sol_get_clock_sysvar", SyscallGetClockSysvar::call)?; + result.register_function( + b"sol_get_epoch_schedule_sysvar", SyscallGetEpochScheduleSysvar::call, )?; register_feature_gated_function!( result, !disable_fees_sysvar, - "sol_get_fees_sysvar", + b"sol_get_fees_sysvar", SyscallGetFeesSysvar::call, )?; - result.register_function_by_name("sol_get_rent_sysvar", SyscallGetRentSysvar::call)?; + result.register_function(b"sol_get_rent_sysvar", SyscallGetRentSysvar::call)?; // Memory ops - result.register_function_by_name("sol_memcpy_", SyscallMemcpy::call)?; - result.register_function_by_name("sol_memmove_", SyscallMemmove::call)?; - result.register_function_by_name("sol_memcmp_", SyscallMemcmp::call)?; - result.register_function_by_name("sol_memset_", SyscallMemset::call)?; + result.register_function(b"sol_memcpy_", SyscallMemcpy::call)?; + result.register_function(b"sol_memmove_", SyscallMemmove::call)?; + result.register_function(b"sol_memcmp_", SyscallMemcmp::call)?; + result.register_function(b"sol_memset_", SyscallMemset::call)?; // Processed sibling instructions - result.register_function_by_name( - "sol_get_processed_sibling_instruction", + result.register_function( + b"sol_get_processed_sibling_instruction", SyscallGetProcessedSiblingInstruction::call, )?; // Stack height - result.register_function_by_name("sol_get_stack_height", SyscallGetStackHeight::call)?; + result.register_function(b"sol_get_stack_height", SyscallGetStackHeight::call)?; // Return data - result.register_function_by_name("sol_set_return_data", SyscallSetReturnData::call)?; - result.register_function_by_name("sol_get_return_data", SyscallGetReturnData::call)?; + result.register_function(b"sol_set_return_data", SyscallSetReturnData::call)?; + result.register_function(b"sol_get_return_data", SyscallGetReturnData::call)?; // Cross-program invocation - result.register_function_by_name("sol_invoke_signed_c", SyscallInvokeSignedC::call)?; - result.register_function_by_name("sol_invoke_signed_rust", SyscallInvokeSignedRust::call)?; + result.register_function(b"sol_invoke_signed_c", SyscallInvokeSignedC::call)?; + result.register_function(b"sol_invoke_signed_rust", SyscallInvokeSignedRust::call)?; // Memory allocator register_feature_gated_function!( result, !disable_deploy_of_alloc_free_syscall, - "sol_alloc_free_", + b"sol_alloc_free_", SyscallAllocFree::call, )?; @@ -296,7 +297,7 @@ pub fn create_loader<'a>( register_feature_gated_function!( result, enable_alt_bn128_syscall, - "sol_alt_bn128_group_op", + b"sol_alt_bn128_group_op", SyscallAltBn128::call, )?; @@ -304,12 +305,12 @@ pub fn create_loader<'a>( register_feature_gated_function!( result, enable_big_mod_exp_syscall, - "sol_big_mod_exp", + b"sol_big_mod_exp", SyscallBigModExp::call, )?; // Log data - result.register_function_by_name("sol_log_data", SyscallLogData::call)?; + result.register_function(b"sol_log_data", SyscallLogData::call)?; Ok(Arc::new(result)) } diff --git a/programs/loader-v4/src/lib.rs b/programs/loader-v4/src/lib.rs index cb6cfb28a23e46..59b3537a433628 100644 --- a/programs/loader-v4/src/lib.rs +++ b/programs/loader-v4/src/lib.rs @@ -12,10 +12,11 @@ use { solana_rbpf::{ aligned_memory::AlignedMemory, ebpf, + elf::Executable, memory_region::{MemoryMapping, MemoryRegion}, verifier::RequisiteVerifier, vm::{ - BuiltInProgram, Config, ContextObject, EbpfVm, ProgramResult, VerifiedExecutable, + BuiltInProgram, Config, ContextObject, EbpfVm, ProgramResult, PROGRAM_ENVIRONMENT_KEY_SHIFT, }, }, @@ -79,6 +80,7 @@ pub fn load_program_from_account( let config = Config { max_call_depth: compute_budget.max_call_depth, stack_frame_size: compute_budget.stack_frame_size, + enable_address_translation: true, // To be deactivated once we have BTF inference and verification enable_stack_frame_gaps: false, instruction_meter_checkpoint_distance: 10000, enable_instruction_meter: true, @@ -139,9 +141,9 @@ fn calculate_heap_cost(heap_size: u64, heap_cost: u64) -> u64 { /// Create the SBF virtual machine pub fn create_vm<'a, 'b>( invoke_context: &'a mut InvokeContext<'b>, - program: &'a VerifiedExecutable>, + program: &'a Executable>, ) -> Result>, Box> { - let config = program.get_executable().get_config(); + let config = program.get_config(); let compute_budget = invoke_context.get_compute_budget(); let heap_size = compute_budget.heap_size.unwrap_or(HEAP_LENGTH); invoke_context.consume_checked(calculate_heap_cost( @@ -154,7 +156,7 @@ pub fn create_vm<'a, 'b>( ); let stack_len = stack.len(); let regions: Vec = vec![ - program.get_executable().get_ro_region(), + program.get_ro_region(), MemoryRegion::new_writable_gapped(stack.as_slice_mut(), ebpf::MM_STACK_START, 0), MemoryRegion::new_writable(heap.as_slice_mut(), ebpf::MM_HEAP_START), ]; @@ -173,7 +175,7 @@ pub fn create_vm<'a, 'b>( fn execute( invoke_context: &mut InvokeContext, - program: &VerifiedExecutable>, + program: &Executable>, ) -> Result<(), Box> { let log_collector = invoke_context.get_log_collector(); let stack_height = invoke_context.get_stack_height(); @@ -183,7 +185,7 @@ fn execute( #[cfg(any(target_os = "windows", not(target_arch = "x86_64")))] let use_jit = false; #[cfg(all(not(target_os = "windows"), target_arch = "x86_64"))] - let use_jit = program.get_executable().get_compiled_program().is_some(); + let use_jit = program.get_compiled_program().is_some(); let compute_meter_prev = invoke_context.get_remaining(); let mut create_vm_time = Measure::start("create_vm"); diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index ed6de4debf3fe5..51391629eb65da 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -6571,9 +6571,9 @@ dependencies = [ [[package]] name = "solana_rbpf" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb31627f86190e2d97f86988f1de1a757b530caa50694244d9d28812611b063" +checksum = "5c0820fa96c8e644159a308b338465d2a6314b0a71abc92ed3ecf9ad61c906e3" dependencies = [ "byteorder 1.4.3", "combine", diff --git a/programs/sbf/Cargo.toml b/programs/sbf/Cargo.toml index b8146b76ff55e0..ddeace50dedb7f 100644 --- a/programs/sbf/Cargo.toml +++ b/programs/sbf/Cargo.toml @@ -24,7 +24,7 @@ num-traits = "0.2" rand = "0.7" serde = "1.0.112" serde_json = "1.0.56" -solana_rbpf = "=0.3.0" +solana_rbpf = "=0.4.0" solana-account-decoder = { path = "../../account-decoder", version = "=1.16.0" } solana-address-lookup-table-program = { path = "../../programs/address-lookup-table", version = "=1.16.0" } solana-bpf-loader-program = { path = "../bpf_loader", version = "=1.16.0" } diff --git a/programs/sbf/benches/bpf_loader.rs b/programs/sbf/benches/bpf_loader.rs index b210cb67f4b418..c9600372cf5c50 100644 --- a/programs/sbf/benches/bpf_loader.rs +++ b/programs/sbf/benches/bpf_loader.rs @@ -21,8 +21,8 @@ use { ebpf::MM_INPUT_START, elf::Executable, memory_region::MemoryRegion, - verifier::RequisiteVerifier, - vm::{ContextObject, VerifiedExecutable}, + verifier::{RequisiteVerifier, TautologyVerifier}, + vm::ContextObject, }, solana_runtime::{ bank::Bank, @@ -97,7 +97,8 @@ fn bench_program_create_executable(bencher: &mut Bencher) { ) .unwrap(); bencher.iter(|| { - let _ = Executable::::from_elf(&elf, loader.clone()).unwrap(); + let _ = + Executable::::from_elf(&elf, loader.clone()).unwrap(); }); } @@ -120,11 +121,11 @@ fn bench_program_alu(bencher: &mut Bencher) { false, ) .unwrap(); - let executable = Executable::::from_elf(&elf, loader).unwrap(); + let executable = + Executable::::from_elf(&elf, loader).unwrap(); let mut verified_executable = - VerifiedExecutable::::from_executable(executable) - .unwrap(); + Executable::::verified(executable).unwrap(); verified_executable.jit_compile().unwrap(); create_vm!( @@ -237,11 +238,11 @@ fn bench_create_vm(bencher: &mut Bencher) { false, ) .unwrap(); - let executable = Executable::::from_elf(&elf, loader).unwrap(); + let executable = + Executable::::from_elf(&elf, loader).unwrap(); let verified_executable = - VerifiedExecutable::::from_executable(executable) - .unwrap(); + Executable::::verified(executable).unwrap(); // Serialize account data let (_serialized, regions, account_lengths) = serialize_parameters( @@ -297,11 +298,11 @@ fn bench_instruction_count_tuner(_bencher: &mut Bencher) { false, ) .unwrap(); - let executable = Executable::::from_elf(&elf, loader).unwrap(); + let executable = + Executable::::from_elf(&elf, loader).unwrap(); let verified_executable = - VerifiedExecutable::::from_executable(executable) - .unwrap(); + Executable::::verified(executable).unwrap(); create_vm!( vm,