diff --git a/Cargo.lock b/Cargo.lock index be281eea..6993d026 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -643,7 +643,7 @@ dependencies = [ [[package]] name = "cli" -version = "0.5.3" +version = "0.5.5" dependencies = [ "clap", "client", @@ -661,7 +661,7 @@ dependencies = [ [[package]] name = "client" -version = "0.5.3" +version = "0.5.5" dependencies = [ "common", "config", @@ -743,7 +743,7 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "common" -version = "0.5.3" +version = "0.5.5" dependencies = [ "ethers", "eyre", @@ -755,7 +755,7 @@ dependencies = [ [[package]] name = "config" -version = "0.5.3" +version = "0.5.5" dependencies = [ "common", "dirs 4.0.0", @@ -776,7 +776,7 @@ dependencies = [ [[package]] name = "consensus" -version = "0.5.3" +version = "0.5.5" dependencies = [ "async-trait", "bytes", @@ -1681,7 +1681,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "execution" -version = "0.5.3" +version = "0.5.5" dependencies = [ "async-trait", "bytes", @@ -2201,7 +2201,7 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "helios" -version = "0.5.2" +version = "0.5.5" dependencies = [ "client", "common", diff --git a/Cargo.toml b/Cargo.toml index a4850497..44696403 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "helios" -version = "0.5.4" +version = "0.5.5" edition = "2021" autobenches = false exclude = [ diff --git a/cli/Cargo.toml b/cli/Cargo.toml index d6b86c5d..603a975f 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cli" -version = "0.5.4" +version = "0.5.5" edition = "2021" [[bin]] diff --git a/client/Cargo.toml b/client/Cargo.toml index aec8d1fb..0e8ee5ae 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "client" -version = "0.5.4" +version = "0.5.5" edition = "2021" [dependencies] diff --git a/common/Cargo.toml b/common/Cargo.toml index 4f515a70..6e1dfb90 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "common" -version = "0.5.4" +version = "0.5.5" edition = "2021" [dependencies] diff --git a/config/Cargo.toml b/config/Cargo.toml index cab430d4..63a2a0e8 100644 --- a/config/Cargo.toml +++ b/config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "config" -version = "0.5.4" +version = "0.5.5" edition = "2021" [dependencies] diff --git a/config/src/networks.rs b/config/src/networks.rs index cd06bb0f..c8b90bcc 100644 --- a/config/src/networks.rs +++ b/config/src/networks.rs @@ -72,7 +72,7 @@ impl Network { pub fn mainnet() -> BaseConfig { BaseConfig { default_checkpoint: hex_str_to_bytes( - "0x7e495f50102bed2aae9e698b73a2a640de548658998033d732feb1c0c0c7f80b", + "0xc7fc7b2f4b548bfc9305fa80bc1865ddc6eea4557f0a80507af5dc34db7bd9ce", ) .unwrap(), rpc_port: 8545, @@ -103,7 +103,7 @@ pub fn mainnet() -> BaseConfig { fork_version: hex_str_to_bytes("0x03000000").unwrap(), }, deneb: Fork { - epoch: u64::MAX, + epoch: 269568, fork_version: hex_str_to_bytes("0x04000000").unwrap(), }, }, diff --git a/consensus/Cargo.toml b/consensus/Cargo.toml index e893eca2..e8ba2422 100644 --- a/consensus/Cargo.toml +++ b/consensus/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "consensus" -version = "0.5.4" +version = "0.5.5" edition = "2021" [dependencies] diff --git a/execution/Cargo.toml b/execution/Cargo.toml index f1f34440..7ebc7fae 100644 --- a/execution/Cargo.toml +++ b/execution/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "execution" -version = "0.5.4" +version = "0.5.5" edition = "2021" [dependencies] diff --git a/execution/src/execution.rs b/execution/src/execution.rs index c1d37e00..c8f78fc1 100644 --- a/execution/src/execution.rs +++ b/execution/src/execution.rs @@ -89,7 +89,7 @@ impl ExecutionClient { let is_valid = verify_proof( &storage_proof.proof, proof.storage_hash.as_bytes(), - &key_hash.to_vec(), + &key_hash, &value, ); diff --git a/execution/src/proof.rs b/execution/src/proof.rs index 0d836ab5..eeeaf608 100644 --- a/execution/src/proof.rs +++ b/execution/src/proof.rs @@ -2,7 +2,7 @@ use ethers::types::{Bytes, EIP1186ProofResponse}; use ethers::utils::keccak256; use ethers::utils::rlp::{decode_list, RlpStream}; -pub fn verify_proof(proof: &Vec, root: &[u8], path: &Vec, value: &Vec) -> bool { +pub fn verify_proof(proof: &[Bytes], root: &[u8], path: &[u8], value: &[u8]) -> bool { let mut expected_hash = root.to_vec(); let mut path_offset = 0; @@ -38,7 +38,7 @@ pub fn verify_proof(proof: &Vec, root: &[u8], path: &Vec, value: &Vec } // inclusion proof - if &node_list[1] == value { + if node_list[1] == value { return paths_match( &node_list[0], skip_length(&node_list[0]), @@ -65,7 +65,7 @@ pub fn verify_proof(proof: &Vec, root: &[u8], path: &Vec, value: &Vec false } -fn paths_match(p1: &Vec, s1: usize, p2: &Vec, s2: usize) -> bool { +fn paths_match(p1: &[u8], s1: usize, p2: &[u8], s2: usize) -> bool { let len1 = p1.len() * 2 - s1; let len2 = p2.len() * 2 - s2; @@ -86,7 +86,7 @@ fn paths_match(p1: &Vec, s1: usize, p2: &Vec, s2: usize) -> bool { } #[allow(dead_code)] -fn get_rest_path(p: &Vec, s: usize) -> String { +fn get_rest_path(p: &[u8], s: usize) -> String { let mut ret = String::new(); for i in s..p.len() * 2 { let n = get_nibble(p, i); @@ -95,7 +95,7 @@ fn get_rest_path(p: &Vec, s: usize) -> String { ret } -fn is_empty_value(value: &Vec) -> bool { +fn is_empty_value(value: &[u8]) -> bool { let mut stream = RlpStream::new(); stream.begin_list(4); stream.append_empty_data(); @@ -107,11 +107,11 @@ fn is_empty_value(value: &Vec) -> bool { let empty_account = stream.out(); let is_empty_slot = value.len() == 1 && value[0] == 0x80; - let is_empty_account = value == &empty_account; + let is_empty_account = value == empty_account; is_empty_slot || is_empty_account } -fn shared_prefix_length(path: &Vec, path_offset: usize, node_path: &Vec) -> usize { +fn shared_prefix_length(path: &[u8], path_offset: usize, node_path: &[u8]) -> usize { let skip_length = skip_length(node_path); let len = std::cmp::min( @@ -134,7 +134,7 @@ fn shared_prefix_length(path: &Vec, path_offset: usize, node_path: &Vec) prefix_len } -fn skip_length(node: &Vec) -> usize { +fn skip_length(node: &[u8]) -> usize { if node.is_empty() { return 0; }