Revert "Bump solana_rbpf to version 0.2.12 (#17585)"

This reverts commit 231a3bda8e.
This commit is contained in:
Trent Nelson
2021-12-13 08:48:38 -07:00
committed by Tao Zhu
parent de8dc27ecf
commit 6aaff6183d
7 changed files with 16 additions and 18 deletions

4
Cargo.lock generated
View File

@ -5898,9 +5898,9 @@ dependencies = [
[[package]]
name = "solana_rbpf"
version = "0.2.12"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c44596a3613a44f76a7f6e5205464a1e78d1529fa19e8eacde0b9e55a6387f50"
checksum = "7c1c5bdfa63c68d848d95024c7f4335bae4b1917f7df2e48e2d945f4664a8b45"
dependencies = [
"byteorder",
"combine",

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.11"
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::{bpf_verifier, BpfError, ThisInstructionMeter},
solana_clap_utils::{self, input_parsers::*, input_validators::*, keypair::*},
solana_cli_output::{
CliProgram, CliProgramAccountType, CliProgramAuthority, CliProgramBuffer, CliProgramId,
@ -24,10 +24,7 @@ use {
rpc_filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType},
tpu_client::{TpuClient, TpuClientConfig},
},
solana_rbpf::{
verifier,
vm::{Config, Executable},
},
solana_rbpf::vm::{Config, Executable},
solana_remote_wallet::remote_wallet::RemoteWalletManager,
solana_sdk::{
account::Account,
@ -1989,7 +1986,7 @@ fn read_and_verify_elf(program_location: &str) -> Result<Vec<u8>, Box<dyn std::e
// Verify the program
<dyn Executable<BpfError, ThisInstructionMeter>>::from_elf(
&program_data,
Some(|x| verifier::check(x)),
Some(|x| bpf_verifier::check(x)),
Config::default(),
)
.map_err(|err| format!("ELF error: {}", err))?;

View File

@ -3698,9 +3698,9 @@ dependencies = [
[[package]]
name = "solana_rbpf"
version = "0.2.12"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c44596a3613a44f76a7f6e5205464a1e78d1529fa19e8eacde0b9e55a6387f50"
checksum = "7c1c5bdfa63c68d848d95024c7f4335bae4b1917f7df2e48e2d945f4664a8b45"
dependencies = [
"byteorder 1.3.4",
"combine",

View File

@ -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.11"
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" }

View File

@ -21,7 +21,7 @@ sha3 = "0.9.1"
solana-measure = { path = "../../measure", version = "=1.8.7" }
solana-runtime = { path = "../../runtime", version = "=1.8.7" }
solana-sdk = { path = "../../sdk", version = "=1.8.7" }
solana_rbpf = "=0.2.12"
solana_rbpf = "=0.2.11"
thiserror = "1.0"
[dev-dependencies]

View File

@ -1,6 +1,7 @@
#![allow(clippy::integer_arithmetic)]
pub mod alloc;
pub mod allocator_bump;
pub mod bpf_verifier;
pub mod deprecated;
pub mod serialization;
pub mod syscalls;
@ -10,6 +11,7 @@ pub mod with_jit;
use {
crate::{
bpf_verifier::VerifierError,
serialization::{deserialize_parameters, serialize_parameters},
syscalls::SyscallError,
},
@ -21,7 +23,6 @@ use {
error::{EbpfError, UserDefinedError},
memory_region::MemoryRegion,
static_analysis::Analysis,
verifier::{self, VerifierError},
vm::{Config, EbpfVm, Executable, InstructionMeter},
},
solana_runtime::message_processor::MessageProcessor,
@ -102,8 +103,8 @@ pub fn create_executor(
let (_, elf_bytes) = executable
.get_text_bytes()
.map_err(|e| map_ebpf_error(invoke_context, e))?;
verifier::check(elf_bytes)
.map_err(|e| map_ebpf_error(invoke_context, EbpfError::UserError(e.into())))?;
bpf_verifier::check(elf_bytes)
.map_err(|e| map_ebpf_error(invoke_context, EbpfError::UserError(e)))?;
executable.set_syscall_registry(syscall_registry);
if use_jit {
if let Err(err) = executable.jit_compile() {
@ -1070,12 +1071,12 @@ mod tests {
}
#[test]
#[should_panic(expected = "LDDWCannotBeLast")]
#[should_panic(expected = "VerifierError(LDDWCannotBeLast)")]
fn test_bpf_loader_check_load_dw() {
let prog = &[
0x18, 0x00, 0x00, 0x00, 0x88, 0x77, 0x66, 0x55, // first half of lddw
];
verifier::check(prog).unwrap();
bpf_verifier::check(prog).unwrap();
}
#[test]