diff --git a/Cargo.lock b/Cargo.lock index 9d36eaf6f..49c12f925 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -718,6 +718,14 @@ dependencies = [ "tokio-io 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "hash32" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hashbrown" version = "0.1.8" @@ -2020,7 +2028,7 @@ dependencies = [ "serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)", "solana-logger 0.12.0", "solana-sdk 0.12.0", - "solana_rbpf 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "solana_rbpf 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2350,12 +2358,13 @@ dependencies = [ [[package]] name = "solana_rbpf" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "combine 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "elfkit 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "hash32 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.49 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2946,6 +2955,7 @@ dependencies = [ "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" "checksum globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4743617a7464bbda3c8aec8558ff2f9429047e025771037df561d383337ff865" "checksum h2 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "30e0b8e55b4d7ffedade2b9605851f8e85f5010663e7ad170ef3c0f0681bc43f" +"checksum hash32 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12d790435639c06a7b798af9e1e331ae245b7ef915b92f70a39b4cf8c00686af" "checksum hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3bae29b6653b3412c2e71e9d486db9f9df5d701941d86683005efb9f2d28e3da" "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hex-literal 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "27455ce8b4a6666c87220e4b59c9a83995476bdadc10197905e61dbe906e36fa" @@ -3081,7 +3091,7 @@ dependencies = [ "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b73ea3738b47563803ef814925e69be00799a8c07420be8b996f8e98fb2336db" "checksum socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d11a52082057d87cb5caa31ad812f4504b97ab44732cd8359df2e9ff9f48e7" -"checksum solana_rbpf 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "0aa48e45529a335d2b016d9bacb41f2fb5b51bd2b36c224a4a9ae10f138c4a89" +"checksum solana_rbpf 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ad37128dd7524e96cce18dec21be28fa369785842fcedb530b22df3a94b5fe5c" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b639411d0b9c738748b5397d5ceba08e648f4f1992231aa859af1a017f31f60b" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" diff --git a/programs/native/bpf_loader/Cargo.toml b/programs/native/bpf_loader/Cargo.toml index 23d221114..2273b97da 100644 --- a/programs/native/bpf_loader/Cargo.toml +++ b/programs/native/bpf_loader/Cargo.toml @@ -18,7 +18,7 @@ byteorder = "1.3.1" elf = "0.0.10" libc = "0.2.49" log = "0.4.2" -solana_rbpf = "=0.1.9" +solana_rbpf = "=0.1.10" serde = "1.0.88" solana-logger = { path = "../../../logger", version = "0.12.0" } solana-sdk = { path = "../../../sdk", version = "0.12.0" } diff --git a/programs/native/bpf_loader/src/bpf_verifier.rs b/programs/native/bpf_loader/src/bpf_verifier.rs index 87ae0aade..3e1d5b33b 100644 --- a/programs/native/bpf_loader/src/bpf_verifier.rs +++ b/programs/native/bpf_loader/src/bpf_verifier.rs @@ -298,8 +298,8 @@ pub fn check(prog: &[u8]) -> Result<(), Error> { ebpf::JSLE_REG => { check_jmp_offset(prog, insn_ptr)?; } - ebpf::CALL => {} - ebpf::TAIL_CALL => unimplemented!(), + ebpf::CALL_IMM => {} + ebpf::CALL_REG => {} ebpf::EXIT => {} _ => { diff --git a/programs/native/bpf_loader/src/lib.rs b/programs/native/bpf_loader/src/lib.rs index 54d532bf2..5235037b8 100644 --- a/programs/native/bpf_loader/src/lib.rs +++ b/programs/native/bpf_loader/src/lib.rs @@ -80,7 +80,7 @@ pub fn helper_sol_log_u64(arg1: u64, arg2: u64, arg3: u64, arg4: u64, arg5: u64) pub fn create_vm(prog: &[u8]) -> Result { let mut vm = EbpfVmRaw::new(None)?; vm.set_verifier(bpf_verifier::check)?; - vm.set_max_instruction_count(36000)?; // 36000 is a wag, need to tune + vm.set_max_instruction_count(36000)?; // TODO 36000 is a wag, need to tune vm.set_elf(&prog)?; vm.register_helper_ex("sol_log", Some(helper_sol_log_verify), helper_sol_log)?; vm.register_helper_ex("sol_log_", Some(helper_sol_log_verify), helper_sol_log)?;