Bump solana_rbpf to version 0.2.13 (#18068)
* Moves syscall_registry into the rbpf Executable constructor. * Adds the reject_unresolved_syscalls flag which is only set when deploying programs via the CLI.
This commit is contained in:
committed by
Trent Nelson
parent
231a3bda8e
commit
765fbc9a8c
8
programs/bpf/Cargo.lock
generated
8
programs/bpf/Cargo.lock
generated
@@ -1159,9 +1159,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
|
||||
|
||||
[[package]]
|
||||
name = "goblin"
|
||||
version = "0.3.0"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c69552f48b18aa6102ce0c82dd9bc9d3f8af5fc0a5797069b1b466b90570e39c"
|
||||
checksum = "0b1800b95efee8ad4ef04517d4d69f8e209e763b1668f1179aeeedd0e454da55"
|
||||
dependencies = [
|
||||
"log",
|
||||
"plain",
|
||||
@@ -3698,9 +3698,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solana_rbpf"
|
||||
version = "0.2.12"
|
||||
version = "0.2.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c44596a3613a44f76a7f6e5205464a1e78d1529fa19e8eacde0b9e55a6387f50"
|
||||
checksum = "fc1dced9892c2b0273318ef4d8486112ea7c7a7b8eb563a20e7858ad921b4719"
|
||||
dependencies = [
|
||||
"byteorder 1.3.4",
|
||||
"combine",
|
||||
|
@@ -30,7 +30,7 @@ solana-bpf-loader-program = { path = "../bpf_loader", version = "=1.8.7" }
|
||||
solana-cli-output = { path = "../../cli-output", version = "=1.8.7" }
|
||||
solana-logger = { path = "../../logger", version = "=1.8.7" }
|
||||
solana-measure = { path = "../../measure", version = "=1.8.7" }
|
||||
solana_rbpf = "=0.2.12"
|
||||
solana_rbpf = "=0.2.13"
|
||||
solana-runtime = { path = "../../runtime", version = "=1.8.7" }
|
||||
solana-sdk = { path = "../../sdk", version = "=1.8.7" }
|
||||
solana-transaction-status = { path = "../../transaction-status", version = "=1.8.7" }
|
||||
|
@@ -11,7 +11,7 @@ use solana_bpf_loader_program::{
|
||||
ThisInstructionMeter,
|
||||
};
|
||||
use solana_measure::measure::Measure;
|
||||
use solana_rbpf::vm::{Config, Executable, InstructionMeter};
|
||||
use solana_rbpf::vm::{Config, Executable, InstructionMeter, SyscallRegistry};
|
||||
use solana_runtime::{
|
||||
bank::Bank,
|
||||
bank_client::BankClient,
|
||||
@@ -79,6 +79,7 @@ fn bench_program_create_executable(bencher: &mut Bencher) {
|
||||
&elf,
|
||||
None,
|
||||
Config::default(),
|
||||
SyscallRegistry::default(),
|
||||
)
|
||||
.unwrap();
|
||||
});
|
||||
@@ -97,10 +98,13 @@ fn bench_program_alu(bencher: &mut Bencher) {
|
||||
let mut invoke_context = MockInvokeContext::new(vec![]);
|
||||
|
||||
let elf = load_elf("bench_alu").unwrap();
|
||||
let mut executable =
|
||||
<dyn Executable<BpfError, ThisInstructionMeter>>::from_elf(&elf, None, Config::default())
|
||||
.unwrap();
|
||||
executable.set_syscall_registry(register_syscalls(&mut invoke_context).unwrap());
|
||||
let mut executable = <dyn Executable<BpfError, ThisInstructionMeter>>::from_elf(
|
||||
&elf,
|
||||
None,
|
||||
Config::default(),
|
||||
register_syscalls(&mut invoke_context).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
executable.jit_compile().unwrap();
|
||||
let compute_meter = invoke_context.get_compute_meter();
|
||||
let mut instruction_meter = ThisInstructionMeter { compute_meter };
|
||||
@@ -225,10 +229,13 @@ fn bench_create_vm(bencher: &mut Bencher) {
|
||||
.unwrap();
|
||||
|
||||
let elf = load_elf("noop").unwrap();
|
||||
let mut executable =
|
||||
<dyn Executable<BpfError, ThisInstructionMeter>>::from_elf(&elf, None, Config::default())
|
||||
.unwrap();
|
||||
executable.set_syscall_registry(register_syscalls(&mut invoke_context).unwrap());
|
||||
let executable = <dyn Executable<BpfError, ThisInstructionMeter>>::from_elf(
|
||||
&elf,
|
||||
None,
|
||||
Config::default(),
|
||||
register_syscalls(&mut invoke_context).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
bencher.iter(|| {
|
||||
let _ = create_vm(
|
||||
@@ -273,10 +280,13 @@ fn bench_instruction_count_tuner(_bencher: &mut Bencher) {
|
||||
.unwrap();
|
||||
|
||||
let elf = load_elf("tuner").unwrap();
|
||||
let mut executable =
|
||||
<dyn Executable<BpfError, ThisInstructionMeter>>::from_elf(&elf, None, Config::default())
|
||||
.unwrap();
|
||||
executable.set_syscall_registry(register_syscalls(&mut invoke_context).unwrap());
|
||||
let executable = <dyn Executable<BpfError, ThisInstructionMeter>>::from_elf(
|
||||
&elf,
|
||||
None,
|
||||
Config::default(),
|
||||
register_syscalls(&mut invoke_context).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
let compute_meter = invoke_context.get_compute_meter();
|
||||
let mut instruction_meter = ThisInstructionMeter { compute_meter };
|
||||
let mut vm = create_vm(
|
||||
|
@@ -211,14 +211,16 @@ fn run_program(
|
||||
let mut instruction_meter = ThisInstructionMeter { compute_meter };
|
||||
|
||||
let config = Config {
|
||||
max_call_depth: 20,
|
||||
stack_frame_size: 4096,
|
||||
enable_instruction_meter: true,
|
||||
enable_instruction_tracing: true,
|
||||
..Config::default()
|
||||
};
|
||||
let mut executable =
|
||||
<dyn Executable<BpfError, ThisInstructionMeter>>::from_elf(&data, None, config).unwrap();
|
||||
executable.set_syscall_registry(register_syscalls(&mut invoke_context).unwrap());
|
||||
let mut executable = <dyn Executable<BpfError, ThisInstructionMeter>>::from_elf(
|
||||
&data,
|
||||
None,
|
||||
config,
|
||||
register_syscalls(&mut invoke_context).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
executable.jit_compile().unwrap();
|
||||
|
||||
let mut instruction_count = 0;
|
||||
|
Reference in New Issue
Block a user