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:
Alexander Meißner
2021-12-03 23:43:38 +01:00
committed by Trent Nelson
parent 231a3bda8e
commit 765fbc9a8c
12 changed files with 104 additions and 69 deletions

View File

@@ -40,7 +40,7 @@ solana-config-program = { path = "../programs/config", version = "=1.8.7" }
solana-faucet = { path = "../faucet", version = "=1.8.7" }
solana-logger = { path = "../logger", version = "=1.8.7" }
solana-net-utils = { path = "../net-utils", version = "=1.8.7" }
solana_rbpf = "=0.2.12"
solana_rbpf = "=0.2.13"
solana-remote-wallet = { path = "../remote-wallet", version = "=1.8.7" }
solana-sdk = { path = "../sdk", version = "=1.8.7" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.7" }

View File

@@ -10,7 +10,7 @@ use {
clap::{App, AppSettings, Arg, ArgMatches, SubCommand},
log::*,
solana_account_decoder::{UiAccountEncoding, UiDataSliceConfig},
solana_bpf_loader_program::{BpfError, ThisInstructionMeter},
solana_bpf_loader_program::{syscalls::register_syscalls, BpfError, ThisInstructionMeter},
solana_clap_utils::{self, input_parsers::*, input_validators::*, keypair::*},
solana_cli_output::{
CliProgram, CliProgramAccountType, CliProgramAuthority, CliProgramBuffer, CliProgramId,
@@ -39,6 +39,7 @@ use {
message::Message,
native_token::Sol,
packet::PACKET_DATA_SIZE,
process_instruction::MockInvokeContext,
pubkey::Pubkey,
signature::{keypair_from_seed, read_keypair_file, Keypair, Signature, Signer},
system_instruction::{self, SystemError},
@@ -1985,12 +1986,17 @@ fn read_and_verify_elf(program_location: &str) -> Result<Vec<u8>, Box<dyn std::e
let mut program_data = Vec::new();
file.read_to_end(&mut program_data)
.map_err(|err| format!("Unable to read program file: {}", err))?;
let mut invoke_context = MockInvokeContext::new(vec![]);
// Verify the program
<dyn Executable<BpfError, ThisInstructionMeter>>::from_elf(
&program_data,
Some(|x| verifier::check(x)),
Config::default(),
Config {
reject_unresolved_syscalls: true,
..Config::default()
},
register_syscalls(&mut invoke_context).unwrap(),
)
.map_err(|err| format!("ELF error: {}", err))?;

Binary file not shown.