Bump solana_rbpf to version 0.2.11 (#17404)
This commit is contained in:
parent
1108cb32b5
commit
85b647d80f
|
@ -5518,9 +5518,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana_rbpf"
|
||||
version = "0.2.9"
|
||||
version = "0.2.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "debbc13545a1d972955a4fd3014e7c9d6d81da16c3626ee5f64bf3aa619548f8"
|
||||
checksum = "7c1c5bdfa63c68d848d95024c7f4335bae4b1917f7df2e48e2d945f4664a8b45"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"combine",
|
||||
|
@ -5529,6 +5529,7 @@ dependencies = [
|
|||
"libc",
|
||||
"log 0.4.11",
|
||||
"rand 0.7.3",
|
||||
"rustc-demangle",
|
||||
"scroll",
|
||||
"thiserror",
|
||||
"time 0.1.43",
|
||||
|
|
|
@ -38,7 +38,7 @@ solana-config-program = { path = "../programs/config", version = "=1.7.0" }
|
|||
solana-faucet = { path = "../faucet", version = "=1.7.0" }
|
||||
solana-logger = { path = "../logger", version = "=1.7.0" }
|
||||
solana-net-utils = { path = "../net-utils", version = "=1.7.0" }
|
||||
solana_rbpf = "=0.2.9"
|
||||
solana_rbpf = "=0.2.11"
|
||||
solana-remote-wallet = { path = "../remote-wallet", version = "=1.7.0" }
|
||||
solana-sdk = { path = "../sdk", version = "=1.7.0" }
|
||||
solana-stake-program = { path = "../programs/stake", version = "=1.7.0" }
|
||||
|
|
|
@ -3637,9 +3637,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana_rbpf"
|
||||
version = "0.2.9"
|
||||
version = "0.2.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "debbc13545a1d972955a4fd3014e7c9d6d81da16c3626ee5f64bf3aa619548f8"
|
||||
checksum = "7c1c5bdfa63c68d848d95024c7f4335bae4b1917f7df2e48e2d945f4664a8b45"
|
||||
dependencies = [
|
||||
"byteorder 1.3.4",
|
||||
"combine",
|
||||
|
@ -3648,6 +3648,7 @@ dependencies = [
|
|||
"libc",
|
||||
"log",
|
||||
"rand 0.7.3",
|
||||
"rustc-demangle",
|
||||
"scroll",
|
||||
"thiserror",
|
||||
"time",
|
||||
|
|
|
@ -30,7 +30,7 @@ solana-bpf-loader-program = { path = "../bpf_loader", version = "=1.7.0" }
|
|||
solana-cli-output = { path = "../../cli-output", version = "=1.7.0" }
|
||||
solana-logger = { path = "../../logger", version = "=1.7.0" }
|
||||
solana-measure = { path = "../../measure", version = "=1.7.0" }
|
||||
solana_rbpf = "=0.2.9"
|
||||
solana_rbpf = "=0.2.11"
|
||||
solana-runtime = { path = "../../runtime", version = "=1.7.0" }
|
||||
solana-sdk = { path = "../../sdk", version = "=1.7.0" }
|
||||
solana-transaction-status = { path = "../../transaction-status", version = "=1.7.0" }
|
||||
|
|
|
@ -15,7 +15,10 @@ use solana_bpf_loader_program::{
|
|||
BpfError, ThisInstructionMeter,
|
||||
};
|
||||
use solana_cli_output::display::println_transaction;
|
||||
use solana_rbpf::vm::{Config, Executable, Tracer};
|
||||
use solana_rbpf::{
|
||||
static_analysis::Analysis,
|
||||
vm::{Config, Executable, Tracer}
|
||||
};
|
||||
use solana_runtime::{
|
||||
bank::{Bank, ExecuteTimings, NonceRollbackInfo, TransactionBalancesSet, TransactionResults},
|
||||
bank_client::BankClient,
|
||||
|
@ -242,27 +245,29 @@ fn run_program(
|
|||
if config.enable_instruction_tracing {
|
||||
if i == 1 {
|
||||
if !Tracer::compare(tracer.as_ref().unwrap(), vm.get_tracer()) {
|
||||
let mut tracer_display = String::new();
|
||||
let analysis = Analysis::from_executable(executable.as_ref());
|
||||
let stdout = std::io::stdout();
|
||||
println!("TRACE (interpreted):");
|
||||
tracer
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.write(&mut tracer_display, vm.get_program())
|
||||
.write(&mut stdout.lock(), &analysis)
|
||||
.unwrap();
|
||||
println!("TRACE (interpreted): {}", tracer_display);
|
||||
let mut tracer_display = String::new();
|
||||
println!("TRACE (jit):");
|
||||
vm.get_tracer()
|
||||
.write(&mut tracer_display, vm.get_program())
|
||||
.write(&mut stdout.lock(), &analysis)
|
||||
.unwrap();
|
||||
println!("TRACE (jit): {}", tracer_display);
|
||||
assert!(false);
|
||||
} else if log_enabled!(Trace) {
|
||||
let mut trace_buffer = String::new();
|
||||
let analysis = Analysis::from_executable(executable.as_ref());
|
||||
let mut trace_buffer = Vec::<u8>::new();
|
||||
tracer
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.write(&mut trace_buffer, vm.get_program())
|
||||
.write(&mut trace_buffer, &analysis)
|
||||
.unwrap();
|
||||
trace!("BPF Program Instruction Trace:\n{}", trace_buffer);
|
||||
let trace_string = String::from_utf8(trace_buffer).unwrap();
|
||||
trace!("BPF Program Instruction Trace:\n{}", trace_string);
|
||||
}
|
||||
}
|
||||
tracer = Some(vm.get_tracer().clone());
|
||||
|
|
|
@ -20,7 +20,7 @@ sha3 = "0.9.1"
|
|||
solana-measure = { path = "../../measure", version = "=1.7.0" }
|
||||
solana-runtime = { path = "../../runtime", version = "=1.7.0" }
|
||||
solana-sdk = { path = "../../sdk", version = "=1.7.0" }
|
||||
solana_rbpf = "=0.2.9"
|
||||
solana_rbpf = "=0.2.11"
|
||||
thiserror = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
@ -21,6 +21,7 @@ use solana_rbpf::{
|
|||
ebpf::{HOST_ALIGN, MM_HEAP_START},
|
||||
error::{EbpfError, UserDefinedError},
|
||||
memory_region::MemoryRegion,
|
||||
static_analysis::Analysis,
|
||||
vm::{Config, EbpfVm, Executable, InstructionMeter},
|
||||
};
|
||||
use solana_runtime::message_processor::MessageProcessor;
|
||||
|
@ -794,11 +795,11 @@ impl Executor for BpfExecutor {
|
|||
before
|
||||
);
|
||||
if log_enabled!(Trace) {
|
||||
let mut trace_buffer = String::new();
|
||||
vm.get_tracer()
|
||||
.write(&mut trace_buffer, vm.get_program())
|
||||
.unwrap();
|
||||
trace!("BPF Program Instruction Trace:\n{}", trace_buffer);
|
||||
let mut trace_buffer = Vec::<u8>::new();
|
||||
let analysis = Analysis::from_executable(self.executable.as_ref());
|
||||
vm.get_tracer().write(&mut trace_buffer, &analysis).unwrap();
|
||||
let trace_string = String::from_utf8(trace_buffer).unwrap();
|
||||
trace!("BPF Program Instruction Trace:\n{}", trace_string);
|
||||
}
|
||||
match result {
|
||||
Ok(status) => {
|
||||
|
@ -896,9 +897,11 @@ mod tests {
|
|||
0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exit
|
||||
];
|
||||
let input = &mut [0x00];
|
||||
|
||||
let mut bpf_functions = std::collections::BTreeMap::<u32, (usize, String)>::new();
|
||||
solana_rbpf::elf::register_bpf_function(&mut bpf_functions, 0, "entrypoint").unwrap();
|
||||
let program = <dyn Executable<BpfError, TestInstructionMeter>>::from_text_bytes(
|
||||
program,
|
||||
bpf_functions,
|
||||
None,
|
||||
Config::default(),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue