Bump rbpf to v0.2.19 (#21880)

* Bump rbpf to v0.2.19

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
This commit is contained in:
Jack May
2021-12-14 07:51:23 -08:00
committed by GitHub
parent a86fe899ac
commit 509bcd2e74
11 changed files with 25 additions and 16 deletions

View File

@ -20,7 +20,7 @@ libsecp256k1 = "0.6.0"
solana-measure = { path = "../../measure", version = "=1.10.0" }
solana-program-runtime = { path = "../../program-runtime", version = "=1.10.0" }
solana-sdk = { path = "../../sdk", version = "=1.10.0" }
solana_rbpf = "=0.2.18"
solana_rbpf = "=0.2.19"
thiserror = "1.0"
[dev-dependencies]

View File

@ -38,7 +38,7 @@ use {
clock::Clock,
entrypoint::{HEAP_LENGTH, SUCCESS},
feature_set::{
do_support_realloc, reduce_required_deploy_balance,
do_support_realloc, reduce_required_deploy_balance, reject_all_elf_rw,
reject_deployment_of_unresolved_syscalls,
reject_section_virtual_address_file_offset_mismatch, requestable_heap_size,
start_verify_shift32_imm, stop_verify_mul64_imm_nonzero,
@ -52,7 +52,7 @@ use {
rent::Rent,
system_instruction::{self, MAX_PERMITTED_DATA_LENGTH},
},
std::{cell::RefCell, fmt::Debug, rc::Rc, sync::Arc},
std::{cell::RefCell, fmt::Debug, pin::Pin, rc::Rc, sync::Arc},
thiserror::Error,
};
@ -107,6 +107,9 @@ pub fn create_executor(
verify_shift32_imm: invoke_context
.feature_set
.is_active(&start_verify_shift32_imm::id()),
reject_all_writable_sections: invoke_context
.feature_set
.is_active(&reject_all_elf_rw::id()),
..Config::default()
};
let mut executable = {
@ -124,7 +127,8 @@ pub fn create_executor(
verifier::check(text_bytes, &config)
.map_err(|e| map_ebpf_error(invoke_context, EbpfError::UserError(e.into())))?;
if use_jit {
if let Err(err) = executable.jit_compile() {
if let Err(err) = Executable::<BpfError, ThisInstructionMeter>::jit_compile(&mut executable)
{
ic_msg!(invoke_context, "Failed to compile program {:?}", err);
return Err(InstructionError::ProgramFailedToCompile);
}
@ -164,7 +168,7 @@ fn check_loader_id(id: &Pubkey) -> bool {
/// Create the BPF virtual machine
pub fn create_vm<'a, 'b>(
program: &'a Executable<BpfError, ThisInstructionMeter>,
program: &'a Pin<Box<Executable<BpfError, ThisInstructionMeter>>>,
parameter_bytes: &mut [u8],
invoke_context: &'a mut InvokeContext<'b>,
orig_data_lens: &'a [usize],
@ -955,7 +959,7 @@ impl InstructionMeter for ThisInstructionMeter {
/// BPF Loader's Executor implementation
pub struct BpfExecutor {
executable: Executable<BpfError, ThisInstructionMeter>,
executable: Pin<Box<Executable<BpfError, ThisInstructionMeter>>>,
}
// Well, implement Debug for solana_rbpf::vm::Executable in solana-rbpf...