From 44f24707c978acb0510f28c1e076919707a158bb Mon Sep 17 00:00:00 2001 From: dospore Date: Fri, 16 Feb 2024 08:54:24 +1000 Subject: [PATCH 01/62] Remove use of ethers_core::RlpStream --- Cargo.lock | 58 +++++++++++++----- beacon_node/execution_layer/Cargo.toml | 4 +- beacon_node/execution_layer/src/block_hash.rs | 47 ++++++--------- .../src/engine_api/json_structures.rs | 19 ++++++ beacon_node/execution_layer/src/keccak.rs | 3 +- consensus/types/Cargo.toml | 4 +- consensus/types/src/execution_block_header.rs | 60 +++++++++++++++++++ consensus/types/src/execution_transaction.rs | 0 consensus/types/src/lib.rs | 2 +- 9 files changed, 147 insertions(+), 50 deletions(-) create mode 100644 consensus/types/src/execution_transaction.rs diff --git a/Cargo.lock b/Cargo.lock index aa17e2f4ceb..b4f1bd08ce4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -268,6 +268,19 @@ dependencies = [ "syn 2.0.49", ] +[[package]] +name = "alloy-rpc-types" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy.git#e127fed9118b53c9f6776ce7aed412788827e9a5" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "itertools 0.12.1", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "amcl" version = "0.3.0" @@ -348,7 +361,7 @@ dependencies = [ "ark-std 0.4.0", "derivative", "digest 0.10.7", - "itertools", + "itertools 0.10.5", "num-bigint", "num-traits", "paste", @@ -900,7 +913,7 @@ dependencies = [ "genesis", "hex", "int_to_bytes", - "itertools", + "itertools 0.10.5", "kzg", "lazy_static", "lighthouse_metrics", @@ -983,7 +996,7 @@ dependencies = [ "fnv", "futures", "hex", - "itertools", + "itertools 0.10.5", "lazy_static", "lighthouse_metrics", "lighthouse_network", @@ -1540,7 +1553,7 @@ name = "compare_fields" version = "0.2.0" dependencies = [ "compare_fields_derive", - "itertools", + "itertools 0.10.5", ] [[package]] @@ -1645,7 +1658,7 @@ dependencies = [ "clap", "criterion-plot", "csv", - "itertools", + "itertools 0.10.5", "lazy_static", "num-traits", "oorandom", @@ -1667,7 +1680,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" dependencies = [ "cast", - "itertools", + "itertools 0.10.5", ] [[package]] @@ -2783,7 +2796,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e61ffea29f26e8249d35128a82ec8d3bd4fbc80179ea5f5e5e3daafef6a80fcb" dependencies = [ "ethereum-types 0.14.1", - "itertools", + "itertools 0.10.5", "smallvec", ] @@ -3010,7 +3023,9 @@ name = "execution_layer" version = "0.1.0" dependencies = [ "alloy-consensus", + "alloy-primitives", "alloy-rlp", + "alloy-rpc-types", "arc-swap", "async-trait", "builder_client", @@ -4357,6 +4372,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.10" @@ -5471,7 +5495,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37cb4045d5677b7da537f8cb5d0730d5b6414e3cc81c61e4b50e1f0cbdc73909" dependencies = [ "darling", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "smallvec", @@ -5743,7 +5767,7 @@ dependencies = [ "hex", "if-addrs 0.6.7", "igd-next", - "itertools", + "itertools 0.10.5", "lazy_static", "lighthouse_metrics", "lighthouse_network", @@ -6060,7 +6084,7 @@ dependencies = [ "derivative", "ethereum_ssz", "ethereum_ssz_derive", - "itertools", + "itertools 0.10.5", "lazy_static", "lighthouse_metrics", "maplit", @@ -8128,7 +8152,7 @@ dependencies = [ "derivative", "ethereum_serde_utils", "ethereum_ssz", - "itertools", + "itertools 0.10.5", "serde", "serde_derive", "smallvec", @@ -8150,7 +8174,7 @@ dependencies = [ "ethereum_ssz_derive", "int_to_bytes", "integer-sqrt", - "itertools", + "itertools 0.10.5", "lazy_static", "lighthouse_metrics", "merkle_proof", @@ -8190,7 +8214,7 @@ dependencies = [ "directory", "ethereum_ssz", "ethereum_ssz_derive", - "itertools", + "itertools 0.10.5", "lazy_static", "leveldb", "lighthouse_metrics", @@ -8263,7 +8287,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b9e5728aa1a87141cefd4e7509903fc01fa0dcb108022b1e841a67c5159fc5" dependencies = [ "darling", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "smallvec", @@ -8976,6 +9000,8 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" name = "types" version = "0.2.1" dependencies = [ + "alloy-primitives", + "alloy-rlp", "arbitrary", "beacon_chain", "bls", @@ -8992,7 +9018,7 @@ dependencies = [ "ethereum_ssz_derive", "hex", "int_to_bytes", - "itertools", + "itertools 0.10.5", "kzg", "lazy_static", "log", @@ -9212,7 +9238,7 @@ dependencies = [ "futures", "hex", "hyper 1.1.0", - "itertools", + "itertools 0.10.5", "lazy_static", "libsecp256k1", "lighthouse_metrics", diff --git a/beacon_node/execution_layer/Cargo.toml b/beacon_node/execution_layer/Cargo.toml index 7fee3721d8f..d7d889ca737 100644 --- a/beacon_node/execution_layer/Cargo.toml +++ b/beacon_node/execution_layer/Cargo.toml @@ -51,5 +51,7 @@ hash-db = "0.15.2" pretty_reqwest_error = { workspace = true } arc-swap = "1.6.0" eth2_network_config = { workspace = true } -alloy-rlp = "0.3" +alloy-rlp = "0.3.4" alloy-consensus = { git = "https://github.com/alloy-rs/alloy.git", rev = "974d488bab5e21e9f17452a39a4bfa56677367b2" } +alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy.git" } +alloy-primitives = "0.6.2" diff --git a/beacon_node/execution_layer/src/block_hash.rs b/beacon_node/execution_layer/src/block_hash.rs index 074ef8b0c14..df448afc80e 100644 --- a/beacon_node/execution_layer/src/block_hash.rs +++ b/beacon_node/execution_layer/src/block_hash.rs @@ -1,13 +1,13 @@ use crate::{ - json_structures::JsonWithdrawal, + json_structures::{EncodableJsonWithdrawal, JsonWithdrawal}, keccak::{keccak256, KeccakHasher}, }; -use ethers_core::utils::rlp::RlpStream; +use alloy_rlp::Encodable; use keccak_hash::KECCAK_EMPTY_LIST_RLP; use triehash::ordered_trie_root; use types::{ - map_execution_block_header_fields_base, Address, EthSpec, ExecutionBlockHash, - ExecutionBlockHeader, ExecutionPayloadRef, Hash256, Hash64, Uint256, + EncodableExecutionBlockHeader, EthSpec, ExecutionBlockHash, ExecutionBlockHeader, + ExecutionPayloadRef, Hash256 }; /// Calculate the block hash of an execution block. @@ -60,36 +60,22 @@ pub fn calculate_execution_block_hash( /// RLP encode a withdrawal. pub fn rlp_encode_withdrawal(withdrawal: &JsonWithdrawal) -> Vec { - let mut rlp_stream = RlpStream::new(); - rlp_stream.begin_list(4); - rlp_stream.append(&withdrawal.index); - rlp_stream.append(&withdrawal.validator_index); - rlp_stream.append(&withdrawal.address); - rlp_stream.append(&withdrawal.amount); - rlp_stream.out().into() + let mut out: Vec = vec![]; + EncodableJsonWithdrawal::from(withdrawal).encode(&mut out); + // rlp_stream.begin_list(4); + // rlp_stream.append(&withdrawal.index); + // rlp_stream.append(&withdrawal.validator_index); + // rlp_stream.append(&withdrawal.address); + // rlp_stream.append(&withdrawal.amount); + // rlp_stream.out().into() + out } /// RLP encode an execution block header. pub fn rlp_encode_block_header(header: &ExecutionBlockHeader) -> Vec { - let mut rlp_header_stream = RlpStream::new(); - rlp_header_stream.begin_unbounded_list(); - map_execution_block_header_fields_base!(&header, |_, field| { - rlp_header_stream.append(field); - }); - if let Some(withdrawals_root) = &header.withdrawals_root { - rlp_header_stream.append(withdrawals_root); - } - if let Some(blob_gas_used) = &header.blob_gas_used { - rlp_header_stream.append(blob_gas_used); - } - if let Some(excess_blob_gas) = &header.excess_blob_gas { - rlp_header_stream.append(excess_blob_gas); - } - if let Some(parent_beacon_block_root) = &header.parent_beacon_block_root { - rlp_header_stream.append(parent_beacon_block_root); - } - rlp_header_stream.finalize_unbounded_list(); - rlp_header_stream.out().into() + let mut out: Vec = vec![]; + EncodableExecutionBlockHeader::from(header).encode(&mut out); + out } #[cfg(test)] @@ -97,6 +83,7 @@ mod test { use super::*; use hex::FromHex; use std::str::FromStr; + use types::{Address, Hash256, Hash64}; fn test_rlp_encoding( header: &ExecutionBlockHeader, diff --git a/beacon_node/execution_layer/src/engine_api/json_structures.rs b/beacon_node/execution_layer/src/engine_api/json_structures.rs index e8641be7953..5679d82c2bd 100644 --- a/beacon_node/execution_layer/src/engine_api/json_structures.rs +++ b/beacon_node/execution_layer/src/engine_api/json_structures.rs @@ -1,4 +1,5 @@ use super::*; +use alloy_rlp::RlpEncodable; use serde::{Deserialize, Serialize}; use strum::EnumString; use superstruct::superstruct; @@ -362,6 +363,24 @@ impl From for Withdrawal { } } } +#[derive(Debug, PartialEq, Clone, RlpEncodable)] +pub struct EncodableJsonWithdrawal<'a> { + pub index: u64, + pub validator_index: u64, + pub address: &'a [u8], + pub amount: u64, +} + +impl<'a> From<&'a JsonWithdrawal> for EncodableJsonWithdrawal<'a> { + fn from(json_withdrawal: &'a JsonWithdrawal) -> Self { + Self { + index: json_withdrawal.index, + validator_index: json_withdrawal.validator_index, + address: json_withdrawal.address.as_bytes(), + amount: json_withdrawal.amount, + } + } +} #[superstruct( variants(V1, V2, V3), diff --git a/beacon_node/execution_layer/src/keccak.rs b/beacon_node/execution_layer/src/keccak.rs index c4c96892728..c78f1fcd37b 100644 --- a/beacon_node/execution_layer/src/keccak.rs +++ b/beacon_node/execution_layer/src/keccak.rs @@ -16,7 +16,8 @@ use hash_db::Hasher; use types::Hash256; pub fn keccak256(bytes: &[u8]) -> Hash256 { - Hash256::from(ethers_core::utils::keccak256(bytes)) + let hash: [u8; 32] = alloy_primitives::utils::keccak256(bytes).into(); + Hash256::from(hash) } /// Keccak hasher. diff --git a/consensus/types/Cargo.toml b/consensus/types/Cargo.toml index db15f53537e..e1c11e6b786 100644 --- a/consensus/types/Cargo.toml +++ b/consensus/types/Cargo.toml @@ -52,6 +52,8 @@ serde_json = { workspace = true } smallvec = { workspace = true } maplit = { workspace = true } strum = { workspace = true } +alloy-rlp = { version = "0.3.4", features = ["derive"] } +alloy-primitives = "0.6.2" [dev-dependencies] criterion = { workspace = true } @@ -68,4 +70,4 @@ sqlite = [] # The `arbitrary-fuzz` feature is a no-op provided for backwards compatibility. # For simplicity `Arbitrary` is now derived regardless of the feature's presence. arbitrary-fuzz = [] -portable = ["bls/supranational-portable"] \ No newline at end of file +portable = ["bls/supranational-portable"] diff --git a/consensus/types/src/execution_block_header.rs b/consensus/types/src/execution_block_header.rs index 945222a9258..64f11dcfead 100644 --- a/consensus/types/src/execution_block_header.rs +++ b/consensus/types/src/execution_block_header.rs @@ -18,6 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. use crate::{Address, EthSpec, ExecutionPayloadRef, Hash256, Hash64, Uint256}; +use alloy_rlp::RlpEncodable; use metastruct::metastruct; /// Execution block header as used for RLP encoding and Keccak hashing. @@ -89,3 +90,62 @@ impl ExecutionBlockHeader { } } } + +#[derive(Debug, Clone, PartialEq, Eq, RlpEncodable)] +#[rlp(trailing)] +pub struct EncodableExecutionBlockHeader<'a> { + pub parent_hash: &'a [u8], + pub ommers_hash: &'a [u8], + pub beneficiary: &'a [u8], + pub state_root: &'a [u8], + pub transactions_root: &'a [u8], + pub receipts_root: &'a [u8], + pub logs_bloom: &'a [u8], + pub difficulty: u64, + pub number: u64, + pub gas_limit: u64, + pub gas_used: u64, + pub timestamp: u64, + pub extra_data: &'a [u8], + pub mix_hash: &'a [u8], + pub nonce: &'a [u8], + pub base_fee_per_gas: u64, + pub withdrawals_root: Option<&'a [u8]>, + pub blob_gas_used: Option, + pub excess_blob_gas: Option, + pub parent_beacon_block_root: Option<&'a [u8]>, +} + +impl<'a> From<&'a ExecutionBlockHeader> for EncodableExecutionBlockHeader<'a> { + fn from(header: &'a ExecutionBlockHeader) -> Self { + let mut encodable = Self { + parent_hash: header.parent_hash.as_bytes(), + ommers_hash: header.ommers_hash.as_bytes(), + beneficiary: header.beneficiary.as_bytes(), + state_root: header.state_root.as_bytes(), + transactions_root: header.transactions_root.as_bytes(), + receipts_root: header.receipts_root.as_bytes(), + logs_bloom: header.logs_bloom.as_slice(), + difficulty: header.difficulty.as_u64(), // TODO this might panic + number: header.number.as_u64(), // TODO this might panic + gas_limit: header.gas_limit.as_u64(), // TODO this might panic + gas_used: header.gas_used.as_u64(), // TODO this might panic + timestamp: header.timestamp, + extra_data: header.extra_data.as_slice(), + mix_hash: header.mix_hash.as_bytes(), + nonce: header.nonce.as_bytes(), + base_fee_per_gas: header.base_fee_per_gas.as_u64(), // TODO this might panic + withdrawals_root: None, + blob_gas_used: header.blob_gas_used, + excess_blob_gas: header.excess_blob_gas, + parent_beacon_block_root: None, + }; + if let Some(withdrawals_root) = &header.withdrawals_root { + encodable.withdrawals_root = Some(withdrawals_root.as_bytes()); + } + if let Some(parent_beacon_block_root) = &header.parent_beacon_block_root { + encodable.parent_beacon_block_root = Some(parent_beacon_block_root.as_bytes()) + } + encodable + } +} diff --git a/consensus/types/src/execution_transaction.rs b/consensus/types/src/execution_transaction.rs new file mode 100644 index 00000000000..e69de29bb2d diff --git a/consensus/types/src/lib.rs b/consensus/types/src/lib.rs index b07b497a2ae..519cc9e59e8 100644 --- a/consensus/types/src/lib.rs +++ b/consensus/types/src/lib.rs @@ -135,7 +135,7 @@ pub use crate::enr_fork_id::EnrForkId; pub use crate::eth1_data::Eth1Data; pub use crate::eth_spec::EthSpecId; pub use crate::execution_block_hash::ExecutionBlockHash; -pub use crate::execution_block_header::ExecutionBlockHeader; +pub use crate::execution_block_header::{EncodableExecutionBlockHeader, ExecutionBlockHeader}; pub use crate::execution_payload::{ ExecutionPayload, ExecutionPayloadCapella, ExecutionPayloadDeneb, ExecutionPayloadMerge, ExecutionPayloadRef, Transaction, Transactions, Withdrawals, From 7b5843500117d6110fbfd00085bf231c5b70f1ca Mon Sep 17 00:00:00 2001 From: dospore Date: Mon, 26 Feb 2024 13:16:26 +1000 Subject: [PATCH 02/62] Remove old code --- beacon_node/execution_layer/src/block_hash.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/beacon_node/execution_layer/src/block_hash.rs b/beacon_node/execution_layer/src/block_hash.rs index df448afc80e..2b7da016152 100644 --- a/beacon_node/execution_layer/src/block_hash.rs +++ b/beacon_node/execution_layer/src/block_hash.rs @@ -62,12 +62,6 @@ pub fn calculate_execution_block_hash( pub fn rlp_encode_withdrawal(withdrawal: &JsonWithdrawal) -> Vec { let mut out: Vec = vec![]; EncodableJsonWithdrawal::from(withdrawal).encode(&mut out); - // rlp_stream.begin_list(4); - // rlp_stream.append(&withdrawal.index); - // rlp_stream.append(&withdrawal.validator_index); - // rlp_stream.append(&withdrawal.address); - // rlp_stream.append(&withdrawal.amount); - // rlp_stream.out().into() out } From b3e46900d95432ba0bfb7f20c08a94e2f498a8dc Mon Sep 17 00:00:00 2001 From: dospore Date: Mon, 26 Feb 2024 13:19:45 +1000 Subject: [PATCH 03/62] Simplify keccak call --- beacon_node/execution_layer/src/keccak.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/beacon_node/execution_layer/src/keccak.rs b/beacon_node/execution_layer/src/keccak.rs index c78f1fcd37b..62e354d5030 100644 --- a/beacon_node/execution_layer/src/keccak.rs +++ b/beacon_node/execution_layer/src/keccak.rs @@ -16,8 +16,7 @@ use hash_db::Hasher; use types::Hash256; pub fn keccak256(bytes: &[u8]) -> Hash256 { - let hash: [u8; 32] = alloy_primitives::utils::keccak256(bytes).into(); - Hash256::from(hash) + Hash256::from(alloy_primitives::utils::keccak256(bytes).as_ref()) } /// Keccak hasher. From 6f3fda92bc1a2b6216bcc0f0adc12b120a0a02e5 Mon Sep 17 00:00:00 2001 From: dospore Date: Mon, 26 Feb 2024 13:23:23 +1000 Subject: [PATCH 04/62] Remove unused package --- Cargo.lock | 55 ++++++++------------------ beacon_node/execution_layer/Cargo.toml | 1 - 2 files changed, 16 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b4f1bd08ce4..7a6909619b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -268,19 +268,6 @@ dependencies = [ "syn 2.0.49", ] -[[package]] -name = "alloy-rpc-types" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#e127fed9118b53c9f6776ce7aed412788827e9a5" -dependencies = [ - "alloy-primitives", - "alloy-rlp", - "itertools 0.12.1", - "serde", - "serde_json", - "thiserror", -] - [[package]] name = "amcl" version = "0.3.0" @@ -361,7 +348,7 @@ dependencies = [ "ark-std 0.4.0", "derivative", "digest 0.10.7", - "itertools 0.10.5", + "itertools", "num-bigint", "num-traits", "paste", @@ -913,7 +900,7 @@ dependencies = [ "genesis", "hex", "int_to_bytes", - "itertools 0.10.5", + "itertools", "kzg", "lazy_static", "lighthouse_metrics", @@ -996,7 +983,7 @@ dependencies = [ "fnv", "futures", "hex", - "itertools 0.10.5", + "itertools", "lazy_static", "lighthouse_metrics", "lighthouse_network", @@ -1553,7 +1540,7 @@ name = "compare_fields" version = "0.2.0" dependencies = [ "compare_fields_derive", - "itertools 0.10.5", + "itertools", ] [[package]] @@ -1658,7 +1645,7 @@ dependencies = [ "clap", "criterion-plot", "csv", - "itertools 0.10.5", + "itertools", "lazy_static", "num-traits", "oorandom", @@ -1680,7 +1667,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" dependencies = [ "cast", - "itertools 0.10.5", + "itertools", ] [[package]] @@ -2796,7 +2783,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e61ffea29f26e8249d35128a82ec8d3bd4fbc80179ea5f5e5e3daafef6a80fcb" dependencies = [ "ethereum-types 0.14.1", - "itertools 0.10.5", + "itertools", "smallvec", ] @@ -3025,7 +3012,6 @@ dependencies = [ "alloy-consensus", "alloy-primitives", "alloy-rlp", - "alloy-rpc-types", "arc-swap", "async-trait", "builder_client", @@ -4372,15 +4358,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.10" @@ -5495,7 +5472,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37cb4045d5677b7da537f8cb5d0730d5b6414e3cc81c61e4b50e1f0cbdc73909" dependencies = [ "darling", - "itertools 0.10.5", + "itertools", "proc-macro2", "quote", "smallvec", @@ -5767,7 +5744,7 @@ dependencies = [ "hex", "if-addrs 0.6.7", "igd-next", - "itertools 0.10.5", + "itertools", "lazy_static", "lighthouse_metrics", "lighthouse_network", @@ -6084,7 +6061,7 @@ dependencies = [ "derivative", "ethereum_ssz", "ethereum_ssz_derive", - "itertools 0.10.5", + "itertools", "lazy_static", "lighthouse_metrics", "maplit", @@ -8152,7 +8129,7 @@ dependencies = [ "derivative", "ethereum_serde_utils", "ethereum_ssz", - "itertools 0.10.5", + "itertools", "serde", "serde_derive", "smallvec", @@ -8174,7 +8151,7 @@ dependencies = [ "ethereum_ssz_derive", "int_to_bytes", "integer-sqrt", - "itertools 0.10.5", + "itertools", "lazy_static", "lighthouse_metrics", "merkle_proof", @@ -8214,7 +8191,7 @@ dependencies = [ "directory", "ethereum_ssz", "ethereum_ssz_derive", - "itertools 0.10.5", + "itertools", "lazy_static", "leveldb", "lighthouse_metrics", @@ -8287,7 +8264,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b9e5728aa1a87141cefd4e7509903fc01fa0dcb108022b1e841a67c5159fc5" dependencies = [ "darling", - "itertools 0.10.5", + "itertools", "proc-macro2", "quote", "smallvec", @@ -9018,7 +8995,7 @@ dependencies = [ "ethereum_ssz_derive", "hex", "int_to_bytes", - "itertools 0.10.5", + "itertools", "kzg", "lazy_static", "log", @@ -9238,7 +9215,7 @@ dependencies = [ "futures", "hex", "hyper 1.1.0", - "itertools 0.10.5", + "itertools", "lazy_static", "libsecp256k1", "lighthouse_metrics", diff --git a/beacon_node/execution_layer/Cargo.toml b/beacon_node/execution_layer/Cargo.toml index d7d889ca737..c56debe5383 100644 --- a/beacon_node/execution_layer/Cargo.toml +++ b/beacon_node/execution_layer/Cargo.toml @@ -53,5 +53,4 @@ arc-swap = "1.6.0" eth2_network_config = { workspace = true } alloy-rlp = "0.3.4" alloy-consensus = { git = "https://github.com/alloy-rs/alloy.git", rev = "974d488bab5e21e9f17452a39a4bfa56677367b2" } -alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy.git" } alloy-primitives = "0.6.2" From 208bf1c2323e967c98d9f155a23b836ec823f474 Mon Sep 17 00:00:00 2001 From: dospore Date: Fri, 5 Jul 2024 16:14:51 +1000 Subject: [PATCH 05/62] Run clippy --- beacon_node/execution_layer/src/engine_api/http.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/beacon_node/execution_layer/src/engine_api/http.rs b/beacon_node/execution_layer/src/engine_api/http.rs index ef651194147..4d7f0d787fa 100644 --- a/beacon_node/execution_layer/src/engine_api/http.rs +++ b/beacon_node/execution_layer/src/engine_api/http.rs @@ -257,9 +257,9 @@ pub mod deposit_methods { Latest, } - impl Into for Eth1Id { - fn into(self) -> u64 { - match self { + impl From for u64 { + fn from(val: Eth1Id) -> Self { + match val { Eth1Id::Mainnet => 1, Eth1Id::Custom(id) => id, } From e8829487546ab097271ae79a01d97f228d948b56 Mon Sep 17 00:00:00 2001 From: dospore Date: Wed, 10 Jul 2024 09:18:24 +1000 Subject: [PATCH 06/62] Check all cargo fmt --- beacon_node/execution_layer/src/block_hash.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon_node/execution_layer/src/block_hash.rs b/beacon_node/execution_layer/src/block_hash.rs index 5ca3336cdcf..10edb7b2fd4 100644 --- a/beacon_node/execution_layer/src/block_hash.rs +++ b/beacon_node/execution_layer/src/block_hash.rs @@ -7,7 +7,7 @@ use keccak_hash::KECCAK_EMPTY_LIST_RLP; use triehash::ordered_trie_root; use types::{ EncodableExecutionBlockHeader, EthSpec, ExecutionBlockHash, ExecutionBlockHeader, - ExecutionPayloadRef, Hash256 + ExecutionPayloadRef, Hash256, }; /// Calculate the block hash of an execution block. From 77f1e114745fad9e77cad08446133fd8e9b938fa Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Wed, 10 Jul 2024 14:44:32 +0100 Subject: [PATCH 07/62] migrate to alloy primitives init --- Cargo.lock | 917 +++++++++++------- Cargo.toml | 13 +- common/clap_utils/src/lib.rs | 4 +- consensus/types/Cargo.toml | 4 +- consensus/types/src/aggregate_and_proof.rs | 3 +- consensus/types/src/beacon_block.rs | 92 +- consensus/types/src/chain_spec.rs | 17 +- consensus/types/src/deposit_tree_snapshot.rs | 2 +- consensus/types/src/lib.rs | 8 +- consensus/types/src/subnet_id.rs | 3 +- consensus/types/src/validator.rs | 4 +- consensus/types/src/withdrawal_credentials.rs | 2 +- crypto/bls/Cargo.toml | 2 +- crypto/bls/src/impls/blst.rs | 10 +- crypto/bls/src/lib.rs | 2 +- 15 files changed, 630 insertions(+), 453 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 317b30d960d..4ed4741524d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -183,7 +183,7 @@ source = "git+https://github.com/alloy-rs/alloy.git?rev=974d488bab5e21e9f17452a3 dependencies = [ "alloy-eips", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.6.4", "alloy-rlp", ] @@ -192,7 +192,7 @@ name = "alloy-eips" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy.git?rev=974d488bab5e21e9f17452a39a4bfa56677367b2#974d488bab5e21e9f17452a39a4bfa56677367b2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.6.4", "alloy-rlp", "serde", "thiserror", @@ -203,7 +203,7 @@ name = "alloy-json-rpc" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy.git?rev=974d488bab5e21e9f17452a39a4bfa56677367b2#974d488bab5e21e9f17452a39a4bfa56677367b2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.6.4", "serde", "serde_json", "thiserror", @@ -216,7 +216,7 @@ source = "git+https://github.com/alloy-rs/alloy.git?rev=974d488bab5e21e9f17452a3 dependencies = [ "alloy-eips", "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.6.4", "alloy-rlp", "serde", ] @@ -243,11 +243,37 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "alloy-primitives" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" +dependencies = [ + "alloy-rlp", + "arbitrary", + "bytes", + "cfg-if", + "const-hex", + "derive_arbitrary", + "derive_more", + "ethereum_ssz 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "hex-literal", + "itoa", + "k256 0.13.3", + "keccak-asm", + "proptest", + "proptest-derive", + "rand", + "ruint", + "serde", + "tiny-keccak", +] + [[package]] name = "alloy-rlp" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" +checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -256,13 +282,13 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" +checksum = "d83524c1f6162fcb5b0decf775498a125066c86dda6066ed609531b0e912f85a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -318,9 +344,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] @@ -395,7 +421,7 @@ dependencies = [ "ark-std 0.4.0", "derivative", "digest 0.10.7", - "itertools", + "itertools 0.10.5", "num-bigint", "num-traits", "paste", @@ -531,7 +557,7 @@ checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", "synstructure", ] @@ -543,7 +569,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -565,9 +591,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" dependencies = [ "async-lock", "cfg-if", @@ -584,24 +610,24 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", + "event-listener 5.3.1", "event-listener-strategy", "pin-project-lite", ] [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -671,7 +697,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -693,7 +719,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.1", "hyper-util", "itoa", "matchit", @@ -737,9 +763,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.72" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -804,16 +830,16 @@ dependencies = [ "eth2", "eth2_network_config", "ethereum_hashing", - "ethereum_serde_utils", - "ethereum_ssz", - "ethereum_ssz_derive", + "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "execution_layer", "fork_choice", "futures", "genesis", "hex", "int_to_bytes", - "itertools", + "itertools 0.10.5", "kzg", "lazy_static", "lighthouse_metrics", @@ -848,7 +874,7 @@ dependencies = [ "tempfile", "tokio", "tokio-stream", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "tree_hash_derive", "types", ] @@ -869,7 +895,7 @@ dependencies = [ "genesis", "hex", "http_api", - "hyper 1.3.1", + "hyper 1.4.1", "lighthouse_network", "monitoring_api", "node_test_rig", @@ -890,7 +916,7 @@ version = "0.1.0" dependencies = [ "fnv", "futures", - "itertools", + "itertools 0.10.5", "lazy_static", "lighthouse_metrics", "lighthouse_network", @@ -922,10 +948,10 @@ version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cexpr", "clang-sys", - "itertools", + "itertools 0.12.1", "lazy_static", "lazycell", "proc-macro2", @@ -933,7 +959,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -959,9 +985,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitvec" @@ -1025,24 +1051,24 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" name = "bls" version = "0.2.0" dependencies = [ + "alloy-primitives 0.7.7", "arbitrary", "blst", - "ethereum-types 0.14.1", "ethereum_hashing", - "ethereum_serde_utils", - "ethereum_ssz", + "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "hex", "rand", "serde", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "zeroize", ] [[package]] name = "blst" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c94087b935a822949d3291a9989ad2b2051ea141eda0fd4e478a75f6aa3e604b" +checksum = "62dc83a094a71d43eeadd254b1ec2d24cb6a0bb6cadce00df51f0db594711a32" dependencies = [ "cc", "glob", @@ -1068,7 +1094,7 @@ dependencies = [ "clap", "clap_utils", "eth2_network_config", - "ethereum_ssz", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "hex", "lighthouse_network", "log", @@ -1209,9 +1235,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.98" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" dependencies = [ "jobserver", "libc", @@ -1272,7 +1298,7 @@ dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -1324,9 +1350,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.8.2" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f803f94ecf597339c7a34eed2036ef83f86aaba937f001f7c5b5e251f043f1f9" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -1335,18 +1361,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" dependencies = [ "anstream", "anstyle", @@ -1357,9 +1383,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "clap_utils" @@ -1369,7 +1395,7 @@ dependencies = [ "dirs", "eth2_network_config", "ethereum-types 0.14.1", - "ethereum_ssz", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "hex", "serde", "serde_json", @@ -1390,7 +1416,7 @@ dependencies = [ "eth1", "eth2", "eth2_config", - "ethereum_ssz", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "execution_layer", "futures", "genesis", @@ -1438,7 +1464,7 @@ name = "compare_fields" version = "0.2.0" dependencies = [ "compare_fields_derive", - "itertools", + "itertools 0.10.5", ] [[package]] @@ -1544,7 +1570,7 @@ dependencies = [ "clap", "criterion-plot", "is-terminal", - "itertools", + "itertools 0.10.5", "num-traits", "once_cell", "oorandom", @@ -1565,7 +1591,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", - "itertools", + "itertools 0.10.5", ] [[package]] @@ -1724,7 +1750,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -1733,8 +1759,18 @@ version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.13.4", + "darling_macro 0.13.4", +] + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core 0.20.10", + "darling_macro 0.20.10", ] [[package]] @@ -1751,17 +1787,42 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.11.1", + "syn 2.0.70", +] + [[package]] name = "darling_macro" version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ - "darling_core", + "darling_core 0.13.4", "quote", "syn 1.0.109", ] +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core 0.20.10", + "quote", + "syn 2.0.70", +] + [[package]] name = "darwin-libproc" version = "0.1.2" @@ -1851,12 +1912,12 @@ name = "deposit_contract" version = "0.2.0" dependencies = [ "ethabi 16.0.0", - "ethereum_ssz", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "hex", "reqwest", "serde_json", "sha2 0.9.9", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "types", ] @@ -1923,29 +1984,29 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 1.0.109", + "syn 2.0.70", ] [[package]] name = "diesel" -version = "2.1.6" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff236accb9a5069572099f0b350a92e9560e8e63a9b8d546162f4a5e03026bb2" +checksum = "62d6dcd069e7b5fe49a302411f759d4cf1cf2c27fe798ef46fb8baefc053dd2b" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "byteorder", "diesel_derives", "itoa", @@ -1955,21 +2016,22 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.1.4" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14701062d6bed917b5c7103bdffaee1e4609279e240488ad24e7bd979ca6866c" +checksum = "59de76a222c2b8059f789cbe07afbfd8deb8c31dd0bc2a21f85e256c1def8259" dependencies = [ "diesel_table_macro_syntax", + "dsl_auto_type", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] name = "diesel_migrations" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6036b3f0120c5961381b570ee20a02432d7e2d27ea60de9578799cf9156914ac" +checksum = "8a73ce704bad4231f001bff3314d91dce4aba0770cee8b233991859abc15c1f6" dependencies = [ "diesel", "migrations_internals", @@ -1978,11 +2040,11 @@ dependencies = [ [[package]] name = "diesel_table_macro_syntax" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" +checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" dependencies = [ - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -2089,13 +2151,27 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.70", +] + +[[package]] +name = "dsl_auto_type" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "0892a17df262a24294c382f0d5997571006e7a4348b4327557c4ff1cd4a8bccc" dependencies = [ + "darling 0.20.10", + "either", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -2172,8 +2248,8 @@ dependencies = [ "derivative", "eth2_network_config", "ethereum-types 0.14.1", - "ethereum_ssz", - "ethereum_ssz_derive", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "execution_layer", "fork_choice", "fs2", @@ -2188,16 +2264,16 @@ dependencies = [ "snap", "state_processing", "swap_or_not_shuffle", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "tree_hash_derive", "types", ] [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" @@ -2275,7 +2351,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -2364,8 +2440,8 @@ dependencies = [ "environment", "eth1_test_rig", "eth2", - "ethereum_ssz", - "ethereum_ssz_derive", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "execution_layer", "futures", "lazy_static", @@ -2381,7 +2457,7 @@ dependencies = [ "superstruct", "task_executor", "tokio", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "types", ] @@ -2407,9 +2483,9 @@ dependencies = [ "account_utils", "bytes", "eth2_keystore", - "ethereum_serde_utils", - "ethereum_ssz", - "ethereum_ssz_derive", + "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "futures", "futures-util", "libsecp256k1", @@ -2494,7 +2570,7 @@ dependencies = [ "bytes", "discv5", "eth2_config", - "ethereum_ssz", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "logging", "pretty_reqwest_error", "reqwest", @@ -2649,24 +2725,57 @@ dependencies = [ "serde_json", ] +[[package]] +name = "ethereum_serde_utils" +version = "0.5.2" +source = "git+https://github.com/sigp/ethereum_serde_utils?branch=alloy#a70603017e81e6016c8a07ca8c939dddc390d9be" +dependencies = [ + "alloy-primitives 0.7.7", + "hex", + "serde", + "serde_derive", + "serde_json", +] + [[package]] name = "ethereum_ssz" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e61ffea29f26e8249d35128a82ec8d3bd4fbc80179ea5f5e5e3daafef6a80fcb" +checksum = "7d3627f83d8b87b432a5fad9934b4565260722a141a2c40f371f8080adec9425" dependencies = [ "ethereum-types 0.14.1", - "itertools", + "itertools 0.10.5", + "smallvec", +] + +[[package]] +name = "ethereum_ssz" +version = "0.5.4" +source = "git+https://github.com/sigp/ethereum_ssz?branch=alloy#6baa1217c531ee4bc4e8ae00fa99a427806b5320" +dependencies = [ + "alloy-primitives 0.7.7", + "itertools 0.10.5", "smallvec", ] [[package]] name = "ethereum_ssz_derive" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6085d7fd3cf84bd2b8fec150d54c8467fb491d8db9c460607c5534f653a0ee38" +checksum = "8eccd5378ec34a07edd3d9b48088cbc63309d0367d14ba10b0cdb1d1791080ea" dependencies = [ - "darling", + "darling 0.13.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ethereum_ssz_derive" +version = "0.5.4" +source = "git+https://github.com/sigp/ethereum_ssz?branch=alloy#6baa1217c531ee4bc4e8ae00fa99a427806b5320" +dependencies = [ + "darling 0.13.4", "proc-macro2", "quote", "syn 1.0.109", @@ -2803,9 +2912,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "4.0.3" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", @@ -2814,11 +2923,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.4.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 4.0.3", + "event-listener 5.3.1", "pin-project-lite", ] @@ -2857,8 +2966,8 @@ dependencies = [ "environment", "eth2", "eth2_network_config", - "ethereum_serde_utils", - "ethereum_ssz", + "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "ethers-core", "fork_choice", "hash-db", @@ -2888,7 +2997,7 @@ dependencies = [ "tempfile", "tokio", "tokio-stream", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "tree_hash_derive", "triehash", "types", @@ -3057,8 +3166,8 @@ name = "fork_choice" version = "0.1.0" dependencies = [ "beacon_chain", - "ethereum_ssz", - "ethereum_ssz_derive", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "proto_array", "slog", "state_processing", @@ -3115,9 +3224,9 @@ dependencies = [ [[package]] name = "futures-bounded" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e2774cc104e198ef3d3e1ff4ab40f86fa3245d6cb6a3a46174f21463cee173" +checksum = "91f328e7fb845fc832912fb6a34f40cf6d1888c92f974d1893a54e97b5ff542e" dependencies = [ "futures-timer", "futures-util", @@ -3175,7 +3284,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -3185,7 +3294,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.23.8", + "rustls 0.23.11", "rustls-pki-types", ] @@ -3264,7 +3373,7 @@ dependencies = [ "eth1", "eth1_test_rig", "ethereum_hashing", - "ethereum_ssz", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "futures", "int_to_bytes", "merkle_proof", @@ -3273,7 +3382,7 @@ dependencies = [ "slog", "state_processing", "tokio", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "types", ] @@ -3333,7 +3442,7 @@ checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -3357,7 +3466,7 @@ dependencies = [ "futures-ticker", "futures-timer", "getrandom", - "hashlink 0.9.0", + "hashlink 0.9.1", "hex_fmt", "libp2p", "prometheus-client", @@ -3475,9 +3584,9 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692eaaf7f7607518dd3cef090f1474b61edc5301d8012f09579920df68b725ee" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ "hashbrown 0.14.5", ] @@ -3533,6 +3642,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" @@ -3705,12 +3820,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", - "futures-core", + "futures-util", "http 1.1.0", "http-body 1.0.0", "pin-project-lite", @@ -3728,8 +3843,8 @@ dependencies = [ "environment", "eth1", "eth2", - "ethereum_serde_utils", - "ethereum_ssz", + "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "execution_layer", "futures", "genesis", @@ -3757,7 +3872,7 @@ dependencies = [ "task_executor", "tokio", "tokio-stream", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "types", "warp", "warp_utils", @@ -3786,9 +3901,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -3804,9 +3919,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -3828,9 +3943,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", @@ -3853,7 +3968,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.30", "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", @@ -3866,7 +3981,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.28", + "hyper 0.14.30", "native-tls", "tokio", "tokio-native-tls", @@ -3874,15 +3989,15 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" dependencies = [ "bytes", "futures-util", "http 1.1.0", "http-body 1.0.0", - "hyper 1.3.1", + "hyper 1.4.1", "pin-project-lite", "tokio", ] @@ -3976,7 +4091,7 @@ dependencies = [ "bytes", "futures", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.30", "log", "rand", "tokio", @@ -4160,6 +4275,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -4293,21 +4417,21 @@ dependencies = [ "c-kzg", "derivative", "ethereum_hashing", - "ethereum_serde_utils", - "ethereum_ssz", - "ethereum_ssz_derive", + "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "hex", "serde", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin 0.9.8", ] [[package]] @@ -4332,7 +4456,7 @@ dependencies = [ "eth2_network_config", "eth2_wallet", "ethereum_hashing", - "ethereum_ssz", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "execution_layer", "hex", "lighthouse_network", @@ -4346,7 +4470,7 @@ dependencies = [ "snap", "state_processing", "store", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "types", "validator_dir", ] @@ -4406,12 +4530,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4494,15 +4618,14 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.41.2" +version = "0.41.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8130a8269e65a2554d55131c770bdf4bcd94d2b8d4efb24ca23699be65066c05" +checksum = "a5a8920cbd8540059a01950c1e5c96ea8d89eb50c51cd366fc18bdf540a6e48f" dependencies = [ "either", "fnv", "futures", "futures-timer", - "instant", "libp2p-identity", "multiaddr", "multihash", @@ -4518,6 +4641,7 @@ dependencies = [ "tracing", "unsigned-varint 0.8.0", "void", + "web-time", ] [[package]] @@ -4561,9 +4685,9 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "999ec70441b2fb35355076726a6bc466c932e9bdc66f6a11c6c0aa17c7ab9be0" +checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8" dependencies = [ "asn1_der", "bs58 0.5.1", @@ -4697,7 +4821,7 @@ dependencies = [ "quinn", "rand", "ring 0.17.8", - "rustls 0.23.8", + "rustls 0.23.11", "socket2 0.5.7", "thiserror", "tokio", @@ -4737,7 +4861,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -4769,7 +4893,7 @@ dependencies = [ "libp2p-identity", "rcgen", "ring 0.17.8", - "rustls 0.23.8", + "rustls 0.23.11", "rustls-webpki 0.101.7", "thiserror", "x509-parser", @@ -4804,7 +4928,7 @@ dependencies = [ "thiserror", "tracing", "yamux 0.12.1", - "yamux 0.13.2", + "yamux 0.13.3", ] [[package]] @@ -4813,7 +4937,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -4948,8 +5072,8 @@ dependencies = [ "discv5", "either", "error-chain", - "ethereum_ssz", - "ethereum_ssz_derive", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "fnv", "futures", "gossipsub", @@ -5058,9 +5182,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "logging" @@ -5193,9 +5317,9 @@ checksum = "8878cd8d1b3c8c8ae4b2ba0a36652b7cf192f618a599a7fbdfa25cffd4ea72dd" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memoffset" @@ -5233,8 +5357,8 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37cb4045d5677b7da537f8cb5d0730d5b6414e3cc81c61e4b50e1f0cbdc73909" dependencies = [ - "darling", - "itertools", + "darling 0.13.4", + "itertools 0.10.5", "proc-macro2", "quote", "smallvec", @@ -5243,19 +5367,19 @@ dependencies = [ [[package]] name = "migrations_internals" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f23f71580015254b020e856feac3df5878c2c7a8812297edd6c0a485ac9dada" +checksum = "fd01039851e82f8799046eabbb354056283fb265c8ec0996af940f4e85a380ff" dependencies = [ "serde", - "toml 0.7.8", + "toml 0.8.14", ] [[package]] name = "migrations_macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce3325ac70e67bbab5bd837a31cae01f1a6db64e0e744a33cb03a543469ef08" +checksum = "ffb161cc72176cb37aa47f1fc520d3ef02263d67d661f44f05d05a079e1237fd" dependencies = [ "migrations_internals", "proc-macro2", @@ -5272,14 +5396,14 @@ dependencies = [ "derivative", "ethereum-types 0.14.1", "ethereum_hashing", - "ethereum_ssz", - "ethereum_ssz_derive", - "itertools", + "ethereum_ssz 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum_ssz_derive 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.10.5", "parking_lot 0.12.3", "rayon", "serde", "smallvec", - "tree_hash", + "tree_hash 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "triomphe", "typenum", "vec_map", @@ -5293,9 +5417,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -5309,9 +5433,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -5507,7 +5631,7 @@ dependencies = [ "derivative", "error-chain", "eth2", - "ethereum_ssz", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "execution_layer", "fnv", "futures", @@ -5515,7 +5639,7 @@ dependencies = [ "gossipsub", "hex", "igd-next", - "itertools", + "itertools 0.10.5", "lazy_static", "lighthouse_metrics", "lighthouse_network", @@ -5558,7 +5682,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "cfg_aliases", "libc", @@ -5617,9 +5741,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", @@ -5691,9 +5815,9 @@ dependencies = [ [[package]] name = "object" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -5722,9 +5846,9 @@ dependencies = [ [[package]] name = "oorandom" -version = "11.1.3" +version = "11.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "opaque-debug" @@ -5763,7 +5887,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -5780,7 +5904,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -5791,9 +5915,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.3.0+3.3.0" +version = "300.3.1+3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eba8804a1c5765b18c4b3f907e6897ebabeedebc9830e1a0046c4a4cf44663e1" +checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" dependencies = [ "cc", ] @@ -5818,9 +5942,9 @@ dependencies = [ "beacon_chain", "bitvec 1.0.1", "derivative", - "ethereum_ssz", - "ethereum_ssz_derive", - "itertools", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "itertools 0.10.5", "lazy_static", "lighthouse_metrics", "maplit", @@ -5953,9 +6077,9 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.1", + "redox_syscall 0.5.2", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -6032,9 +6156,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", "thiserror", @@ -6086,7 +6210,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -6163,13 +6287,13 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.0" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi 0.3.9", + "hermit-abi 0.4.0", "pin-project-lite", "rustix 0.38.34", "tracing", @@ -6254,9 +6378,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "pq-sys" -version = "0.4.8" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0052426df997c0cbd30789eb44ca097e3541717a7b8fa36b1c464ee7edebd" +checksum = "a24ff9e4cf6945c988f0db7005d87747bf72864965c3529d259ad155ac41d584" dependencies = [ "vcpkg", ] @@ -6326,9 +6450,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.84" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -6383,35 +6507,46 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.5.0", + "bitflags 2.6.0", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", "rusty-fork", "tempfile", "unarray", ] +[[package]] +name = "proptest-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf16337405ca084e9c78985114633b6827711d22b9e6ef6c6c0d665eb3f0b6e" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "proto_array" version = "0.2.0" dependencies = [ - "ethereum_ssz", - "ethereum_ssz_derive", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "safe_arith", "serde", "serde_yaml", @@ -6509,9 +6644,9 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904e3d3ba178131798c6d9375db2b13b34337d489b089fc5ba0825a2ff1bee73" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" dependencies = [ "bytes", "futures-io", @@ -6519,7 +6654,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.8", + "rustls 0.23.11", "thiserror", "tokio", "tracing", @@ -6527,15 +6662,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e974563a4b1c2206bbc61191ca4da9c22e4308b4c455e8906751cc7828393f08" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" dependencies = [ "bytes", "rand", "ring 0.17.8", "rustc-hash", - "rustls 0.23.8", + "rustls 0.23.11", "slab", "thiserror", "tinyvec", @@ -6544,9 +6679,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4f0def2590301f4f667db5a77f9694fb004f82796dc1a8b1508fafa3d0e8b72" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" dependencies = [ "libc", "once_cell", @@ -6670,9 +6805,9 @@ dependencies = [ [[package]] name = "redb" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed7508e692a49b6b2290b56540384ccae9b1fb4d77065640b165835b56ffe3bb" +checksum = "a6dd20d3cdeb9c7d2366a0b16b93b35b75aec15309fbeb7ce477138c9f68c8c0" dependencies = [ "libc", ] @@ -6697,11 +6832,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -6717,14 +6852,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -6738,13 +6873,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -6755,9 +6890,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" @@ -6773,7 +6908,7 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.30", "hyper-rustls", "hyper-tls", "ipnet", @@ -6929,14 +7064,16 @@ dependencies = [ [[package]] name = "ruint" -version = "1.12.1" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f308135fef9fc398342da5472ce7c484529df23743fb7c734e0f3d472971e62" +checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" dependencies = [ "alloy-rlp", + "arbitrary", "ark-ff 0.3.0", "ark-ff 0.4.2", "bytes", + "ethereum_ssz 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "fastrlp", "num-bigint", "num-traits", @@ -6953,9 +7090,9 @@ dependencies = [ [[package]] name = "ruint-macro" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "rusqlite" @@ -7036,7 +7173,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys 0.4.14", @@ -7064,21 +7201,21 @@ dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.4", + "rustls-webpki 0.102.5", "subtle", "zeroize", ] [[package]] name = "rustls" -version = "0.23.8" +version = "0.23.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79adb16721f56eb2d843e67676896a61ce7a0fa622dc18d3e372477a029d2740" +checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" dependencies = [ "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.4", + "rustls-webpki 0.102.5", "subtle", "zeroize", ] @@ -7120,9 +7257,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -7296,7 +7433,7 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -7356,9 +7493,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] @@ -7375,20 +7512,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", @@ -7413,7 +7550,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -7453,7 +7590,7 @@ version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ - "darling", + "darling 0.13.4", "proc-macro2", "quote", "syn 1.0.109", @@ -7635,8 +7772,8 @@ dependencies = [ "bincode", "byteorder", "derivative", - "ethereum_ssz", - "ethereum_ssz_derive", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "filesystem", "flate2", "lazy_static", @@ -7657,7 +7794,7 @@ dependencies = [ "ssz_types", "strum", "tempfile", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "tree_hash_derive", "types", ] @@ -7684,7 +7821,7 @@ name = "slashing_protection" version = "0.1.0" dependencies = [ "arbitrary", - "ethereum_serde_utils", + "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", "filesystem", "lazy_static", "r2d2", @@ -7896,18 +8033,17 @@ dependencies = [ [[package]] name = "ssz_types" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "625b20de2d4b3891e6972f4ce5061cb11bd52b3479270c4b177c134b571194a9" +source = "git+https://github.com/sigp/ssz_types?branch=alloy#d107b54024db99e69ebad233b19ebdb10eefbb6f" dependencies = [ "arbitrary", "derivative", - "ethereum_serde_utils", - "ethereum_ssz", - "itertools", + "ethereum_serde_utils 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum_ssz 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.10.5", "serde", "serde_derive", "smallvec", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/KolbyML/tree_hash.git?rev=8aaf8bb4184148768d48e2cfbbdd0b95d1da8730)", "typenum", ] @@ -7927,11 +8063,11 @@ dependencies = [ "derivative", "env_logger 0.9.3", "ethereum_hashing", - "ethereum_ssz", - "ethereum_ssz_derive", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "int_to_bytes", "integer-sqrt", - "itertools", + "itertools 0.10.5", "lazy_static", "lighthouse_metrics", "merkle_proof", @@ -7942,7 +8078,7 @@ dependencies = [ "ssz_types", "test_random_derive", "tokio", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "types", ] @@ -7951,7 +8087,7 @@ name = "state_transition_vectors" version = "0.1.0" dependencies = [ "beacon_chain", - "ethereum_ssz", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "lazy_static", "state_processing", "tokio", @@ -7971,9 +8107,9 @@ dependencies = [ "beacon_chain", "db-key", "directory", - "ethereum_ssz", - "ethereum_ssz_derive", - "itertools", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "itertools 0.10.5", "lazy_static", "leveldb", "lighthouse_metrics", @@ -8035,9 +8171,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "superstruct" @@ -8045,8 +8181,8 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf0f31f730ad9e579364950e10d6172b4a9bd04b447edf5988b066a860cc340e" dependencies = [ - "darling", - "itertools", + "darling 0.13.4", + "itertools 0.10.5", "proc-macro2", "quote", "smallvec", @@ -8075,9 +8211,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" dependencies = [ "proc-macro2", "quote", @@ -8104,7 +8240,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -8285,7 +8421,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -8389,9 +8525,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -8404,9 +8540,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -8432,13 +8568,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -8536,14 +8672,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.8" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.19.15", + "toml_edit 0.22.15", ] [[package]] @@ -8562,10 +8698,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.2.6", - "serde", - "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -8576,7 +8710,20 @@ checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap 2.2.6", "toml_datetime", - "winnow", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1" +dependencies = [ + "indexmap 2.2.6", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.6.13", ] [[package]] @@ -8639,7 +8786,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -8721,13 +8868,32 @@ dependencies = [ "smallvec", ] +[[package]] +name = "tree_hash" +version = "0.6.0" +source = "git+https://github.com/sigp/tree_hash?branch=alloy#0df21e420154c4c8e300a8e7afddcf6aac54bd93" +dependencies = [ + "alloy-primitives 0.7.7", + "ethereum_hashing", + "smallvec", +] + +[[package]] +name = "tree_hash" +version = "0.6.0" +source = "git+https://github.com/KolbyML/tree_hash.git?rev=8aaf8bb4184148768d48e2cfbbdd0b95d1da8730#8aaf8bb4184148768d48e2cfbbdd0b95d1da8730" +dependencies = [ + "alloy-primitives 0.7.7", + "ethereum_hashing", + "smallvec", +] + [[package]] name = "tree_hash_derive" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce7bccc538359a213436af7bc95804bdbf1c2a21d80e22953cbe9e096837ff1" +source = "git+https://github.com/sigp/tree_hash?branch=alloy#0df21e420154c4c8e300a8e7afddcf6aac54bd93" dependencies = [ - "darling", + "darling 0.13.4", "quote", "syn 1.0.109", ] @@ -8744,9 +8910,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b2cb4fbb9995eeb36ac86fadf24031ccd58f99d6b4b2d7b911db70bddb80d90" +checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" dependencies = [ "serde", "stable_deref_trait", @@ -8768,6 +8934,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" name = "types" version = "0.2.1" dependencies = [ + "alloy-primitives 0.7.7", "arbitrary", "beacon_chain", "bls", @@ -8776,14 +8943,13 @@ dependencies = [ "criterion", "derivative", "eth2_interop_keypairs", - "ethereum-types 0.14.1", "ethereum_hashing", - "ethereum_serde_utils", - "ethereum_ssz", - "ethereum_ssz_derive", + "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "hex", "int_to_bytes", - "itertools", + "itertools 0.10.5", "kzg", "lazy_static", "log", @@ -8812,7 +8978,7 @@ dependencies = [ "tempfile", "test_random_derive", "tokio", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "tree_hash_derive", ] @@ -8958,9 +9124,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna 0.5.0", @@ -8969,9 +9135,9 @@ dependencies = [ [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -8998,13 +9164,13 @@ dependencies = [ "environment", "eth2", "eth2_keystore", - "ethereum_serde_utils", + "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", "fdlimit", "filesystem", "futures", "hex", - "hyper 1.3.1", - "itertools", + "hyper 1.4.1", + "itertools 0.10.5", "lazy_static", "libsecp256k1", "lighthouse_metrics", @@ -9031,7 +9197,7 @@ dependencies = [ "tempfile", "tokio", "tokio-stream", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "types", "url", "validator_dir", @@ -9053,7 +9219,7 @@ dependencies = [ "lockfile", "rand", "tempfile", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "types", ] @@ -9068,14 +9234,14 @@ dependencies = [ "eth2", "eth2_network_config", "eth2_wallet", - "ethereum_serde_utils", + "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", "hex", "regex", "serde", "serde_json", "tempfile", "tokio", - "tree_hash", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "types", "validator_client", ] @@ -9149,7 +9315,7 @@ dependencies = [ "futures-util", "headers", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.30", "log", "mime", "mime_guess", @@ -9220,7 +9386,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", "wasm-bindgen-shared", ] @@ -9254,7 +9420,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -9308,7 +9474,7 @@ dependencies = [ "env_logger 0.9.3", "eth2", "http_api", - "hyper 1.3.1", + "hyper 1.4.1", "log", "logging", "network", @@ -9470,7 +9636,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -9497,7 +9663,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -9532,18 +9698,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -9560,9 +9726,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -9578,9 +9744,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -9596,15 +9762,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -9620,9 +9786,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -9638,9 +9804,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -9656,9 +9822,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -9674,9 +9840,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -9687,6 +9853,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.50.0" @@ -9777,9 +9952,9 @@ dependencies = [ [[package]] name = "yaml-rust2" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "498f4d102a79ea1c9d4dd27573c0fc96ad74c023e8da38484e47883076da25fb" +checksum = "8902160c4e6f2fb145dbe9d6760a75e3c9522d8bf796ed7047c85919ac7115f8" dependencies = [ "arraydeque", "encoding_rs", @@ -9803,18 +9978,18 @@ dependencies = [ [[package]] name = "yamux" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f97202f6b125031b95d83e01dc57292b529384f80bfae4677e4bbc10178cf72" +checksum = "a31b5e376a8b012bee9c423acdbb835fc34d45001cfa3106236a624e4b738028" dependencies = [ "futures", - "instant", "log", "nohash-hasher", "parking_lot 0.12.3", "pin-project", "rand", "static_assertions", + "web-time", ] [[package]] @@ -9828,22 +10003,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -9863,7 +10038,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.70", ] [[package]] @@ -9907,9 +10082,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.12+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index b3532dda35e..17f71b6a6a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,6 +94,7 @@ resolver = "2" edition = "2021" [workspace.dependencies] +alloy-primitives = { version = "0.7.7", features =["arbitrary", "serde", "ssz"] } anyhow = "1" arbitrary = { version = "1", features = ["derive"] } async-channel = "1.9.0" @@ -116,9 +117,9 @@ env_logger = "0.9" error-chain = "0.12" ethereum-types = "0.14" ethereum_hashing = "0.6.0" -ethereum_serde_utils = "0.5.2" -ethereum_ssz = "0.5" -ethereum_ssz_derive = "0.5" +ethereum_serde_utils = { git = "https://github.com/sigp/ethereum_serde_utils", branch = "alloy"} +ethereum_ssz = { git = "https://github.com/sigp/ethereum_ssz", branch = "alloy" } +ethereum_ssz_derive = { git = "https://github.com/sigp/ethereum_ssz", branch = "alloy" } ethers-core = "1" ethers-providers = { version = "1", default-features = false } exit-future = "0.2" @@ -160,7 +161,7 @@ slog-term = "2" sloggers = { version = "2", features = ["json"] } smallvec = { version = "1.11.2", features = ["arbitrary"] } snap = "1" -ssz_types = "0.6" +ssz_types = { git = "https://github.com/sigp/ssz_types", branch = "alloy" } strum = { version = "0.24", features = ["derive"] } superstruct = "0.8" syn = "1" @@ -174,8 +175,8 @@ tracing-appender = "0.2" tracing-core = "0.1" tracing-log = "0.2" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -tree_hash = "0.6" -tree_hash_derive = "0.6" +tree_hash = { git = "https://github.com/sigp/tree_hash", branch = "alloy"} +tree_hash_derive = { git = "https://github.com/sigp/tree_hash", branch = "alloy"} url = "2" uuid = { version = "0.8", features = ["serde", "v4"] } warp = { version = "0.3.7", default-features = false, features = ["tls"] } diff --git a/common/clap_utils/src/lib.rs b/common/clap_utils/src/lib.rs index ea56e7e672a..b2c35650a0f 100644 --- a/common/clap_utils/src/lib.rs +++ b/common/clap_utils/src/lib.rs @@ -3,7 +3,7 @@ use clap::builder::styling::*; use clap::ArgMatches; use eth2_network_config::{Eth2NetworkConfig, DEFAULT_HARDCODED_NETWORK}; -use ethereum_types::U256 as Uint256; +use alloy_primitives::U256 as Uint256; use ssz::Decode; use std::path::PathBuf; use std::str::FromStr; @@ -36,7 +36,7 @@ pub fn get_eth2_network_config(cli_args: &ArgMatches) -> Result(cli_args, "terminal-total-difficulty-override")? { let stripped = string.replace(',', ""); - let terminal_total_difficulty = Uint256::from_dec_str(&stripped).map_err(|e| { + let terminal_total_difficulty = Uint256::from_str(&stripped).map_err(|e| { format!( "Could not parse --terminal-total-difficulty-override as decimal value: {:?}", e diff --git a/consensus/types/Cargo.toml b/consensus/types/Cargo.toml index 28207f828a5..bca281a0048 100644 --- a/consensus/types/Cargo.toml +++ b/consensus/types/Cargo.toml @@ -9,13 +9,13 @@ name = "benches" harness = false [dependencies] +alloy-primitives = { workspace = true, features = ["ssz", "serde"]} merkle_proof = { workspace = true } bls = { workspace = true, features = ["arbitrary"] } kzg = { workspace = true } compare_fields = { workspace = true } compare_fields_derive = { workspace = true } eth2_interop_keypairs = { path = "../../common/eth2_interop_keypairs" } -ethereum-types = { workspace = true, features = ["arbitrary"] } ethereum_hashing = { workspace = true } hex = { workspace = true } int_to_bytes = { workspace = true } @@ -30,7 +30,7 @@ ethereum_ssz_derive = { workspace = true } ssz_types = { workspace = true, features = ["arbitrary"] } swap_or_not_shuffle = { workspace = true, features = ["arbitrary"] } test_random_derive = { path = "../../common/test_random_derive" } -tree_hash = { workspace = true, features = ["arbitrary"] } +tree_hash = { workspace = true } tree_hash_derive = { workspace = true } rand_xorshift = "0.3.0" serde_yaml = { workspace = true } diff --git a/consensus/types/src/aggregate_and_proof.rs b/consensus/types/src/aggregate_and_proof.rs index 223b12e7684..cdcbc51a623 100644 --- a/consensus/types/src/aggregate_and_proof.rs +++ b/consensus/types/src/aggregate_and_proof.rs @@ -132,10 +132,9 @@ impl AggregateAndProof { fork: &Fork, genesis_validators_root: Hash256, spec: &ChainSpec, - ) -> bool { + ) -> bool { let target_epoch = self.aggregate().data().slot.epoch(E::slots_per_epoch()); let domain = spec.get_domain( - target_epoch, Domain::SelectionProof, fork, genesis_validators_root, diff --git a/consensus/types/src/beacon_block.rs b/consensus/types/src/beacon_block.rs index f67a965955c..df07d45b4d0 100644 --- a/consensus/types/src/beacon_block.rs +++ b/consensus/types/src/beacon_block.rs @@ -169,7 +169,7 @@ impl> BeaconBlock { self.to_ref().block_header() } - /// Returns a "temporary" header, where the `state_root` is `Hash256::zero()`. + /// Returns a "temporary" header, where the `state_root` is `Hash256::ZERO`. pub fn temporary_block_header(&self) -> BeaconBlockHeader { self.to_ref().temporary_block_header() } @@ -263,10 +263,10 @@ impl<'a, E: EthSpec, Payload: AbstractExecPayload> BeaconBlockRef<'a, E, Payl } } - /// Returns a "temporary" header, where the `state_root` is `Hash256::zero()`. + /// Returns a "temporary" header, where the `state_root` is `Hash256::ZERO`. pub fn temporary_block_header(self) -> BeaconBlockHeader { BeaconBlockHeader { - state_root: Hash256::zero(), + state_root: Hash256::ZERO, ..self.block_header() } } @@ -292,13 +292,13 @@ impl> EmptyBlock for BeaconBlockBase BeaconBlockBase { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::zero(), - state_root: Hash256::zero(), + parent_root: Hash256::ZERO, + state_root: Hash256::ZERO, body: BeaconBlockBodyBase { randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::zero(), - block_hash: Hash256::zero(), + deposit_root: Hash256::ZERO, + block_hash: Hash256::ZERO, deposit_count: 0, }, graffiti: Graffiti::default(), @@ -319,9 +319,9 @@ impl> BeaconBlockBase { let header = BeaconBlockHeader { slot: Slot::new(1), proposer_index: 0, - parent_root: Hash256::zero(), - state_root: Hash256::zero(), - body_root: Hash256::zero(), + parent_root: Hash256::ZERO, + state_root: Hash256::ZERO, + body_root: Hash256::ZERO, }; let signed_header = SignedBeaconBlockHeader { @@ -340,7 +340,7 @@ impl> BeaconBlockBase { let deposit_data = DepositData { pubkey: PublicKeyBytes::empty(), - withdrawal_credentials: Hash256::zero(), + withdrawal_credentials: Hash256::ZERO, amount: 0, signature: SignatureBytes::empty(), }; @@ -362,7 +362,7 @@ impl> BeaconBlockBase { }; let deposit = Deposit { - proof: FixedVector::from_elem(Hash256::zero()), + proof: FixedVector::from_elem(Hash256::ZERO), data: deposit_data, }; @@ -415,13 +415,13 @@ impl> EmptyBlock for BeaconBlockAlta BeaconBlockAltair { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::zero(), - state_root: Hash256::zero(), + parent_root: Hash256::ZERO, + state_root: Hash256::ZERO, body: BeaconBlockBodyAltair { randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::zero(), - block_hash: Hash256::zero(), + deposit_root: Hash256::ZERO, + block_hash: Hash256::ZERO, deposit_count: 0, }, graffiti: Graffiti::default(), @@ -448,8 +448,8 @@ impl> BeaconBlockAltair BeaconBlockAltair { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::zero(), - state_root: Hash256::zero(), + parent_root: Hash256::ZERO, + state_root: Hash256::ZERO, body: BeaconBlockBodyAltair { proposer_slashings: base_block.body.proposer_slashings, attester_slashings: base_block.body.attester_slashings, @@ -459,8 +459,8 @@ impl> BeaconBlockAltair sync_aggregate, randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::zero(), - block_hash: Hash256::zero(), + deposit_root: Hash256::ZERO, + block_hash: Hash256::ZERO, deposit_count: 0, }, graffiti: Graffiti::default(), @@ -476,13 +476,13 @@ impl> EmptyBlock for BeaconBlockBell BeaconBlockBellatrix { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::zero(), - state_root: Hash256::zero(), + parent_root: Hash256::ZERO, + state_root: Hash256::ZERO, body: BeaconBlockBodyBellatrix { randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::zero(), - block_hash: Hash256::zero(), + deposit_root: Hash256::ZERO, + block_hash: Hash256::ZERO, deposit_count: 0, }, graffiti: Graffiti::default(), @@ -507,7 +507,7 @@ impl> BeaconBlockCapella message: BlsToExecutionChange { validator_index: 0, from_bls_pubkey: PublicKeyBytes::empty(), - to_execution_address: Address::zero(), + to_execution_address: Address::ZERO, }, signature: Signature::empty() }; @@ -521,8 +521,8 @@ impl> BeaconBlockCapella BeaconBlockCapella { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::zero(), - state_root: Hash256::zero(), + parent_root: Hash256::ZERO, + state_root: Hash256::ZERO, body: BeaconBlockBodyCapella { proposer_slashings: base_block.body.proposer_slashings, attester_slashings: base_block.body.attester_slashings, @@ -533,8 +533,8 @@ impl> BeaconBlockCapella sync_aggregate, randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::zero(), - block_hash: Hash256::zero(), + deposit_root: Hash256::ZERO, + block_hash: Hash256::ZERO, deposit_count: 0, }, graffiti: Graffiti::default(), @@ -550,13 +550,13 @@ impl> EmptyBlock for BeaconBlockCape BeaconBlockCapella { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::zero(), - state_root: Hash256::zero(), + parent_root: Hash256::ZERO, + state_root: Hash256::ZERO, body: BeaconBlockBodyCapella { randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::zero(), - block_hash: Hash256::zero(), + deposit_root: Hash256::ZERO, + block_hash: Hash256::ZERO, deposit_count: 0, }, graffiti: Graffiti::default(), @@ -579,13 +579,13 @@ impl> EmptyBlock for BeaconBlockDene BeaconBlockDeneb { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::zero(), - state_root: Hash256::zero(), + parent_root: Hash256::ZERO, + state_root: Hash256::ZERO, body: BeaconBlockBodyDeneb { randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::zero(), - block_hash: Hash256::zero(), + deposit_root: Hash256::ZERO, + block_hash: Hash256::ZERO, deposit_count: 0, }, graffiti: Graffiti::default(), @@ -637,7 +637,7 @@ impl> BeaconBlockElectra message: BlsToExecutionChange { validator_index: 0, from_bls_pubkey: PublicKeyBytes::empty(), - to_execution_address: Address::zero(), + to_execution_address: Address::ZERO, }, signature: Signature::empty() }; @@ -651,8 +651,8 @@ impl> BeaconBlockElectra BeaconBlockElectra { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::zero(), - state_root: Hash256::zero(), + parent_root: Hash256::ZERO, + state_root: Hash256::ZERO, body: BeaconBlockBodyElectra { proposer_slashings: base_block.body.proposer_slashings, attester_slashings, @@ -663,8 +663,8 @@ impl> BeaconBlockElectra sync_aggregate, randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::zero(), - block_hash: Hash256::zero(), + deposit_root: Hash256::ZERO, + block_hash: Hash256::ZERO, deposit_count: 0, }, graffiti: Graffiti::default(), @@ -682,13 +682,13 @@ impl> EmptyBlock for BeaconBlockElec BeaconBlockElectra { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::zero(), - state_root: Hash256::zero(), + parent_root: Hash256::ZERO, + state_root: Hash256::ZERO, body: BeaconBlockBodyElectra { randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::zero(), - block_hash: Hash256::zero(), + deposit_root: Hash256::ZERO, + block_hash: Hash256::ZERO, deposit_count: 0, }, graffiti: Graffiti::default(), diff --git a/consensus/types/src/chain_spec.rs b/consensus/types/src/chain_spec.rs index 0f61f74efe1..1db6cd2a9ff 100644 --- a/consensus/types/src/chain_spec.rs +++ b/consensus/types/src/chain_spec.rs @@ -7,6 +7,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde_utils::quoted_u64::MaybeQuoted; use ssz::Encode; use std::fs::File; +use std::io::Read; use std::path::Path; use std::time::Duration; use tree_hash::TreeHash; @@ -483,7 +484,7 @@ impl ChainSpec { /// /// Spec v0.12.1 pub fn get_deposit_domain(&self) -> Hash256 { - self.compute_domain(Domain::Deposit, self.genesis_fork_version, Hash256::zero()) + self.compute_domain(Domain::Deposit, self.genesis_fork_version, Hash256::ZERO) } // This should be updated to include the current fork and the genesis validators root, but discussion is ongoing: @@ -493,7 +494,7 @@ impl ChainSpec { self.compute_domain( Domain::ApplicationMask(ApplicationDomain::Builder), self.genesis_fork_version, - Hash256::zero(), + Hash256::ZERO, ) } @@ -524,7 +525,7 @@ impl ChainSpec { let mut result = [0; 4]; let root = Self::compute_fork_data_root(current_version, genesis_validators_root); result.copy_from_slice( - root.as_bytes() + root.as_slice() .get(0..4) .expect("root hash is at least 4 bytes"), ); @@ -544,7 +545,7 @@ impl ChainSpec { domain[0..4].copy_from_slice(&int_to_bytes4(domain_constant)); domain[4..].copy_from_slice( Self::compute_fork_data_root(fork_version, genesis_validators_root) - .as_bytes() + .as_slice() .get(..28) .expect("fork has is 32 bytes so first 28 bytes should exist"), ); @@ -866,7 +867,7 @@ impl ChainSpec { .expect("subtraction does not overflow") // Add 1 since the spec declares `2**256 - 2**10` and we use // `Uint256::MAX` which is `2*256- 1`. - .checked_add(Uint256::one()) + .checked_add(Uint256::from(2u64.pow(0))) .expect("addition does not overflow"), // Capella capella_fork_version: [0x03, 0x00, 0x00, 0x01], @@ -1338,7 +1339,7 @@ fn default_electra_fork_version() -> [u8; 4] { /// /// Taken from https://github.com/ethereum/consensus-specs/blob/d5e4828aecafaf1c57ef67a5f23c4ae7b08c5137/configs/mainnet.yaml#L15-L16 const fn default_terminal_total_difficulty() -> Uint256 { - ethereum_types::U256([ + Uint256([ 18446744073709550592, 18446744073709551615, 18446744073709551615, @@ -1449,7 +1450,7 @@ const fn default_maximum_gossip_clock_disparity_millis() -> u64 { fn max_blocks_by_root_request_common(max_request_blocks: u64) -> usize { let max_request_blocks = max_request_blocks as usize; RuntimeVariableList::::from_vec( - vec![Hash256::zero(); max_request_blocks], + vec![Hash256::ZERO; max_request_blocks], max_request_blocks, ) .as_ssz_bytes() @@ -1459,7 +1460,7 @@ fn max_blocks_by_root_request_common(max_request_blocks: u64) -> usize { fn max_blobs_by_root_request_common(max_request_blob_sidecars: u64) -> usize { let max_request_blob_sidecars = max_request_blob_sidecars as usize; let empty_blob_identifier = BlobIdentifier { - block_root: Hash256::zero(), + block_root: Hash256::ZERO, index: 0, }; diff --git a/consensus/types/src/deposit_tree_snapshot.rs b/consensus/types/src/deposit_tree_snapshot.rs index 1793be1c7c8..07f85e6504c 100644 --- a/consensus/types/src/deposit_tree_snapshot.rs +++ b/consensus/types/src/deposit_tree_snapshot.rs @@ -40,7 +40,7 @@ impl Default for DepositTreeSnapshot { fn default() -> Self { let mut result = Self { finalized: vec![], - deposit_root: Hash256::default(), + deposit_root: Hash256::ZERO, deposit_count: 0, execution_block_hash: Hash256::zero(), execution_block_height: 0, diff --git a/consensus/types/src/lib.rs b/consensus/types/src/lib.rs index c8c37ad708e..795a592e232 100644 --- a/consensus/types/src/lib.rs +++ b/consensus/types/src/lib.rs @@ -109,7 +109,7 @@ pub mod light_client_header; pub mod non_zero_usize; pub mod runtime_var_list; -use ethereum_types::{H160, H256}; +use alloy_primitives::{Address as H160, B256 as H256}; pub use crate::activation_queue::ActivationQueue; pub use crate::aggregate_and_proof::{ @@ -253,15 +253,15 @@ pub use crate::withdrawal::Withdrawal; pub use crate::withdrawal_credentials::WithdrawalCredentials; pub type CommitteeIndex = u64; -pub type Hash256 = H256; -pub type Uint256 = ethereum_types::U256; +pub type Hash256 = alloy_primitives::B256; +pub type Uint256 = alloy_primitives::U256; pub type Address = H160; pub type ForkVersion = [u8; 4]; pub type BLSFieldElement = Uint256; pub type Blob = FixedVector::BytesPerBlob>; pub type KzgProofs = VariableList::MaxBlobCommitmentsPerBlock>; pub type VersionedHash = Hash256; -pub type Hash64 = ethereum_types::H64; +pub type Hash64 = alloy_primitives::B64; pub use bls::{ AggregatePublicKey, AggregateSignature, Keypair, PublicKey, PublicKeyBytes, SecretKey, diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index 66786b51297..b115cc93709 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -5,6 +5,7 @@ use safe_arith::{ArithError, SafeArith}; use serde::{Deserialize, Serialize}; use std::ops::{Deref, DerefMut}; use swap_or_not_shuffle::compute_shuffled_index; +use alloy_primitives::B256 as H256; const MAX_SUBNET_ID: usize = 64; @@ -79,7 +80,7 @@ impl SubnetId { /// along with the first epoch in which these subscriptions are no longer valid. #[allow(clippy::arithmetic_side_effects)] pub fn compute_subnets_for_epoch( - node_id: ethereum_types::U256, + node_id: H256, epoch: Epoch, spec: &ChainSpec, ) -> Result<(impl Iterator, Epoch), &'static str> { diff --git a/consensus/types/src/validator.rs b/consensus/types/src/validator.rs index b5e92d1f5d8..8512a2391ec 100644 --- a/consensus/types/src/validator.rs +++ b/consensus/types/src/validator.rs @@ -129,7 +129,7 @@ impl Validator { /// Returns `true` if the validator has eth1 withdrawal credential. pub fn has_eth1_withdrawal_credential(&self, spec: &ChainSpec) -> bool { self.withdrawal_credentials - .as_bytes() + .as_slice() .first() .map(|byte| *byte == spec.eth1_address_withdrawal_prefix_byte) .unwrap_or(false) @@ -282,7 +282,7 @@ impl Default for Validator { fn default() -> Self { Self { pubkey: PublicKeyBytes::empty(), - withdrawal_credentials: Hash256::default(), + withdrawal_credentials: Hash256::ZERO, activation_eligibility_epoch: Epoch::from(u64::MAX), activation_epoch: Epoch::from(u64::MAX), exit_epoch: Epoch::from(u64::MAX), diff --git a/consensus/types/src/withdrawal_credentials.rs b/consensus/types/src/withdrawal_credentials.rs index 8d42d4eafd4..d0a9bb1af7e 100644 --- a/consensus/types/src/withdrawal_credentials.rs +++ b/consensus/types/src/withdrawal_credentials.rs @@ -13,7 +13,7 @@ impl WithdrawalCredentials { pub fn eth1(withdrawal_address: Address, spec: &ChainSpec) -> Self { let mut withdrawal_credentials = [0; 32]; withdrawal_credentials[0] = spec.eth1_address_withdrawal_prefix_byte; - withdrawal_credentials[12..].copy_from_slice(withdrawal_address.as_bytes()); + withdrawal_credentials[12..].copy_from_slice(withdrawal_address.as_slice()); Self(Hash256::from_slice(&withdrawal_credentials)) } } diff --git a/crypto/bls/Cargo.toml b/crypto/bls/Cargo.toml index 7aa8e02dcab..2d11f50aabb 100644 --- a/crypto/bls/Cargo.toml +++ b/crypto/bls/Cargo.toml @@ -5,6 +5,7 @@ authors = ["Paul Hauner "] edition = { workspace = true } [dependencies] +alloy-primitives = { workspace = true } ethereum_ssz = { workspace = true } tree_hash = { workspace = true } rand = { workspace = true } @@ -12,7 +13,6 @@ serde = { workspace = true } ethereum_serde_utils = { workspace = true } hex = { workspace = true } ethereum_hashing = { workspace = true } -ethereum-types = { workspace = true } arbitrary = { workspace = true } zeroize = { workspace = true } blst = { version = "0.3.3", optional = true } diff --git a/crypto/bls/src/impls/blst.rs b/crypto/bls/src/impls/blst.rs index 54c7ad2944e..baa704e05a9 100644 --- a/crypto/bls/src/impls/blst.rs +++ b/crypto/bls/src/impls/blst.rs @@ -68,7 +68,7 @@ pub fn verify_signature_sets<'a>( } // Grab a slice of the message, to satisfy the blst API. - msgs_refs.push(set.message.as_bytes()); + msgs_refs.push(set.message.as_slice()); if let Some(point) = set.signature.point() { // Subgroup check the signature @@ -196,7 +196,7 @@ impl TSignature for blst_core::Signature { fn verify(&self, pubkey: &blst_core::PublicKey, msg: Hash256) -> bool { // Public keys have already been checked for subgroup and infinity // Check Signature inside function for subgroup - self.verify(true, msg.as_bytes(), DST, &[], pubkey, false) == BLST_ERROR::BLST_SUCCESS + self.verify(true, msg.as_slice(), DST, &[], pubkey, false) == BLST_ERROR::BLST_SUCCESS } } @@ -256,7 +256,7 @@ impl TAggregateSignature], ) -> bool { let pubkeys = pubkeys.iter().map(|pk| pk.point()).collect::>(); - let msgs = msgs.iter().map(|hash| hash.as_bytes()).collect::>(); + let msgs = msgs.iter().map(|hash| hash.as_slice()).collect::>(); let signature = self.0.clone().to_signature(); // Public keys have already been checked for subgroup and infinity // Check Signature inside function for subgroup @@ -287,7 +287,7 @@ impl TSecretKey for blst_core::Secre } fn sign(&self, msg: Hash256) -> blst_core::Signature { - self.sign(msg.as_bytes(), DST, &[]) + self.sign(msg.as_slice(), DST, &[]) } fn serialize(&self) -> ZeroizeHash { diff --git a/crypto/bls/src/lib.rs b/crypto/bls/src/lib.rs index af269b943d7..0f52b88a1b9 100644 --- a/crypto/bls/src/lib.rs +++ b/crypto/bls/src/lib.rs @@ -44,7 +44,7 @@ pub use zeroize_hash::ZeroizeHash; #[cfg(feature = "supranational")] use blst::BLST_ERROR as BlstError; -pub type Hash256 = ethereum_types::H256; +pub type Hash256 = alloy_primitives::B256; #[derive(Clone, Debug, PartialEq)] pub enum Error { From 8b118b35bf60fc60fc121443de657fcd20c59033 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Wed, 10 Jul 2024 15:18:19 +0100 Subject: [PATCH 08/62] fix deps --- Cargo.lock | 51 +++++-------------- Cargo.toml | 2 +- consensus/types/src/execution_block_hash.rs | 2 +- consensus/types/src/execution_block_header.rs | 4 +- .../types/src/execution_payload_header.rs | 6 +-- consensus/types/src/historical_summary.rs | 1 - 6 files changed, 21 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4ed4741524d..22c06e1e188 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -830,7 +830,7 @@ dependencies = [ "eth2", "eth2_network_config", "ethereum_hashing", - "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "execution_layer", @@ -1055,7 +1055,7 @@ dependencies = [ "arbitrary", "blst", "ethereum_hashing", - "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "hex", "rand", @@ -2483,7 +2483,7 @@ dependencies = [ "account_utils", "bytes", "eth2_keystore", - "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "futures", @@ -2712,19 +2712,6 @@ dependencies = [ "sha2 0.10.8", ] -[[package]] -name = "ethereum_serde_utils" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de4d5951468846963c24e8744c133d44f39dff2cd3a233f6be22b370d08a524f" -dependencies = [ - "ethereum-types 0.14.1", - "hex", - "serde", - "serde_derive", - "serde_json", -] - [[package]] name = "ethereum_serde_utils" version = "0.5.2" @@ -2966,7 +2953,7 @@ dependencies = [ "environment", "eth2", "eth2_network_config", - "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "ethers-core", "fork_choice", @@ -3843,7 +3830,7 @@ dependencies = [ "environment", "eth1", "eth2", - "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "execution_layer", "futures", @@ -4417,7 +4404,7 @@ dependencies = [ "c-kzg", "derivative", "ethereum_hashing", - "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "hex", @@ -7821,7 +7808,7 @@ name = "slashing_protection" version = "0.1.0" dependencies = [ "arbitrary", - "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "filesystem", "lazy_static", "r2d2", @@ -8033,17 +8020,17 @@ dependencies = [ [[package]] name = "ssz_types" version = "0.6.0" -source = "git+https://github.com/sigp/ssz_types?branch=alloy#d107b54024db99e69ebad233b19ebdb10eefbb6f" +source = "git+https://github.com/eserilev/ssz_types?branch=alloy-tweaks#26015c5a7c802aa7158da4e14019d5e538771b46" dependencies = [ "arbitrary", "derivative", - "ethereum_serde_utils 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum_ssz 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum_serde_utils", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "itertools 0.10.5", "serde", "serde_derive", "smallvec", - "tree_hash 0.6.0 (git+https://github.com/KolbyML/tree_hash.git?rev=8aaf8bb4184148768d48e2cfbbdd0b95d1da8730)", + "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", "typenum", ] @@ -8878,16 +8865,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "tree_hash" -version = "0.6.0" -source = "git+https://github.com/KolbyML/tree_hash.git?rev=8aaf8bb4184148768d48e2cfbbdd0b95d1da8730#8aaf8bb4184148768d48e2cfbbdd0b95d1da8730" -dependencies = [ - "alloy-primitives 0.7.7", - "ethereum_hashing", - "smallvec", -] - [[package]] name = "tree_hash_derive" version = "0.6.0" @@ -8944,7 +8921,7 @@ dependencies = [ "derivative", "eth2_interop_keypairs", "ethereum_hashing", - "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "hex", @@ -9164,7 +9141,7 @@ dependencies = [ "environment", "eth2", "eth2_keystore", - "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "fdlimit", "filesystem", "futures", @@ -9234,7 +9211,7 @@ dependencies = [ "eth2", "eth2_network_config", "eth2_wallet", - "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "hex", "regex", "serde", diff --git a/Cargo.toml b/Cargo.toml index 17f71b6a6a9..6a398e8e70e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -161,7 +161,7 @@ slog-term = "2" sloggers = { version = "2", features = ["json"] } smallvec = { version = "1.11.2", features = ["arbitrary"] } snap = "1" -ssz_types = { git = "https://github.com/sigp/ssz_types", branch = "alloy" } +ssz_types = { git = "https://github.com/eserilev/ssz_types", branch = "alloy-tweaks" } strum = { version = "0.24", features = ["derive"] } superstruct = "0.8" syn = "1" diff --git a/consensus/types/src/execution_block_hash.rs b/consensus/types/src/execution_block_hash.rs index b2401f0c0f1..8c5a19dd48f 100644 --- a/consensus/types/src/execution_block_hash.rs +++ b/consensus/types/src/execution_block_hash.rs @@ -24,7 +24,7 @@ pub struct ExecutionBlockHash(pub Hash256); impl ExecutionBlockHash { pub fn zero() -> Self { - Self(Hash256::zero()) + Self(Hash256::ZERO) } pub fn repeat_byte(b: u8) -> Self { diff --git a/consensus/types/src/execution_block_header.rs b/consensus/types/src/execution_block_header.rs index 945222a9258..aace2e2775d 100644 --- a/consensus/types/src/execution_block_header.rs +++ b/consensus/types/src/execution_block_header.rs @@ -73,14 +73,14 @@ impl ExecutionBlockHeader { transactions_root: rlp_transactions_root, receipts_root: payload.receipts_root(), logs_bloom: payload.logs_bloom().clone().into(), - difficulty: Uint256::zero(), + difficulty: Uint256::ZERO, number: payload.block_number().into(), gas_limit: payload.gas_limit().into(), gas_used: payload.gas_used().into(), timestamp: payload.timestamp(), extra_data: payload.extra_data().clone().into(), mix_hash: payload.prev_randao(), - nonce: Hash64::zero(), + nonce: Hash64::ZERO, base_fee_per_gas: payload.base_fee_per_gas(), withdrawals_root: rlp_withdrawals_root, blob_gas_used: rlp_blob_gas_used, diff --git a/consensus/types/src/execution_payload_header.rs b/consensus/types/src/execution_payload_header.rs index 962e7a16fbc..e92c53c93b1 100644 --- a/consensus/types/src/execution_payload_header.rs +++ b/consensus/types/src/execution_payload_header.rs @@ -153,7 +153,7 @@ impl ExecutionPayloadHeaderBellatrix { base_fee_per_gas: self.base_fee_per_gas, block_hash: self.block_hash, transactions_root: self.transactions_root, - withdrawals_root: Hash256::zero(), + withdrawals_root: Hash256::ZERO, } } } @@ -202,8 +202,8 @@ impl ExecutionPayloadHeaderDeneb { withdrawals_root: self.withdrawals_root, blob_gas_used: self.blob_gas_used, excess_blob_gas: self.excess_blob_gas, - deposit_receipts_root: Hash256::zero(), - withdrawal_requests_root: Hash256::zero(), + deposit_receipts_root: Hash256::ZERO, + withdrawal_requests_root: Hash256::ZERO, } } } diff --git a/consensus/types/src/historical_summary.rs b/consensus/types/src/historical_summary.rs index 76bb111ea2f..d7773a68a45 100644 --- a/consensus/types/src/historical_summary.rs +++ b/consensus/types/src/historical_summary.rs @@ -4,7 +4,6 @@ use compare_fields_derive::CompareFields; use serde::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; use test_random_derive::TestRandom; -use tree_hash::TreeHash; use tree_hash_derive::TreeHash; /// `HistoricalSummary` matches the components of the phase0 `HistoricalBatch` From 3e6e4409ff609b356d5cecde4676bb1e245d3b2b Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Thu, 11 Jul 2024 12:24:06 +0100 Subject: [PATCH 09/62] integrate alloy-primitives --- Cargo.lock | 46 +++++++++++++--------- Cargo.toml | 4 +- consensus/merkle_proof/Cargo.toml | 4 +- consensus/merkle_proof/src/lib.rs | 38 +++++++++--------- consensus/types/src/aggregate_and_proof.rs | 1 + crypto/bls/tests/tests.rs | 2 +- 6 files changed, 53 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 22c06e1e188..dd896c6459d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -874,7 +874,7 @@ dependencies = [ "tempfile", "tokio", "tokio-stream", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "tree_hash_derive", "types", ] @@ -1060,7 +1060,7 @@ dependencies = [ "hex", "rand", "serde", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "zeroize", ] @@ -1917,7 +1917,7 @@ dependencies = [ "reqwest", "serde_json", "sha2 0.9.9", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "types", ] @@ -2264,7 +2264,7 @@ dependencies = [ "snap", "state_processing", "swap_or_not_shuffle", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "tree_hash_derive", "types", ] @@ -2457,7 +2457,7 @@ dependencies = [ "superstruct", "task_executor", "tokio", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "types", ] @@ -2984,7 +2984,7 @@ dependencies = [ "tempfile", "tokio", "tokio-stream", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "tree_hash_derive", "triehash", "types", @@ -3369,7 +3369,7 @@ dependencies = [ "slog", "state_processing", "tokio", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "types", ] @@ -3859,7 +3859,7 @@ dependencies = [ "task_executor", "tokio", "tokio-stream", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "types", "warp", "warp_utils", @@ -4409,7 +4409,7 @@ dependencies = [ "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "hex", "serde", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", ] [[package]] @@ -4457,7 +4457,7 @@ dependencies = [ "snap", "state_processing", "store", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "types", "validator_dir", ] @@ -5321,7 +5321,7 @@ dependencies = [ name = "merkle_proof" version = "0.2.0" dependencies = [ - "ethereum-types 0.14.1", + "alloy-primitives 0.7.7", "ethereum_hashing", "lazy_static", "quickcheck", @@ -7781,7 +7781,7 @@ dependencies = [ "ssz_types", "strum", "tempfile", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "tree_hash_derive", "types", ] @@ -8065,7 +8065,7 @@ dependencies = [ "ssz_types", "test_random_derive", "tokio", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "types", ] @@ -8865,10 +8865,20 @@ dependencies = [ "smallvec", ] +[[package]] +name = "tree_hash" +version = "0.6.0" +source = "git+https://github.com/eserilev/tree_hash?branch=alloy-deps#48ec4bf464168d202902de992df4a95c4c336fd2" +dependencies = [ + "alloy-primitives 0.7.7", + "ethereum_hashing", + "smallvec", +] + [[package]] name = "tree_hash_derive" version = "0.6.0" -source = "git+https://github.com/sigp/tree_hash?branch=alloy#0df21e420154c4c8e300a8e7afddcf6aac54bd93" +source = "git+https://github.com/eserilev/tree_hash?branch=alloy-deps#48ec4bf464168d202902de992df4a95c4c336fd2" dependencies = [ "darling 0.13.4", "quote", @@ -8955,7 +8965,7 @@ dependencies = [ "tempfile", "test_random_derive", "tokio", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "tree_hash_derive", ] @@ -9174,7 +9184,7 @@ dependencies = [ "tempfile", "tokio", "tokio-stream", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "types", "url", "validator_dir", @@ -9196,7 +9206,7 @@ dependencies = [ "lockfile", "rand", "tempfile", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "types", ] @@ -9218,7 +9228,7 @@ dependencies = [ "serde_json", "tempfile", "tokio", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", "types", "validator_client", ] diff --git a/Cargo.toml b/Cargo.toml index 6a398e8e70e..0daf476643c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -175,8 +175,8 @@ tracing-appender = "0.2" tracing-core = "0.1" tracing-log = "0.2" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -tree_hash = { git = "https://github.com/sigp/tree_hash", branch = "alloy"} -tree_hash_derive = { git = "https://github.com/sigp/tree_hash", branch = "alloy"} +tree_hash = { git = "https://github.com/eserilev/tree_hash", branch = "alloy-deps"} +tree_hash_derive = { git = "https://github.com/eserilev/tree_hash", branch = "alloy-deps"} url = "2" uuid = { version = "0.8", features = ["serde", "v4"] } warp = { version = "0.3.7", default-features = false, features = ["tls"] } diff --git a/consensus/merkle_proof/Cargo.toml b/consensus/merkle_proof/Cargo.toml index 3bee25eaac9..ca7765a1fde 100644 --- a/consensus/merkle_proof/Cargo.toml +++ b/consensus/merkle_proof/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Michael Sproul "] edition = { workspace = true } [dependencies] -ethereum-types = { workspace = true } +alloy-primitives = { workspace = true } ethereum_hashing = { workspace = true } lazy_static = { workspace = true } safe_arith = { workspace = true } @@ -15,4 +15,4 @@ quickcheck = { workspace = true } quickcheck_macros = { workspace = true } [features] -arbitrary = ["ethereum-types/arbitrary"] +arbitrary = ["alloy-primitives/arbitrary"] diff --git a/consensus/merkle_proof/src/lib.rs b/consensus/merkle_proof/src/lib.rs index 2d2d2afddab..9e9e8ea3d7c 100644 --- a/consensus/merkle_proof/src/lib.rs +++ b/consensus/merkle_proof/src/lib.rs @@ -1,5 +1,5 @@ use ethereum_hashing::{hash, hash32_concat, ZERO_HASHES}; -use ethereum_types::H256; +use alloy_primitives::B256 as H256; use lazy_static::lazy_static; use safe_arith::ArithError; @@ -89,8 +89,8 @@ impl MerkleTree { let left_subtree = MerkleTree::create(left_leaves, depth - 1); let right_subtree = MerkleTree::create(right_leaves, depth - 1); let hash = H256::from_slice(&hash32_concat( - left_subtree.hash().as_bytes(), - right_subtree.hash().as_bytes(), + left_subtree.hash().as_slice(), + right_subtree.hash().as_slice(), )); Node(hash, Box::new(left_subtree), Box::new(right_subtree)) @@ -146,9 +146,9 @@ impl MerkleTree { // All other possibilities are invalid MerkleTrees (_, _) => return Err(MerkleTreeError::Invalid), }; - hash.assign_from_slice(&hash32_concat( - left.hash().as_bytes(), - right.hash().as_bytes(), + hash.copy_from_slice(&hash32_concat( + left.hash().as_slice(), + right.hash().as_slice(), )); } Finalized(_) => return Err(MerkleTreeError::FinalizedNodePushed), @@ -277,8 +277,8 @@ impl MerkleTree { }; let hash = H256::from_slice(&hash32_concat( - left.hash().as_bytes(), - right.hash().as_bytes(), + left.hash().as_slice(), + right.hash().as_slice(), )); Ok(MerkleTree::Node(hash, Box::new(left), Box::new(right))) } @@ -372,15 +372,15 @@ pub fn verify_merkle_proof( pub fn merkle_root_from_branch(leaf: H256, branch: &[H256], depth: usize, index: usize) -> H256 { assert_eq!(branch.len(), depth, "proof length should equal depth"); - let mut merkle_root = leaf.as_bytes().to_vec(); + let mut merkle_root = leaf.as_slice().to_vec(); for (i, leaf) in branch.iter().enumerate().take(depth) { let ith_bit = (index >> i) & 0x01; if ith_bit == 1 { - merkle_root = hash32_concat(leaf.as_bytes(), &merkle_root)[..].to_vec(); + merkle_root = hash32_concat(leaf.as_slice(), &merkle_root)[..].to_vec(); } else { let mut input = merkle_root; - input.extend_from_slice(leaf.as_bytes()); + input.extend_from_slice(leaf.as_slice()); merkle_root = hash(&input); } } @@ -415,7 +415,7 @@ mod tests { return TestResult::discard(); } - let leaves: Vec<_> = int_leaves.into_iter().map(H256::from_low_u64_be).collect(); + let leaves: Vec<_> = int_leaves.into_iter().map(|leaf| H256::from_slice(&leaf.to_le_bytes())).collect(); let merkle_tree = MerkleTree::create(&leaves, depth); let merkle_root = merkle_tree.hash(); @@ -435,7 +435,7 @@ mod tests { return TestResult::discard(); } - let leaves_iter = int_leaves.into_iter().map(H256::from_low_u64_be); + let leaves_iter = int_leaves.into_iter().map(|leaf| H256::from_slice(&leaf.to_le_bytes())); let mut merkle_tree = MerkleTree::create(&[], depth); @@ -468,10 +468,10 @@ mod tests { let leaf_b10 = H256::from([0xCC; 32]); let leaf_b11 = H256::from([0xDD; 32]); - let node_b0x = H256::from_slice(&hash32_concat(leaf_b00.as_bytes(), leaf_b01.as_bytes())); - let node_b1x = H256::from_slice(&hash32_concat(leaf_b10.as_bytes(), leaf_b11.as_bytes())); + let node_b0x = H256::from_slice(&hash32_concat(leaf_b00.as_slice(), leaf_b01.as_slice())); + let node_b1x = H256::from_slice(&hash32_concat(leaf_b10.as_slice(), leaf_b11.as_slice())); - let root = H256::from_slice(&hash32_concat(node_b0x.as_bytes(), node_b1x.as_bytes())); + let root = H256::from_slice(&hash32_concat(node_b0x.as_slice(), node_b1x.as_slice())); let tree = MerkleTree::create(&[leaf_b00, leaf_b01, leaf_b10, leaf_b11], 2); assert_eq!(tree.hash(), root); @@ -485,10 +485,10 @@ mod tests { let leaf_b10 = H256::from([0xCC; 32]); let leaf_b11 = H256::from([0xDD; 32]); - let node_b0x = H256::from_slice(&hash32_concat(leaf_b00.as_bytes(), leaf_b01.as_bytes())); - let node_b1x = H256::from_slice(&hash32_concat(leaf_b10.as_bytes(), leaf_b11.as_bytes())); + let node_b0x = H256::from_slice(&hash32_concat(leaf_b00.as_slice(), leaf_b01.as_slice())); + let node_b1x = H256::from_slice(&hash32_concat(leaf_b10.as_slice(), leaf_b11.as_slice())); - let root = H256::from_slice(&hash32_concat(node_b0x.as_bytes(), node_b1x.as_bytes())); + let root = H256::from_slice(&hash32_concat(node_b0x.as_slice(), node_b1x.as_slice())); // Run some proofs assert!(verify_merkle_proof( diff --git a/consensus/types/src/aggregate_and_proof.rs b/consensus/types/src/aggregate_and_proof.rs index cdcbc51a623..012b3bd7102 100644 --- a/consensus/types/src/aggregate_and_proof.rs +++ b/consensus/types/src/aggregate_and_proof.rs @@ -135,6 +135,7 @@ impl AggregateAndProof { ) -> bool { let target_epoch = self.aggregate().data().slot.epoch(E::slots_per_epoch()); let domain = spec.get_domain( + target_epoch, Domain::SelectionProof, fork, genesis_validators_root, diff --git a/crypto/bls/tests/tests.rs b/crypto/bls/tests/tests.rs index dac2e97f407..a65eb952da5 100644 --- a/crypto/bls/tests/tests.rs +++ b/crypto/bls/tests/tests.rs @@ -421,7 +421,7 @@ macro_rules! test_suite { self.owned_sets.push(OwnedSignatureSet { signature: AggregateSignature::deserialize(&INFINITY_SIGNATURE).unwrap(), signing_keys: vec![secret_from_u64(42).public_key()], - message: Hash256::zero(), + message: Hash256::ZERO, should_be_valid: false, }); self From abdef933b67bdf78079be7a2b37920728282f078 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Thu, 11 Jul 2024 14:56:25 +0100 Subject: [PATCH 10/62] resolve dep issues --- Cargo.lock | 113 +++++++----------- Cargo.toml | 5 +- common/clap_utils/Cargo.toml | 2 +- common/clap_utils/src/lib.rs | 2 +- consensus/merkle_proof/src/lib.rs | 11 +- consensus/swap_or_not_shuffle/Cargo.toml | 5 +- .../src/compute_shuffled_index.rs | 2 +- consensus/swap_or_not_shuffle/src/lib.rs | 2 +- consensus/types/src/aggregate_and_proof.rs | 2 +- consensus/types/src/beacon_state.rs | 12 +- consensus/types/src/chain_spec.rs | 25 ++-- consensus/types/src/deposit_tree_snapshot.rs | 4 +- consensus/types/src/execution_block_header.rs | 6 +- consensus/types/src/graffiti.rs | 2 +- consensus/types/src/historical_summary.rs | 1 + consensus/types/src/subnet_id.rs | 7 +- .../src/test_utils/test_random/uint256.rs | 2 +- consensus/types/src/validator.rs | 6 +- crypto/bls/tests/tests.rs | 13 +- testing/ef_tests/Cargo.toml | 2 +- 20 files changed, 100 insertions(+), 124 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd896c6459d..eec00ff21cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -257,6 +257,7 @@ dependencies = [ "derive_arbitrary", "derive_more", "ethereum_ssz 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom", "hex-literal", "itoa", "k256 0.13.3", @@ -832,7 +833,7 @@ dependencies = [ "ethereum_hashing", "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "execution_layer", "fork_choice", "futures", @@ -874,7 +875,7 @@ dependencies = [ "tempfile", "tokio", "tokio-stream", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "tree_hash_derive", "types", ] @@ -1060,7 +1061,7 @@ dependencies = [ "hex", "rand", "serde", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "zeroize", ] @@ -1391,10 +1392,10 @@ checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" name = "clap_utils" version = "0.1.0" dependencies = [ + "alloy-primitives 0.7.7", "clap", "dirs", "eth2_network_config", - "ethereum-types 0.14.1", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "hex", "serde", @@ -1917,7 +1918,7 @@ dependencies = [ "reqwest", "serde_json", "sha2 0.9.9", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", ] @@ -2241,15 +2242,15 @@ dependencies = [ name = "ef_tests" version = "0.2.0" dependencies = [ + "alloy-primitives 0.7.7", "beacon_chain", "bls", "compare_fields", "compare_fields_derive", "derivative", "eth2_network_config", - "ethereum-types 0.14.1", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "execution_layer", "fork_choice", "fs2", @@ -2264,7 +2265,7 @@ dependencies = [ "snap", "state_processing", "swap_or_not_shuffle", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "tree_hash_derive", "types", ] @@ -2441,7 +2442,7 @@ dependencies = [ "eth1_test_rig", "eth2", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "execution_layer", "futures", "lazy_static", @@ -2457,7 +2458,7 @@ dependencies = [ "superstruct", "task_executor", "tokio", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", ] @@ -2485,7 +2486,7 @@ dependencies = [ "eth2_keystore", "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "futures", "futures-util", "libsecp256k1", @@ -2745,18 +2746,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "ethereum_ssz_derive" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eccd5378ec34a07edd3d9b48088cbc63309d0367d14ba10b0cdb1d1791080ea" -dependencies = [ - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "ethereum_ssz_derive" version = "0.5.4" @@ -2984,7 +2973,7 @@ dependencies = [ "tempfile", "tokio", "tokio-stream", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "tree_hash_derive", "triehash", "types", @@ -3154,7 +3143,7 @@ version = "0.1.0" dependencies = [ "beacon_chain", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "proto_array", "slog", "state_processing", @@ -3369,7 +3358,7 @@ dependencies = [ "slog", "state_processing", "tokio", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", ] @@ -3859,7 +3848,7 @@ dependencies = [ "task_executor", "tokio", "tokio-stream", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", "warp", "warp_utils", @@ -4406,10 +4395,10 @@ dependencies = [ "ethereum_hashing", "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "hex", "serde", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", ] [[package]] @@ -4457,7 +4446,7 @@ dependencies = [ "snap", "state_processing", "store", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", "validator_dir", ] @@ -5060,7 +5049,7 @@ dependencies = [ "either", "error-chain", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "fnv", "futures", "gossipsub", @@ -5376,21 +5365,20 @@ dependencies = [ [[package]] name = "milhouse" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3826d3602a3674b07e080ce1982350e454ec253d73f156bd927ac1b652293f4d" +source = "git+https://github.com/eserilev/milhouse?branch=alloy#bf532ed1108664ec5059bfcbbe4b85115613422d" dependencies = [ + "alloy-primitives 0.7.7", "arbitrary", "derivative", - "ethereum-types 0.14.1", "ethereum_hashing", - "ethereum_ssz 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "ethereum_ssz_derive 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "itertools 0.10.5", "parking_lot 0.12.3", "rayon", "serde", "smallvec", - "tree_hash 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tree_hash", "triomphe", "typenum", "vec_map", @@ -5930,7 +5918,7 @@ dependencies = [ "bitvec 1.0.1", "derivative", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "itertools 0.10.5", "lazy_static", "lighthouse_metrics", @@ -6533,7 +6521,7 @@ name = "proto_array" version = "0.2.0" dependencies = [ "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "safe_arith", "serde", "serde_yaml", @@ -7760,7 +7748,7 @@ dependencies = [ "byteorder", "derivative", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "filesystem", "flate2", "lazy_static", @@ -7781,7 +7769,7 @@ dependencies = [ "ssz_types", "strum", "tempfile", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "tree_hash_derive", "types", ] @@ -8020,7 +8008,7 @@ dependencies = [ [[package]] name = "ssz_types" version = "0.6.0" -source = "git+https://github.com/eserilev/ssz_types?branch=alloy-tweaks#26015c5a7c802aa7158da4e14019d5e538771b46" +source = "git+https://github.com/eserilev/ssz_types?branch=alloy-tweaks#2adab87c27a4306709180f3b4c44abe0a0c80a45" dependencies = [ "arbitrary", "derivative", @@ -8030,7 +8018,7 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash", "typenum", ] @@ -8051,7 +8039,7 @@ dependencies = [ "env_logger 0.9.3", "ethereum_hashing", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "int_to_bytes", "integer-sqrt", "itertools 0.10.5", @@ -8065,7 +8053,7 @@ dependencies = [ "ssz_types", "test_random_derive", "tokio", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", ] @@ -8095,7 +8083,7 @@ dependencies = [ "db-key", "directory", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "itertools 0.10.5", "lazy_static", "leveldb", @@ -8180,8 +8168,8 @@ dependencies = [ name = "swap_or_not_shuffle" version = "0.2.0" dependencies = [ + "alloy-primitives 0.7.7", "criterion", - "ethereum-types 0.14.1", "ethereum_hashing", ] @@ -8844,27 +8832,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "tree_hash" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134d6b24a5b829f30b5ee7de05ba7384557f5f6b00e29409cdf2392f93201bfa" -dependencies = [ - "ethereum-types 0.14.1", - "ethereum_hashing", - "smallvec", -] - -[[package]] -name = "tree_hash" -version = "0.6.0" -source = "git+https://github.com/sigp/tree_hash?branch=alloy#0df21e420154c4c8e300a8e7afddcf6aac54bd93" -dependencies = [ - "alloy-primitives 0.7.7", - "ethereum_hashing", - "smallvec", -] - [[package]] name = "tree_hash" version = "0.6.0" @@ -8933,7 +8900,7 @@ dependencies = [ "ethereum_hashing", "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "hex", "int_to_bytes", "itertools 0.10.5", @@ -8965,7 +8932,7 @@ dependencies = [ "tempfile", "test_random_derive", "tokio", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "tree_hash_derive", ] @@ -9184,7 +9151,7 @@ dependencies = [ "tempfile", "tokio", "tokio-stream", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", "url", "validator_dir", @@ -9206,7 +9173,7 @@ dependencies = [ "lockfile", "rand", "tempfile", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", ] @@ -9228,7 +9195,7 @@ dependencies = [ "serde_json", "tempfile", "tokio", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", "validator_client", ] diff --git a/Cargo.toml b/Cargo.toml index 0daf476643c..26e23ae4073 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ resolver = "2" edition = "2021" [workspace.dependencies] -alloy-primitives = { version = "0.7.7", features =["arbitrary", "serde", "ssz"] } +alloy-primitives = { version = "0.7.7", features =["arbitrary", "serde", "ssz", "getrandom"] } anyhow = "1" arbitrary = { version = "1", features = ["derive"] } async-channel = "1.9.0" @@ -115,7 +115,6 @@ either = "1.9" discv5 = { version = "0.4.1", features = ["libp2p"] } env_logger = "0.9" error-chain = "0.12" -ethereum-types = "0.14" ethereum_hashing = "0.6.0" ethereum_serde_utils = { git = "https://github.com/sigp/ethereum_serde_utils", branch = "alloy"} ethereum_ssz = { git = "https://github.com/sigp/ethereum_ssz", branch = "alloy" } @@ -135,7 +134,7 @@ libsecp256k1 = "0.7" log = "0.4" lru = "0.12" maplit = "1" -milhouse = "0.1" +milhouse = { git = "https://github.com/eserilev/milhouse", branch = "alloy"} num_cpus = "1" parking_lot = "0.12" paste = "1" diff --git a/common/clap_utils/Cargo.toml b/common/clap_utils/Cargo.toml index e4dfb2a5560..73823ae24e9 100644 --- a/common/clap_utils/Cargo.toml +++ b/common/clap_utils/Cargo.toml @@ -7,12 +7,12 @@ edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +alloy-primitives = { workspace = true } clap = { workspace = true } hex = { workspace = true } dirs = { workspace = true } eth2_network_config = { workspace = true } ethereum_ssz = { workspace = true } -ethereum-types = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } serde_yaml = { workspace = true } diff --git a/common/clap_utils/src/lib.rs b/common/clap_utils/src/lib.rs index b2c35650a0f..cba7399c9bf 100644 --- a/common/clap_utils/src/lib.rs +++ b/common/clap_utils/src/lib.rs @@ -1,9 +1,9 @@ //! A helper library for parsing values from `clap::ArgMatches`. +use alloy_primitives::U256 as Uint256; use clap::builder::styling::*; use clap::ArgMatches; use eth2_network_config::{Eth2NetworkConfig, DEFAULT_HARDCODED_NETWORK}; -use alloy_primitives::U256 as Uint256; use ssz::Decode; use std::path::PathBuf; use std::str::FromStr; diff --git a/consensus/merkle_proof/src/lib.rs b/consensus/merkle_proof/src/lib.rs index 9e9e8ea3d7c..90993ba32c7 100644 --- a/consensus/merkle_proof/src/lib.rs +++ b/consensus/merkle_proof/src/lib.rs @@ -1,5 +1,5 @@ -use ethereum_hashing::{hash, hash32_concat, ZERO_HASHES}; use alloy_primitives::B256 as H256; +use ethereum_hashing::{hash, hash32_concat, ZERO_HASHES}; use lazy_static::lazy_static; use safe_arith::ArithError; @@ -415,7 +415,10 @@ mod tests { return TestResult::discard(); } - let leaves: Vec<_> = int_leaves.into_iter().map(|leaf| H256::from_slice(&leaf.to_le_bytes())).collect(); + let leaves: Vec<_> = int_leaves + .into_iter() + .map(|leaf| H256::from_slice(&leaf.to_le_bytes())) + .collect(); let merkle_tree = MerkleTree::create(&leaves, depth); let merkle_root = merkle_tree.hash(); @@ -435,7 +438,9 @@ mod tests { return TestResult::discard(); } - let leaves_iter = int_leaves.into_iter().map(|leaf| H256::from_slice(&leaf.to_le_bytes())); + let leaves_iter = int_leaves + .into_iter() + .map(|leaf| H256::from_slice(&leaf.to_le_bytes())); let mut merkle_tree = MerkleTree::create(&[], depth); diff --git a/consensus/swap_or_not_shuffle/Cargo.toml b/consensus/swap_or_not_shuffle/Cargo.toml index ea9b603c5bc..bebf8f1d04d 100644 --- a/consensus/swap_or_not_shuffle/Cargo.toml +++ b/consensus/swap_or_not_shuffle/Cargo.toml @@ -12,8 +12,9 @@ harness = false criterion = { workspace = true } [dependencies] +alloy-primitives = { workspace = true } ethereum_hashing = { workspace = true } -ethereum-types = { workspace = true } [features] -arbitrary = ["ethereum-types/arbitrary"] +arbitrary = ["alloy-primitives/arbitrary"] +getrandom = ["alloy-primitives/getrandom"] diff --git a/consensus/swap_or_not_shuffle/src/compute_shuffled_index.rs b/consensus/swap_or_not_shuffle/src/compute_shuffled_index.rs index 5f25c517b0e..a7f25ea65f7 100644 --- a/consensus/swap_or_not_shuffle/src/compute_shuffled_index.rs +++ b/consensus/swap_or_not_shuffle/src/compute_shuffled_index.rs @@ -87,7 +87,7 @@ fn bytes_to_int64(slice: &[u8]) -> u64 { #[cfg(test)] mod tests { use super::*; - use ethereum_types::H256 as Hash256; + use alloy_primitives::B256 as Hash256; #[test] #[ignore] diff --git a/consensus/swap_or_not_shuffle/src/lib.rs b/consensus/swap_or_not_shuffle/src/lib.rs index ede15b31963..25e83992d47 100644 --- a/consensus/swap_or_not_shuffle/src/lib.rs +++ b/consensus/swap_or_not_shuffle/src/lib.rs @@ -20,4 +20,4 @@ mod shuffle_list; pub use compute_shuffled_index::compute_shuffled_index; pub use shuffle_list::shuffle_list; -type Hash256 = ethereum_types::H256; +type Hash256 = alloy_primitives::B256; diff --git a/consensus/types/src/aggregate_and_proof.rs b/consensus/types/src/aggregate_and_proof.rs index 012b3bd7102..223b12e7684 100644 --- a/consensus/types/src/aggregate_and_proof.rs +++ b/consensus/types/src/aggregate_and_proof.rs @@ -132,7 +132,7 @@ impl AggregateAndProof { fork: &Fork, genesis_validators_root: Hash256, spec: &ChainSpec, - ) -> bool { + ) -> bool { let target_epoch = self.aggregate().data().slot.epoch(E::slots_per_epoch()); let domain = spec.get_domain( target_epoch, diff --git a/consensus/types/src/beacon_state.rs b/consensus/types/src/beacon_state.rs index 06220391793..c7fb8197d4f 100644 --- a/consensus/types/src/beacon_state.rs +++ b/consensus/types/src/beacon_state.rs @@ -565,7 +565,7 @@ impl BeaconState { BeaconState::Base(BeaconStateBase { // Versioning genesis_time, - genesis_validators_root: Hash256::zero(), // Set later. + genesis_validators_root: Hash256::ZERO, // Set later. slot: spec.genesis_slot, fork: Fork { previous_version: spec.genesis_fork_version, @@ -1030,7 +1030,7 @@ impl BeaconState { let epoch = slot.epoch(E::slots_per_epoch()); let mut preimage = self .get_seed(epoch, Domain::BeaconProposer, spec)? - .as_bytes() + .as_slice() .to_vec(); preimage.append(&mut int_to_bytes8(slot.as_u64())); Ok(hash(&preimage)) @@ -1090,14 +1090,14 @@ impl BeaconState { let shuffled_index = compute_shuffled_index( i.safe_rem(active_validator_count)?, active_validator_count, - seed.as_bytes(), + seed.as_slice(), spec.shuffle_round_count, ) .ok_or(Error::UnableToShuffle)?; let candidate_index = *active_validator_indices .get(shuffled_index) .ok_or(Error::ShuffleIndexOutOfBounds(shuffled_index))?; - let random_byte = Self::shuffling_random_byte(i, seed.as_bytes())?; + let random_byte = Self::shuffling_random_byte(i, seed.as_slice())?; let effective_balance = self.get_validator(candidate_index)?.effective_balance; if effective_balance.safe_mul(MAX_RANDOM_BYTE)? >= spec @@ -1521,7 +1521,7 @@ impl BeaconState { let mut preimage = [0; NUM_DOMAIN_BYTES + NUM_EPOCH_BYTES + NUM_MIX_BYTES]; preimage[0..NUM_DOMAIN_BYTES].copy_from_slice(&domain_bytes); preimage[NUM_DOMAIN_BYTES..MIX_OFFSET].copy_from_slice(&epoch_bytes); - preimage[MIX_OFFSET..].copy_from_slice(mix.as_bytes()); + preimage[MIX_OFFSET..].copy_from_slice(mix.as_slice()); Ok(Hash256::from_slice(&hash(&preimage))) } @@ -2203,7 +2203,7 @@ impl BeaconState { .get_mut(validator_index) .ok_or(Error::UnknownValidator(validator_index))?; if validator.has_eth1_withdrawal_credential(spec) { - validator.withdrawal_credentials.as_fixed_bytes_mut()[0] = + validator.withdrawal_credentials.as_mut_slice().to_owned()[0] = spec.compounding_withdrawal_prefix_byte; self.queue_excess_active_balance(validator_index, spec)?; } diff --git a/consensus/types/src/chain_spec.rs b/consensus/types/src/chain_spec.rs index 1db6cd2a9ff..a4bacb9a2e1 100644 --- a/consensus/types/src/chain_spec.rs +++ b/consensus/types/src/chain_spec.rs @@ -7,7 +7,6 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde_utils::quoted_u64::MaybeQuoted; use ssz::Encode; use std::fs::File; -use std::io::Read; use std::path::Path; use std::time::Duration; use tree_hash::TreeHash; @@ -729,7 +728,8 @@ impl ChainSpec { proportional_slashing_multiplier_bellatrix: 3, bellatrix_fork_version: [0x02, 0x00, 0x00, 0x00], bellatrix_fork_epoch: Some(Epoch::new(144896)), - terminal_total_difficulty: Uint256::from_dec_str("58750000000000000000000") + terminal_total_difficulty: "58750000000000000000000" + .parse() .expect("terminal_total_difficulty is a valid integer"), terminal_block_hash: ExecutionBlockHash::zero(), terminal_block_hash_activation_epoch: Epoch::new(u64::MAX), @@ -1031,10 +1031,9 @@ impl ChainSpec { proportional_slashing_multiplier_bellatrix: 3, bellatrix_fork_version: [0x02, 0x00, 0x00, 0x64], bellatrix_fork_epoch: Some(Epoch::new(385536)), - terminal_total_difficulty: Uint256::from_dec_str( - "8626000000000000000000058750000000000000000000", - ) - .expect("terminal_total_difficulty is a valid integer"), + terminal_total_difficulty: "8626000000000000000000058750000000000000000000" + .parse() + .expect("terminal_total_difficulty is a valid integer"), terminal_block_hash: ExecutionBlockHash::zero(), terminal_block_hash_activation_epoch: Epoch::new(u64::MAX), safe_slots_to_import_optimistically: 128u64, @@ -1339,12 +1338,14 @@ fn default_electra_fork_version() -> [u8; 4] { /// /// Taken from https://github.com/ethereum/consensus-specs/blob/d5e4828aecafaf1c57ef67a5f23c4ae7b08c5137/configs/mainnet.yaml#L15-L16 const fn default_terminal_total_difficulty() -> Uint256 { - Uint256([ - 18446744073709550592, - 18446744073709551615, - 18446744073709551615, - 18446744073709551615, - ]) + // TODO alloy + todo!() + // Uint256([ + // 18446744073709550592, + // 18446744073709551615, + // 18446744073709551615, + // 18446744073709551615, + // ]) } fn default_terminal_block_hash() -> ExecutionBlockHash { diff --git a/consensus/types/src/deposit_tree_snapshot.rs b/consensus/types/src/deposit_tree_snapshot.rs index 07f85e6504c..8104721c12a 100644 --- a/consensus/types/src/deposit_tree_snapshot.rs +++ b/consensus/types/src/deposit_tree_snapshot.rs @@ -42,7 +42,7 @@ impl Default for DepositTreeSnapshot { finalized: vec![], deposit_root: Hash256::ZERO, deposit_count: 0, - execution_block_hash: Hash256::zero(), + execution_block_hash: Hash256::ZERO, execution_block_height: 0, }; // properly set the empty deposit root @@ -60,7 +60,7 @@ impl DepositTreeSnapshot { for height in 0..DEPOSIT_TREE_DEPTH { deposit_root = if (size & 1) == 1 { index = index.checked_sub(1)?; - hash32_concat(self.finalized.get(index)?.as_bytes(), &deposit_root) + hash32_concat(self.finalized.get(index)?.as_slice(), &deposit_root) } else { hash32_concat(&deposit_root, ZERO_HASHES.get(height)?) }; diff --git a/consensus/types/src/execution_block_header.rs b/consensus/types/src/execution_block_header.rs index aace2e2775d..9d81a23ee26 100644 --- a/consensus/types/src/execution_block_header.rs +++ b/consensus/types/src/execution_block_header.rs @@ -74,9 +74,9 @@ impl ExecutionBlockHeader { receipts_root: payload.receipts_root(), logs_bloom: payload.logs_bloom().clone().into(), difficulty: Uint256::ZERO, - number: payload.block_number().into(), - gas_limit: payload.gas_limit().into(), - gas_used: payload.gas_used().into(), + number: Uint256::from_le_bytes(payload.block_number().to_le_bytes()), + gas_limit: Uint256::from_le_bytes(payload.gas_limit().to_le_bytes()), + gas_used: Uint256::from_le_bytes(payload.gas_used().to_le_bytes()), timestamp: payload.timestamp(), extra_data: payload.extra_data().clone().into(), mix_hash: payload.prev_randao(), diff --git a/consensus/types/src/graffiti.rs b/consensus/types/src/graffiti.rs index 3d8f411cafb..ee15c02947e 100644 --- a/consensus/types/src/graffiti.rs +++ b/consensus/types/src/graffiti.rs @@ -180,6 +180,6 @@ impl TreeHash for Graffiti { impl TestRandom for Graffiti { fn random_for_test(rng: &mut impl RngCore) -> Self { - Self::from(Hash256::random_for_test(rng).to_fixed_bytes()) + Self::from(Hash256::random_for_test(rng).to_string()) } } diff --git a/consensus/types/src/historical_summary.rs b/consensus/types/src/historical_summary.rs index d7773a68a45..76bb111ea2f 100644 --- a/consensus/types/src/historical_summary.rs +++ b/consensus/types/src/historical_summary.rs @@ -4,6 +4,7 @@ use compare_fields_derive::CompareFields; use serde::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; use test_random_derive::TestRandom; +use tree_hash::TreeHash; use tree_hash_derive::TreeHash; /// `HistoricalSummary` matches the components of the phase0 `HistoricalBatch` diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index b115cc93709..cfc8c71a3e4 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -1,11 +1,11 @@ //! Identifies each shard by an integer identifier. use crate::{AttestationRef, ChainSpec, CommitteeIndex, Epoch, EthSpec, Slot}; +use alloy_primitives::B256 as H256; use lazy_static::lazy_static; use safe_arith::{ArithError, SafeArith}; use serde::{Deserialize, Serialize}; use std::ops::{Deref, DerefMut}; use swap_or_not_shuffle::compute_shuffled_index; -use alloy_primitives::B256 as H256; const MAX_SUBNET_ID: usize = 64; @@ -90,8 +90,9 @@ impl SubnetId { let shuffling_prefix_bits = spec.attestation_subnet_shuffling_prefix_bits as u64; // calculate the prefixes used to compute the subnet and shuffling - let node_id_prefix = (node_id >> (256 - prefix_bits)).as_u64(); - let shuffling_prefix = (node_id >> (256 - (prefix_bits + shuffling_prefix_bits))).as_u64(); + // TODO alloy + let node_id_prefix = 064; // (node_id >> (256 - prefix_bits)).as_u64(); + let shuffling_prefix = 064; // (node_id >> (256 - (prefix_bits + shuffling_prefix_bits))).as_u64(); // number of groups the shuffling creates let shuffling_groups = 1 << shuffling_prefix_bits; diff --git a/consensus/types/src/test_utils/test_random/uint256.rs b/consensus/types/src/test_utils/test_random/uint256.rs index 5eccc0a9fa5..30077f0e0f6 100644 --- a/consensus/types/src/test_utils/test_random/uint256.rs +++ b/consensus/types/src/test_utils/test_random/uint256.rs @@ -4,6 +4,6 @@ impl TestRandom for Uint256 { fn random_for_test(rng: &mut impl RngCore) -> Self { let mut key_bytes = [0; 32]; rng.fill_bytes(&mut key_bytes); - Self::from_little_endian(&key_bytes[..]) + Self::from_le_slice(&key_bytes[..]) } } diff --git a/consensus/types/src/validator.rs b/consensus/types/src/validator.rs index 8512a2391ec..9e12a61f02b 100644 --- a/consensus/types/src/validator.rs +++ b/consensus/types/src/validator.rs @@ -145,7 +145,7 @@ impl Validator { self.has_execution_withdrawal_credential(spec) .then(|| { self.withdrawal_credentials - .as_bytes() + .as_slice() .get(12..) .map(Address::from_slice) }) @@ -158,7 +158,7 @@ impl Validator { pub fn change_withdrawal_credentials(&mut self, execution_address: &Address, spec: &ChainSpec) { let mut bytes = [0u8; 32]; bytes[0] = spec.eth1_address_withdrawal_prefix_byte; - bytes[12..].copy_from_slice(execution_address.as_bytes()); + bytes[12..].copy_from_slice(execution_address.as_slice()); self.withdrawal_credentials = Hash256::from(bytes); } @@ -298,7 +298,7 @@ pub fn is_compounding_withdrawal_credential( spec: &ChainSpec, ) -> bool { withdrawal_credentials - .as_bytes() + .as_slice() .first() .map(|prefix_byte| *prefix_byte == spec.compounding_withdrawal_prefix_byte) .unwrap_or(false) diff --git a/crypto/bls/tests/tests.rs b/crypto/bls/tests/tests.rs index a65eb952da5..8fed22f5371 100644 --- a/crypto/bls/tests/tests.rs +++ b/crypto/bls/tests/tests.rs @@ -42,7 +42,7 @@ macro_rules! test_suite { let mut agg_sig = AggregateSignature::infinity(); ssz_round_trip(agg_sig.clone()); - let msg = Hash256::from_low_u64_be(42); + let msg = Hash256::from_slice(&42u64.to_le_bytes()); let secret = secret_from_u64(42); let sig = secret.sign(msg); @@ -121,7 +121,7 @@ macro_rules! test_suite { fn default() -> Self { let secret = SecretKey::deserialize(&[42; 32]).unwrap(); let pubkey = secret.public_key(); - let msg = Hash256::from_low_u64_be(42); + let msg = Hash256::from_slice(&42u64.to_le_bytes()); Self { sig: secret.sign(msg), @@ -172,7 +172,7 @@ macro_rules! test_suite { fn new_with_single_msg(num_pubkeys: u64) -> Self { let mut pubkeys = Vec::with_capacity(num_pubkeys as usize); let mut sig = AggregateSignature::infinity(); - let msg = Hash256::from_low_u64_be(42); + let msg = Hash256::from_slice(&42u64.to_le_bytes()); for i in 0..num_pubkeys { let secret = secret_from_u64(i); @@ -195,7 +195,8 @@ macro_rules! test_suite { pub fn wrong_sig(mut self) -> Self { let sk = SecretKey::deserialize(&[1; 32]).unwrap(); self.sig = AggregateSignature::infinity(); - self.sig.add_assign(&sk.sign(Hash256::from_low_u64_be(1))); + self.sig + .add_assign(&sk.sign(Hash256::from_slice(&1u64.to_le_bytes()))); self } @@ -380,7 +381,7 @@ macro_rules! test_suite { impl SignatureSetTester { pub fn push_valid_set(mut self, num_signers: usize) -> Self { let mut signature = AggregateSignature::infinity(); - let message = Hash256::from_low_u64_be(42); + let message = Hash256::from_slice(&42u64.to_le_bytes()); let signing_keys = (0..num_signers) .map(|i| { @@ -403,7 +404,7 @@ macro_rules! test_suite { pub fn push_invalid_set(mut self) -> Self { let mut signature = AggregateSignature::infinity(); - let message = Hash256::from_low_u64_be(42); + let message = Hash256::from_slice(&42u64.to_le_bytes()); signature.add_assign(&secret_from_u64(0).sign(message)); diff --git a/testing/ef_tests/Cargo.toml b/testing/ef_tests/Cargo.toml index fc4614f5d45..6012283e111 100644 --- a/testing/ef_tests/Cargo.toml +++ b/testing/ef_tests/Cargo.toml @@ -11,11 +11,11 @@ fake_crypto = ["bls/fake_crypto"] portable = ["beacon_chain/portable"] [dependencies] +alloy-primitives = { workspace = true } bls = { workspace = true } compare_fields = { workspace = true } compare_fields_derive = { workspace = true } derivative = { workspace = true } -ethereum-types = { workspace = true } hex = { workspace = true } kzg = { workspace = true } rayon = { workspace = true } From 647c7b0bc77563e9420f01da53e730a3946c941d Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Thu, 11 Jul 2024 16:36:07 +0100 Subject: [PATCH 11/62] more changes based on dep changes --- Cargo.lock | 12 +++- Cargo.toml | 3 +- beacon_node/execution_layer/Cargo.toml | 1 + beacon_node/execution_layer/src/block_hash.rs | 62 +++++++++---------- .../execution_layer/src/engine_api/http.rs | 14 ++--- beacon_node/execution_layer/src/lib.rs | 4 +- .../test_utils/execution_block_generator.rs | 16 ++--- .../src/test_utils/handle_rpc.rs | 8 +-- .../src/test_utils/mock_builder.rs | 2 +- .../src/test_utils/mock_execution_layer.rs | 6 +- .../execution_layer/src/test_utils/mod.rs | 4 +- .../lighthouse_network/src/rpc/codec/base.rs | 2 +- .../src/rpc/codec/ssz_snappy.rs | 20 +++--- .../lighthouse_network/tests/common.rs | 2 +- .../lighthouse_network/tests/rpc_tests.rs | 40 ++++++------ .../operation_pool/src/reward_cache.rs | 2 +- beacon_node/store/src/hot_cold_store.rs | 48 +++++++------- beacon_node/store/src/impls/beacon_state.rs | 4 +- beacon_node/store/src/lib.rs | 12 ++-- beacon_node/store/src/partial_beacon_state.rs | 2 +- common/eth2/src/types.rs | 4 +- common/eth2_network_config/src/lib.rs | 4 +- consensus/fork_choice/src/fork_choice.rs | 8 +-- .../src/fork_choice_test_definition.rs | 18 +++--- .../fork_choice_test_definition/no_votes.rs | 58 ++++++++--------- consensus/proto_array/src/proto_array.rs | 8 +-- .../src/proto_array_fork_choice.rs | 58 ++++++++--------- consensus/state_processing/src/all_caches.rs | 2 +- consensus/state_processing/src/epoch_cache.rs | 4 +- consensus/state_processing/src/genesis.rs | 2 +- .../verify_bls_to_execution_change.rs | 4 +- .../src/per_slot_processing.rs | 2 +- .../state_processing/src/state_advance.rs | 4 +- consensus/types/src/graffiti.rs | 2 +- slasher/src/database.rs | 2 +- slasher/src/test_utils.rs | 18 +++--- testing/eth1_test_rig/src/lib.rs | 4 +- .../execution_engine_integration/Cargo.toml | 2 +- .../src/attestation_tests.rs | 8 +-- .../src/bin/test_generator.rs | 6 +- .../slashing_protection/src/block_tests.rs | 4 +- .../src/extra_interchange_tests.rs | 10 +-- .../src/interchange_test.rs | 4 +- .../slashing_protection/src/lib.rs | 2 +- .../src/slashing_database.rs | 4 +- .../slashing_protection/src/test_utils.rs | 4 +- .../slashing_protection/tests/migration.rs | 2 +- 47 files changed, 262 insertions(+), 250 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eec00ff21cb..d9f48829f85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -187,6 +187,15 @@ dependencies = [ "alloy-rlp", ] +[[package]] +name = "alloy-core" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "529fc6310dc1126c8de51c376cbc59c79c7f662bd742be7dc67055d5421a81b4" +dependencies = [ + "alloy-primitives 0.7.7", +] + [[package]] name = "alloy-eips" version = "0.1.0" @@ -2911,9 +2920,9 @@ dependencies = [ name = "execution_engine_integration" version = "0.1.0" dependencies = [ + "alloy-core", "async-channel", "deposit_contract", - "ethers-core", "ethers-providers", "execution_layer", "fork_choice", @@ -2935,6 +2944,7 @@ name = "execution_layer" version = "0.1.0" dependencies = [ "alloy-consensus", + "alloy-primitives 0.7.7", "alloy-rlp", "arc-swap", "builder_client", diff --git a/Cargo.toml b/Cargo.toml index 26e23ae4073..f27c6d87d35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,8 @@ resolver = "2" edition = "2021" [workspace.dependencies] -alloy-primitives = { version = "0.7.7", features =["arbitrary", "serde", "ssz", "getrandom"] } +alloy-core = "0.7.0" +alloy-primitives = { version = "0.7.0", features =["arbitrary", "serde", "ssz", "getrandom"] } anyhow = "1" arbitrary = { version = "1", features = ["derive"] } async-channel = "1.9.0" diff --git a/beacon_node/execution_layer/Cargo.toml b/beacon_node/execution_layer/Cargo.toml index ff147ad3b4c..775c84e1313 100644 --- a/beacon_node/execution_layer/Cargo.toml +++ b/beacon_node/execution_layer/Cargo.toml @@ -6,6 +6,7 @@ edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +alloy-primitives = { workspace = true } types = { workspace = true } tokio = { workspace = true } slog = { workspace = true } diff --git a/beacon_node/execution_layer/src/block_hash.rs b/beacon_node/execution_layer/src/block_hash.rs index 0d0cfaf352c..74712bc4449 100644 --- a/beacon_node/execution_layer/src/block_hash.rs +++ b/beacon_node/execution_layer/src/block_hash.rs @@ -64,7 +64,7 @@ pub fn rlp_encode_withdrawal(withdrawal: &JsonWithdrawal) -> Vec { rlp_stream.begin_list(4); rlp_stream.append(&withdrawal.index); rlp_stream.append(&withdrawal.validator_index); - rlp_stream.append(&withdrawal.address); + rlp_stream.append(&withdrawal.address.as_slice()); rlp_stream.append(&withdrawal.amount); rlp_stream.out().into() } @@ -124,15 +124,15 @@ mod test { transactions_root: Hash256::from_str("50f738580ed699f0469702c7ccc63ed2e51bc034be9479b7bff4e68dee84accf").unwrap(), receipts_root: Hash256::from_str("29b0562f7140574dd0d50dee8a271b22e1a0a7b78fca58f7c60370d8317ba2a9").unwrap(), logs_bloom: <[u8; 256]>::from_hex("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap().into(), - difficulty: 0x020000.into(), - number: 0x01_u64.into(), - gas_limit: 0x016345785d8a0000_u64.into(), - gas_used: 0x015534_u64.into(), + difficulty: Uint256::from(0x020000), + number: Uint256::from(0x01_u64), + gas_limit: Uint256::from(0x016345785d8a0000_u64), + gas_used: Uint256::from(0x015534_u64), timestamp: 0x079e, extra_data: vec![0x42], mix_hash: Hash256::from_str("0000000000000000000000000000000000000000000000000000000000000000").unwrap(), - nonce: Hash64::zero(), - base_fee_per_gas: 0x036b_u64.into(), + nonce: Hash64::ZERO, + base_fee_per_gas: Uint256::from(0x036b_u64), withdrawals_root: None, blob_gas_used: None, excess_blob_gas: None, @@ -155,15 +155,15 @@ mod test { transactions_root: Hash256::from_str("50f738580ed699f0469702c7ccc63ed2e51bc034be9479b7bff4e68dee84accf").unwrap(), receipts_root: Hash256::from_str("29b0562f7140574dd0d50dee8a271b22e1a0a7b78fca58f7c60370d8317ba2a9").unwrap(), logs_bloom: <[u8; 256]>::from_hex("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap().into(), - difficulty: 0x00.into(), - number: 0x01_u64.into(), - gas_limit: 0x016345785d8a0000_u64.into(), - gas_used: 0x015534_u64.into(), + difficulty: Uint256::from(0x00), + number: Uint256::from(0x01_u64), + gas_limit: Uint256::from(0x016345785d8a0000_u64), + gas_used: Uint256::from(0x015534_u64), timestamp: 0x079e, extra_data: vec![0x42], mix_hash: Hash256::from_str("0000000000000000000000000000000000000000000000000000000000020000").unwrap(), - nonce: Hash64::zero(), - base_fee_per_gas: 0x036b_u64.into(), + nonce: Hash64::ZERO, + base_fee_per_gas: Uint256::from(0x036b_u64), withdrawals_root: None, blob_gas_used: None, excess_blob_gas: None, @@ -187,15 +187,15 @@ mod test { transactions_root: Hash256::from_str("0223f0cb35f184d2ac409e89dc0768ad738f777bd1c85d3302ca50f307180c94").unwrap(), receipts_root: Hash256::from_str("371c76821b1cc21232574604eac5349d51647eb530e2a45d4f6fe2c501351aa5").unwrap(), logs_bloom: <[u8; 256]>::from_hex("1a2c559955848d2662a0634cb40c7a6192a1524f11061203689bcbcdec901b054084d4f4d688009d24c10918e0089b48e72fe2d7abafb903889d10c3827c6901096612d259801b1b7ba1663a4201f5f88f416a9997c55bcc2c54785280143b057a008764c606182e324216822a2d5913e797a05c16cc1468d001acf3783b18e00e0203033e43106178db554029e83ca46402dc49d929d7882a04a0e7215041bdabf7430bd10ef4bb658a40f064c63c4816660241c2480862f26742fdf9ca41637731350301c344e439428182a03e384484e6d65d0c8a10117c6739ca201b60974519a1ae6b0c3966c0f650b449d10eae065dab2c83ab4edbab5efdea50bbc801").unwrap().into(), - difficulty: 0.into(), - number: 16182891.into(), - gas_limit: 0x1c9c380.into(), - gas_used: 0xe9b752.into(), + difficulty: Uint256::ZERO, + number: Uint256::from(16182891), + gas_limit: Uint256::from(0x1c9c380), + gas_used: Uint256::from(0xe9b752), timestamp: 0x6399bf63, extra_data: hex::decode("496c6c756d696e61746520446d6f63726174697a6520447374726962757465").unwrap(), mix_hash: Hash256::from_str("bf5289894b2ceab3549f92f063febbac896b280ddb18129a57cff13113c11b13").unwrap(), - nonce: Hash64::zero(), - base_fee_per_gas: 0x34187b238_u64.into(), + nonce: Hash64::ZERO, + base_fee_per_gas: Uint256::from(0x34187b238_u64), withdrawals_root: None, blob_gas_used: None, excess_blob_gas: None, @@ -217,15 +217,15 @@ mod test { transactions_root: Hash256::from_str("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").unwrap(), receipts_root: Hash256::from_str("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").unwrap(), logs_bloom:<[u8; 256]>::from_hex("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap().into(), - difficulty: 0.into(), - number: 97.into(), - gas_limit: 27482534.into(), - gas_used: 0.into(), + difficulty: Uint256::ZERO, + number: Uint256::from(97), + gas_limit: Uint256::from(27482534), + gas_used: Uint256::ZERO, timestamp: 1692132829u64, extra_data: hex::decode("d883010d00846765746888676f312e32302e37856c696e7578").unwrap(), mix_hash: Hash256::from_str("0b493c22d2ad4ca76c77ae6ad916af429b42b1dc98fdcb8e5ddbd049bbc5d623").unwrap(), - nonce: Hash64::zero(), - base_fee_per_gas: 2374u64.into(), + nonce: Hash64::ZERO, + base_fee_per_gas: Uint256::from(2374u64), withdrawals_root: Some(Hash256::from_str("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").unwrap()), blob_gas_used: Some(0x0u64), excess_blob_gas: Some(0x0u64), @@ -247,15 +247,15 @@ mod test { transactions_root: Hash256::from_str("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").unwrap(), receipts_root: Hash256::from_str("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").unwrap(), logs_bloom:<[u8; 256]>::from_hex("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap().into(), - difficulty: 0.into(), - number: 97.into(), - gas_limit: 27482534.into(), - gas_used: 0.into(), + difficulty: Uint256::ZERO, + number: Uint256::from(97), + gas_limit: Uint256::from(27482534), + gas_used: Uint256::ZERO, timestamp: 1692132829u64, extra_data: hex::decode("d883010d00846765746888676f312e32302e37856c696e7578").unwrap(), mix_hash: Hash256::from_str("0b493c22d2ad4ca76c77ae6ad916af429b42b1dc98fdcb8e5ddbd049bbc5d623").unwrap(), - nonce: Hash64::zero(), - base_fee_per_gas: 2374u64.into(), + nonce: Hash64::ZERO, + base_fee_per_gas: Uint256::from(2374u64), withdrawals_root: Some(Hash256::from_str("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").unwrap()), blob_gas_used: Some(0x0u64), excess_blob_gas: Some(0x0u64), diff --git a/beacon_node/execution_layer/src/engine_api/http.rs b/beacon_node/execution_layer/src/engine_api/http.rs index 1c03cc81fc3..52d72bd43e0 100644 --- a/beacon_node/execution_layer/src/engine_api/http.rs +++ b/beacon_node/execution_layer/src/engine_api/http.rs @@ -874,7 +874,7 @@ impl HttpJsonRpc { // Set the V1 payload values from the EE to be zero. This simulates // the pre-block-value functionality of always choosing the builder // block. - block_value: Uint256::zero(), + block_value: Uint256::ZERO, })) } @@ -1620,7 +1620,7 @@ mod test { }, Some(PayloadAttributes::V1(PayloadAttributesV1 { timestamp: 5, - prev_randao: Hash256::zero(), + prev_randao: Hash256::ZERO, suggested_fee_recipient: Address::repeat_byte(0), })), ) @@ -1655,7 +1655,7 @@ mod test { }, Some(PayloadAttributes::V1(PayloadAttributesV1 { timestamp: 5, - prev_randao: Hash256::zero(), + prev_randao: Hash256::ZERO, suggested_fee_recipient: Address::repeat_byte(0), })), ) @@ -1842,7 +1842,7 @@ mod test { }, Some(PayloadAttributes::V1(PayloadAttributesV1 { timestamp: 5, - prev_randao: Hash256::zero(), + prev_randao: Hash256::ZERO, suggested_fee_recipient: Address::from_str("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b").unwrap(), })) ) @@ -1889,7 +1889,7 @@ mod test { }, Some(PayloadAttributes::V1(PayloadAttributesV1 { timestamp: 5, - prev_randao: Hash256::zero(), + prev_randao: Hash256::ZERO, suggested_fee_recipient: Address::from_str("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b").unwrap(), })) ) @@ -1957,7 +1957,7 @@ mod test { state_root: Hash256::from_str("0xca3149fa9e37db08d1cd49c9061db1002ef1cd58db2210f2115c8c989b2bdf45").unwrap(), receipts_root: Hash256::from_str("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").unwrap(), logs_bloom: vec![0; 256].into(), - prev_randao: Hash256::zero(), + prev_randao: Hash256::ZERO, block_number: 1, gas_limit: u64::from_str_radix("1c95111",16).unwrap(), gas_used: 0, @@ -1982,7 +1982,7 @@ mod test { state_root: Hash256::from_str("0xca3149fa9e37db08d1cd49c9061db1002ef1cd58db2210f2115c8c989b2bdf45").unwrap(), receipts_root: Hash256::from_str("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").unwrap(), logs_bloom: vec![0; 256].into(), - prev_randao: Hash256::zero(), + prev_randao: Hash256::ZERO, block_number: 1, gas_limit: u64::from_str_radix("1c9c380",16).unwrap(), gas_used: 0, diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index eaa739d7a5d..4f9986bed35 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -1133,7 +1133,7 @@ impl ExecutionLayer { let boosted_relay_value = match builder_boost_factor { Some(builder_boost_factor) => { - (relay_value / 100).saturating_mul(builder_boost_factor.into()) + (relay_value / Uint256::from(100)).saturating_mul(Uint256::from(builder_boost_factor)) } None => relay_value, }; @@ -2190,7 +2190,7 @@ fn verify_builder_bid( let header = &bid.data.message.header(); // Avoid logging values that we can't represent with our Prometheus library. - let payload_value_gwei = bid.data.message.value() / 1_000_000_000; + let payload_value_gwei = bid.data.message.value() / Uint256::from(1_000_000_000); if payload_value_gwei <= Uint256::from(i64::MAX) { metrics::set_gauge_vec( &metrics::EXECUTION_LAYER_PAYLOAD_BIDS, diff --git a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs index 8619e24a238..c91d22542e0 100644 --- a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs +++ b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs @@ -368,7 +368,7 @@ impl ExecutionBlockGenerator { // Hack the block hash to make this block distinct from any other block with a different // `unique_id` (the default is 0). - block.block_hash = ExecutionBlockHash::from_root(Hash256::from_low_u64_be(unique_id)); + block.block_hash = ExecutionBlockHash::from_root(Hash256::from_slice(&unique_id.to_le_bytes())); block.block_hash = ExecutionBlockHash::from_root(block.tree_hash_root()); let hash = self.insert_block(Block::PoW(block))?; @@ -581,7 +581,7 @@ impl ExecutionBlockGenerator { gas_used: GAS_USED, timestamp: pa.timestamp, extra_data: "block gen was here".as_bytes().to_vec().into(), - base_fee_per_gas: Uint256::one(), + base_fee_per_gas: Uint256::from(1u64), block_hash: ExecutionBlockHash::zero(), transactions: vec![].into(), }), @@ -598,7 +598,7 @@ impl ExecutionBlockGenerator { gas_used: GAS_USED, timestamp: pa.timestamp, extra_data: "block gen was here".as_bytes().to_vec().into(), - base_fee_per_gas: Uint256::one(), + base_fee_per_gas: Uint256::from(1u64), block_hash: ExecutionBlockHash::zero(), transactions: vec![].into(), }), @@ -614,7 +614,7 @@ impl ExecutionBlockGenerator { gas_used: GAS_USED, timestamp: pa.timestamp, extra_data: "block gen was here".as_bytes().to_vec().into(), - base_fee_per_gas: Uint256::one(), + base_fee_per_gas: Uint256::from(1u64), block_hash: ExecutionBlockHash::zero(), transactions: vec![].into(), withdrawals: pa.withdrawals.clone().into(), @@ -634,7 +634,7 @@ impl ExecutionBlockGenerator { gas_used: GAS_USED, timestamp: pa.timestamp, extra_data: "block gen was here".as_bytes().to_vec().into(), - base_fee_per_gas: Uint256::one(), + base_fee_per_gas: Uint256::from(1u64), block_hash: ExecutionBlockHash::zero(), transactions: vec![].into(), withdrawals: pa.withdrawals.clone().into(), @@ -653,7 +653,7 @@ impl ExecutionBlockGenerator { gas_used: GAS_USED, timestamp: pa.timestamp, extra_data: "block gen was here".as_bytes().to_vec().into(), - base_fee_per_gas: Uint256::one(), + base_fee_per_gas: Uint256::from(1u64), block_hash: ExecutionBlockHash::zero(), transactions: vec![].into(), withdrawals: pa.withdrawals.clone().into(), @@ -878,7 +878,7 @@ mod test { const DIFFICULTY_INCREMENT: u64 = 1; let mut generator: ExecutionBlockGenerator = ExecutionBlockGenerator::new( - TERMINAL_DIFFICULTY.into(), + Uint256::from(TERMINAL_DIFFICULTY), TERMINAL_BLOCK, ExecutionBlockHash::zero(), None, @@ -907,7 +907,7 @@ mod test { assert_eq!( block.total_difficulty().unwrap(), - (i * DIFFICULTY_INCREMENT).into() + Uint256::from(i * DIFFICULTY_INCREMENT) ); assert_eq!(generator.block_by_hash(block.block_hash()).unwrap(), block); diff --git a/beacon_node/execution_layer/src/test_utils/handle_rpc.rs b/beacon_node/execution_layer/src/test_utils/handle_rpc.rs index 0dc7a7759c5..b0c83dd6e06 100644 --- a/beacon_node/execution_layer/src/test_utils/handle_rpc.rs +++ b/beacon_node/execution_layer/src/test_utils/handle_rpc.rs @@ -330,14 +330,14 @@ pub async fn handle_rpc( JsonExecutionPayload::V1(execution_payload) => { serde_json::to_value(JsonGetPayloadResponseV1 { execution_payload, - block_value: DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI.into(), + block_value: Uint256::from(DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI), }) .unwrap() } JsonExecutionPayload::V2(execution_payload) => { serde_json::to_value(JsonGetPayloadResponseV2 { execution_payload, - block_value: DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI.into(), + block_value: Uint256::from(DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI), }) .unwrap() } @@ -350,7 +350,7 @@ pub async fn handle_rpc( JsonExecutionPayload::V3(execution_payload) => { serde_json::to_value(JsonGetPayloadResponseV3 { execution_payload, - block_value: DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI.into(), + block_value: Uint256::from(DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI), blobs_bundle: maybe_blobs .ok_or(( "No blobs returned despite V3 Payload".to_string(), @@ -367,7 +367,7 @@ pub async fn handle_rpc( JsonExecutionPayload::V4(execution_payload) => { serde_json::to_value(JsonGetPayloadResponseV4 { execution_payload, - block_value: DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI.into(), + block_value: Uint256::from(DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI), blobs_bundle: maybe_blobs .ok_or(( "No blobs returned despite V4 Payload".to_string(), diff --git a/beacon_node/execution_layer/src/test_utils/mock_builder.rs b/beacon_node/execution_layer/src/test_utils/mock_builder.rs index c9ae1e60cdc..1c7a3472c51 100644 --- a/beacon_node/execution_layer/src/test_utils/mock_builder.rs +++ b/beacon_node/execution_layer/src/test_utils/mock_builder.rs @@ -521,7 +521,7 @@ pub fn serve( .await; let forkchoice_update_params = ForkchoiceUpdateParameters { - head_root: Hash256::zero(), + head_root: Hash256::ZERO, head_hash: None, justified_hash: Some(justified_execution_hash), finalized_hash: Some(finalized_execution_hash), diff --git a/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs b/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs index da9b2817f69..b47a53a2ced 100644 --- a/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs +++ b/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs @@ -4,8 +4,8 @@ use crate::{ }, *, }; -use keccak_hash::H256; use kzg::Kzg; +use alloy_primitives::B256 as H256; use tempfile::NamedTempFile; use types::MainnetEthSpec; @@ -19,7 +19,7 @@ pub struct MockExecutionLayer { impl MockExecutionLayer { pub fn default_params(executor: TaskExecutor) -> Self { let mut spec = MainnetEthSpec::default_spec(); - spec.terminal_total_difficulty = DEFAULT_TERMINAL_DIFFICULTY.into(); + spec.terminal_total_difficulty = Uint256::from(DEFAULT_TERMINAL_DIFFICULTY); spec.terminal_block_hash = ExecutionBlockHash::zero(); spec.terminal_block_hash_activation_epoch = Epoch::new(0); Self::new( @@ -92,7 +92,7 @@ impl MockExecutionLayer { let parent_hash = latest_execution_block.block_hash(); let block_number = latest_execution_block.block_number() + 1; let timestamp = block_number; - let prev_randao = Hash256::from_low_u64_be(block_number); + let prev_randao = Hash256::from_slice(&block_number.to_le_bytes()); let head_block_root = Hash256::repeat_byte(42); let forkchoice_update_params = ForkchoiceUpdateParameters { head_root: head_block_root, diff --git a/beacon_node/execution_layer/src/test_utils/mod.rs b/beacon_node/execution_layer/src/test_utils/mod.rs index 7b00ca9fbc3..ca2450f425d 100644 --- a/beacon_node/execution_layer/src/test_utils/mod.rs +++ b/beacon_node/execution_layer/src/test_utils/mod.rs @@ -88,7 +88,7 @@ impl Default for MockExecutionConfig { fn default() -> Self { Self { jwt_key: JwtKey::random(), - terminal_difficulty: DEFAULT_TERMINAL_DIFFICULTY.into(), + terminal_difficulty: Uint256::from(DEFAULT_TERMINAL_DIFFICULTY), terminal_block: DEFAULT_TERMINAL_BLOCK, terminal_block_hash: ExecutionBlockHash::zero(), server_config: Config::default(), @@ -111,7 +111,7 @@ impl MockServer { Self::new( &runtime::Handle::current(), JwtKey::from_slice(&DEFAULT_JWT_SECRET).unwrap(), - DEFAULT_TERMINAL_DIFFICULTY.into(), + Uint256::from(DEFAULT_TERMINAL_DIFFICULTY), DEFAULT_TERMINAL_BLOCK, ExecutionBlockHash::zero(), None, // FIXME(capella): should this be the default? diff --git a/beacon_node/lighthouse_network/src/rpc/codec/base.rs b/beacon_node/lighthouse_network/src/rpc/codec/base.rs index 42a31d3480a..975bad23703 100644 --- a/beacon_node/lighthouse_network/src/rpc/codec/base.rs +++ b/beacon_node/lighthouse_network/src/rpc/codec/base.rs @@ -203,7 +203,7 @@ mod tests { ForkName::Deneb => deneb_fork_epoch.start_slot(Spec::slots_per_epoch()), ForkName::Electra => electra_fork_epoch.start_slot(Spec::slots_per_epoch()), }; - ForkContext::new::(current_slot, Hash256::zero(), &chain_spec) + ForkContext::new::(current_slot, Hash256::ZERO, &chain_spec) } #[test] diff --git a/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs b/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs index 482d1d96b4a..f986cff235f 100644 --- a/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs +++ b/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs @@ -774,7 +774,7 @@ mod tests { ForkName::Deneb => deneb_fork_epoch.start_slot(Spec::slots_per_epoch()), ForkName::Electra => electra_fork_epoch.start_slot(Spec::slots_per_epoch()), }; - ForkContext::new::(current_slot, Hash256::zero(), &chain_spec) + ForkContext::new::(current_slot, Hash256::ZERO, &chain_spec) } /// Smallest sized block across all current forks. Useful for testing @@ -833,9 +833,9 @@ mod tests { fn status_message() -> StatusMessage { StatusMessage { fork_digest: [0; 4], - finalized_root: Hash256::from_low_u64_be(0), + finalized_root: Hash256::ZERO, finalized_epoch: Epoch::new(1), - head_root: Hash256::from_low_u64_be(0), + head_root: Hash256::ZERO, head_slot: Slot::new(1), } } @@ -856,17 +856,17 @@ mod tests { } fn bbroot_request_v1(spec: &ChainSpec) -> BlocksByRootRequest { - BlocksByRootRequest::new_v1(vec![Hash256::zero()], spec) + BlocksByRootRequest::new_v1(vec![Hash256::ZERO], spec) } fn bbroot_request_v2(spec: &ChainSpec) -> BlocksByRootRequest { - BlocksByRootRequest::new(vec![Hash256::zero()], spec) + BlocksByRootRequest::new(vec![Hash256::ZERO], spec) } fn blbroot_request(spec: &ChainSpec) -> BlobsByRootRequest { BlobsByRootRequest::new( vec![BlobIdentifier { - block_root: Hash256::zero(), + block_root: Hash256::ZERO, index: 0, }], spec, @@ -1517,9 +1517,9 @@ mod tests { // Status message is 84 bytes uncompressed. `max_compressed_len` is 32 + 84 + 84/6 = 130. let status_message_bytes = StatusMessage { fork_digest: [0; 4], - finalized_root: Hash256::from_low_u64_be(0), + finalized_root: Hash256::ZERO, finalized_epoch: Epoch::new(1), - head_root: Hash256::from_low_u64_be(0), + head_root: Hash256::ZERO, head_slot: Slot::new(1), } .as_ssz_bytes(); @@ -1640,9 +1640,9 @@ mod tests { // Status message is 84 bytes uncompressed. `max_compressed_len` is 32 + 84 + 84/6 = 130. let status_message_bytes = StatusMessage { fork_digest: [0; 4], - finalized_root: Hash256::from_low_u64_be(0), + finalized_root: Hash256::ZERO, finalized_epoch: Epoch::new(1), - head_root: Hash256::from_low_u64_be(0), + head_root: Hash256::ZERO, head_slot: Slot::new(1), } .as_ssz_bytes(); diff --git a/beacon_node/lighthouse_network/tests/common.rs b/beacon_node/lighthouse_network/tests/common.rs index 25431226ca6..c2deb42162f 100644 --- a/beacon_node/lighthouse_network/tests/common.rs +++ b/beacon_node/lighthouse_network/tests/common.rs @@ -39,7 +39,7 @@ pub fn fork_context(fork_name: ForkName) -> ForkContext { ForkName::Deneb => deneb_fork_epoch.start_slot(E::slots_per_epoch()), ForkName::Electra => electra_fork_epoch.start_slot(E::slots_per_epoch()), }; - ForkContext::new::(current_slot, Hash256::zero(), &chain_spec) + ForkContext::new::(current_slot, Hash256::ZERO, &chain_spec) } pub struct Libp2pInstance( diff --git a/beacon_node/lighthouse_network/tests/rpc_tests.rs b/beacon_node/lighthouse_network/tests/rpc_tests.rs index 12a1c593930..13346a93266 100644 --- a/beacon_node/lighthouse_network/tests/rpc_tests.rs +++ b/beacon_node/lighthouse_network/tests/rpc_tests.rs @@ -77,18 +77,18 @@ fn test_tcp_status_rpc() { // Dummy STATUS RPC message let rpc_request = Request::Status(StatusMessage { fork_digest: [0; 4], - finalized_root: Hash256::from_low_u64_be(0), + finalized_root: Hash256::ZERO, finalized_epoch: Epoch::new(1), - head_root: Hash256::from_low_u64_be(0), + head_root: Hash256::ZERO, head_slot: Slot::new(1), }); // Dummy STATUS RPC message let rpc_response = Response::Status(StatusMessage { fork_digest: [0; 4], - finalized_root: Hash256::from_low_u64_be(0), + finalized_root: Hash256::ZERO, finalized_epoch: Epoch::new(1), - head_root: Hash256::from_low_u64_be(0), + head_root: Hash256::ZERO, head_slot: Slot::new(1), }); @@ -756,12 +756,12 @@ fn test_tcp_blocks_by_root_chunked_rpc() { // BlocksByRoot Request let rpc_request = Request::BlocksByRoot(BlocksByRootRequest::new( vec![ - Hash256::from_low_u64_be(0), - Hash256::from_low_u64_be(0), - Hash256::from_low_u64_be(0), - Hash256::from_low_u64_be(0), - Hash256::from_low_u64_be(0), - Hash256::from_low_u64_be(0), + Hash256::ZERO, + Hash256::ZERO, + Hash256::ZERO, + Hash256::ZERO, + Hash256::ZERO, + Hash256::ZERO, ], &spec, )); @@ -894,16 +894,16 @@ fn test_tcp_blocks_by_root_chunked_rpc_terminates_correctly() { // BlocksByRoot Request let rpc_request = Request::BlocksByRoot(BlocksByRootRequest::new( vec![ - Hash256::from_low_u64_be(0), - Hash256::from_low_u64_be(0), - Hash256::from_low_u64_be(0), - Hash256::from_low_u64_be(0), - Hash256::from_low_u64_be(0), - Hash256::from_low_u64_be(0), - Hash256::from_low_u64_be(0), - Hash256::from_low_u64_be(0), - Hash256::from_low_u64_be(0), - Hash256::from_low_u64_be(0), + Hash256::ZERO, + Hash256::ZERO, + Hash256::ZERO, + Hash256::ZERO, + Hash256::ZERO, + Hash256::ZERO, + Hash256::ZERO, + Hash256::ZERO, + Hash256::ZERO, + Hash256::ZERO, ], &spec, )); diff --git a/beacon_node/operation_pool/src/reward_cache.rs b/beacon_node/operation_pool/src/reward_cache.rs index 9e4c424bd7d..92d47a13e3a 100644 --- a/beacon_node/operation_pool/src/reward_cache.rs +++ b/beacon_node/operation_pool/src/reward_cache.rs @@ -54,7 +54,7 @@ impl RewardCache { /// re-calculation in `update`. fn latest_block_root(state: &BeaconState) -> Result { if state.slot() == 0 { - Ok(Hash256::zero()) + Ok( Hash256::ZERO) } else { Ok(*state .get_block_root(state.slot() - 1) diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index 9c247c983a9..27f8ba38361 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -339,7 +339,7 @@ impl HotColdDB, LevelDB> { pub fn iter_temporary_state_roots(&self) -> impl Iterator> + '_ { let column = DBColumn::BeaconStateTemporary; let start_key = - BytesKey::from_vec(get_key_for_col(column.into(), Hash256::zero().as_bytes())); + BytesKey::from_vec(get_key_for_col(column.into(), Hash256::ZERO.as_slice())); let keys_iter = self.hot_db.keys_iter(); keys_iter.seek(&start_key); @@ -422,7 +422,7 @@ impl, Cold: ItemStore> HotColdDB blinded_block: &SignedBeaconBlock>, ops: &mut Vec, ) { - let db_key = get_key_for_col(DBColumn::BeaconBlock.into(), key.as_bytes()); + let db_key = get_key_for_col(DBColumn::BeaconBlock.into(), key.as_slice()); ops.push(KeyValueStoreOp::PutKeyValue( db_key, blinded_block.as_ssz_bytes(), @@ -546,7 +546,7 @@ impl, Cold: ItemStore> HotColdDB decoder: impl FnOnce(&[u8]) -> Result, ssz::DecodeError>, ) -> Result>, Error> { self.hot_db - .get_bytes(DBColumn::BeaconBlock.into(), block_root.as_bytes())? + .get_bytes(DBColumn::BeaconBlock.into(), block_root.as_slice())? .map(|block_bytes| decoder(&block_bytes)) .transpose() .map_err(|e| e.into()) @@ -560,7 +560,7 @@ impl, Cold: ItemStore> HotColdDB fork_name: ForkName, ) -> Result>, Error> { let column = ExecutionPayload::::db_column().into(); - let key = block_root.as_bytes(); + let key = block_root.as_slice(); match self.hot_db.get_bytes(column, key)? { Some(bytes) => Ok(Some(ExecutionPayload::from_ssz_bytes(&bytes, fork_name)?)), @@ -586,30 +586,30 @@ impl, Cold: ItemStore> HotColdDB /// Check if the blobs for a block exists on disk. pub fn blobs_exist(&self, block_root: &Hash256) -> Result { self.blobs_db - .key_exists(DBColumn::BeaconBlob.into(), block_root.as_bytes()) + .key_exists(DBColumn::BeaconBlob.into(), block_root.as_slice()) } /// Determine whether a block exists in the database. pub fn block_exists(&self, block_root: &Hash256) -> Result { self.hot_db - .key_exists(DBColumn::BeaconBlock.into(), block_root.as_bytes()) + .key_exists(DBColumn::BeaconBlock.into(), block_root.as_slice()) } /// Delete a block from the store and the block cache. pub fn delete_block(&self, block_root: &Hash256) -> Result<(), Error> { self.block_cache.lock().delete(block_root); self.hot_db - .key_delete(DBColumn::BeaconBlock.into(), block_root.as_bytes())?; + .key_delete(DBColumn::BeaconBlock.into(), block_root.as_slice())?; self.hot_db - .key_delete(DBColumn::ExecPayload.into(), block_root.as_bytes())?; + .key_delete(DBColumn::ExecPayload.into(), block_root.as_slice())?; self.blobs_db - .key_delete(DBColumn::BeaconBlob.into(), block_root.as_bytes()) + .key_delete(DBColumn::BeaconBlob.into(), block_root.as_slice()) } pub fn put_blobs(&self, block_root: &Hash256, blobs: BlobSidecarList) -> Result<(), Error> { self.blobs_db.put_bytes( DBColumn::BeaconBlob.into(), - block_root.as_bytes(), + block_root.as_slice(), &blobs.as_ssz_bytes(), )?; self.block_cache.lock().put_blobs(*block_root, blobs); @@ -622,7 +622,7 @@ impl, Cold: ItemStore> HotColdDB blobs: BlobSidecarList, ops: &mut Vec, ) { - let db_key = get_key_for_col(DBColumn::BeaconBlob.into(), key.as_bytes()); + let db_key = get_key_for_col(DBColumn::BeaconBlob.into(), key.as_slice()); ops.push(KeyValueStoreOp::PutKeyValue(db_key, blobs.as_ssz_bytes())); } @@ -919,34 +919,34 @@ impl, Cold: ItemStore> HotColdDB StoreOp::DeleteStateTemporaryFlag(state_root) => { let db_key = - get_key_for_col(TemporaryFlag::db_column().into(), state_root.as_bytes()); + get_key_for_col(TemporaryFlag::db_column().into(), state_root.as_slice()); key_value_batch.push(KeyValueStoreOp::DeleteKey(db_key)); } StoreOp::DeleteBlock(block_root) => { - let key = get_key_for_col(DBColumn::BeaconBlock.into(), block_root.as_bytes()); + let key = get_key_for_col(DBColumn::BeaconBlock.into(), block_root.as_slice()); key_value_batch.push(KeyValueStoreOp::DeleteKey(key)); } StoreOp::DeleteBlobs(block_root) => { - let key = get_key_for_col(DBColumn::BeaconBlob.into(), block_root.as_bytes()); + let key = get_key_for_col(DBColumn::BeaconBlob.into(), block_root.as_slice()); key_value_batch.push(KeyValueStoreOp::DeleteKey(key)); } StoreOp::DeleteState(state_root, slot) => { let state_summary_key = - get_key_for_col(DBColumn::BeaconStateSummary.into(), state_root.as_bytes()); + get_key_for_col(DBColumn::BeaconStateSummary.into(), state_root.as_slice()); key_value_batch.push(KeyValueStoreOp::DeleteKey(state_summary_key)); if slot.map_or(true, |slot| slot % E::slots_per_epoch() == 0) { let state_key = - get_key_for_col(DBColumn::BeaconState.into(), state_root.as_bytes()); + get_key_for_col(DBColumn::BeaconState.into(), state_root.as_slice()); key_value_batch.push(KeyValueStoreOp::DeleteKey(state_key)); } } StoreOp::DeleteExecutionPayload(block_root) => { - let key = get_key_for_col(DBColumn::ExecPayload.into(), block_root.as_bytes()); + let key = get_key_for_col(DBColumn::ExecPayload.into(), block_root.as_slice()); key_value_batch.push(KeyValueStoreOp::DeleteKey(key)); } @@ -1328,7 +1328,7 @@ impl, Cold: ItemStore> HotColdDB fn load_restore_point(&self, state_root: &Hash256) -> Result, Error> { let partial_state_bytes = self .cold_db - .get_bytes(DBColumn::BeaconState.into(), state_root.as_bytes())? + .get_bytes(DBColumn::BeaconState.into(), state_root.as_slice())? .ok_or(HotColdDBError::MissingRestorePoint(*state_root))?; let mut partial_state: PartialBeaconState = PartialBeaconState::from_ssz_bytes(&partial_state_bytes, &self.spec)?; @@ -1404,7 +1404,7 @@ impl, Cold: ItemStore> HotColdDB let state_root_iter = self.forwards_state_roots_iterator_until( low_slot, slot, - || Ok((high_restore_point, Hash256::zero())), + || Ok((high_restore_point, Hash256::ZERO)), &self.spec, )?; @@ -1539,7 +1539,7 @@ impl, Cold: ItemStore> HotColdDB match self .blobs_db - .get_bytes(DBColumn::BeaconBlob.into(), block_root.as_bytes())? + .get_bytes(DBColumn::BeaconBlob.into(), block_root.as_slice())? { Some(ref blobs_bytes) => { let blobs = BlobSidecarList::from_ssz_bytes(blobs_bytes)?; @@ -1621,7 +1621,7 @@ impl, Cold: ItemStore> HotColdDB mut ops: Vec, ) -> Result<(), Error> { let column = SchemaVersion::db_column().into(); - let key = SCHEMA_VERSION_KEY.as_bytes(); + let key = SCHEMA_VERSION_KEY.as_slice(); let db_key = get_key_for_col(column, key); let op = KeyValueStoreOp::PutKeyValue(db_key, schema_version.as_store_bytes()); ops.push(op); @@ -1716,7 +1716,7 @@ impl, Cold: ItemStore> HotColdDB } else { KeyValueStoreOp::DeleteKey(get_key_for_col( DBColumn::BeaconMeta.into(), - ANCHOR_INFO_KEY.as_bytes(), + ANCHOR_INFO_KEY.as_slice(), )) } } @@ -1898,7 +1898,7 @@ impl, Cold: ItemStore> HotColdDB /// Convert a `restore_point_index` into a database key. fn restore_point_key(restore_point_index: u64) -> Hash256 { - Hash256::from_low_u64_be(restore_point_index) + Hash256::from_slice(&restore_point_index.to_le_bytes()) } /// Load a frozen state's slot, given its root. @@ -2422,7 +2422,7 @@ impl, Cold: ItemStore> HotColdDB AnchorInfo { anchor_slot: Slot::new(0), oldest_block_slot: Slot::new(0), - oldest_block_parent: Hash256::zero(), + oldest_block_parent: Hash256::ZERO, state_upper_limit: STATE_UPPER_LIMIT_NO_RETAIN, state_lower_limit: Slot::new(0), } diff --git a/beacon_node/store/src/impls/beacon_state.rs b/beacon_node/store/src/impls/beacon_state.rs index f752bf39795..48c289f2b2d 100644 --- a/beacon_node/store/src/impls/beacon_state.rs +++ b/beacon_node/store/src/impls/beacon_state.rs @@ -13,7 +13,7 @@ pub fn store_full_state( }; metrics::inc_counter_by(&metrics::BEACON_STATE_WRITE_BYTES, bytes.len() as u64); metrics::inc_counter(&metrics::BEACON_STATE_WRITE_COUNT); - let key = get_key_for_col(DBColumn::BeaconState.into(), state_root.as_bytes()); + let key = get_key_for_col(DBColumn::BeaconState.into(), state_root.as_slice()); ops.push(KeyValueStoreOp::PutKeyValue(key, bytes)); Ok(()) } @@ -25,7 +25,7 @@ pub fn get_full_state, E: EthSpec>( ) -> Result>, Error> { let total_timer = metrics::start_timer(&metrics::BEACON_STATE_READ_TIMES); - match db.get_bytes(DBColumn::BeaconState.into(), state_root.as_bytes())? { + match db.get_bytes(DBColumn::BeaconState.into(), state_root.as_slice())? { Some(bytes) => { let overhead_timer = metrics::start_timer(&metrics::BEACON_STATE_READ_OVERHEAD_TIMES); let container = StorageContainer::from_ssz_bytes(&bytes, spec)?; diff --git a/beacon_node/store/src/lib.rs b/beacon_node/store/src/lib.rs index 0247bea5541..3e28dbf538d 100644 --- a/beacon_node/store/src/lib.rs +++ b/beacon_node/store/src/lib.rs @@ -154,7 +154,7 @@ pub trait ItemStore: KeyValueStore + Sync + Send + Sized + 'stati /// Store an item in `Self`. fn put(&self, key: &Hash256, item: &I) -> Result<(), Error> { let column = I::db_column().into(); - let key = key.as_bytes(); + let key = key.as_slice(); self.put_bytes(column, key, &item.as_store_bytes()) .map_err(Into::into) @@ -162,7 +162,7 @@ pub trait ItemStore: KeyValueStore + Sync + Send + Sized + 'stati fn put_sync(&self, key: &Hash256, item: &I) -> Result<(), Error> { let column = I::db_column().into(); - let key = key.as_bytes(); + let key = key.as_slice(); self.put_bytes_sync(column, key, &item.as_store_bytes()) .map_err(Into::into) @@ -171,7 +171,7 @@ pub trait ItemStore: KeyValueStore + Sync + Send + Sized + 'stati /// Retrieve an item from `Self`. fn get(&self, key: &Hash256) -> Result, Error> { let column = I::db_column().into(); - let key = key.as_bytes(); + let key = key.as_slice(); match self.get_bytes(column, key)? { Some(bytes) => Ok(Some(I::from_store_bytes(&bytes[..])?)), @@ -182,7 +182,7 @@ pub trait ItemStore: KeyValueStore + Sync + Send + Sized + 'stati /// Returns `true` if the given key represents an item in `Self`. fn exists(&self, key: &Hash256) -> Result { let column = I::db_column().into(); - let key = key.as_bytes(); + let key = key.as_slice(); self.key_exists(column, key) } @@ -190,7 +190,7 @@ pub trait ItemStore: KeyValueStore + Sync + Send + Sized + 'stati /// Remove an item from `Self`. fn delete(&self, key: &Hash256) -> Result<(), Error> { let column = I::db_column().into(); - let key = key.as_bytes(); + let key = key.as_slice(); self.key_delete(column, key) } @@ -328,7 +328,7 @@ pub trait StoreItem: Sized { fn from_store_bytes(bytes: &[u8]) -> Result; fn as_kv_store_op(&self, key: Hash256) -> KeyValueStoreOp { - let db_key = get_key_for_col(Self::db_column().into(), key.as_bytes()); + let db_key = get_key_for_col(Self::db_column().into(), key.as_slice()); KeyValueStoreOp::PutKeyValue(db_key, self.as_store_bytes()) } } diff --git a/beacon_node/store/src/partial_beacon_state.rs b/beacon_node/store/src/partial_beacon_state.rs index 8f40b4b9241..8a66ec121e1 100644 --- a/beacon_node/store/src/partial_beacon_state.rs +++ b/beacon_node/store/src/partial_beacon_state.rs @@ -323,7 +323,7 @@ impl PartialBeaconState { /// Prepare the partial state for storage in the KV database. pub fn as_kv_store_op(&self, state_root: Hash256) -> KeyValueStoreOp { - let db_key = get_key_for_col(DBColumn::BeaconState.into(), state_root.as_bytes()); + let db_key = get_key_for_col(DBColumn::BeaconState.into(), state_root.as_slice()); KeyValueStoreOp::PutKeyValue(db_key, self.as_ssz_bytes()) } diff --git a/common/eth2/src/types.rs b/common/eth2/src/types.rs index 70aa5aab3e2..fd7fa615f41 100644 --- a/common/eth2/src/types.rs +++ b/common/eth2/src/types.rs @@ -1757,12 +1757,12 @@ impl TryFrom<&HeaderMap> for ProduceBlockV3Metadata { })?; let execution_payload_value = parse_required_header(headers, EXECUTION_PAYLOAD_VALUE_HEADER, |s| { - Uint256::from_dec_str(s) + Uint256::from_str(s) .map_err(|e| format!("invalid {EXECUTION_PAYLOAD_VALUE_HEADER}: {e:?}")) })?; let consensus_block_value = parse_required_header(headers, CONSENSUS_BLOCK_VALUE_HEADER, |s| { - Uint256::from_dec_str(s) + Uint256::from_str(s) .map_err(|e| format!("invalid {CONSENSUS_BLOCK_VALUE_HEADER}: {e:?}")) })?; diff --git a/common/eth2_network_config/src/lib.rs b/common/eth2_network_config/src/lib.rs index fb8c6938cdb..ddb543784e3 100644 --- a/common/eth2_network_config/src/lib.rs +++ b/common/eth2_network_config/src/lib.rs @@ -545,9 +545,9 @@ mod tests { let spec = &E::default_spec(); let eth1_data = Eth1Data { - deposit_root: Hash256::zero(), + deposit_root: Hash256::ZERO, deposit_count: 0, - block_hash: Hash256::zero(), + block_hash: Hash256::ZERO, }; // TODO: figure out how to generate ENR and add some here. diff --git a/consensus/fork_choice/src/fork_choice.rs b/consensus/fork_choice/src/fork_choice.rs index c55219a6761..0dc7b117dfe 100644 --- a/consensus/fork_choice/src/fork_choice.rs +++ b/consensus/fork_choice/src/fork_choice.rs @@ -397,7 +397,7 @@ where justified_hash: None, finalized_hash: None, // This will be updated during the next call to `Self::get_head`. - head_root: Hash256::zero(), + head_root: Hash256::ZERO, }, _phantom: PhantomData, }; @@ -1055,7 +1055,7 @@ where // (1) becomes weird once we hit finality and fork choice drops the genesis block. (2) is // fine because votes to the genesis block are not useful; all validators implicitly attest // to genesis just by being present in the chain. - if attestation.data().beacon_block_root == Hash256::zero() { + if attestation.data().beacon_block_root == Hash256::ZERO { return Ok(()); } @@ -1139,7 +1139,7 @@ where // Reset proposer boost if this is a new slot. if current_slot > previous_slot { - store.set_proposer_boost_root(Hash256::zero()); + store.set_proposer_boost_root(Hash256::ZERO); } // Not a new epoch, return. @@ -1465,7 +1465,7 @@ where justified_hash: None, finalized_hash: None, // Will be updated in the following call to `Self::get_head`. - head_root: Hash256::zero(), + head_root: Hash256::ZERO, }, _phantom: PhantomData, }; diff --git a/consensus/proto_array/src/fork_choice_test_definition.rs b/consensus/proto_array/src/fork_choice_test_definition.rs index 57648499753..41a7f9f6def 100644 --- a/consensus/proto_array/src/fork_choice_test_definition.rs +++ b/consensus/proto_array/src/fork_choice_test_definition.rs @@ -78,11 +78,11 @@ impl ForkChoiceTestDefinition { spec.proposer_score_boost = Some(50); let junk_shuffling_id = - AttestationShufflingId::from_components(Epoch::new(0), Hash256::zero()); + AttestationShufflingId::from_components(Epoch::new(0), Hash256::ZERO); let mut fork_choice = ProtoArrayForkChoice::new::( self.finalized_block_slot, self.finalized_block_slot, - Hash256::zero(), + Hash256::ZERO, self.justified_checkpoint, self.finalized_checkpoint, junk_shuffling_id.clone(), @@ -108,7 +108,7 @@ impl ForkChoiceTestDefinition { justified_checkpoint, finalized_checkpoint, &justified_balances, - Hash256::zero(), + Hash256::ZERO, &equivocating_indices, Slot::new(0), &spec, @@ -167,7 +167,7 @@ impl ForkChoiceTestDefinition { justified_checkpoint, finalized_checkpoint, &justified_balances, - Hash256::zero(), + Hash256::ZERO, &equivocating_indices, Slot::new(0), &spec, @@ -192,15 +192,15 @@ impl ForkChoiceTestDefinition { slot, root, parent_root: Some(parent_root), - state_root: Hash256::zero(), - target_root: Hash256::zero(), + state_root: Hash256::ZERO, + target_root: Hash256::ZERO, current_epoch_shuffling_id: AttestationShufflingId::from_components( Epoch::new(0), - Hash256::zero(), + Hash256::ZERO, ), next_epoch_shuffling_id: AttestationShufflingId::from_components( Epoch::new(0), - Hash256::zero(), + Hash256::ZERO, ), justified_checkpoint, finalized_checkpoint, @@ -287,7 +287,7 @@ impl ForkChoiceTestDefinition { /// Gives a root that is not the zero hash (unless i is `usize::MAX)`. fn get_root(i: u64) -> Hash256 { - Hash256::from_low_u64_be(i + 1) + Hash256::from_slice(&(i + 1).to_le_bytes()) } /// Gives a hash that is not the zero hash (unless i is `usize::MAX)`. diff --git a/consensus/proto_array/src/fork_choice_test_definition/no_votes.rs b/consensus/proto_array/src/fork_choice_test_definition/no_votes.rs index 27a7969e49b..65f430226f6 100644 --- a/consensus/proto_array/src/fork_choice_test_definition/no_votes.rs +++ b/consensus/proto_array/src/fork_choice_test_definition/no_votes.rs @@ -8,14 +8,14 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { Operation::FindHead { justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, justified_state_balances: balances.clone(), - expected_head: Hash256::zero(), + expected_head: Hash256::ZERO, }, // Add block 2 // @@ -25,14 +25,14 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { Operation::ProcessBlock { slot: Slot::new(1), root: get_root(2), - parent_root: Hash256::zero(), + parent_root: Hash256::ZERO, justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, }, // Ensure the head is 2 @@ -43,11 +43,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { Operation::FindHead { justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, justified_state_balances: balances.clone(), expected_head: get_root(2), @@ -63,11 +63,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { parent_root: get_root(0), justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, }, // Ensure the head is still 2 @@ -78,11 +78,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { Operation::FindHead { justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, justified_state_balances: balances.clone(), expected_head: get_root(2), @@ -100,11 +100,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { parent_root: get_root(1), justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, }, // Ensure 2 is still the head @@ -117,11 +117,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { Operation::FindHead { justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, justified_state_balances: balances.clone(), expected_head: get_root(2), @@ -139,11 +139,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { parent_root: get_root(2), justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, }, // Ensure the head is 4. @@ -156,11 +156,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { Operation::FindHead { justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, justified_state_balances: balances.clone(), expected_head: get_root(4), @@ -181,7 +181,7 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { justified_checkpoint: get_checkpoint(2), finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, }, // Ensure the head is now 5 whilst the justified epoch is 0. @@ -196,11 +196,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { Operation::FindHead { justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, justified_state_balances: balances.clone(), expected_head: get_root(5), @@ -226,7 +226,7 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, justified_state_balances: balances.clone(), expected_head: get_root(5), @@ -244,7 +244,7 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { justified_checkpoint: get_checkpoint(2), finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, justified_state_balances: balances.clone(), expected_head: get_root(5), @@ -267,7 +267,7 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { justified_checkpoint: get_checkpoint(2), finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, }, // Ensure 6 is the head @@ -285,7 +285,7 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { justified_checkpoint: get_checkpoint(2), finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, justified_state_balances: balances, expected_head: get_root(6), @@ -296,11 +296,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { finalized_block_slot: Slot::new(0), justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::zero(), + root: Hash256::ZERO, }, operations, } diff --git a/consensus/proto_array/src/proto_array.rs b/consensus/proto_array/src/proto_array.rs index efe154a27e1..7314dd4cbb0 100644 --- a/consensus/proto_array/src/proto_array.rs +++ b/consensus/proto_array/src/proto_array.rs @@ -119,7 +119,7 @@ pub struct ProposerBoost { impl Default for ProposerBoost { fn default() -> Self { Self { - root: Hash256::zero(), + root: Hash256::ZERO, score: 0, } } @@ -189,7 +189,7 @@ impl ProtoArray { // There is no need to adjust the balances or manage parent of the zero hash since it // is an alias to the genesis block. The weight applied to the genesis block is // irrelevant as we _always_ choose it and it's impossible for it to have a parent. - if node.root == Hash256::zero() { + if node.root == Hash256::ZERO { continue; } @@ -209,7 +209,7 @@ impl ProtoArray { // If we find the node for which the proposer boost was previously applied, decrease // the delta by the previous score amount. - if self.previous_proposer_boost.root != Hash256::zero() + if self.previous_proposer_boost.root != Hash256::ZERO && self.previous_proposer_boost.root == node.root // Invalid nodes will always have a weight of zero so there's no need to subtract // the proposer boost delta. @@ -224,7 +224,7 @@ impl ProtoArray { // // https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/fork-choice.md#get_latest_attesting_balance if let Some(proposer_score_boost) = spec.proposer_score_boost { - if proposer_boost_root != Hash256::zero() + if proposer_boost_root != Hash256::ZERO && proposer_boost_root == node.root // Invalid nodes (or their ancestors) should not receive a proposer boost. && !execution_status_is_invalid diff --git a/consensus/proto_array/src/proto_array_fork_choice.rs b/consensus/proto_array/src/proto_array_fork_choice.rs index 4b7050df7d7..a62e8b6760c 100644 --- a/consensus/proto_array/src/proto_array_fork_choice.rs +++ b/consensus/proto_array/src/proto_array_fork_choice.rs @@ -895,7 +895,7 @@ impl ProtoArrayForkChoice { /// ## Errors /// /// - If a value in `indices` is greater to or equal to `indices.len()`. -/// - If some `Hash256` in `votes` is not a key in `indices` (except for `Hash256::zero()`, this is +/// - If some `Hash256` in `votes` is not a key in `indices` (except for `Hash256::ZERO`, this is /// always valid). fn compute_deltas( indices: &HashMap, @@ -909,7 +909,7 @@ fn compute_deltas( for (val_index, vote) in votes.iter_mut().enumerate() { // There is no need to create a score change if the validator has never voted or both their // votes are for the zero hash (alias to the genesis block). - if vote.current_root == Hash256::zero() && vote.next_root == Hash256::zero() { + if vote.current_root == Hash256::ZERO && vote.next_root == Hash256::ZERO { continue; } @@ -939,7 +939,7 @@ fn compute_deltas( deltas[current_delta_index] = delta; } - vote.current_root = Hash256::zero(); + vote.current_root = Hash256::ZERO; } // We've handled this slashed validator, continue without applying an ordinary delta. continue; @@ -997,7 +997,7 @@ mod test_compute_deltas { /// Gives a hash that is not the zero hash (unless i is `usize::MAX)`. fn hash_from_index(i: usize) -> Hash256 { - Hash256::from_low_u64_be(i as u64 + 1) + Hash256::from_slice(&(i as u64 + 1).to_le_bytes()) } #[test] @@ -1005,13 +1005,13 @@ mod test_compute_deltas { let genesis_slot = Slot::new(0); let genesis_epoch = Epoch::new(0); - let state_root = Hash256::from_low_u64_be(0); - let finalized_root = Hash256::from_low_u64_be(1); - let finalized_desc = Hash256::from_low_u64_be(2); - let not_finalized_desc = Hash256::from_low_u64_be(3); - let unknown = Hash256::from_low_u64_be(4); + let state_root = Hash256::ZERO; + let finalized_root = Hash256::from_slice(&1u64.to_le_bytes()); + let finalized_desc = Hash256::from_slice(&2u64.to_le_bytes()); + let not_finalized_desc = Hash256::from_slice(&3u64.to_le_bytes()); + let unknown = Hash256::from_slice(&4u64.to_le_bytes()); let junk_shuffling_id = - AttestationShufflingId::from_components(Epoch::new(0), Hash256::zero()); + AttestationShufflingId::from_components(Epoch::new(0), Hash256::ZERO); let execution_status = ExecutionStatus::irrelevant(); let genesis_checkpoint = Checkpoint { @@ -1137,16 +1137,16 @@ mod test_compute_deltas { /// *checkpoint*, not just the finalized *block*. #[test] fn finalized_descendant_edge_case() { - let get_block_root = Hash256::from_low_u64_be; + let get_block_root = Hash256::from_slice; let genesis_slot = Slot::new(0); - let junk_state_root = Hash256::zero(); + let junk_state_root = Hash256::ZERO; let junk_shuffling_id = - AttestationShufflingId::from_components(Epoch::new(0), Hash256::zero()); + AttestationShufflingId::from_components(Epoch::new(0), Hash256::ZERO); let execution_status = ExecutionStatus::irrelevant(); let genesis_checkpoint = Checkpoint { epoch: Epoch::new(0), - root: get_block_root(0), + root: Hash256::ZERO, }; let mut fc = ProtoArrayForkChoice::new::( @@ -1172,15 +1172,15 @@ mod test_compute_deltas { .on_block::( Block { slot: Slot::from(block.slot), - root: get_block_root(block.root), - parent_root: Some(get_block_root(block.parent_root)), - state_root: Hash256::zero(), - target_root: Hash256::zero(), + root: get_block_root(&block.root.to_le_bytes()), + parent_root: Some(get_block_root(&block.parent_root.to_le_bytes())), + state_root: Hash256::ZERO, + target_root: Hash256::ZERO, current_epoch_shuffling_id: junk_shuffling_id.clone(), next_epoch_shuffling_id: junk_shuffling_id.clone(), justified_checkpoint: Checkpoint { epoch: Epoch::new(0), - root: get_block_root(0), + root: Hash256::ZERO, }, finalized_checkpoint: genesis_checkpoint, execution_status, @@ -1238,7 +1238,7 @@ mod test_compute_deltas { }, ); - let finalized_root = get_block_root(last_slot_of_epoch_0); + let finalized_root = get_block_root(&last_slot_of_epoch_0.to_le_bytes()); // Set the finalized checkpoint to finalize the first slot of epoch 1 on // the canonical chain. @@ -1256,14 +1256,14 @@ mod test_compute_deltas { assert!( fc.proto_array .is_finalized_checkpoint_or_descendant::(get_block_root( - canonical_slot + &canonical_slot.to_le_bytes() )), "the canonical block is a descendant of the finalized checkpoint" ); assert!( !fc.proto_array .is_finalized_checkpoint_or_descendant::(get_block_root( - non_canonical_slot + &non_canonical_slot.to_le_bytes() )), "although the non-canonical block is a descendant of the finalized block, \ it's not a descendant of the finalized checkpoint" @@ -1283,8 +1283,8 @@ mod test_compute_deltas { for i in 0..validator_count { indices.insert(hash_from_index(i), i); votes.0.push(VoteTracker { - current_root: Hash256::zero(), - next_root: Hash256::zero(), + current_root: Hash256::ZERO, + next_root: Hash256::ZERO, next_epoch: Epoch::new(0), }); old_balances.push(0); @@ -1334,7 +1334,7 @@ mod test_compute_deltas { for i in 0..validator_count { indices.insert(hash_from_index(i), i); votes.0.push(VoteTracker { - current_root: Hash256::zero(), + current_root: Hash256::ZERO, next_root: hash_from_index(0), next_epoch: Epoch::new(0), }); @@ -1392,7 +1392,7 @@ mod test_compute_deltas { for i in 0..validator_count { indices.insert(hash_from_index(i), i); votes.0.push(VoteTracker { - current_root: Hash256::zero(), + current_root: Hash256::ZERO, next_root: hash_from_index(i), next_epoch: Epoch::new(0), }); @@ -1510,14 +1510,14 @@ mod test_compute_deltas { // One validator moves their vote from the block to the zero hash. votes.0.push(VoteTracker { current_root: hash_from_index(1), - next_root: Hash256::zero(), + next_root: Hash256::ZERO, next_epoch: Epoch::new(0), }); // One validator moves their vote from the block to something outside the tree. votes.0.push(VoteTracker { current_root: hash_from_index(1), - next_root: Hash256::from_low_u64_be(1337), + next_root: Hash256::from_slice(&1337u64.to_le_bytes()), next_epoch: Epoch::new(0), }); @@ -1772,7 +1772,7 @@ mod test_compute_deltas { ); // Validator 0's current root should have been reset. - assert_eq!(votes.0[0].current_root, Hash256::zero()); + assert_eq!(votes.0[0].current_root, Hash256::ZERO); assert_eq!(votes.0[0].next_root, hash_from_index(2)); // Validator 1's current root should have been updated. diff --git a/consensus/state_processing/src/all_caches.rs b/consensus/state_processing/src/all_caches.rs index b915091405b..f6071f6f8fa 100644 --- a/consensus/state_processing/src/all_caches.rs +++ b/consensus/state_processing/src/all_caches.rs @@ -31,7 +31,7 @@ impl AllCaches for BeaconState { fn all_caches_built(&self) -> bool { let current_epoch = self.current_epoch(); let Ok(epoch_cache_decision_block_root) = - self.proposer_shuffling_decision_root(Hash256::zero()) + self.proposer_shuffling_decision_root(Hash256::ZERO) else { return false; }; diff --git a/consensus/state_processing/src/epoch_cache.rs b/consensus/state_processing/src/epoch_cache.rs index 0e940fabe4f..f31ed2b418c 100644 --- a/consensus/state_processing/src/epoch_cache.rs +++ b/consensus/state_processing/src/epoch_cache.rs @@ -119,7 +119,7 @@ pub fn is_epoch_cache_initialized( let current_epoch = state.current_epoch(); let epoch_cache: &EpochCache = state.epoch_cache(); let decision_block_root = state - .proposer_shuffling_decision_root(Hash256::zero()) + .proposer_shuffling_decision_root(Hash256::ZERO) .map_err(EpochCacheError::BeaconState)?; Ok(epoch_cache @@ -139,7 +139,7 @@ pub fn initialize_epoch_cache( let current_epoch = state.current_epoch(); let next_epoch = state.next_epoch().map_err(EpochCacheError::BeaconState)?; let decision_block_root = state - .proposer_shuffling_decision_root(Hash256::zero()) + .proposer_shuffling_decision_root(Hash256::ZERO) .map_err(EpochCacheError::BeaconState)?; state.build_total_active_balance_cache(spec)?; diff --git a/consensus/state_processing/src/genesis.rs b/consensus/state_processing/src/genesis.rs index c73417077ae..510ee06ce36 100644 --- a/consensus/state_processing/src/genesis.rs +++ b/consensus/state_processing/src/genesis.rs @@ -21,7 +21,7 @@ pub fn initialize_beacon_state_from_eth1( let genesis_time = eth2_genesis_time(eth1_timestamp, spec)?; let eth1_data = Eth1Data { // Temporary deposit root - deposit_root: Hash256::zero(), + deposit_root: Hash256::ZERO, deposit_count: deposits.len() as u64, block_hash: eth1_block_hash, }; diff --git a/consensus/state_processing/src/per_block_processing/verify_bls_to_execution_change.rs b/consensus/state_processing/src/per_block_processing/verify_bls_to_execution_change.rs index 1e8f25ed10b..24024fa8990 100644 --- a/consensus/state_processing/src/per_block_processing/verify_bls_to_execution_change.rs +++ b/consensus/state_processing/src/per_block_processing/verify_bls_to_execution_change.rs @@ -30,7 +30,7 @@ pub fn verify_bls_to_execution_change( verify!( validator .withdrawal_credentials - .as_bytes() + .as_slice() .first() .map(|byte| *byte == spec.bls_withdrawal_prefix_byte) .unwrap_or(false), @@ -41,7 +41,7 @@ pub fn verify_bls_to_execution_change( // future. let pubkey_hash = hash(address_change.from_bls_pubkey.as_serialized()); verify!( - validator.withdrawal_credentials.as_bytes().get(1..) == pubkey_hash.get(1..), + validator.withdrawal_credentials.as_slice().get(1..) == pubkey_hash.get(1..), Invalid::WithdrawalCredentialsMismatch ); diff --git a/consensus/state_processing/src/per_slot_processing.rs b/consensus/state_processing/src/per_slot_processing.rs index 6554423199f..dd6f5ca06cc 100644 --- a/consensus/state_processing/src/per_slot_processing.rs +++ b/consensus/state_processing/src/per_slot_processing.rs @@ -101,7 +101,7 @@ fn cache_state( state.set_state_root(previous_slot, previous_state_root)?; // Cache latest block header state root - if state.latest_block_header().state_root == Hash256::zero() { + if state.latest_block_header().state_root == Hash256::ZERO { state.latest_block_header_mut().state_root = previous_state_root; } diff --git a/consensus/state_processing/src/state_advance.rs b/consensus/state_processing/src/state_advance.rs index 721907cac93..c28f5ef49c2 100644 --- a/consensus/state_processing/src/state_advance.rs +++ b/consensus/state_processing/src/state_advance.rs @@ -73,7 +73,7 @@ pub fn partial_state_advance( // `state.block_roots` array, since the `state.latest_block_header` would contain an invalid // (all-zeros) state root. let mut initial_state_root = Some(if state.slot() > state.latest_block_header().slot { - state_root_opt.unwrap_or_else(Hash256::zero) + state_root_opt.unwrap_or_else(|| Hash256::ZERO) } else { state_root_opt.ok_or(Error::StateRootNotProvided)? }); @@ -85,7 +85,7 @@ pub fn partial_state_advance( // Failing to provide the correct state root on the initial iteration may result in // corrupting the `state.block_roots` array since the latest block header may not be updated // with the correct state root. - let state_root = initial_state_root.take().unwrap_or_else(Hash256::zero); + let state_root = initial_state_root.take().unwrap_or_else(|| Hash256::ZERO); per_slot_processing(state, Some(state_root), spec).map_err(Error::PerSlotProcessing)?; } diff --git a/consensus/types/src/graffiti.rs b/consensus/types/src/graffiti.rs index ee15c02947e..2c8305ad5ab 100644 --- a/consensus/types/src/graffiti.rs +++ b/consensus/types/src/graffiti.rs @@ -180,6 +180,6 @@ impl TreeHash for Graffiti { impl TestRandom for Graffiti { fn random_for_test(rng: &mut impl RngCore) -> Self { - Self::from(Hash256::random_for_test(rng).to_string()) + Self::from(GraffitiString(Hash256::random_for_test(rng).to_string())) } } diff --git a/slasher/src/database.rs b/slasher/src/database.rs index 4f4729a123f..f1434902ed9 100644 --- a/slasher/src/database.rs +++ b/slasher/src/database.rs @@ -174,7 +174,7 @@ impl IndexedAttestationIdKey { let mut data = [0; INDEXED_ATTESTATION_ID_KEY_SIZE]; data[0..8].copy_from_slice(&target_epoch.as_u64().to_be_bytes()); data[8..INDEXED_ATTESTATION_ID_KEY_SIZE] - .copy_from_slice(indexed_attestation_root.as_bytes()); + .copy_from_slice(indexed_attestation_root.as_slice()); Self { target_and_root: data, } diff --git a/slasher/src/test_utils.rs b/slasher/src/test_utils.rs index 453d0e66670..dd6fc38e737 100644 --- a/slasher/src/test_utils.rs +++ b/slasher/src/test_utils.rs @@ -20,14 +20,14 @@ pub fn indexed_att_electra( data: AttestationData { slot: Slot::new(0), index: 0, - beacon_block_root: Hash256::zero(), + beacon_block_root: Hash256::ZERO, source: Checkpoint { epoch: Epoch::new(source_epoch), - root: Hash256::from_low_u64_be(0), + root: Hash256::ZERO, }, target: Checkpoint { epoch: Epoch::new(target_epoch), - root: Hash256::from_low_u64_be(target_root), + root: Hash256::from_slice(&target_root.to_le_bytes()), }, }, signature: AggregateSignature::empty(), @@ -45,14 +45,14 @@ pub fn indexed_att( data: AttestationData { slot: Slot::new(0), index: 0, - beacon_block_root: Hash256::zero(), + beacon_block_root: Hash256::ZERO, source: Checkpoint { epoch: Epoch::new(source_epoch), - root: Hash256::from_low_u64_be(0), + root: Hash256::ZERO, }, target: Checkpoint { epoch: Epoch::new(target_epoch), - root: Hash256::from_low_u64_be(target_root), + root: Hash256::from_slice(&target_root.to_le_bytes()), }, }, signature: AggregateSignature::empty(), @@ -139,9 +139,9 @@ pub fn block(slot: u64, proposer_index: u64, block_root: u64) -> SignedBeaconBlo message: BeaconBlockHeader { slot: Slot::new(slot), proposer_index, - parent_root: Hash256::zero(), - state_root: Hash256::zero(), - body_root: Hash256::from_low_u64_be(block_root), + parent_root: Hash256::ZERO, + state_root: Hash256::ZERO, + body_root: Hash256::from_slice(&block_root.to_le_bytes()), }, signature: Signature::empty(), } diff --git a/testing/eth1_test_rig/src/lib.rs b/testing/eth1_test_rig/src/lib.rs index 55a71605940..921db9a0875 100644 --- a/testing/eth1_test_rig/src/lib.rs +++ b/testing/eth1_test_rig/src/lib.rs @@ -137,7 +137,7 @@ impl DepositContract { let mut deposit = DepositData { pubkey: keypair.pk.into(), - withdrawal_credentials: Hash256::zero(), + withdrawal_credentials: Hash256::ZERO, amount: 32_000_000_000, signature: Signature::empty().into(), }; @@ -163,7 +163,7 @@ impl DepositContract { let mut deposit = DepositData { pubkey: keypair.pk.into(), - withdrawal_credentials: Hash256::zero(), + withdrawal_credentials: Hash256::ZERO, amount, signature: Signature::empty().into(), }; diff --git a/testing/execution_engine_integration/Cargo.toml b/testing/execution_engine_integration/Cargo.toml index 43d24cd1237..bb1045efc7f 100644 --- a/testing/execution_engine_integration/Cargo.toml +++ b/testing/execution_engine_integration/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" edition = { workspace = true } [dependencies] +alloy-core = { workspace = true } async-channel = { workspace = true } tempfile = { workspace = true } serde_json = { workspace = true } @@ -14,7 +15,6 @@ execution_layer = { workspace = true } sensitive_url = { workspace = true } types = { workspace = true } unused_port = { workspace = true } -ethers-core = { workspace = true } ethers-providers = { workspace = true } deposit_contract = { workspace = true } reqwest = { workspace = true } diff --git a/validator_client/slashing_protection/src/attestation_tests.rs b/validator_client/slashing_protection/src/attestation_tests.rs index a162c4e150e..014fd229ee3 100644 --- a/validator_client/slashing_protection/src/attestation_tests.rs +++ b/validator_client/slashing_protection/src/attestation_tests.rs @@ -7,7 +7,7 @@ use types::{AttestationData, Checkpoint, Epoch, Slot}; pub fn build_checkpoint(epoch_num: u64) -> Checkpoint { Checkpoint { epoch: Epoch::from(epoch_num), - root: Hash256::zero(), + root: Hash256::ZERO, } } @@ -20,7 +20,7 @@ pub fn attestation_data_builder(source: u64, target: u64) -> AttestationData { AttestationData { slot, index, - beacon_block_root: Hash256::zero(), + beacon_block_root: Hash256::ZERO, source, target, } @@ -230,8 +230,8 @@ fn invalid_double_vote_diff_data() { #[test] fn invalid_double_vote_diff_domain() { let first = attestation_data_builder(0, 2); - let domain1 = Hash256::from_low_u64_le(1); - let domain2 = Hash256::from_low_u64_le(2); + let domain1 = Hash256::from_slice(&1u64.to_le_bytes()); + let domain2 = Hash256::from_slice(&2u64.to_le_bytes()); StreamTest { cases: vec![ diff --git a/validator_client/slashing_protection/src/bin/test_generator.rs b/validator_client/slashing_protection/src/bin/test_generator.rs index c95cb6917c5..690ebbbed4a 100644 --- a/validator_client/slashing_protection/src/bin/test_generator.rs +++ b/validator_client/slashing_protection/src/bin/test_generator.rs @@ -50,7 +50,7 @@ fn interchange_with_signing_roots( .into_iter() .map(|(slot, signing_root)| SignedBlock { slot: Slot::new(slot), - signing_root: signing_root.map(Hash256::from_low_u64_be), + signing_root: signing_root.map(|root| Hash256::from_slice(&root.to_le_bytes())), }) .collect(), signed_attestations: attestations @@ -58,7 +58,7 @@ fn interchange_with_signing_roots( .map(|(source, target, signing_root)| SignedAttestation { source_epoch: Epoch::new(source), target_epoch: Epoch::new(target), - signing_root: signing_root.map(Hash256::from_low_u64_be), + signing_root: signing_root.map(|root| Hash256::from_slice(&root.to_le_bytes())), }) .collect(), }) @@ -199,7 +199,7 @@ fn main() { "wrong_genesis_validators_root", TestCase::new(interchange(vec![])).should_fail(), ) - .gvr(Hash256::from_low_u64_be(1)), + .gvr(Hash256::from_slice(&1u64.to_le_bytes())), MultiTestCase::new( "multiple_interchanges_single_validator_single_message_gap", vec![ diff --git a/validator_client/slashing_protection/src/block_tests.rs b/validator_client/slashing_protection/src/block_tests.rs index abd452a0b67..510b592cb55 100644 --- a/validator_client/slashing_protection/src/block_tests.rs +++ b/validator_client/slashing_protection/src/block_tests.rs @@ -93,8 +93,8 @@ fn invalid_double_block_proposal() { #[test] fn invalid_double_block_proposal_diff_domain() { let first_block = block(1); - let domain1 = Hash256::from_low_u64_be(1); - let domain2 = Hash256::from_low_u64_be(2); + let domain1 = Hash256::from_slice(&1u64.to_le_bytes()); + let domain2 = Hash256::from_slice(&2u64.to_le_bytes()); StreamTest { cases: vec![ Test::single(first_block.clone()).with_domain(domain1), diff --git a/validator_client/slashing_protection/src/extra_interchange_tests.rs b/validator_client/slashing_protection/src/extra_interchange_tests.rs index dd1c1882158..d6f0ee8f210 100644 --- a/validator_client/slashing_protection/src/extra_interchange_tests.rs +++ b/validator_client/slashing_protection/src/extra_interchange_tests.rs @@ -15,7 +15,7 @@ fn export_non_existent_key() { // Exporting two non-existent keys should fail on the first one. let err = slashing_db - .export_interchange_info(Hash256::zero(), Some(&[key1, key2])) + .export_interchange_info(Hash256::ZERO, Some(&[key1, key2])) .unwrap_err(); assert!(matches!( err, @@ -26,7 +26,7 @@ fn export_non_existent_key() { // Exporting one key that exists and one that doesn't should fail on the one that doesn't. let err = slashing_db - .export_interchange_info(Hash256::zero(), Some(&[key1, key2])) + .export_interchange_info(Hash256::ZERO, Some(&[key1, key2])) .unwrap_err(); assert!(matches!( err, @@ -35,7 +35,7 @@ fn export_non_existent_key() { // Exporting only keys that exist should work. let interchange = slashing_db - .export_interchange_info(Hash256::zero(), Some(&[key1])) + .export_interchange_info(Hash256::ZERO, Some(&[key1])) .unwrap(); assert_eq!(interchange.data.len(), 1); assert_eq!(interchange.data[0].pubkey, key1); @@ -52,10 +52,10 @@ fn export_same_key_twice() { slashing_db.register_validator(key1).unwrap(); let export_single = slashing_db - .export_interchange_info(Hash256::zero(), Some(&[key1])) + .export_interchange_info(Hash256::ZERO, Some(&[key1])) .unwrap(); let export_double = slashing_db - .export_interchange_info(Hash256::zero(), Some(&[key1, key1])) + .export_interchange_info(Hash256::ZERO, Some(&[key1, key1])) .unwrap(); assert_eq!(export_single.data.len(), 1); diff --git a/validator_client/slashing_protection/src/interchange_test.rs b/validator_client/slashing_protection/src/interchange_test.rs index d99647bc936..7023534ac36 100644 --- a/validator_client/slashing_protection/src/interchange_test.rs +++ b/validator_client/slashing_protection/src/interchange_test.rs @@ -200,7 +200,7 @@ impl TestCase { TestBlock { pubkey: pubkey(pk), slot: Slot::new(slot), - signing_root: Hash256::from_low_u64_be(signing_root), + signing_root: Hash256::from_slice(&signing_root.to_le_bytes()), should_succeed, should_succeed_complete, } @@ -234,7 +234,7 @@ impl TestCase { pubkey: pubkey(pk), source_epoch: Epoch::new(source), target_epoch: Epoch::new(target), - signing_root: Hash256::from_low_u64_be(signing_root), + signing_root: Hash256::from_slice(&signing_root.to_le_bytes()), should_succeed, should_succeed_complete, } diff --git a/validator_client/slashing_protection/src/lib.rs b/validator_client/slashing_protection/src/lib.rs index e5606d4042a..e8ca93204aa 100644 --- a/validator_client/slashing_protection/src/lib.rs +++ b/validator_client/slashing_protection/src/lib.rs @@ -135,7 +135,7 @@ mod test { #[test] #[allow(clippy::eq_op)] fn signing_root_partial_eq() { - let h0 = SigningRoot(Hash256::zero()); + let h0 = SigningRoot(Hash256::ZERO); let h1 = SigningRoot(Hash256::repeat_byte(1)); let h2 = SigningRoot(Hash256::repeat_byte(2)); assert_ne!(h0, h0); diff --git a/validator_client/slashing_protection/src/slashing_database.rs b/validator_client/slashing_protection/src/slashing_database.rs index 04554786f6f..baaf930c68b 100644 --- a/validator_client/slashing_protection/src/slashing_database.rs +++ b/validator_client/slashing_protection/src/slashing_database.rs @@ -513,7 +513,7 @@ impl SlashingDatabase { txn.execute( "INSERT INTO signed_blocks (validator_id, slot, signing_root) VALUES (?1, ?2, ?3)", - params![validator_id, slot, signing_root.to_hash256_raw().as_bytes()], + params![validator_id, slot, signing_root.to_hash256_raw().as_slice()], )?; Ok(()) } @@ -539,7 +539,7 @@ impl SlashingDatabase { validator_id, att_source_epoch, att_target_epoch, - att_signing_root.to_hash256_raw().as_bytes() + att_signing_root.to_hash256_raw().as_slice() ], )?; Ok(()) diff --git a/validator_client/slashing_protection/src/test_utils.rs b/validator_client/slashing_protection/src/test_utils.rs index efdeb9bc6ba..8cbca12a10b 100644 --- a/validator_client/slashing_protection/src/test_utils.rs +++ b/validator_client/slashing_protection/src/test_utils.rs @@ -3,8 +3,8 @@ use tempfile::{tempdir, TempDir}; use types::{test_utils::generate_deterministic_keypair, AttestationData, BeaconBlockHeader}; pub const DEFAULT_VALIDATOR_INDEX: usize = 0; -pub const DEFAULT_DOMAIN: Hash256 = Hash256::zero(); -pub const DEFAULT_GENESIS_VALIDATORS_ROOT: Hash256 = Hash256::zero(); +pub const DEFAULT_DOMAIN: Hash256 = Hash256::ZERO; +pub const DEFAULT_GENESIS_VALIDATORS_ROOT: Hash256 = Hash256::ZERO; pub fn pubkey(index: usize) -> PublicKeyBytes { generate_deterministic_keypair(index).pk.compress() diff --git a/validator_client/slashing_protection/tests/migration.rs b/validator_client/slashing_protection/tests/migration.rs index cd3561f2114..3107470fea6 100644 --- a/validator_client/slashing_protection/tests/migration.rs +++ b/validator_client/slashing_protection/tests/migration.rs @@ -30,7 +30,7 @@ fn add_enabled_column() { let db = SlashingDatabase::open(&path).unwrap(); // Check that exporting an interchange file lists all the validators. - let interchange = db.export_all_interchange_info(Hash256::zero()).unwrap(); + let interchange = db.export_all_interchange_info(Hash256::ZERO).unwrap(); assert_eq!(interchange.data.len(), num_expected_validators); db.with_transaction(|txn| { From 4063495f630f09831b9f601ff44b419152b1c998 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Thu, 11 Jul 2024 16:44:17 +0100 Subject: [PATCH 12/62] add TODOs --- beacon_node/execution_layer/src/lib.rs | 5 ++++- consensus/types/src/chain_spec.rs | 2 +- consensus/types/src/subnet_id.rs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index 4f9986bed35..d7818168e87 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -2195,7 +2195,10 @@ fn verify_builder_bid( metrics::set_gauge_vec( &metrics::EXECUTION_LAYER_PAYLOAD_BIDS, &[metrics::BUILDER], - payload_value_gwei.low_u64() as i64, + + // TODO(alloy) display as a u64 + 0 + // payload_value_gwei.to_base_le(10) as i64, ); } diff --git a/consensus/types/src/chain_spec.rs b/consensus/types/src/chain_spec.rs index a4bacb9a2e1..5ad9b96e16e 100644 --- a/consensus/types/src/chain_spec.rs +++ b/consensus/types/src/chain_spec.rs @@ -1338,7 +1338,7 @@ fn default_electra_fork_version() -> [u8; 4] { /// /// Taken from https://github.com/ethereum/consensus-specs/blob/d5e4828aecafaf1c57ef67a5f23c4ae7b08c5137/configs/mainnet.yaml#L15-L16 const fn default_terminal_total_difficulty() -> Uint256 { - // TODO alloy + // TODO(alloy) todo!() // Uint256([ // 18446744073709550592, diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index cfc8c71a3e4..da1847c3ca3 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -90,7 +90,7 @@ impl SubnetId { let shuffling_prefix_bits = spec.attestation_subnet_shuffling_prefix_bits as u64; // calculate the prefixes used to compute the subnet and shuffling - // TODO alloy + // TODO(alloy) rshift impl let node_id_prefix = 064; // (node_id >> (256 - prefix_bits)).as_u64(); let shuffling_prefix = 064; // (node_id >> (256 - (prefix_bits + shuffling_prefix_bits))).as_u64(); From 8361d4bf8e744a52c1dd3316081d005ccfa4c374 Mon Sep 17 00:00:00 2001 From: dospore Date: Mon, 15 Jul 2024 08:30:31 +1000 Subject: [PATCH 13/62] Revert lock --- Cargo.lock | 590 +++++++++++++++++++++++------------------------------ 1 file changed, 257 insertions(+), 333 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 689c4e36909..f7796dd5f25 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -245,9 +245,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.7" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" +checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -256,13 +256,13 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.7" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83524c1f6162fcb5b0decf775498a125066c86dda6066ed609531b0e912f85a" +checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -318,9 +318,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ "windows-sys 0.52.0", ] @@ -531,7 +531,7 @@ checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", "synstructure", ] @@ -543,7 +543,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -565,9 +565,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.3" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" dependencies = [ "async-lock", "cfg-if", @@ -584,11 +584,11 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.4.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener 5.3.1", + "event-listener 4.0.3", "event-listener-strategy", "pin-project-lite", ] @@ -601,7 +601,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -671,7 +671,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -693,7 +693,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.4.0", + "hyper 1.3.1", "hyper-util", "itoa", "matchit", @@ -737,9 +737,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" dependencies = [ "addr2line", "cc", @@ -869,7 +869,7 @@ dependencies = [ "genesis", "hex", "http_api", - "hyper 1.4.0", + "hyper 1.3.1", "lighthouse_network", "monitoring_api", "node_test_rig", @@ -922,7 +922,7 @@ version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "cexpr", "clang-sys", "itertools", @@ -933,7 +933,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -959,9 +959,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bitvec" @@ -1040,9 +1040,9 @@ dependencies = [ [[package]] name = "blst" -version = "0.3.12" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62dc83a094a71d43eeadd254b1ec2d24cb6a0bb6cadce00df51f0db594711a32" +checksum = "c94087b935a822949d3291a9989ad2b2051ea141eda0fd4e478a75f6aa3e604b" dependencies = [ "cc", "glob", @@ -1209,9 +1209,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.104" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" dependencies = [ "jobserver", "libc", @@ -1272,7 +1272,7 @@ dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -1324,9 +1324,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +checksum = "f803f94ecf597339c7a34eed2036ef83f86aaba937f001f7c5b5e251f043f1f9" dependencies = [ "glob", "libc", @@ -1335,9 +1335,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.8" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -1345,9 +1345,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.8" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -1370,9 +1370,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "clap_utils" @@ -1737,7 +1737,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -1746,18 +1746,8 @@ version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", -] - -[[package]] -name = "darling" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" -dependencies = [ - "darling_core 0.20.9", - "darling_macro 0.20.9", + "darling_core", + "darling_macro", ] [[package]] @@ -1774,42 +1764,17 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "darling_core" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.11.1", - "syn 2.0.68", -] - [[package]] name = "darling_macro" version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", "syn 1.0.109", ] -[[package]] -name = "darling_macro" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" -dependencies = [ - "darling_core 0.20.9", - "quote", - "syn 2.0.68", -] - [[package]] name = "darwin-libproc" version = "0.1.2" @@ -1972,29 +1937,29 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] name = "derive_more" -version = "0.99.18" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.68", + "syn 1.0.109", ] [[package]] name = "diesel" -version = "2.2.1" +version = "2.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62d6dcd069e7b5fe49a302411f759d4cf1cf2c27fe798ef46fb8baefc053dd2b" +checksum = "ff236accb9a5069572099f0b350a92e9560e8e63a9b8d546162f4a5e03026bb2" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "byteorder", "diesel_derives", "itoa", @@ -2004,22 +1969,21 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.2.1" +version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59de76a222c2b8059f789cbe07afbfd8deb8c31dd0bc2a21f85e256c1def8259" +checksum = "14701062d6bed917b5c7103bdffaee1e4609279e240488ad24e7bd979ca6866c" dependencies = [ "diesel_table_macro_syntax", - "dsl_auto_type", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] name = "diesel_migrations" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a73ce704bad4231f001bff3314d91dce4aba0770cee8b233991859abc15c1f6" +checksum = "6036b3f0120c5961381b570ee20a02432d7e2d27ea60de9578799cf9156914ac" dependencies = [ "diesel", "migrations_internals", @@ -2028,11 +1992,11 @@ dependencies = [ [[package]] name = "diesel_table_macro_syntax" -version = "0.2.0" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" +checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -2139,27 +2103,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "dsl_auto_type" -version = "0.1.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0892a17df262a24294c382f0d5997571006e7a4348b4327557c4ff1cd4a8bccc" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ - "darling 0.20.9", - "either", - "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -2259,9 +2209,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" @@ -2339,7 +2289,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -2715,9 +2665,9 @@ dependencies = [ [[package]] name = "ethereum_ssz" -version = "0.5.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3627f83d8b87b432a5fad9934b4565260722a141a2c40f371f8080adec9425" +checksum = "e61ffea29f26e8249d35128a82ec8d3bd4fbc80179ea5f5e5e3daafef6a80fcb" dependencies = [ "ethereum-types 0.14.1", "itertools", @@ -2726,11 +2676,11 @@ dependencies = [ [[package]] name = "ethereum_ssz_derive" -version = "0.5.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eccd5378ec34a07edd3d9b48088cbc63309d0367d14ba10b0cdb1d1791080ea" +checksum = "6085d7fd3cf84bd2b8fec150d54c8467fb491d8db9c460607c5534f653a0ee38" dependencies = [ - "darling 0.13.4", + "darling", "proc-macro2", "quote", "syn 1.0.109", @@ -2867,9 +2817,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "5.3.1" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ "concurrent-queue", "parking", @@ -2878,11 +2828,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 5.3.1", + "event-listener 4.0.3", "pin-project-lite", ] @@ -3180,9 +3130,9 @@ dependencies = [ [[package]] name = "futures-bounded" -version = "0.2.4" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91f328e7fb845fc832912fb6a34f40cf6d1888c92f974d1893a54e97b5ff542e" +checksum = "e1e2774cc104e198ef3d3e1ff4ab40f86fa3245d6cb6a3a46174f21463cee173" dependencies = [ "futures-timer", "futures-util", @@ -3240,7 +3190,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -3250,7 +3200,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.23.10", + "rustls 0.23.8", "rustls-pki-types", ] @@ -3398,7 +3348,7 @@ checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -3598,12 +3548,6 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - [[package]] name = "hex" version = "0.4.3" @@ -3776,12 +3720,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" dependencies = [ "bytes", - "futures-util", + "futures-core", "http 1.1.0", "http-body 1.0.0", "pin-project-lite", @@ -3857,9 +3801,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -3875,9 +3819,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.29" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -3899,9 +3843,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", @@ -3924,7 +3868,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.29", + "hyper 0.14.28", "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", @@ -3937,7 +3881,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.29", + "hyper 0.14.28", "native-tls", "tokio", "tokio-native-tls", @@ -3945,15 +3889,15 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" dependencies = [ "bytes", "futures-util", "http 1.1.0", "http-body 1.0.0", - "hyper 1.4.0", + "hyper 1.3.1", "pin-project-lite", "tokio", ] @@ -4047,7 +3991,7 @@ dependencies = [ "bytes", "futures", "http 0.2.12", - "hyper 0.14.29", + "hyper 0.14.28", "log", "rand", "tokio", @@ -4374,11 +4318,11 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin 0.9.8", + "spin 0.5.2", ] [[package]] @@ -4477,12 +4421,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -4632,9 +4576,9 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.2.9" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8" +checksum = "999ec70441b2fb35355076726a6bc466c932e9bdc66f6a11c6c0aa17c7ab9be0" dependencies = [ "asn1_der", "bs58 0.5.1", @@ -4768,7 +4712,7 @@ dependencies = [ "quinn", "rand", "ring 0.17.8", - "rustls 0.23.10", + "rustls 0.23.8", "socket2 0.5.7", "thiserror", "tokio", @@ -4808,7 +4752,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -4840,7 +4784,7 @@ dependencies = [ "libp2p-identity", "rcgen", "ring 0.17.8", - "rustls 0.23.10", + "rustls 0.23.8", "rustls-webpki 0.101.7", "thiserror", "x509-parser", @@ -4875,7 +4819,7 @@ dependencies = [ "thiserror", "tracing", "yamux 0.12.1", - "yamux 0.13.3", + "yamux 0.13.2", ] [[package]] @@ -4884,7 +4828,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "libc", ] @@ -5129,9 +5073,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "logging" @@ -5264,9 +5208,9 @@ checksum = "8878cd8d1b3c8c8ae4b2ba0a36652b7cf192f618a599a7fbdfa25cffd4ea72dd" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memoffset" @@ -5304,7 +5248,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37cb4045d5677b7da537f8cb5d0730d5b6414e3cc81c61e4b50e1f0cbdc73909" dependencies = [ - "darling 0.13.4", + "darling", "itertools", "proc-macro2", "quote", @@ -5314,19 +5258,19 @@ dependencies = [ [[package]] name = "migrations_internals" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd01039851e82f8799046eabbb354056283fb265c8ec0996af940f4e85a380ff" +checksum = "0f23f71580015254b020e856feac3df5878c2c7a8812297edd6c0a485ac9dada" dependencies = [ "serde", - "toml 0.8.14", + "toml 0.7.8", ] [[package]] name = "migrations_macros" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb161cc72176cb37aa47f1fc520d3ef02263d67d661f44f05d05a079e1237fd" +checksum = "cce3325ac70e67bbab5bd837a31cae01f1a6db64e0e744a33cb03a543469ef08" dependencies = [ "migrations_internals", "proc-macro2", @@ -5364,9 +5308,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.5" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" dependencies = [ "mime", "unicase", @@ -5380,9 +5324,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] @@ -5629,7 +5573,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "cfg-if", "cfg_aliases", "libc", @@ -5688,9 +5632,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ "num-integer", "num-traits", @@ -5762,9 +5706,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.1" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" dependencies = [ "memchr", ] @@ -5834,7 +5778,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "cfg-if", "foreign-types", "libc", @@ -5851,7 +5795,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -5862,9 +5806,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.3.1+3.3.1" +version = "300.3.0+3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" +checksum = "eba8804a1c5765b18c4b3f907e6897ebabeedebc9830e1a0046c4a4cf44663e1" dependencies = [ "cc", ] @@ -6024,9 +5968,9 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.2", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -6103,9 +6047,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.11" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" dependencies = [ "memchr", "thiserror", @@ -6157,7 +6101,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -6234,13 +6178,13 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.2" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi 0.4.0", + "hermit-abi 0.3.9", "pin-project-lite", "rustix 0.38.34", "tracing", @@ -6325,9 +6269,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "pq-sys" -version = "0.6.1" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a24ff9e4cf6945c988f0db7005d87747bf72864965c3529d259ad155ac41d584" +checksum = "31c0052426df997c0cbd30789eb44ca097e3541717a7b8fa36b1c464ee7edebd" dependencies = [ "vcpkg", ] @@ -6397,9 +6341,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" dependencies = [ "unicode-ident", ] @@ -6454,24 +6398,24 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] name = "proptest" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.6.0", + "bitflags 2.5.0", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.8.4", + "regex-syntax 0.8.3", "rusty-fork", "tempfile", "unarray", @@ -6580,9 +6524,9 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +checksum = "904e3d3ba178131798c6d9375db2b13b34337d489b089fc5ba0825a2ff1bee73" dependencies = [ "bytes", "futures-io", @@ -6590,7 +6534,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.10", + "rustls 0.23.8", "thiserror", "tokio", "tracing", @@ -6598,15 +6542,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.3" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +checksum = "e974563a4b1c2206bbc61191ca4da9c22e4308b4c455e8906751cc7828393f08" dependencies = [ "bytes", "rand", "ring 0.17.8", "rustc-hash", - "rustls 0.23.10", + "rustls 0.23.8", "slab", "thiserror", "tinyvec", @@ -6615,9 +6559,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +checksum = "e4f0def2590301f4f667db5a77f9694fb004f82796dc1a8b1508fafa3d0e8b72" dependencies = [ "libc", "once_cell", @@ -6768,11 +6712,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", ] [[package]] @@ -6788,14 +6732,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -6809,13 +6753,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.3", ] [[package]] @@ -6826,9 +6770,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" @@ -6844,7 +6788,7 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.29", + "hyper 0.14.28", "hyper-rustls", "hyper-tls", "ipnet", @@ -7000,9 +6944,9 @@ dependencies = [ [[package]] name = "ruint" -version = "1.12.3" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" +checksum = "8f308135fef9fc398342da5472ce7c484529df23743fb7c734e0f3d472971e62" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", @@ -7024,9 +6968,9 @@ dependencies = [ [[package]] name = "ruint-macro" -version = "1.2.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" +checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" [[package]] name = "rusqlite" @@ -7107,7 +7051,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys 0.4.14", @@ -7135,21 +7079,21 @@ dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.5", + "rustls-webpki 0.102.4", "subtle", "zeroize", ] [[package]] name = "rustls" -version = "0.23.10" +version = "0.23.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +checksum = "79adb16721f56eb2d843e67676896a61ce7a0fa622dc18d3e372477a029d2740" dependencies = [ "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.5", + "rustls-webpki 0.102.4", "subtle", "zeroize", ] @@ -7191,9 +7135,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.5" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -7367,7 +7311,7 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", @@ -7452,14 +7396,14 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -7484,7 +7428,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -7524,7 +7468,7 @@ version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ - "darling 0.13.4", + "darling", "proc-macro2", "quote", "syn 1.0.109", @@ -8106,9 +8050,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.6.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "superstruct" @@ -8116,7 +8060,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf0f31f730ad9e579364950e10d6172b4a9bd04b447edf5988b066a860cc340e" dependencies = [ - "darling 0.13.4", + "darling", "itertools", "proc-macro2", "quote", @@ -8146,9 +8090,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.68" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -8175,7 +8119,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -8356,7 +8300,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -8460,9 +8404,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -8475,9 +8419,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -8503,13 +8447,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -8607,14 +8551,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.14" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.14", + "toml_edit 0.19.15", ] [[package]] @@ -8633,8 +8577,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.2.6", + "serde", + "serde_spanned", "toml_datetime", - "winnow 0.5.40", + "winnow", ] [[package]] @@ -8645,20 +8591,7 @@ checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap 2.2.6", "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" -dependencies = [ - "indexmap 2.2.6", - "serde", - "serde_spanned", - "toml_datetime", - "winnow 0.6.13", + "winnow", ] [[package]] @@ -8721,7 +8654,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -8809,7 +8742,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce7bccc538359a213436af7bc95804bdbf1c2a21d80e22953cbe9e096837ff1" dependencies = [ - "darling 0.13.4", + "darling", "quote", "syn 1.0.109", ] @@ -8826,9 +8759,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.13" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" +checksum = "1b2cb4fbb9995eeb36ac86fadf24031ccd58f99d6b4b2d7b911db70bddb80d90" dependencies = [ "serde", "stable_deref_trait", @@ -9041,9 +8974,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna 0.5.0", @@ -9052,9 +8985,9 @@ dependencies = [ [[package]] name = "utf8parse" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" @@ -9086,7 +9019,7 @@ dependencies = [ "filesystem", "futures", "hex", - "hyper 1.4.0", + "hyper 1.3.1", "itertools", "lazy_static", "libsecp256k1", @@ -9232,7 +9165,7 @@ dependencies = [ "futures-util", "headers", "http 0.2.12", - "hyper 0.14.29", + "hyper 0.14.28", "log", "mime", "mime_guess", @@ -9303,7 +9236,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -9337,7 +9270,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -9391,7 +9324,7 @@ dependencies = [ "env_logger 0.9.3", "eth2", "http_api", - "hyper 1.4.0", + "hyper 1.3.1", "log", "logging", "network", @@ -9553,7 +9486,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -9580,7 +9513,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -9615,18 +9548,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -9643,9 +9576,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -9661,9 +9594,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -9679,15 +9612,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" [[package]] name = "windows_i686_gnullvm" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -9703,9 +9636,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -9721,9 +9654,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -9739,9 +9672,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -9757,9 +9690,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" @@ -9770,15 +9703,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winnow" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" -dependencies = [ - "memchr", -] - [[package]] name = "winreg" version = "0.50.0" @@ -9869,9 +9793,9 @@ dependencies = [ [[package]] name = "yaml-rust2" -version = "0.8.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8902160c4e6f2fb145dbe9d6760a75e3c9522d8bf796ed7047c85919ac7115f8" +checksum = "498f4d102a79ea1c9d4dd27573c0fc96ad74c023e8da38484e47883076da25fb" dependencies = [ "arraydeque", "encoding_rs", @@ -9895,18 +9819,18 @@ dependencies = [ [[package]] name = "yamux" -version = "0.13.3" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31b5e376a8b012bee9c423acdbb835fc34d45001cfa3106236a624e4b738028" +checksum = "5f97202f6b125031b95d83e01dc57292b529384f80bfae4677e4bbc10178cf72" dependencies = [ "futures", + "instant", "log", "nohash-hasher", "parking_lot 0.12.3", "pin-project", "rand", "static_assertions", - "web-time", ] [[package]] @@ -9920,22 +9844,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -9955,7 +9879,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.66", ] [[package]] @@ -9999,9 +9923,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.11+zstd.1.5.6" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75652c55c0b6f3e6f12eb786fe1bc960396bf05a1eb3bf1f3691c3610ac2e6d4" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", "pkg-config", From e3ce7fc5eae558da117b41ca7abbd6e03f4e420d Mon Sep 17 00:00:00 2001 From: dapplion <35266934+dapplion@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:36:05 +0200 Subject: [PATCH 14/62] Add BeaconBlocksByRange v3 --- beacon_node/network/src/sync/block_lookups/mod.rs | 2 +- beacon_node/network/src/sync/range_sync/chain.rs | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/beacon_node/network/src/sync/block_lookups/mod.rs b/beacon_node/network/src/sync/block_lookups/mod.rs index 0a44cf2fdf5..43bae1f9601 100644 --- a/beacon_node/network/src/sync/block_lookups/mod.rs +++ b/beacon_node/network/src/sync/block_lookups/mod.rs @@ -53,7 +53,7 @@ mod tests; /// The maximum depth we will search for a parent block. In principle we should have sync'd any /// canonical chain to its head once the peer connects. A chain should not appear where it's depth /// is further back than the most recent head slot. -pub(crate) const PARENT_DEPTH_TOLERANCE: usize = SLOT_IMPORT_TOLERANCE * 2; +pub(crate) const PARENT_DEPTH_TOLERANCE: usize = SLOT_IMPORT_TOLERANCE + 1; const FAILED_CHAINS_CACHE_EXPIRY_SECONDS: u64 = 60; pub const SINGLE_BLOCK_LOOKUP_MAX_ATTEMPTS: u8 = 4; diff --git a/beacon_node/network/src/sync/range_sync/chain.rs b/beacon_node/network/src/sync/range_sync/chain.rs index a735001fed3..0e4058dddf1 100644 --- a/beacon_node/network/src/sync/range_sync/chain.rs +++ b/beacon_node/network/src/sync/range_sync/chain.rs @@ -11,6 +11,7 @@ use rand::{seq::SliceRandom, Rng}; use slog::{crit, debug, o, warn}; use std::collections::{btree_map::Entry, BTreeMap, HashSet}; use std::hash::{Hash, Hasher}; +use std::time::Instant; use types::{Epoch, EthSpec, Hash256, Slot}; /// Blocks are downloaded in batches from peers. This constant specifies how many epochs worth of @@ -109,6 +110,9 @@ pub struct SyncingChain { pub enum ChainSyncingState { /// The chain is not being synced. Stopped, + /// The chain should not download any more batches, but should attempt to processing everything + /// that is already downloaded. + Stopping(Instant), /// The chain is undergoing syncing. Syncing, } @@ -866,6 +870,11 @@ impl SyncingChain { network: &mut SyncNetworkContext, batch_id: BatchId, ) -> ProcessingResult { + // If chain is stopping do not request any more batches. + if matches!(self.state, ChainSyncingState::Stopping) { + return Ok(KeepChain); + } + let Some(batch) = self.batches.get_mut(&batch_id) else { return Ok(KeepChain); }; @@ -972,7 +981,7 @@ impl SyncingChain { pub fn is_syncing(&self) -> bool { match self.state { ChainSyncingState::Syncing => true, - ChainSyncingState::Stopped => false, + ChainSyncingState::Stopped | ChainSyncingState::Stopping { .. } => false, } } @@ -991,6 +1000,7 @@ impl SyncingChain { /// Attempts to request the next required batches from the peer pool if the chain is syncing. It will exhaust the peer /// pool and left over batches until the batch buffer is reached or all peers are exhausted. fn request_batches(&mut self, network: &mut SyncNetworkContext) -> ProcessingResult { + // If chain is stopped or stopping do not request any more batches. if !matches!(self.state, ChainSyncingState::Syncing) { return Ok(KeepChain); } From 21b22de72248eb740b07c6fb7fa1dc55fb157fad Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 15 Jul 2024 16:47:21 +0100 Subject: [PATCH 15/62] continue migration --- .../beacon_chain/src/attester_cache.rs | 2 +- .../beacon_chain/src/beacon_block_streamer.rs | 4 +-- beacon_node/beacon_chain/src/beacon_chain.rs | 26 +++++++------- .../src/beacon_fork_choice_store.rs | 4 +-- .../beacon_chain/src/block_times_cache.rs | 2 +- beacon_node/beacon_chain/src/builder.rs | 4 +-- .../overflow_lru_cache.rs | 12 +++---- beacon_node/beacon_chain/src/eth1_chain.rs | 2 +- .../beacon_chain/src/historical_blocks.rs | 2 +- beacon_node/beacon_chain/src/migrate.rs | 2 +- .../beacon_chain/src/observed_attesters.rs | 4 +-- beacon_node/beacon_chain/src/test_utils.rs | 18 +++++----- .../beacon_chain/tests/block_verification.rs | 18 +++++----- beacon_node/beacon_chain/tests/store_tests.rs | 14 ++++---- .../tests/sync_committee_verification.rs | 8 ++--- beacon_node/eth1/tests/test.rs | 2 +- .../test_utils/execution_block_generator.rs | 2 +- .../src/test_utils/mock_execution_layer.rs | 2 +- .../genesis/src/eth1_genesis_service.rs | 6 ++-- beacon_node/http_api/src/block_id.rs | 2 +- .../tests/broadcast_validation_tests.rs | 34 +++++++++---------- beacon_node/http_api/tests/tests.rs | 14 ++++---- .../network_beacon_processor/rpc_methods.rs | 4 +-- beacon_node/network/src/persisted_dht.rs | 2 +- beacon_node/network/src/status.rs | 2 +- .../network/src/sync/range_sync/range.rs | 4 +-- beacon_node/operation_pool/src/lib.rs | 26 +++++++------- consensus/fork_choice/src/fork_choice.rs | 2 +- consensus/fork_choice/tests/tests.rs | 10 +++--- .../src/fork_choice_test_definition.rs | 2 +- .../src/proto_array_fork_choice.rs | 22 ++++++------ .../src/per_block_processing/tests.rs | 2 +- .../src/per_epoch_processing/tests.rs | 2 +- consensus/types/benches/benches.rs | 4 +-- .../src/beacon_state/committee_cache/tests.rs | 2 +- consensus/types/src/beacon_state/tests.rs | 2 +- consensus/types/src/sync_selection_proof.rs | 2 +- crypto/bls/tests/tests.rs | 12 +++---- lcli/src/generate_bootnode_enr.rs | 2 +- slasher/src/test_utils.rs | 6 ++-- .../src/test_rig.rs | 8 ++--- .../src/transactions.rs | 2 +- testing/state_transition_vectors/src/main.rs | 2 +- testing/web3signer_tests/src/lib.rs | 2 +- .../src/attestation_tests.rs | 4 +-- .../src/bin/test_generator.rs | 4 +-- .../slashing_protection/src/block_tests.rs | 4 +-- .../src/interchange_test.rs | 4 +-- .../src/http_api/tests/keystores.rs | 2 +- 49 files changed, 162 insertions(+), 162 deletions(-) diff --git a/beacon_node/beacon_chain/src/attester_cache.rs b/beacon_node/beacon_chain/src/attester_cache.rs index b5012e8e4e4..67484d46582 100644 --- a/beacon_node/beacon_chain/src/attester_cache.rs +++ b/beacon_node/beacon_chain/src/attester_cache.rs @@ -229,7 +229,7 @@ impl AttesterCacheKey { let decision_root = if decision_slot.epoch(slots_per_epoch) == epoch { // This scenario is only possible during the genesis epoch. In this scenario, all-zeros // is used as an alias to the genesis block. - Hash256::zero() + Hash256::ZERO } else if epoch > state.current_epoch() { // If the requested epoch is higher than the current epoch, the latest block will always // be the decision root. diff --git a/beacon_node/beacon_chain/src/beacon_block_streamer.rs b/beacon_node/beacon_chain/src/beacon_block_streamer.rs index f0a68b6be55..6008c9a1c81 100644 --- a/beacon_node/beacon_chain/src/beacon_block_streamer.rs +++ b/beacon_node/beacon_chain/src/beacon_block_streamer.rs @@ -830,7 +830,7 @@ mod tests { for epoch in 0..num_epochs { let start = epoch * slots_per_epoch; - let mut epoch_roots = vec![Hash256::zero(); slots_per_epoch]; + let mut epoch_roots = vec![Hash256::ZERO; slots_per_epoch]; epoch_roots[..].clone_from_slice(&block_roots[start..(start + slots_per_epoch)]); let streamer = BeaconBlockStreamer::new(&harness.chain, CheckCaches::No) .expect("should create streamer"); @@ -973,7 +973,7 @@ mod tests { for epoch in 0..num_epochs { let start = epoch * slots_per_epoch; - let mut epoch_roots = vec![Hash256::zero(); slots_per_epoch]; + let mut epoch_roots = vec![Hash256::ZERO; slots_per_epoch]; epoch_roots[..].clone_from_slice(&block_roots[start..(start + slots_per_epoch)]); let streamer = BeaconBlockStreamer::new(&harness.chain, CheckCaches::No) .expect("should create streamer"); diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index 7f09430227f..5b03cd8deae 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -143,10 +143,10 @@ pub const VALIDATOR_PUBKEY_CACHE_LOCK_TIMEOUT: Duration = Duration::from_secs(1) pub const ETH1_FINALIZATION_CACHE_LOCK_TIMEOUT: Duration = Duration::from_millis(200); // These keys are all zero because they get stored in different columns, see `DBColumn` type. -pub const BEACON_CHAIN_DB_KEY: Hash256 = Hash256::zero(); -pub const OP_POOL_DB_KEY: Hash256 = Hash256::zero(); -pub const ETH1_CACHE_DB_KEY: Hash256 = Hash256::zero(); -pub const FORK_CHOICE_DB_KEY: Hash256 = Hash256::zero(); +pub const BEACON_CHAIN_DB_KEY: Hash256 = Hash256::ZERO; +pub const OP_POOL_DB_KEY: Hash256 = Hash256::ZERO; +pub const ETH1_CACHE_DB_KEY: Hash256 = Hash256::ZERO; +pub const FORK_CHOICE_DB_KEY: Hash256 = Hash256::ZERO; /// Defines how old a block can be before it's no longer a candidate for the early attester cache. const EARLY_ATTESTER_CACHE_HISTORIC_SLOTS: u64 = 4; @@ -1415,7 +1415,7 @@ impl BeaconChain { let skip_state_root = match config { StateSkipConfig::WithStateRoots => None, - StateSkipConfig::WithoutStateRoots => Some(Hash256::zero()), + StateSkipConfig::WithoutStateRoots => Some(Hash256::ZERO), }; while state.slot() < slot { @@ -5173,7 +5173,7 @@ impl BeaconChain { slot, proposer_index, parent_root, - state_root: Hash256::zero(), + state_root: Hash256::ZERO, body: BeaconBlockBodyBase { randao_reveal, eth1_data, @@ -5194,7 +5194,7 @@ impl BeaconChain { slot, proposer_index, parent_root, - state_root: Hash256::zero(), + state_root: Hash256::ZERO, body: BeaconBlockBodyAltair { randao_reveal, eth1_data, @@ -5221,7 +5221,7 @@ impl BeaconChain { slot, proposer_index, parent_root, - state_root: Hash256::zero(), + state_root: Hash256::ZERO, body: BeaconBlockBodyBellatrix { randao_reveal, eth1_data, @@ -5253,7 +5253,7 @@ impl BeaconChain { slot, proposer_index, parent_root, - state_root: Hash256::zero(), + state_root: Hash256::ZERO, body: BeaconBlockBodyCapella { randao_reveal, eth1_data, @@ -5287,7 +5287,7 @@ impl BeaconChain { slot, proposer_index, parent_root, - state_root: Hash256::zero(), + state_root: Hash256::ZERO, body: BeaconBlockBodyDeneb { randao_reveal, eth1_data, @@ -5325,7 +5325,7 @@ impl BeaconChain { slot, proposer_index, parent_root, - state_root: Hash256::zero(), + state_root: Hash256::ZERO, body: BeaconBlockBodyElectra { randao_reveal, eth1_data, @@ -5382,7 +5382,7 @@ impl BeaconChain { let mut ctxt = ConsensusContext::new(block.slot()); let consensus_block_value = self - .compute_beacon_block_reward(block.message(), Hash256::zero(), &mut state) + .compute_beacon_block_reward(block.message(), Hash256::ZERO, &mut state) .map(|reward| reward.total) .unwrap_or(0); @@ -6565,7 +6565,7 @@ impl BeaconChain { let mut finalized_blocks: HashSet = HashSet::new(); let mut justified_blocks: HashSet = HashSet::new(); - let genesis_block_hash = Hash256::zero(); + let genesis_block_hash = Hash256::ZERO; writeln!(output, "digraph beacon {{").unwrap(); writeln!(output, "\t_{:?}[label=\"zero\"];", genesis_block_hash).unwrap(); diff --git a/beacon_node/beacon_chain/src/beacon_fork_choice_store.rs b/beacon_node/beacon_chain/src/beacon_fork_choice_store.rs index f746b68996f..2f41e6f3e92 100644 --- a/beacon_node/beacon_chain/src/beacon_fork_choice_store.rs +++ b/beacon_node/beacon_chain/src/beacon_fork_choice_store.rs @@ -166,7 +166,7 @@ where ) -> Result { let anchor_state = &anchor.beacon_state; let mut anchor_block_header = anchor_state.latest_block_header().clone(); - if anchor_block_header.state_root == Hash256::zero() { + if anchor_block_header.state_root == Hash256::ZERO { anchor_block_header.state_root = anchor.beacon_state_root(); } let anchor_root = anchor_block_header.canonical_root(); @@ -187,7 +187,7 @@ where finalized_checkpoint, unrealized_justified_checkpoint: justified_checkpoint, unrealized_finalized_checkpoint: finalized_checkpoint, - proposer_boost_root: Hash256::zero(), + proposer_boost_root: Hash256::ZERO, equivocating_indices: BTreeSet::new(), _phantom: PhantomData, }) diff --git a/beacon_node/beacon_chain/src/block_times_cache.rs b/beacon_node/beacon_chain/src/block_times_cache.rs index db547a1186c..3632443d158 100644 --- a/beacon_node/beacon_chain/src/block_times_cache.rs +++ b/beacon_node/beacon_chain/src/block_times_cache.rs @@ -247,7 +247,7 @@ mod test { fn observed_time_uses_minimum() { let mut cache = BlockTimesCache::default(); - let block_root = Hash256::zero(); + let block_root = Hash256::ZERO; let slot = Slot::new(100); let slot_start_time = Duration::from_secs(0); diff --git a/beacon_node/beacon_chain/src/builder.rs b/beacon_node/beacon_chain/src/builder.rs index 90461b8f03e..2ef394d5223 100644 --- a/beacon_node/beacon_chain/src/builder.rs +++ b/beacon_node/beacon_chain/src/builder.rs @@ -364,7 +364,7 @@ where // Store the genesis block under the `ZERO_HASH` key. store - .put_block(&Hash256::zero(), beacon_block.clone()) + .put_block(&Hash256::ZERO, beacon_block.clone()) .map_err(|e| { format!( "Failed to store genesis block under 0x00..00 alias: {:?}", @@ -1212,7 +1212,7 @@ mod test { assert_eq!( chain .store - .get_blinded_block(&Hash256::zero()) + .get_blinded_block(&Hash256::ZERO) .expect("should read db") .expect("should find genesis block"), block.clone_as_blinded(), diff --git a/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs b/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs index adc1a1e202c..fb8afb2bfbb 100644 --- a/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs +++ b/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs @@ -2009,7 +2009,7 @@ mod pending_components_tests { let (block_commitments, blobs, random_blobs) = pre_setup(); let (block_commitments, blobs, random_blobs) = setup_pending_components(block_commitments, blobs, random_blobs); - let block_root = Hash256::zero(); + let block_root = Hash256::ZERO; let mut cache = >::empty(block_root); cache.merge_block(block_commitments); cache.merge_blobs(random_blobs); @@ -2023,7 +2023,7 @@ mod pending_components_tests { let (block_commitments, blobs, random_blobs) = pre_setup(); let (block_commitments, blobs, random_blobs) = setup_pending_components(block_commitments, blobs, random_blobs); - let block_root = Hash256::zero(); + let block_root = Hash256::ZERO; let mut cache = >::empty(block_root); cache.merge_blobs(random_blobs); cache.merge_block(block_commitments); @@ -2038,7 +2038,7 @@ mod pending_components_tests { let (block_commitments, blobs, random_blobs) = setup_pending_components(block_commitments, blobs, random_blobs); - let block_root = Hash256::zero(); + let block_root = Hash256::ZERO; let mut cache = >::empty(block_root); cache.merge_blobs(random_blobs); cache.merge_blobs(blobs); @@ -2053,7 +2053,7 @@ mod pending_components_tests { let (block_commitments, blobs, random_blobs) = setup_pending_components(block_commitments, blobs, random_blobs); - let block_root = Hash256::zero(); + let block_root = Hash256::ZERO; let mut cache = >::empty(block_root); cache.merge_block(block_commitments); cache.merge_blobs(blobs); @@ -2068,7 +2068,7 @@ mod pending_components_tests { let (block_commitments, blobs, random_blobs) = setup_pending_components(block_commitments, blobs, random_blobs); - let block_root = Hash256::zero(); + let block_root = Hash256::ZERO; let mut cache = >::empty(block_root); cache.merge_blobs(blobs); cache.merge_block(block_commitments); @@ -2083,7 +2083,7 @@ mod pending_components_tests { let (block_commitments, blobs, random_blobs) = setup_pending_components(block_commitments, blobs, random_blobs); - let block_root = Hash256::zero(); + let block_root = Hash256::ZERO; let mut cache = >::empty(block_root); cache.merge_blobs(blobs); cache.merge_blobs(random_blobs); diff --git a/beacon_node/beacon_chain/src/eth1_chain.rs b/beacon_node/beacon_chain/src/eth1_chain.rs index ee50e3b3843..f6b77c6de15 100644 --- a/beacon_node/beacon_chain/src/eth1_chain.rs +++ b/beacon_node/beacon_chain/src/eth1_chain.rs @@ -752,7 +752,7 @@ mod test { let keypair = generate_deterministic_keypair(i as usize); let mut deposit = DepositData { pubkey: keypair.pk.into(), - withdrawal_credentials: Hash256::zero(), + withdrawal_credentials: Hash256::ZERO, amount: spec.max_effective_balance, signature: Signature::empty().into(), }; diff --git a/beacon_node/beacon_chain/src/historical_blocks.rs b/beacon_node/beacon_chain/src/historical_blocks.rs index 85208c8ad6f..c324b2f4d94 100644 --- a/beacon_node/beacon_chain/src/historical_blocks.rs +++ b/beacon_node/beacon_chain/src/historical_blocks.rs @@ -146,7 +146,7 @@ impl BeaconChain { chunk_writer.set(slot, self.genesis_block_root, &mut cold_batch)?; } prev_block_slot = genesis_slot; - expected_block_root = Hash256::zero(); + expected_block_root = Hash256::ZERO; break; } } diff --git a/beacon_node/beacon_chain/src/migrate.rs b/beacon_node/beacon_chain/src/migrate.rs index 08b2a51720d..971b3452f99 100644 --- a/beacon_node/beacon_chain/src/migrate.rs +++ b/beacon_node/beacon_chain/src/migrate.rs @@ -452,7 +452,7 @@ impl, Cold: ItemStore> BackgroundMigrator::default(); let key = Slot::new(0); let validator_index = 0; - let value = Hash256::zero(); + let value = Hash256::ZERO; // Assert there is no entry. assert!(store @@ -1171,7 +1171,7 @@ mod tests { test_suite_slot!( observed_sync_contributors, ObservedSyncContributors, - Hash256::zero() + Hash256::ZERO ); test_suite_slot!(observed_sync_aggregators, ObservedSyncAggregators, ()); } diff --git a/beacon_node/beacon_chain/src/test_utils.rs b/beacon_node/beacon_chain/src/test_utils.rs index bd98f19af6f..9acf3908f3d 100644 --- a/beacon_node/beacon_chain/src/test_utils.rs +++ b/beacon_node/beacon_chain/src/test_utils.rs @@ -1510,13 +1510,13 @@ where let data = AttestationData { slot: Slot::new(0), index: 0, - beacon_block_root: Hash256::zero(), + beacon_block_root: Hash256::ZERO, target: Checkpoint { - root: Hash256::zero(), + root: Hash256::ZERO, epoch: target1.unwrap_or(fork.epoch), }, source: Checkpoint { - root: Hash256::zero(), + root: Hash256::ZERO, epoch: source1.unwrap_or(Epoch::new(0)), }, }; @@ -1601,13 +1601,13 @@ where let data = AttestationData { slot: Slot::new(0), index: 0, - beacon_block_root: Hash256::zero(), + beacon_block_root: Hash256::ZERO, target: Checkpoint { - root: Hash256::zero(), + root: Hash256::ZERO, epoch: Epoch::new(0), }, source: Checkpoint { - root: Hash256::zero(), + root: Hash256::ZERO, epoch: Epoch::new(0), }, }; @@ -1719,7 +1719,7 @@ where } let mut block_header_2 = block_header_1.clone(); - block_header_2.state_root = Hash256::zero(); + block_header_2.state_root = Hash256::ZERO; let sk = &self.validator_keypairs[validator_index as usize].sk; let fork = self.chain.canonical_head.cached_head().head_fork(); @@ -2292,7 +2292,7 @@ where validators, HashMap::new(), HashMap::new(), - SignedBeaconBlockHash::from(Hash256::zero()), + SignedBeaconBlockHash::from(Hash256::ZERO), ) }) .collect::>(); @@ -2357,7 +2357,7 @@ where .iter() .cloned() .map(|checkpoint| checkpoint.beacon_state.finalized_checkpoint().root) - .filter(|block_hash| *block_hash != Hash256::zero()) + .filter(|block_hash| *block_hash != Hash256::ZERO) .map(|hash| hash.into()) .collect() } diff --git a/beacon_node/beacon_chain/tests/block_verification.rs b/beacon_node/beacon_chain/tests/block_verification.rs index d9c9a3b6a74..8a358c8621a 100644 --- a/beacon_node/beacon_chain/tests/block_verification.rs +++ b/beacon_node/beacon_chain/tests/block_verification.rs @@ -333,7 +333,7 @@ async fn chain_segment_non_linear_parent_roots() { .collect(); let (mut block, signature) = blocks[3].as_block().clone().deconstruct(); - *block.parent_root_mut() = Hash256::zero(); + *block.parent_root_mut() = Hash256::ZERO; blocks[3] = RpcBlock::new_without_blobs( None, Arc::new(SignedBeaconBlock::from_block(block, signature)), @@ -676,14 +676,14 @@ async fn invalid_signature_attester_slashing() { data: AttestationData { slot: Slot::new(0), index: 0, - beacon_block_root: Hash256::zero(), + beacon_block_root: Hash256::ZERO, source: Checkpoint { epoch: Epoch::new(0), - root: Hash256::zero(), + root: Hash256::ZERO, }, target: Checkpoint { epoch: Epoch::new(0), - root: Hash256::zero(), + root: Hash256::ZERO, }, }, signature: junk_aggregate_signature(), @@ -700,14 +700,14 @@ async fn invalid_signature_attester_slashing() { data: AttestationData { slot: Slot::new(0), index: 0, - beacon_block_root: Hash256::zero(), + beacon_block_root: Hash256::ZERO, source: Checkpoint { epoch: Epoch::new(0), - root: Hash256::zero(), + root: Hash256::ZERO, }, target: Checkpoint { epoch: Epoch::new(0), - root: Hash256::zero(), + root: Hash256::ZERO, }, }, signature: junk_aggregate_signature(), @@ -845,10 +845,10 @@ async fn invalid_signature_deposit() { let harness = get_invalid_sigs_harness(&chain_segment).await; let mut snapshots = chain_segment.clone(); let deposit = Deposit { - proof: vec![Hash256::zero(); DEPOSIT_TREE_DEPTH + 1].into(), + proof: vec![Hash256::ZERO; DEPOSIT_TREE_DEPTH + 1].into(), data: DepositData { pubkey: Keypair::random().pk.into(), - withdrawal_credentials: Hash256::zero(), + withdrawal_credentials: Hash256::ZERO, amount: 0, signature: junk_signature().into(), }, diff --git a/beacon_node/beacon_chain/tests/store_tests.rs b/beacon_node/beacon_chain/tests/store_tests.rs index 6b77df4f812..9cb8a0fb3ca 100644 --- a/beacon_node/beacon_chain/tests/store_tests.rs +++ b/beacon_node/beacon_chain/tests/store_tests.rs @@ -295,8 +295,8 @@ async fn heal_freezer_block_roots_at_genesis() { .unwrap() .unwrap(); - chunk.values[1] = Hash256::zero(); - chunk.values[2] = Hash256::zero(); + chunk.values[1] = Hash256::ZERO; + chunk.values[2] = Hash256::ZERO; let mut ops = vec![]; chunk @@ -319,8 +319,8 @@ async fn heal_freezer_block_roots_at_genesis() { assert_eq!( block_roots, vec![ - (Hash256::zero(), Slot::new(1)), - (Hash256::zero(), Slot::new(2)) + (Hash256::ZERO, Slot::new(1)), + (Hash256::ZERO, Slot::new(2)) ] ); @@ -1447,7 +1447,7 @@ async fn pruning_does_not_touch_abandoned_block_shared_with_canonical_chain() { let chain_dump = rig.chain.chain_dump().unwrap(); assert_eq!( get_finalized_epoch_boundary_blocks(&chain_dump), - vec![Hash256::zero().into()].into_iter().collect(), + vec![Hash256::ZERO.into()].into_iter().collect(), ); assert!(get_blocks(&chain_dump).contains(&shared_head)); @@ -2187,7 +2187,7 @@ async fn pruning_test( let chain_dump = harness.chain.chain_dump().unwrap(); assert_eq!( get_finalized_epoch_boundary_blocks(&chain_dump), - vec![Hash256::zero().into()].into_iter().collect(), + vec![Hash256::ZERO.into()].into_iter().collect(), ); // Trigger finalization @@ -2584,7 +2584,7 @@ async fn weak_subjectivity_sync_test(slots: Vec, checkpoint_slot: Slot) { assert_eq!(forwards, expected); // All blocks can be loaded. - let mut prev_block_root = Hash256::zero(); + let mut prev_block_root = Hash256::ZERO; for (block_root, slot) in beacon_chain .forwards_iter_block_roots(Slot::new(0)) .unwrap() diff --git a/beacon_node/beacon_chain/tests/sync_committee_verification.rs b/beacon_node/beacon_chain/tests/sync_committee_verification.rs index 242ed558475..6944b2e1205 100644 --- a/beacon_node/beacon_chain/tests/sync_committee_verification.rs +++ b/beacon_node/beacon_chain/tests/sync_committee_verification.rs @@ -180,7 +180,7 @@ async fn aggregated_gossip_verification() { harness .add_attested_blocks_at_slots( state, - Hash256::zero(), + Hash256::ZERO, &[Slot::new(1), Slot::new(2)], (0..VALIDATOR_COUNT).collect::>().as_slice(), ) @@ -490,7 +490,7 @@ async fn aggregated_gossip_verification() { ); harness - .add_attested_block_at_slot(target_slot, state, Hash256::zero(), &[]) + .add_attested_block_at_slot(target_slot, state, Hash256::ZERO, &[]) .await .expect("should add block"); @@ -514,7 +514,7 @@ async fn unaggregated_gossip_verification() { harness .add_attested_blocks_at_slots( state, - Hash256::zero(), + Hash256::ZERO, &[Slot::new(1), Slot::new(2)], (0..VALIDATOR_COUNT).collect::>().as_slice(), ) @@ -793,7 +793,7 @@ async fn unaggregated_gossip_verification() { ); harness - .add_attested_block_at_slot(target_slot, state, Hash256::zero(), &[]) + .add_attested_block_at_slot(target_slot, state, Hash256::ZERO, &[]) .await .expect("should add block"); diff --git a/beacon_node/eth1/tests/test.rs b/beacon_node/eth1/tests/test.rs index 0479ea7c585..3310caa3a31 100644 --- a/beacon_node/eth1/tests/test.rs +++ b/beacon_node/eth1/tests/test.rs @@ -39,7 +39,7 @@ fn random_deposit_data() -> DepositData { let mut deposit = DepositData { pubkey: keypair.pk.into(), - withdrawal_credentials: Hash256::zero(), + withdrawal_credentials: Hash256::ZERO, amount: 32_000_000_000, signature: Signature::empty().into(), }; diff --git a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs index c91d22542e0..3521dd2c7cd 100644 --- a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs +++ b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs @@ -368,7 +368,7 @@ impl ExecutionBlockGenerator { // Hack the block hash to make this block distinct from any other block with a different // `unique_id` (the default is 0). - block.block_hash = ExecutionBlockHash::from_root(Hash256::from_slice(&unique_id.to_le_bytes())); + block.block_hash = ExecutionBlockHash::from_root(Hash256::from_slice(&unique_id.to_be_bytes())); block.block_hash = ExecutionBlockHash::from_root(block.tree_hash_root()); let hash = self.insert_block(Block::PoW(block))?; diff --git a/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs b/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs index b47a53a2ced..4950b89965f 100644 --- a/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs +++ b/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs @@ -92,7 +92,7 @@ impl MockExecutionLayer { let parent_hash = latest_execution_block.block_hash(); let block_number = latest_execution_block.block_number() + 1; let timestamp = block_number; - let prev_randao = Hash256::from_slice(&block_number.to_le_bytes()); + let prev_randao = Hash256::from_slice(&block_number.to_be_bytes()); let head_block_root = Hash256::repeat_byte(42); let forkchoice_update_params = ForkchoiceUpdateParameters { head_root: head_block_root, diff --git a/beacon_node/genesis/src/eth1_genesis_service.rs b/beacon_node/genesis/src/eth1_genesis_service.rs index 70157050278..1ee8eeac903 100644 --- a/beacon_node/genesis/src/eth1_genesis_service.rs +++ b/beacon_node/genesis/src/eth1_genesis_service.rs @@ -402,8 +402,8 @@ impl Eth1GenesisService { let mut state: BeaconState = BeaconState::new( genesis_time, Eth1Data { - block_hash: Hash256::zero(), - deposit_root: Hash256::zero(), + block_hash: Hash256::ZERO, + deposit_root: Hash256::ZERO, deposit_count: 0, }, spec, @@ -416,7 +416,7 @@ impl Eth1GenesisService { // // The deposits are coming directly from our own deposit tree to there's no need to // make proofs about their inclusion in it. - proof: vec![Hash256::zero(); spec.deposit_contract_tree_depth as usize].into(), + proof: vec![Hash256::ZERO; spec.deposit_contract_tree_depth as usize].into(), data: deposit_log.deposit_data.clone(), }) .try_for_each(|deposit| { diff --git a/beacon_node/http_api/src/block_id.rs b/beacon_node/http_api/src/block_id.rs index 45fc651f05c..347fc1a1212 100644 --- a/beacon_node/http_api/src/block_id.rs +++ b/beacon_node/http_api/src/block_id.rs @@ -81,7 +81,7 @@ impl BlockId { } CoreBlockId::Root(root) => { // This matches the behaviour of other consensus clients (e.g. Teku). - if root == &Hash256::zero() { + if root == &Hash256::ZERO { return Err(warp_utils::reject::custom_not_found(format!( "beacon block with root {}", root diff --git a/beacon_node/http_api/tests/broadcast_validation_tests.rs b/beacon_node/http_api/tests/broadcast_validation_tests.rs index 6a3f7947e6b..30442cfe08d 100644 --- a/beacon_node/http_api/tests/broadcast_validation_tests.rs +++ b/beacon_node/http_api/tests/broadcast_validation_tests.rs @@ -66,8 +66,8 @@ pub async fn gossip_invalid() { let ((block, blobs), _) = tester .harness .make_block_with_modifier(chain_state_before, slot, |b| { - *b.state_root_mut() = Hash256::zero(); - *b.parent_root_mut() = Hash256::zero(); + *b.state_root_mut() = Hash256::ZERO; + *b.parent_root_mut() = Hash256::ZERO; }) .await; @@ -254,8 +254,8 @@ pub async fn consensus_invalid() { let ((block, blobs), _) = tester .harness .make_block_with_modifier(chain_state_before, slot, |b| { - *b.state_root_mut() = Hash256::zero(); - *b.parent_root_mut() = Hash256::zero(); + *b.state_root_mut() = Hash256::ZERO; + *b.parent_root_mut() = Hash256::ZERO; }) .await; @@ -305,7 +305,7 @@ pub async fn consensus_gossip() { let state_a = tester.harness.get_current_state(); let ((block, blobs), _) = tester .harness - .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::zero()) + .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::ZERO) .await; let response: Result<(), eth2::Error> = tester @@ -466,8 +466,8 @@ pub async fn equivocation_invalid() { let ((block, blobs), _) = tester .harness .make_block_with_modifier(chain_state_before, slot, |b| { - *b.state_root_mut() = Hash256::zero(); - *b.parent_root_mut() = Hash256::zero(); + *b.state_root_mut() = Hash256::ZERO; + *b.parent_root_mut() = Hash256::ZERO; }) .await; @@ -589,7 +589,7 @@ pub async fn equivocation_gossip() { let state_a = tester.harness.get_current_state(); let ((block, blobs), _) = tester .harness - .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::zero()) + .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::ZERO) .await; let response: Result<(), eth2::Error> = tester @@ -760,8 +760,8 @@ pub async fn blinded_gossip_invalid() { let (block_contents_tuple, _) = tester .harness .make_block_with_modifier(chain_state_before, slot, |b| { - *b.state_root_mut() = Hash256::zero(); - *b.parent_root_mut() = Hash256::zero(); + *b.state_root_mut() = Hash256::ZERO; + *b.parent_root_mut() = Hash256::ZERO; }) .await; @@ -812,7 +812,7 @@ pub async fn blinded_gossip_partial_pass() { let (block_contents_tuple, _) = tester .harness .make_block_with_modifier(chain_state_before, slot, |b| { - *b.state_root_mut() = Hash256::zero() + *b.state_root_mut() = Hash256::ZERO }) .await; @@ -941,8 +941,8 @@ pub async fn blinded_consensus_invalid() { let (block_contents_tuple, _) = tester .harness .make_block_with_modifier(chain_state_before, slot, |b| { - *b.state_root_mut() = Hash256::zero(); - *b.parent_root_mut() = Hash256::zero(); + *b.state_root_mut() = Hash256::ZERO; + *b.parent_root_mut() = Hash256::ZERO; }) .await; @@ -992,7 +992,7 @@ pub async fn blinded_consensus_gossip() { let state_a = tester.harness.get_current_state(); let (block_contents_tuple, _) = tester .harness - .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::zero()) + .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::ZERO) .await; let response: Result<(), eth2::Error> = tester @@ -1085,8 +1085,8 @@ pub async fn blinded_equivocation_invalid() { let (block_contents_tuple, _) = tester .harness .make_block_with_modifier(chain_state_before, slot, |b| { - *b.state_root_mut() = Hash256::zero(); - *b.parent_root_mut() = Hash256::zero(); + *b.state_root_mut() = Hash256::ZERO; + *b.parent_root_mut() = Hash256::ZERO; }) .await; @@ -1204,7 +1204,7 @@ pub async fn blinded_equivocation_gossip() { let state_a = tester.harness.get_current_state(); let (block_contents_tuple, _) = tester .harness - .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::zero()) + .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::ZERO) .await; let response: Result<(), eth2::Error> = tester diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index 4213fd4ab8d..58b853d00a1 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -444,7 +444,7 @@ impl ApiTester { StateId(CoreStateId::Slot(Slot::from(SKIPPED_SLOTS[1]))), StateId(CoreStateId::Slot(Slot::from(SKIPPED_SLOTS[2]))), StateId(CoreStateId::Slot(Slot::from(SKIPPED_SLOTS[3]))), - StateId(CoreStateId::Root(Hash256::zero())), + StateId(CoreStateId::Root(Hash256::ZERO)), ]; ids.push(StateId(CoreStateId::Root( self.chain.canonical_head.cached_head().head_state_root(), @@ -464,7 +464,7 @@ impl ApiTester { BlockId(CoreBlockId::Slot(Slot::from(SKIPPED_SLOTS[1]))), BlockId(CoreBlockId::Slot(Slot::from(SKIPPED_SLOTS[2]))), BlockId(CoreBlockId::Slot(Slot::from(SKIPPED_SLOTS[3]))), - BlockId(CoreBlockId::Root(Hash256::zero())), + BlockId(CoreBlockId::Root(Hash256::ZERO)), ]; ids.push(BlockId(CoreBlockId::Root( self.chain.canonical_head.cached_head().head_block_root(), @@ -1322,7 +1322,7 @@ impl ApiTester { self.harness.get_current_state(), self.harness.get_current_slot(), |b| { - *b.state_root_mut() = Hash256::zero(); + *b.state_root_mut() = Hash256::ZERO; }, ) .await @@ -1349,7 +1349,7 @@ impl ApiTester { self.harness.get_current_state(), self.harness.get_current_slot(), |b| { - *b.state_root_mut() = Hash256::zero(); + *b.state_root_mut() = Hash256::ZERO; }, ) .await @@ -3405,7 +3405,7 @@ impl ApiTester { genesis_epoch, Domain::ApplicationMask(ApplicationDomain::Builder), &fork, - Hash256::zero(), + Hash256::ZERO, ); let message = data.signing_root(domain); let signature = keypair.sk.sign(message); @@ -3488,7 +3488,7 @@ impl ApiTester { genesis_epoch, Domain::ApplicationMask(ApplicationDomain::Builder), &fork, - Hash256::zero(), + Hash256::ZERO, ); let message = data.signing_root(domain); let signature = keypair.sk.sign(message); @@ -5440,7 +5440,7 @@ impl ApiTester { } pub async fn test_get_expected_withdrawals_invalid_state(self) -> Self { - let state_id = CoreStateId::Root(Hash256::zero()); + let state_id = CoreStateId::Root(Hash256::ZERO); let result = self.client.get_expected_withdrawals(&state_id).await; diff --git a/beacon_node/network/src/network_beacon_processor/rpc_methods.rs b/beacon_node/network/src/network_beacon_processor/rpc_methods.rs index 2a0c7ea089b..ab5f31007bd 100644 --- a/beacon_node/network/src/network_beacon_processor/rpc_methods.rs +++ b/beacon_node/network/src/network_beacon_processor/rpc_methods.rs @@ -85,8 +85,8 @@ impl NetworkBeaconProcessor { // their or our system's clock is incorrect. Some("Different system clocks or genesis time".to_string()) } else if remote.finalized_epoch <= local.finalized_epoch - && remote.finalized_root != Hash256::zero() - && local.finalized_root != Hash256::zero() + && remote.finalized_root != Hash256::ZERO + && local.finalized_root != Hash256::ZERO && self .chain .block_root_at_slot(start_slot(remote.finalized_epoch), WhenSlotSkipped::Prev) diff --git a/beacon_node/network/src/persisted_dht.rs b/beacon_node/network/src/persisted_dht.rs index 289bf14335e..e1085c4f0c1 100644 --- a/beacon_node/network/src/persisted_dht.rs +++ b/beacon_node/network/src/persisted_dht.rs @@ -4,7 +4,7 @@ use store::{DBColumn, Error as StoreError, HotColdDB, ItemStore, StoreItem}; use types::{EthSpec, Hash256}; /// 32-byte key for accessing the `DhtEnrs`. All zero because `DhtEnrs` has its own column. -pub const DHT_DB_KEY: Hash256 = Hash256::zero(); +pub const DHT_DB_KEY: Hash256 = Hash256::ZERO; pub fn load_dht, Cold: ItemStore>( store: Arc>, diff --git a/beacon_node/network/src/status.rs b/beacon_node/network/src/status.rs index 865f8ee933f..8d9b3cfe900 100644 --- a/beacon_node/network/src/status.rs +++ b/beacon_node/network/src/status.rs @@ -26,7 +26,7 @@ pub(crate) fn status_message(beacon_chain: &BeaconChain) let spec = &beacon_chain.spec; let genesis_epoch = spec.genesis_slot.epoch(T::EthSpec::slots_per_epoch()); if finalized_checkpoint.epoch == genesis_epoch { - finalized_checkpoint.root = Hash256::zero(); + finalized_checkpoint.root = Hash256::ZERO; } StatusMessage { diff --git a/beacon_node/network/src/sync/range_sync/range.rs b/beacon_node/network/src/sync/range_sync/range.rs index fa06af24956..f0f521d90f5 100644 --- a/beacon_node/network/src/sync/range_sync/range.rs +++ b/beacon_node/network/src/sync/range_sync/range.rs @@ -413,9 +413,9 @@ mod tests { known_blocks: RwLock::new(HashSet::new()), status: RwLock::new(StatusMessage { fork_digest: [0; 4], - finalized_root: Hash256::zero(), + finalized_root: Hash256::ZERO, finalized_epoch: 0usize.into(), - head_root: Hash256::zero(), + head_root: Hash256::ZERO, head_slot: 0usize.into(), }), } diff --git a/beacon_node/operation_pool/src/lib.rs b/beacon_node/operation_pool/src/lib.rs index a1c9ada03a0..91a76162c0c 100644 --- a/beacon_node/operation_pool/src/lib.rs +++ b/beacon_node/operation_pool/src/lib.rs @@ -865,7 +865,7 @@ mod release_tests { harness .add_attested_blocks_at_slots( state, - Hash256::zero(), + Hash256::ZERO, &[Slot::new(1)], (0..num_validators).collect::>().as_slice(), ) @@ -898,8 +898,8 @@ mod release_tests { let attestations = harness.make_attestations( (0..num_validators).collect::>().as_slice(), &state, - Hash256::zero(), - SignedBeaconBlockHash::from(Hash256::zero()), + Hash256::ZERO, + SignedBeaconBlockHash::from(Hash256::ZERO), slot, ); @@ -987,8 +987,8 @@ mod release_tests { let attestations = harness.make_attestations( (0..num_validators).collect::>().as_slice(), &state, - Hash256::zero(), - SignedBeaconBlockHash::from(Hash256::zero()), + Hash256::ZERO, + SignedBeaconBlockHash::from(Hash256::ZERO), slot, ); @@ -1058,8 +1058,8 @@ mod release_tests { let attestations = harness.make_attestations( (0..num_validators).collect::>().as_slice(), &state, - Hash256::zero(), - SignedBeaconBlockHash::from(Hash256::zero()), + Hash256::ZERO, + SignedBeaconBlockHash::from(Hash256::ZERO), slot, ); @@ -1102,8 +1102,8 @@ mod release_tests { let attestations = harness.make_attestations( (0..num_validators).collect::>().as_slice(), &state, - Hash256::zero(), - SignedBeaconBlockHash::from(Hash256::zero()), + Hash256::ZERO, + SignedBeaconBlockHash::from(Hash256::ZERO), slot, ); @@ -1204,8 +1204,8 @@ mod release_tests { let attestations = harness.make_attestations( (0..num_validators).collect::>().as_slice(), &state, - Hash256::zero(), - SignedBeaconBlockHash::from(Hash256::zero()), + Hash256::ZERO, + SignedBeaconBlockHash::from(Hash256::ZERO), slot, ); @@ -1324,8 +1324,8 @@ mod release_tests { let attestations = harness.make_attestations( (0..num_validators).collect::>().as_slice(), &state, - Hash256::zero(), - SignedBeaconBlockHash::from(Hash256::zero()), + Hash256::ZERO, + SignedBeaconBlockHash::from(Hash256::ZERO), slot, ); diff --git a/consensus/fork_choice/src/fork_choice.rs b/consensus/fork_choice/src/fork_choice.rs index 0dc7b117dfe..338bb35875b 100644 --- a/consensus/fork_choice/src/fork_choice.rs +++ b/consensus/fork_choice/src/fork_choice.rs @@ -1546,7 +1546,7 @@ mod tests { .map(|i| QueuedAttestation { slot: Slot::new(i), attesting_indices: vec![], - block_root: Hash256::zero(), + block_root: Hash256::ZERO, target_epoch: Epoch::new(0), }) .collect() diff --git a/consensus/fork_choice/tests/tests.rs b/consensus/fork_choice/tests/tests.rs index d2935dbca45..477332febb1 100644 --- a/consensus/fork_choice/tests/tests.rs +++ b/consensus/fork_choice/tests/tests.rs @@ -527,12 +527,12 @@ fn justified_and_finalized_blocks() { let justified_checkpoint = fork_choice.justified_checkpoint(); assert_eq!(justified_checkpoint.epoch, 0); - assert!(justified_checkpoint.root != Hash256::zero()); + assert!(justified_checkpoint.root != Hash256::ZERO); assert!(fork_choice.get_justified_block().is_ok()); let finalized_checkpoint = fork_choice.finalized_checkpoint(); assert_eq!(finalized_checkpoint.epoch, 0); - assert!(finalized_checkpoint.root != Hash256::zero()); + assert!(finalized_checkpoint.root != Hash256::ZERO); assert!(fork_choice.get_finalized_block().is_ok()); } @@ -772,7 +772,7 @@ async fn invalid_block_finalized_slot() { /// https://github.com/ethereum/eth2.0-specs/pull/1884 #[tokio::test] async fn invalid_block_finalized_descendant() { - let invalid_ancestor = Mutex::new(Hash256::zero()); + let invalid_ancestor = Mutex::new(Hash256::ZERO); ForkChoiceTest::new() .apply_blocks_while(|_, state| state.finalized_checkpoint().epoch == 0) @@ -1116,7 +1116,7 @@ fn weak_subjectivity_fail_on_startup() { #[tokio::test] async fn weak_subjectivity_pass_on_startup() { let epoch = Epoch::new(0); - let root = Hash256::zero(); + let root = Hash256::ZERO; let chain_config = ChainConfig { weak_subjectivity_checkpoint: Some(Checkpoint { epoch, root }), @@ -1222,7 +1222,7 @@ async fn weak_subjectivity_check_fails_incorrect_root() { let mut checkpoint = setup_harness.harness.finalized_checkpoint(); - checkpoint.root = Hash256::zero(); + checkpoint.root = Hash256::ZERO; let chain_config = ChainConfig { weak_subjectivity_checkpoint: Some(checkpoint), diff --git a/consensus/proto_array/src/fork_choice_test_definition.rs b/consensus/proto_array/src/fork_choice_test_definition.rs index 41a7f9f6def..78b7ed816de 100644 --- a/consensus/proto_array/src/fork_choice_test_definition.rs +++ b/consensus/proto_array/src/fork_choice_test_definition.rs @@ -287,7 +287,7 @@ impl ForkChoiceTestDefinition { /// Gives a root that is not the zero hash (unless i is `usize::MAX)`. fn get_root(i: u64) -> Hash256 { - Hash256::from_slice(&(i + 1).to_le_bytes()) + Hash256::from_slice(&(i + 1).to_be_bytes()) } /// Gives a hash that is not the zero hash (unless i is `usize::MAX)`. diff --git a/consensus/proto_array/src/proto_array_fork_choice.rs b/consensus/proto_array/src/proto_array_fork_choice.rs index a62e8b6760c..7957109d8fb 100644 --- a/consensus/proto_array/src/proto_array_fork_choice.rs +++ b/consensus/proto_array/src/proto_array_fork_choice.rs @@ -997,7 +997,7 @@ mod test_compute_deltas { /// Gives a hash that is not the zero hash (unless i is `usize::MAX)`. fn hash_from_index(i: usize) -> Hash256 { - Hash256::from_slice(&(i as u64 + 1).to_le_bytes()) + Hash256::from_slice(&(i as u64 + 1).to_be_bytes()) } #[test] @@ -1006,10 +1006,10 @@ mod test_compute_deltas { let genesis_epoch = Epoch::new(0); let state_root = Hash256::ZERO; - let finalized_root = Hash256::from_slice(&1u64.to_le_bytes()); - let finalized_desc = Hash256::from_slice(&2u64.to_le_bytes()); - let not_finalized_desc = Hash256::from_slice(&3u64.to_le_bytes()); - let unknown = Hash256::from_slice(&4u64.to_le_bytes()); + let finalized_root = Hash256::from_slice(&1u64.to_be_bytes()); + let finalized_desc = Hash256::from_slice(&2u64.to_be_bytes()); + let not_finalized_desc = Hash256::from_slice(&3u64.to_be_bytes()); + let unknown = Hash256::from_slice(&4u64.to_be_bytes()); let junk_shuffling_id = AttestationShufflingId::from_components(Epoch::new(0), Hash256::ZERO); let execution_status = ExecutionStatus::irrelevant(); @@ -1172,8 +1172,8 @@ mod test_compute_deltas { .on_block::( Block { slot: Slot::from(block.slot), - root: get_block_root(&block.root.to_le_bytes()), - parent_root: Some(get_block_root(&block.parent_root.to_le_bytes())), + root: get_block_root(&block.root.to_be_bytes()), + parent_root: Some(get_block_root(&block.parent_root.to_be_bytes())), state_root: Hash256::ZERO, target_root: Hash256::ZERO, current_epoch_shuffling_id: junk_shuffling_id.clone(), @@ -1238,7 +1238,7 @@ mod test_compute_deltas { }, ); - let finalized_root = get_block_root(&last_slot_of_epoch_0.to_le_bytes()); + let finalized_root = get_block_root(&last_slot_of_epoch_0.to_be_bytes()); // Set the finalized checkpoint to finalize the first slot of epoch 1 on // the canonical chain. @@ -1256,14 +1256,14 @@ mod test_compute_deltas { assert!( fc.proto_array .is_finalized_checkpoint_or_descendant::(get_block_root( - &canonical_slot.to_le_bytes() + &canonical_slot.to_be_bytes() )), "the canonical block is a descendant of the finalized checkpoint" ); assert!( !fc.proto_array .is_finalized_checkpoint_or_descendant::(get_block_root( - &non_canonical_slot.to_le_bytes() + &non_canonical_slot.to_be_bytes() )), "although the non-canonical block is a descendant of the finalized block, \ it's not a descendant of the finalized checkpoint" @@ -1517,7 +1517,7 @@ mod test_compute_deltas { // One validator moves their vote from the block to something outside the tree. votes.0.push(VoteTracker { current_root: hash_from_index(1), - next_root: Hash256::from_slice(&1337u64.to_le_bytes()), + next_root: Hash256::from_slice(&1337u64.to_be_bytes()), next_epoch: Epoch::new(0), }); diff --git a/consensus/state_processing/src/per_block_processing/tests.rs b/consensus/state_processing/src/per_block_processing/tests.rs index 2774dd3d87f..d7744ce1afd 100644 --- a/consensus/state_processing/src/per_block_processing/tests.rs +++ b/consensus/state_processing/src/per_block_processing/tests.rs @@ -44,7 +44,7 @@ async fn get_harness( harness .add_attested_blocks_at_slots( state, - Hash256::zero(), + Hash256::ZERO, (1..last_slot_of_epoch.as_u64()) .map(Slot::new) .collect::>() diff --git a/consensus/state_processing/src/per_epoch_processing/tests.rs b/consensus/state_processing/src/per_epoch_processing/tests.rs index 14bbfbc071d..58ec963a015 100644 --- a/consensus/state_processing/src/per_epoch_processing/tests.rs +++ b/consensus/state_processing/src/per_epoch_processing/tests.rs @@ -25,7 +25,7 @@ async fn runs_without_error() { harness .add_attested_blocks_at_slots( state, - Hash256::zero(), + Hash256::ZERO, (1..target_slot.as_u64()) .map(Slot::new) .collect::>() diff --git a/consensus/types/benches/benches.rs b/consensus/types/benches/benches.rs index 56c48e6cb1c..3b3ad99e6e8 100644 --- a/consensus/types/benches/benches.rs +++ b/consensus/types/benches/benches.rs @@ -11,9 +11,9 @@ use types::{ fn get_state(validator_count: usize) -> BeaconState { let spec = &E::default_spec(); let eth1_data = Eth1Data { - deposit_root: Hash256::zero(), + deposit_root: Hash256::ZERO, deposit_count: 0, - block_hash: Hash256::zero(), + block_hash: Hash256::ZERO, }; let mut state = BeaconState::new(0, eth1_data, spec); diff --git a/consensus/types/src/beacon_state/committee_cache/tests.rs b/consensus/types/src/beacon_state/committee_cache/tests.rs index 4dc06feab38..69b50612928 100644 --- a/consensus/types/src/beacon_state/committee_cache/tests.rs +++ b/consensus/types/src/beacon_state/committee_cache/tests.rs @@ -42,7 +42,7 @@ async fn new_state(validator_count: usize, slot: Slot) -> BeaconStat harness .add_attested_blocks_at_slots( head_state, - Hash256::zero(), + Hash256::ZERO, (1..=slot.as_u64()) .map(Slot::new) .collect::>() diff --git a/consensus/types/src/beacon_state/tests.rs b/consensus/types/src/beacon_state/tests.rs index 16c7ff152fe..dfa68a88684 100644 --- a/consensus/types/src/beacon_state/tests.rs +++ b/consensus/types/src/beacon_state/tests.rs @@ -38,7 +38,7 @@ async fn get_harness( harness .add_attested_blocks_at_slots( state, - Hash256::zero(), + Hash256::ZERO, slots.as_slice(), (0..validator_count).collect::>().as_slice(), ) diff --git a/consensus/types/src/sync_selection_proof.rs b/consensus/types/src/sync_selection_proof.rs index 0b32c6981b6..b7f08b63087 100644 --- a/consensus/types/src/sync_selection_proof.rs +++ b/consensus/types/src/sync_selection_proof.rs @@ -114,7 +114,7 @@ mod test { let subcommittee_index = 12; let key = keypair(1); let fork = &Fork::default(); - let genesis_validators_root = Hash256::zero(); + let genesis_validators_root = Hash256::ZERO; let spec = &ChainSpec::mainnet(); let proof = SyncSelectionProof::new::( diff --git a/crypto/bls/tests/tests.rs b/crypto/bls/tests/tests.rs index 8fed22f5371..e435d1c93e1 100644 --- a/crypto/bls/tests/tests.rs +++ b/crypto/bls/tests/tests.rs @@ -42,7 +42,7 @@ macro_rules! test_suite { let mut agg_sig = AggregateSignature::infinity(); ssz_round_trip(agg_sig.clone()); - let msg = Hash256::from_slice(&42u64.to_le_bytes()); + let msg = Hash256::from_slice(&42u64.to_be_bytes()); let secret = secret_from_u64(42); let sig = secret.sign(msg); @@ -121,7 +121,7 @@ macro_rules! test_suite { fn default() -> Self { let secret = SecretKey::deserialize(&[42; 32]).unwrap(); let pubkey = secret.public_key(); - let msg = Hash256::from_slice(&42u64.to_le_bytes()); + let msg = Hash256::from_slice(&42u64.to_be_bytes()); Self { sig: secret.sign(msg), @@ -172,7 +172,7 @@ macro_rules! test_suite { fn new_with_single_msg(num_pubkeys: u64) -> Self { let mut pubkeys = Vec::with_capacity(num_pubkeys as usize); let mut sig = AggregateSignature::infinity(); - let msg = Hash256::from_slice(&42u64.to_le_bytes()); + let msg = Hash256::from_slice(&42u64.to_be_bytes()); for i in 0..num_pubkeys { let secret = secret_from_u64(i); @@ -196,7 +196,7 @@ macro_rules! test_suite { let sk = SecretKey::deserialize(&[1; 32]).unwrap(); self.sig = AggregateSignature::infinity(); self.sig - .add_assign(&sk.sign(Hash256::from_slice(&1u64.to_le_bytes()))); + .add_assign(&sk.sign(Hash256::from_slice(&1u64.to_be_bytes()))); self } @@ -381,7 +381,7 @@ macro_rules! test_suite { impl SignatureSetTester { pub fn push_valid_set(mut self, num_signers: usize) -> Self { let mut signature = AggregateSignature::infinity(); - let message = Hash256::from_slice(&42u64.to_le_bytes()); + let message = Hash256::from_slice(&42u64.to_be_bytes()); let signing_keys = (0..num_signers) .map(|i| { @@ -404,7 +404,7 @@ macro_rules! test_suite { pub fn push_invalid_set(mut self) -> Self { let mut signature = AggregateSignature::infinity(); - let message = Hash256::from_slice(&42u64.to_le_bytes()); + let message = Hash256::from_slice(&42u64.to_be_bytes()); signature.add_assign(&secret_from_u64(0).sign(message)); diff --git a/lcli/src/generate_bootnode_enr.rs b/lcli/src/generate_bootnode_enr.rs index 52960b929d8..3f61cfb9e3f 100644 --- a/lcli/src/generate_bootnode_enr.rs +++ b/lcli/src/generate_bootnode_enr.rs @@ -33,7 +33,7 @@ pub fn run(matches: &ArgMatches) -> Result<(), String> { let secp256k1_keypair = secp256k1::Keypair::generate(); let enr_key = CombinedKey::from_secp256k1(&secp256k1_keypair); let enr_fork_id = EnrForkId { - fork_digest: ChainSpec::compute_fork_digest(genesis_fork_version, Hash256::zero()), + fork_digest: ChainSpec::compute_fork_digest(genesis_fork_version, Hash256::ZERO), next_fork_version: genesis_fork_version, next_fork_epoch: Epoch::max_value(), // FAR_FUTURE_EPOCH }; diff --git a/slasher/src/test_utils.rs b/slasher/src/test_utils.rs index dd6fc38e737..aa27dc3dcb7 100644 --- a/slasher/src/test_utils.rs +++ b/slasher/src/test_utils.rs @@ -27,7 +27,7 @@ pub fn indexed_att_electra( }, target: Checkpoint { epoch: Epoch::new(target_epoch), - root: Hash256::from_slice(&target_root.to_le_bytes()), + root: Hash256::from_slice(&target_root.to_be_bytes()), }, }, signature: AggregateSignature::empty(), @@ -52,7 +52,7 @@ pub fn indexed_att( }, target: Checkpoint { epoch: Epoch::new(target_epoch), - root: Hash256::from_slice(&target_root.to_le_bytes()), + root: Hash256::from_slice(&target_root.to_be_bytes()), }, }, signature: AggregateSignature::empty(), @@ -141,7 +141,7 @@ pub fn block(slot: u64, proposer_index: u64, block_root: u64) -> SignedBeaconBlo proposer_index, parent_root: Hash256::ZERO, state_root: Hash256::ZERO, - body_root: Hash256::from_slice(&block_root.to_le_bytes()), + body_root: Hash256::from_slice(&block_root.to_be_bytes()), }, signature: Signature::empty(), } diff --git a/testing/execution_engine_integration/src/test_rig.rs b/testing/execution_engine_integration/src/test_rig.rs index c7d5e704524..72410223dd7 100644 --- a/testing/execution_engine_integration/src/test_rig.rs +++ b/testing/execution_engine_integration/src/test_rig.rs @@ -252,8 +252,8 @@ impl TestRig { let parent_hash = terminal_pow_block_hash; let timestamp = timestamp_now(); - let prev_randao = Hash256::zero(); - let head_root = Hash256::zero(); + let prev_randao = Hash256::ZERO; + let head_root = Hash256::ZERO; let justified_block_hash = ExecutionBlockHash::zero(); let finalized_block_hash = ExecutionBlockHash::zero(); let forkchoice_update_params = ForkchoiceUpdateParameters { @@ -294,7 +294,7 @@ impl TestRig { justified_block_hash, finalized_block_hash, Slot::new(0), - Hash256::zero(), + Hash256::ZERO, ) .await .unwrap(); @@ -457,7 +457,7 @@ impl TestRig { let parent_hash = valid_payload.block_hash(); let timestamp = valid_payload.timestamp() + 1; - let prev_randao = Hash256::zero(); + let prev_randao = Hash256::ZERO; let proposer_index = 0; let builder_params = BuilderParams { pubkey: PublicKeyBytes::empty(), diff --git a/testing/execution_engine_integration/src/transactions.rs b/testing/execution_engine_integration/src/transactions.rs index 62b77d5024b..0e321834828 100644 --- a/testing/execution_engine_integration/src/transactions.rs +++ b/testing/execution_engine_integration/src/transactions.rs @@ -75,7 +75,7 @@ impl Transaction { let amount: u64 = 32_000_000_000; let mut deposit = DepositData { pubkey: keypair.pk.into(), - withdrawal_credentials: Hash256::zero(), + withdrawal_credentials: Hash256::ZERO, amount, signature: Signature::empty().into(), }; diff --git a/testing/state_transition_vectors/src/main.rs b/testing/state_transition_vectors/src/main.rs index 3e7c37af543..020108b7ae7 100644 --- a/testing/state_transition_vectors/src/main.rs +++ b/testing/state_transition_vectors/src/main.rs @@ -65,7 +65,7 @@ async fn get_harness( harness .add_attested_blocks_at_slots( state, - Hash256::zero(), + Hash256::ZERO, (skip_to_slot.as_u64()..slot.as_u64()) .map(Slot::new) .collect::>() diff --git a/testing/web3signer_tests/src/lib.rs b/testing/web3signer_tests/src/lib.rs index 4187844cecc..40eeac71284 100644 --- a/testing/web3signer_tests/src/lib.rs +++ b/testing/web3signer_tests/src/lib.rs @@ -683,7 +683,7 @@ mod tests { "sync_committee_signature", |pubkey, validator_store| async move { validator_store - .produce_sync_committee_signature(altair_fork_slot, Hash256::zero(), 0, &pubkey) + .produce_sync_committee_signature(altair_fork_slot, Hash256::ZERO, 0, &pubkey) .await .unwrap() }, diff --git a/validator_client/slashing_protection/src/attestation_tests.rs b/validator_client/slashing_protection/src/attestation_tests.rs index 014fd229ee3..fb2787e2c76 100644 --- a/validator_client/slashing_protection/src/attestation_tests.rs +++ b/validator_client/slashing_protection/src/attestation_tests.rs @@ -230,8 +230,8 @@ fn invalid_double_vote_diff_data() { #[test] fn invalid_double_vote_diff_domain() { let first = attestation_data_builder(0, 2); - let domain1 = Hash256::from_slice(&1u64.to_le_bytes()); - let domain2 = Hash256::from_slice(&2u64.to_le_bytes()); + let domain1 = Hash256::from_slice(&1u64.to_be_bytes()); + let domain2 = Hash256::from_slice(&2u64.to_be_bytes()); StreamTest { cases: vec![ diff --git a/validator_client/slashing_protection/src/bin/test_generator.rs b/validator_client/slashing_protection/src/bin/test_generator.rs index 690ebbbed4a..c53c9890896 100644 --- a/validator_client/slashing_protection/src/bin/test_generator.rs +++ b/validator_client/slashing_protection/src/bin/test_generator.rs @@ -50,7 +50,7 @@ fn interchange_with_signing_roots( .into_iter() .map(|(slot, signing_root)| SignedBlock { slot: Slot::new(slot), - signing_root: signing_root.map(|root| Hash256::from_slice(&root.to_le_bytes())), + signing_root: signing_root.map(|root| Hash256::from_slice(&root.to_be_bytes())), }) .collect(), signed_attestations: attestations @@ -58,7 +58,7 @@ fn interchange_with_signing_roots( .map(|(source, target, signing_root)| SignedAttestation { source_epoch: Epoch::new(source), target_epoch: Epoch::new(target), - signing_root: signing_root.map(|root| Hash256::from_slice(&root.to_le_bytes())), + signing_root: signing_root.map(|root| Hash256::from_slice(&root.to_be_bytes())), }) .collect(), }) diff --git a/validator_client/slashing_protection/src/block_tests.rs b/validator_client/slashing_protection/src/block_tests.rs index 510b592cb55..0499744442e 100644 --- a/validator_client/slashing_protection/src/block_tests.rs +++ b/validator_client/slashing_protection/src/block_tests.rs @@ -93,8 +93,8 @@ fn invalid_double_block_proposal() { #[test] fn invalid_double_block_proposal_diff_domain() { let first_block = block(1); - let domain1 = Hash256::from_slice(&1u64.to_le_bytes()); - let domain2 = Hash256::from_slice(&2u64.to_le_bytes()); + let domain1 = Hash256::from_slice(&1u64.to_be_bytes()); + let domain2 = Hash256::from_slice(&2u64.to_be_bytes()); StreamTest { cases: vec![ Test::single(first_block.clone()).with_domain(domain1), diff --git a/validator_client/slashing_protection/src/interchange_test.rs b/validator_client/slashing_protection/src/interchange_test.rs index 7023534ac36..8f7977d209d 100644 --- a/validator_client/slashing_protection/src/interchange_test.rs +++ b/validator_client/slashing_protection/src/interchange_test.rs @@ -200,7 +200,7 @@ impl TestCase { TestBlock { pubkey: pubkey(pk), slot: Slot::new(slot), - signing_root: Hash256::from_slice(&signing_root.to_le_bytes()), + signing_root: Hash256::from_slice(&signing_root.to_be_bytes()), should_succeed, should_succeed_complete, } @@ -234,7 +234,7 @@ impl TestCase { pubkey: pubkey(pk), source_epoch: Epoch::new(source), target_epoch: Epoch::new(target), - signing_root: Hash256::from_slice(&signing_root.to_le_bytes()), + signing_root: Hash256::from_slice(&signing_root.to_be_bytes()), should_succeed, should_succeed_complete, } diff --git a/validator_client/src/http_api/tests/keystores.rs b/validator_client/src/http_api/tests/keystores.rs index b6923d1c788..f28286495a6 100644 --- a/validator_client/src/http_api/tests/keystores.rs +++ b/validator_client/src/http_api/tests/keystores.rs @@ -571,7 +571,7 @@ async fn import_invalid_slashing_protection() { let slashing_protection = Interchange { metadata: InterchangeMetadata { interchange_format_version: 0, - genesis_validators_root: Hash256::zero(), + genesis_validators_root: Hash256::ZERO, }, data: vec![], }; From 9f40d91d513ac96ba4ab7758083b0fef57b640aa Mon Sep 17 00:00:00 2001 From: dapplion <35266934+dapplion@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:01:06 +0200 Subject: [PATCH 16/62] Revert "Add BeaconBlocksByRange v3" This reverts commit e3ce7fc5eae558da117b41ca7abbd6e03f4e420d. --- beacon_node/network/src/sync/block_lookups/mod.rs | 2 +- beacon_node/network/src/sync/range_sync/chain.rs | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/beacon_node/network/src/sync/block_lookups/mod.rs b/beacon_node/network/src/sync/block_lookups/mod.rs index 43bae1f9601..0a44cf2fdf5 100644 --- a/beacon_node/network/src/sync/block_lookups/mod.rs +++ b/beacon_node/network/src/sync/block_lookups/mod.rs @@ -53,7 +53,7 @@ mod tests; /// The maximum depth we will search for a parent block. In principle we should have sync'd any /// canonical chain to its head once the peer connects. A chain should not appear where it's depth /// is further back than the most recent head slot. -pub(crate) const PARENT_DEPTH_TOLERANCE: usize = SLOT_IMPORT_TOLERANCE + 1; +pub(crate) const PARENT_DEPTH_TOLERANCE: usize = SLOT_IMPORT_TOLERANCE * 2; const FAILED_CHAINS_CACHE_EXPIRY_SECONDS: u64 = 60; pub const SINGLE_BLOCK_LOOKUP_MAX_ATTEMPTS: u8 = 4; diff --git a/beacon_node/network/src/sync/range_sync/chain.rs b/beacon_node/network/src/sync/range_sync/chain.rs index 0e4058dddf1..a735001fed3 100644 --- a/beacon_node/network/src/sync/range_sync/chain.rs +++ b/beacon_node/network/src/sync/range_sync/chain.rs @@ -11,7 +11,6 @@ use rand::{seq::SliceRandom, Rng}; use slog::{crit, debug, o, warn}; use std::collections::{btree_map::Entry, BTreeMap, HashSet}; use std::hash::{Hash, Hasher}; -use std::time::Instant; use types::{Epoch, EthSpec, Hash256, Slot}; /// Blocks are downloaded in batches from peers. This constant specifies how many epochs worth of @@ -110,9 +109,6 @@ pub struct SyncingChain { pub enum ChainSyncingState { /// The chain is not being synced. Stopped, - /// The chain should not download any more batches, but should attempt to processing everything - /// that is already downloaded. - Stopping(Instant), /// The chain is undergoing syncing. Syncing, } @@ -870,11 +866,6 @@ impl SyncingChain { network: &mut SyncNetworkContext, batch_id: BatchId, ) -> ProcessingResult { - // If chain is stopping do not request any more batches. - if matches!(self.state, ChainSyncingState::Stopping) { - return Ok(KeepChain); - } - let Some(batch) = self.batches.get_mut(&batch_id) else { return Ok(KeepChain); }; @@ -981,7 +972,7 @@ impl SyncingChain { pub fn is_syncing(&self) -> bool { match self.state { ChainSyncingState::Syncing => true, - ChainSyncingState::Stopped | ChainSyncingState::Stopping { .. } => false, + ChainSyncingState::Stopped => false, } } @@ -1000,7 +991,6 @@ impl SyncingChain { /// Attempts to request the next required batches from the peer pool if the chain is syncing. It will exhaust the peer /// pool and left over batches until the batch buffer is reached or all peers are exhausted. fn request_batches(&mut self, network: &mut SyncNetworkContext) -> ProcessingResult { - // If chain is stopped or stopping do not request any more batches. if !matches!(self.state, ChainSyncingState::Syncing) { return Ok(KeepChain); } From e9986dbecedd9d1f6443f6a8fb9d844f7e2c1297 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 15 Jul 2024 18:07:11 +0100 Subject: [PATCH 17/62] impl hash256 extended trait --- Cargo.lock | 1 + .../beacon_chain/src/attester_cache.rs | 6 +- .../beacon_chain/src/beacon_block_streamer.rs | 8 +- beacon_node/beacon_chain/src/beacon_chain.rs | 26 +++--- .../src/beacon_fork_choice_store.rs | 6 +- .../beacon_chain/src/bellatrix_readiness.rs | 2 +- .../beacon_chain/src/block_times_cache.rs | 3 +- beacon_node/beacon_chain/src/builder.rs | 6 +- .../overflow_lru_cache.rs | 21 +++-- beacon_node/beacon_chain/src/eth1_chain.rs | 4 +- .../beacon_chain/src/execution_payload.rs | 4 +- beacon_node/beacon_chain/src/head_tracker.rs | 2 +- .../beacon_chain/src/historical_blocks.rs | 4 +- beacon_node/beacon_chain/src/metrics.rs | 4 +- beacon_node/beacon_chain/src/migrate.rs | 4 +- .../src/naive_aggregation_pool.rs | 5 +- .../beacon_chain/src/observed_attesters.rs | 5 +- .../src/otb_verification_service.rs | 2 +- .../src/schema_change/migration_schema_v21.rs | 2 +- beacon_node/beacon_chain/src/test_utils.rs | 18 ++-- .../src/validator_pubkey_cache.rs | 2 +- .../beacon_chain/tests/block_verification.rs | 18 ++-- beacon_node/beacon_chain/tests/store_tests.rs | 14 +-- .../tests/sync_committee_verification.rs | 8 +- beacon_node/eth1/src/block_cache.rs | 2 + beacon_node/eth1/src/deposit_cache.rs | 2 +- beacon_node/eth1/tests/test.rs | 7 +- beacon_node/execution_layer/src/block_hash.rs | 34 +++---- .../execution_layer/src/engine_api/http.rs | 14 +-- beacon_node/execution_layer/src/lib.rs | 9 +- .../test_utils/execution_block_generator.rs | 4 +- .../src/test_utils/mock_builder.rs | 8 +- .../src/test_utils/mock_execution_layer.rs | 6 +- .../genesis/src/eth1_genesis_service.rs | 8 +- beacon_node/genesis/src/interop.rs | 6 +- beacon_node/genesis/tests/tests.rs | 2 +- beacon_node/http_api/src/block_id.rs | 7 +- .../tests/broadcast_validation_tests.rs | 34 +++---- beacon_node/http_api/tests/tests.rs | 14 +-- .../lighthouse_network/src/rpc/codec/base.rs | 4 +- .../src/rpc/codec/ssz_snappy.rs | 22 ++--- .../lighthouse_network/tests/common.rs | 5 +- .../lighthouse_network/tests/rpc_tests.rs | 44 +++++----- .../network_beacon_processor/rpc_methods.rs | 6 +- beacon_node/network/src/status.rs | 4 +- .../src/sync/block_lookups/parent_chain.rs | 2 +- .../network/src/sync/range_sync/range.rs | 6 +- beacon_node/operation_pool/src/lib.rs | 26 +++--- .../operation_pool/src/reward_cache.rs | 6 +- beacon_node/store/src/hot_cold_store.rs | 8 +- beacon_node/store/src/iter.rs | 1 + common/eth2_network_config/src/lib.rs | 6 +- consensus/fork_choice/src/fork_choice.rs | 14 +-- consensus/fork_choice/tests/tests.rs | 10 +-- .../src/fork_choice_test_definition.rs | 20 ++--- .../fork_choice_test_definition/no_votes.rs | 60 +++++++------ consensus/proto_array/src/proto_array.rs | 10 +-- .../src/proto_array_fork_choice.rs | 62 ++++++------- consensus/state_processing/src/all_caches.rs | 6 +- consensus/state_processing/src/epoch_cache.rs | 6 +- consensus/state_processing/src/genesis.rs | 2 +- .../src/per_block_processing/tests.rs | 2 +- .../src/per_epoch_processing/tests.rs | 4 +- .../src/per_slot_processing.rs | 2 +- .../state_processing/src/state_advance.rs | 6 +- consensus/types/benches/benches.rs | 6 +- consensus/types/src/beacon_block.rs | 88 +++++++++---------- consensus/types/src/beacon_state.rs | 2 +- .../src/beacon_state/committee_cache/tests.rs | 2 +- consensus/types/src/beacon_state/tests.rs | 6 +- consensus/types/src/chain_spec.rs | 17 ++-- consensus/types/src/deposit_tree_snapshot.rs | 4 +- consensus/types/src/execution_block_hash.rs | 3 +- .../types/src/execution_payload_header.rs | 6 +- consensus/types/src/lib.rs | 20 +++++ consensus/types/src/subnet_id.rs | 2 +- consensus/types/src/sync_selection_proof.rs | 4 +- consensus/types/src/validator.rs | 4 +- consensus/types/src/withdrawal_credentials.rs | 2 +- crypto/bls/src/lib.rs | 19 ++++ crypto/bls/tests/tests.rs | 17 ++-- lcli/src/generate_bootnode_enr.rs | 4 +- slasher/src/test_utils.rs | 20 ++--- testing/ef_tests/src/cases/common.rs | 70 ++++++++------- testing/ef_tests/src/cases/ssz_generic.rs | 8 +- testing/ef_tests/src/cases/ssz_static.rs | 10 +-- testing/eth1_test_rig/src/lib.rs | 6 +- .../execution_engine_integration/Cargo.toml | 1 + .../src/test_rig.rs | 12 +-- .../src/transactions.rs | 4 +- testing/state_transition_vectors/src/main.rs | 4 +- testing/web3signer_tests/src/lib.rs | 2 +- .../src/attestation_tests.rs | 10 +-- .../src/bin/test_generator.rs | 8 +- .../slashing_protection/src/block_tests.rs | 6 +- .../src/extra_interchange_tests.rs | 11 +-- .../src/interchange_test.rs | 6 +- .../slashing_protection/src/lib.rs | 4 +- .../slashing_protection/tests/migration.rs | 4 +- .../src/http_api/tests/keystores.rs | 2 +- watch/src/database/watch_types.rs | 2 +- 101 files changed, 568 insertions(+), 504 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d9f48829f85..2958439b249 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2923,6 +2923,7 @@ dependencies = [ "alloy-core", "async-channel", "deposit_contract", + "ethers-core", "ethers-providers", "execution_layer", "fork_choice", diff --git a/beacon_node/beacon_chain/src/attester_cache.rs b/beacon_node/beacon_chain/src/attester_cache.rs index 67484d46582..d12d11ef84d 100644 --- a/beacon_node/beacon_chain/src/attester_cache.rs +++ b/beacon_node/beacon_chain/src/attester_cache.rs @@ -19,8 +19,8 @@ use types::{ beacon_state::{ compute_committee_index_in_epoch, compute_committee_range_in_epoch, epoch_committee_count, }, - BeaconState, BeaconStateError, ChainSpec, Checkpoint, Epoch, EthSpec, Hash256, RelativeEpoch, - Slot, + BeaconState, BeaconStateError, ChainSpec, Checkpoint, Epoch, EthSpec, Hash256, Hash256Extended, + RelativeEpoch, Slot, }; type JustifiedCheckpoint = Checkpoint; @@ -229,7 +229,7 @@ impl AttesterCacheKey { let decision_root = if decision_slot.epoch(slots_per_epoch) == epoch { // This scenario is only possible during the genesis epoch. In this scenario, all-zeros // is used as an alias to the genesis block. - Hash256::ZERO + Hash256::zero() } else if epoch > state.current_epoch() { // If the requested epoch is higher than the current epoch, the latest block will always // be the decision root. diff --git a/beacon_node/beacon_chain/src/beacon_block_streamer.rs b/beacon_node/beacon_chain/src/beacon_block_streamer.rs index 6008c9a1c81..3766f022edd 100644 --- a/beacon_node/beacon_chain/src/beacon_block_streamer.rs +++ b/beacon_node/beacon_chain/src/beacon_block_streamer.rs @@ -715,7 +715,9 @@ mod tests { use lazy_static::lazy_static; use std::time::Duration; use tokio::sync::mpsc; - use types::{ChainSpec, Epoch, EthSpec, Hash256, Keypair, MinimalEthSpec, Slot}; + use types::{ + ChainSpec, Epoch, EthSpec, Hash256, Hash256Extended, Keypair, MinimalEthSpec, Slot, + }; const VALIDATOR_COUNT: usize = 48; lazy_static! { @@ -830,7 +832,7 @@ mod tests { for epoch in 0..num_epochs { let start = epoch * slots_per_epoch; - let mut epoch_roots = vec![Hash256::ZERO; slots_per_epoch]; + let mut epoch_roots = vec![Hash256::zero(); slots_per_epoch]; epoch_roots[..].clone_from_slice(&block_roots[start..(start + slots_per_epoch)]); let streamer = BeaconBlockStreamer::new(&harness.chain, CheckCaches::No) .expect("should create streamer"); @@ -973,7 +975,7 @@ mod tests { for epoch in 0..num_epochs { let start = epoch * slots_per_epoch; - let mut epoch_roots = vec![Hash256::ZERO; slots_per_epoch]; + let mut epoch_roots = vec![Hash256::zero(); slots_per_epoch]; epoch_roots[..].clone_from_slice(&block_roots[start..(start + slots_per_epoch)]); let streamer = BeaconBlockStreamer::new(&harness.chain, CheckCaches::No) .expect("should create streamer"); diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index 5b03cd8deae..2e8f967f85f 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -533,7 +533,7 @@ impl BeaconBlockResponseWrapper { } pub fn consensus_block_value_wei(&self) -> Uint256 { - Uint256::from(self.consensus_block_value_gwei()) * 1_000_000_000 + Uint256::from(self.consensus_block_value_gwei()) * Uint256::from(1_000_000_000) } pub fn is_blinded(&self) -> bool { @@ -1415,7 +1415,7 @@ impl BeaconChain { let skip_state_root = match config { StateSkipConfig::WithStateRoots => None, - StateSkipConfig::WithoutStateRoots => Some(Hash256::ZERO), + StateSkipConfig::WithoutStateRoots => Some(Hash256::zero()), }; while state.slot() < slot { @@ -3270,7 +3270,7 @@ impl BeaconChain { { let mut slashable_cache = self.observed_slashable.write(); for header in blobs - .into_iter() + .iter() .filter_map(|b| b.as_ref().map(|b| b.signed_block_header.clone())) .unique() { @@ -5173,7 +5173,7 @@ impl BeaconChain { slot, proposer_index, parent_root, - state_root: Hash256::ZERO, + state_root: Hash256::zero(), body: BeaconBlockBodyBase { randao_reveal, eth1_data, @@ -5187,14 +5187,14 @@ impl BeaconChain { }, }), None, - Uint256::zero(), + Uint256::ZERO, ), BeaconState::Altair(_) => ( BeaconBlock::Altair(BeaconBlockAltair { slot, proposer_index, parent_root, - state_root: Hash256::ZERO, + state_root: Hash256::zero(), body: BeaconBlockBodyAltair { randao_reveal, eth1_data, @@ -5210,7 +5210,7 @@ impl BeaconChain { }, }), None, - Uint256::zero(), + Uint256::ZERO, ), BeaconState::Bellatrix(_) => { let block_proposal_contents = @@ -5221,7 +5221,7 @@ impl BeaconChain { slot, proposer_index, parent_root, - state_root: Hash256::ZERO, + state_root: Hash256::zero(), body: BeaconBlockBodyBellatrix { randao_reveal, eth1_data, @@ -5253,7 +5253,7 @@ impl BeaconChain { slot, proposer_index, parent_root, - state_root: Hash256::ZERO, + state_root: Hash256::zero(), body: BeaconBlockBodyCapella { randao_reveal, eth1_data, @@ -5287,7 +5287,7 @@ impl BeaconChain { slot, proposer_index, parent_root, - state_root: Hash256::ZERO, + state_root: Hash256::zero(), body: BeaconBlockBodyDeneb { randao_reveal, eth1_data, @@ -5325,7 +5325,7 @@ impl BeaconChain { slot, proposer_index, parent_root, - state_root: Hash256::ZERO, + state_root: Hash256::zero(), body: BeaconBlockBodyElectra { randao_reveal, eth1_data, @@ -5382,7 +5382,7 @@ impl BeaconChain { let mut ctxt = ConsensusContext::new(block.slot()); let consensus_block_value = self - .compute_beacon_block_reward(block.message(), Hash256::ZERO, &mut state) + .compute_beacon_block_reward(block.message(), Hash256::zero(), &mut state) .map(|reward| reward.total) .unwrap_or(0); @@ -6565,7 +6565,7 @@ impl BeaconChain { let mut finalized_blocks: HashSet = HashSet::new(); let mut justified_blocks: HashSet = HashSet::new(); - let genesis_block_hash = Hash256::ZERO; + let genesis_block_hash = Hash256::zero(); writeln!(output, "digraph beacon {{").unwrap(); writeln!(output, "\t_{:?}[label=\"zero\"];", genesis_block_hash).unwrap(); diff --git a/beacon_node/beacon_chain/src/beacon_fork_choice_store.rs b/beacon_node/beacon_chain/src/beacon_fork_choice_store.rs index 2f41e6f3e92..c5fbcc23f4e 100644 --- a/beacon_node/beacon_chain/src/beacon_fork_choice_store.rs +++ b/beacon_node/beacon_chain/src/beacon_fork_choice_store.rs @@ -17,7 +17,7 @@ use store::{Error as StoreError, HotColdDB, ItemStore}; use superstruct::superstruct; use types::{ AbstractExecPayload, BeaconBlockRef, BeaconState, BeaconStateError, Checkpoint, Epoch, EthSpec, - Hash256, Slot, + Hash256, Hash256Extended, Slot, }; #[derive(Debug)] @@ -166,7 +166,7 @@ where ) -> Result { let anchor_state = &anchor.beacon_state; let mut anchor_block_header = anchor_state.latest_block_header().clone(); - if anchor_block_header.state_root == Hash256::ZERO { + if anchor_block_header.state_root == Hash256::zero() { anchor_block_header.state_root = anchor.beacon_state_root(); } let anchor_root = anchor_block_header.canonical_root(); @@ -187,7 +187,7 @@ where finalized_checkpoint, unrealized_justified_checkpoint: justified_checkpoint, unrealized_finalized_checkpoint: finalized_checkpoint, - proposer_boost_root: Hash256::ZERO, + proposer_boost_root: Hash256::zero(), equivocating_indices: BTreeSet::new(), _phantom: PhantomData, }) diff --git a/beacon_node/beacon_chain/src/bellatrix_readiness.rs b/beacon_node/beacon_chain/src/bellatrix_readiness.rs index 60b1abaf098..c2e387c422f 100644 --- a/beacon_node/beacon_chain/src/bellatrix_readiness.rs +++ b/beacon_node/beacon_chain/src/bellatrix_readiness.rs @@ -64,7 +64,7 @@ impl MergeConfig { /// Instantiate `self` from the values in a `ChainSpec`. pub fn from_chainspec(spec: &ChainSpec) -> Self { let mut params = MergeConfig::default(); - if spec.terminal_total_difficulty != Uint256::max_value() { + if spec.terminal_total_difficulty != Uint256::MAX { params.terminal_total_difficulty = Some(spec.terminal_total_difficulty); } if spec.terminal_block_hash != ExecutionBlockHash::zero() { diff --git a/beacon_node/beacon_chain/src/block_times_cache.rs b/beacon_node/beacon_chain/src/block_times_cache.rs index 3632443d158..4a6bacaeb2c 100644 --- a/beacon_node/beacon_chain/src/block_times_cache.rs +++ b/beacon_node/beacon_chain/src/block_times_cache.rs @@ -242,12 +242,13 @@ impl BlockTimesCache { #[cfg(test)] mod test { use super::*; + use types::Hash256Extended; #[test] fn observed_time_uses_minimum() { let mut cache = BlockTimesCache::default(); - let block_root = Hash256::ZERO; + let block_root = Hash256::zero(); let slot = Slot::new(100); let slot_start_time = Duration::from_secs(0); diff --git a/beacon_node/beacon_chain/src/builder.rs b/beacon_node/beacon_chain/src/builder.rs index 2ef394d5223..ced75f6e264 100644 --- a/beacon_node/beacon_chain/src/builder.rs +++ b/beacon_node/beacon_chain/src/builder.rs @@ -40,7 +40,7 @@ use store::{Error as StoreError, HotColdDB, ItemStore, KeyValueStoreOp}; use task_executor::{ShutdownReason, TaskExecutor}; use types::{ BeaconBlock, BeaconState, BlobSidecarList, ChainSpec, Checkpoint, Epoch, EthSpec, Hash256, - Signature, SignedBeaconBlock, Slot, + Hash256Extended, Signature, SignedBeaconBlock, Slot, }; /// An empty struct used to "witness" all the `BeaconChainTypes` traits. It has no user-facing @@ -364,7 +364,7 @@ where // Store the genesis block under the `ZERO_HASH` key. store - .put_block(&Hash256::ZERO, beacon_block.clone()) + .put_block(&Hash256::zero(), beacon_block.clone()) .map_err(|e| { format!( "Failed to store genesis block under 0x00..00 alias: {:?}", @@ -1212,7 +1212,7 @@ mod test { assert_eq!( chain .store - .get_blinded_block(&Hash256::ZERO) + .get_blinded_block(&Hash256::zero()) .expect("should read db") .expect("should find genesis block"), block.clone_as_blinded(), diff --git a/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs b/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs index fb8afb2bfbb..97703fa8527 100644 --- a/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs +++ b/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs @@ -215,9 +215,8 @@ impl PendingComponents { }; let num_blobs_expected = diet_executed_block.num_blobs_expected(); let Some(verified_blobs) = verified_blobs - .into_iter() - .cloned() - .map(|b| b.map(|b| b.to_blob())) + .iter() + .map(|b| b.clone().map(|b| b.to_blob())) .take(num_blobs_expected) .collect::>>() else { @@ -343,7 +342,7 @@ impl OverflowStore { for res in self .0 .hot_db - .iter_raw_entries(DBColumn::OverflowLRUCache, block_root.as_bytes()) + .iter_raw_entries(DBColumn::OverflowLRUCache, block_root.as_slice()) { let (key_bytes, value_bytes) = res?; match OverflowKey::from_ssz_bytes(&key_bytes)? { @@ -1894,7 +1893,7 @@ mod pending_components_tests { use rand::SeedableRng; use state_processing::ConsensusContext; use types::test_utils::TestRandom; - use types::{BeaconState, ForkName, MainnetEthSpec, SignedBeaconBlock, Slot}; + use types::{BeaconState, ForkName, Hash256Extended, MainnetEthSpec, SignedBeaconBlock, Slot}; type E = MainnetEthSpec; @@ -2009,7 +2008,7 @@ mod pending_components_tests { let (block_commitments, blobs, random_blobs) = pre_setup(); let (block_commitments, blobs, random_blobs) = setup_pending_components(block_commitments, blobs, random_blobs); - let block_root = Hash256::ZERO; + let block_root = Hash256::zero(); let mut cache = >::empty(block_root); cache.merge_block(block_commitments); cache.merge_blobs(random_blobs); @@ -2023,7 +2022,7 @@ mod pending_components_tests { let (block_commitments, blobs, random_blobs) = pre_setup(); let (block_commitments, blobs, random_blobs) = setup_pending_components(block_commitments, blobs, random_blobs); - let block_root = Hash256::ZERO; + let block_root = Hash256::zero(); let mut cache = >::empty(block_root); cache.merge_blobs(random_blobs); cache.merge_block(block_commitments); @@ -2038,7 +2037,7 @@ mod pending_components_tests { let (block_commitments, blobs, random_blobs) = setup_pending_components(block_commitments, blobs, random_blobs); - let block_root = Hash256::ZERO; + let block_root = Hash256::zero(); let mut cache = >::empty(block_root); cache.merge_blobs(random_blobs); cache.merge_blobs(blobs); @@ -2053,7 +2052,7 @@ mod pending_components_tests { let (block_commitments, blobs, random_blobs) = setup_pending_components(block_commitments, blobs, random_blobs); - let block_root = Hash256::ZERO; + let block_root = Hash256::zero(); let mut cache = >::empty(block_root); cache.merge_block(block_commitments); cache.merge_blobs(blobs); @@ -2068,7 +2067,7 @@ mod pending_components_tests { let (block_commitments, blobs, random_blobs) = setup_pending_components(block_commitments, blobs, random_blobs); - let block_root = Hash256::ZERO; + let block_root = Hash256::zero(); let mut cache = >::empty(block_root); cache.merge_blobs(blobs); cache.merge_block(block_commitments); @@ -2083,7 +2082,7 @@ mod pending_components_tests { let (block_commitments, blobs, random_blobs) = setup_pending_components(block_commitments, blobs, random_blobs); - let block_root = Hash256::ZERO; + let block_root = Hash256::zero(); let mut cache = >::empty(block_root); cache.merge_blobs(blobs); cache.merge_blobs(random_blobs); diff --git a/beacon_node/beacon_chain/src/eth1_chain.rs b/beacon_node/beacon_chain/src/eth1_chain.rs index f6b77c6de15..8741402cdd8 100644 --- a/beacon_node/beacon_chain/src/eth1_chain.rs +++ b/beacon_node/beacon_chain/src/eth1_chain.rs @@ -678,7 +678,7 @@ fn is_candidate_block(block: &Eth1Block, period_start: u64, spec: &ChainSpec) -> mod test { use super::*; use environment::null_logger; - use types::{DepositData, MinimalEthSpec, Signature}; + use types::{DepositData, Hash256Extended, MinimalEthSpec, Signature}; type E = MinimalEthSpec; @@ -752,7 +752,7 @@ mod test { let keypair = generate_deterministic_keypair(i as usize); let mut deposit = DepositData { pubkey: keypair.pk.into(), - withdrawal_credentials: Hash256::ZERO, + withdrawal_credentials: Hash256::zero(), amount: spec.max_effective_balance, signature: Signature::empty().into(), }; diff --git a/beacon_node/beacon_chain/src/execution_payload.rs b/beacon_node/beacon_chain/src/execution_payload.rs index a6e0d247dc2..81bddf6a927 100644 --- a/beacon_node/beacon_chain/src/execution_payload.rs +++ b/beacon_node/beacon_chain/src/execution_payload.rs @@ -505,7 +505,7 @@ where return Ok(BlockProposalContentsType::Full( BlockProposalContents::Payload { payload: FullPayload::default_at_fork(fork)?, - block_value: Uint256::zero(), + block_value: Uint256::ZERO, }, )); } @@ -523,7 +523,7 @@ where return Ok(BlockProposalContentsType::Full( BlockProposalContents::Payload { payload: FullPayload::default_at_fork(fork)?, - block_value: Uint256::zero(), + block_value: Uint256::ZERO, }, )); } diff --git a/beacon_node/beacon_chain/src/head_tracker.rs b/beacon_node/beacon_chain/src/head_tracker.rs index 71e2473cdcf..9a8927198ed 100644 --- a/beacon_node/beacon_chain/src/head_tracker.rs +++ b/beacon_node/beacon_chain/src/head_tracker.rs @@ -105,7 +105,7 @@ impl SszHeadTracker { mod test { use super::*; use ssz::{Decode, Encode}; - use types::{BeaconBlock, EthSpec, MainnetEthSpec}; + use types::{BeaconBlock, EthSpec, Hash256Extended, MainnetEthSpec}; type E = MainnetEthSpec; diff --git a/beacon_node/beacon_chain/src/historical_blocks.rs b/beacon_node/beacon_chain/src/historical_blocks.rs index c324b2f4d94..3402d38d4e2 100644 --- a/beacon_node/beacon_chain/src/historical_blocks.rs +++ b/beacon_node/beacon_chain/src/historical_blocks.rs @@ -10,7 +10,7 @@ use std::borrow::Cow; use std::iter; use std::time::Duration; use store::{chunked_vector::BlockRoots, AnchorInfo, BlobInfo, ChunkWriter, KeyValueStore}; -use types::{Hash256, Slot}; +use types::{Hash256, Hash256Extended, Slot}; /// Use a longer timeout on the pubkey cache. /// @@ -146,7 +146,7 @@ impl BeaconChain { chunk_writer.set(slot, self.genesis_block_root, &mut cold_batch)?; } prev_block_slot = genesis_slot; - expected_block_root = Hash256::ZERO; + expected_block_root = Hash256::zero(); break; } } diff --git a/beacon_node/beacon_chain/src/metrics.rs b/beacon_node/beacon_chain/src/metrics.rs index 4ceaf675cec..7bde40ab160 100644 --- a/beacon_node/beacon_chain/src/metrics.rs +++ b/beacon_node/beacon_chain/src/metrics.rs @@ -1400,7 +1400,9 @@ fn set_gauge_by_epoch(gauge: &Result, value: Epoch) { } fn set_gauge_by_hash(gauge: &Result, value: Hash256) { - set_gauge(gauge, value.to_low_u64_le() as i64); + // TODO(alloy) implement this + // set_gauge(gauge, value.to_low_u64_le() as i64); + todo!() } fn set_gauge_by_usize(gauge: &Result, value: usize) { diff --git a/beacon_node/beacon_chain/src/migrate.rs b/beacon_node/beacon_chain/src/migrate.rs index 971b3452f99..b444ac1deec 100644 --- a/beacon_node/beacon_chain/src/migrate.rs +++ b/beacon_node/beacon_chain/src/migrate.rs @@ -15,7 +15,7 @@ use store::{Error, ItemStore, StoreItem, StoreOp}; pub use store::{HotColdDB, MemoryStore}; use types::{ BeaconState, BeaconStateError, BeaconStateHash, Checkpoint, Epoch, EthSpec, Hash256, - SignedBeaconBlockHash, Slot, + Hash256Extended, SignedBeaconBlockHash, Slot, }; /// Compact at least this frequently, finalization permitting (7 days). @@ -452,7 +452,7 @@ impl, Cold: ItemStore> BackgroundMigrator::default(); let key = Slot::new(0); let validator_index = 0; - let value = Hash256::ZERO; + let value = Hash256::zero(); // Assert there is no entry. assert!(store @@ -1171,7 +1172,7 @@ mod tests { test_suite_slot!( observed_sync_contributors, ObservedSyncContributors, - Hash256::ZERO + Hash256::zero() ); test_suite_slot!(observed_sync_aggregators, ObservedSyncAggregators, ()); } diff --git a/beacon_node/beacon_chain/src/otb_verification_service.rs b/beacon_node/beacon_chain/src/otb_verification_service.rs index b934c553e6c..31034a7d59b 100644 --- a/beacon_node/beacon_chain/src/otb_verification_service.rs +++ b/beacon_node/beacon_chain/src/otb_verification_service.rs @@ -64,7 +64,7 @@ impl OptimisticTransitionBlock { store .as_ref() .hot_db - .key_delete(OTBColumn.into(), self.root.as_bytes()) + .key_delete(OTBColumn.into(), self.root.as_slice()) } fn is_canonical( diff --git a/beacon_node/beacon_chain/src/schema_change/migration_schema_v21.rs b/beacon_node/beacon_chain/src/schema_change/migration_schema_v21.rs index 4042d328207..fcc8b9884ac 100644 --- a/beacon_node/beacon_chain/src/schema_change/migration_schema_v21.rs +++ b/beacon_node/beacon_chain/src/schema_change/migration_schema_v21.rs @@ -62,7 +62,7 @@ pub fn downgrade_from_v21( message: format!("{e:?}"), })?; - let db_key = get_key_for_col(DBColumn::PubkeyCache.into(), key.as_bytes()); + let db_key = get_key_for_col(DBColumn::PubkeyCache.into(), key.as_slice()); ops.push(KeyValueStoreOp::PutKeyValue( db_key, pubkey_bytes.as_ssz_bytes(), diff --git a/beacon_node/beacon_chain/src/test_utils.rs b/beacon_node/beacon_chain/src/test_utils.rs index 9acf3908f3d..bd98f19af6f 100644 --- a/beacon_node/beacon_chain/src/test_utils.rs +++ b/beacon_node/beacon_chain/src/test_utils.rs @@ -1510,13 +1510,13 @@ where let data = AttestationData { slot: Slot::new(0), index: 0, - beacon_block_root: Hash256::ZERO, + beacon_block_root: Hash256::zero(), target: Checkpoint { - root: Hash256::ZERO, + root: Hash256::zero(), epoch: target1.unwrap_or(fork.epoch), }, source: Checkpoint { - root: Hash256::ZERO, + root: Hash256::zero(), epoch: source1.unwrap_or(Epoch::new(0)), }, }; @@ -1601,13 +1601,13 @@ where let data = AttestationData { slot: Slot::new(0), index: 0, - beacon_block_root: Hash256::ZERO, + beacon_block_root: Hash256::zero(), target: Checkpoint { - root: Hash256::ZERO, + root: Hash256::zero(), epoch: Epoch::new(0), }, source: Checkpoint { - root: Hash256::ZERO, + root: Hash256::zero(), epoch: Epoch::new(0), }, }; @@ -1719,7 +1719,7 @@ where } let mut block_header_2 = block_header_1.clone(); - block_header_2.state_root = Hash256::ZERO; + block_header_2.state_root = Hash256::zero(); let sk = &self.validator_keypairs[validator_index as usize].sk; let fork = self.chain.canonical_head.cached_head().head_fork(); @@ -2292,7 +2292,7 @@ where validators, HashMap::new(), HashMap::new(), - SignedBeaconBlockHash::from(Hash256::ZERO), + SignedBeaconBlockHash::from(Hash256::zero()), ) }) .collect::>(); @@ -2357,7 +2357,7 @@ where .iter() .cloned() .map(|checkpoint| checkpoint.beacon_state.finalized_checkpoint().root) - .filter(|block_hash| *block_hash != Hash256::ZERO) + .filter(|block_hash| *block_hash != Hash256::zero()) .map(|hash| hash.into()) .collect() } diff --git a/beacon_node/beacon_chain/src/validator_pubkey_cache.rs b/beacon_node/beacon_chain/src/validator_pubkey_cache.rs index 576fbf0fd1f..7cfc9b9e2ba 100644 --- a/beacon_node/beacon_chain/src/validator_pubkey_cache.rs +++ b/beacon_node/beacon_chain/src/validator_pubkey_cache.rs @@ -7,7 +7,7 @@ use ssz_derive::{Decode, Encode}; use std::collections::HashMap; use std::marker::PhantomData; use store::{DBColumn, Error as StoreError, StoreItem, StoreOp}; -use types::{BeaconState, Hash256, PublicKey, PublicKeyBytes}; +use types::{BeaconState, Hash256, Hash256Extended, PublicKey, PublicKeyBytes}; /// Provides a mapping of `validator_index -> validator_publickey`. /// diff --git a/beacon_node/beacon_chain/tests/block_verification.rs b/beacon_node/beacon_chain/tests/block_verification.rs index 8a358c8621a..d9c9a3b6a74 100644 --- a/beacon_node/beacon_chain/tests/block_verification.rs +++ b/beacon_node/beacon_chain/tests/block_verification.rs @@ -333,7 +333,7 @@ async fn chain_segment_non_linear_parent_roots() { .collect(); let (mut block, signature) = blocks[3].as_block().clone().deconstruct(); - *block.parent_root_mut() = Hash256::ZERO; + *block.parent_root_mut() = Hash256::zero(); blocks[3] = RpcBlock::new_without_blobs( None, Arc::new(SignedBeaconBlock::from_block(block, signature)), @@ -676,14 +676,14 @@ async fn invalid_signature_attester_slashing() { data: AttestationData { slot: Slot::new(0), index: 0, - beacon_block_root: Hash256::ZERO, + beacon_block_root: Hash256::zero(), source: Checkpoint { epoch: Epoch::new(0), - root: Hash256::ZERO, + root: Hash256::zero(), }, target: Checkpoint { epoch: Epoch::new(0), - root: Hash256::ZERO, + root: Hash256::zero(), }, }, signature: junk_aggregate_signature(), @@ -700,14 +700,14 @@ async fn invalid_signature_attester_slashing() { data: AttestationData { slot: Slot::new(0), index: 0, - beacon_block_root: Hash256::ZERO, + beacon_block_root: Hash256::zero(), source: Checkpoint { epoch: Epoch::new(0), - root: Hash256::ZERO, + root: Hash256::zero(), }, target: Checkpoint { epoch: Epoch::new(0), - root: Hash256::ZERO, + root: Hash256::zero(), }, }, signature: junk_aggregate_signature(), @@ -845,10 +845,10 @@ async fn invalid_signature_deposit() { let harness = get_invalid_sigs_harness(&chain_segment).await; let mut snapshots = chain_segment.clone(); let deposit = Deposit { - proof: vec![Hash256::ZERO; DEPOSIT_TREE_DEPTH + 1].into(), + proof: vec![Hash256::zero(); DEPOSIT_TREE_DEPTH + 1].into(), data: DepositData { pubkey: Keypair::random().pk.into(), - withdrawal_credentials: Hash256::ZERO, + withdrawal_credentials: Hash256::zero(), amount: 0, signature: junk_signature().into(), }, diff --git a/beacon_node/beacon_chain/tests/store_tests.rs b/beacon_node/beacon_chain/tests/store_tests.rs index 9cb8a0fb3ca..6b77df4f812 100644 --- a/beacon_node/beacon_chain/tests/store_tests.rs +++ b/beacon_node/beacon_chain/tests/store_tests.rs @@ -295,8 +295,8 @@ async fn heal_freezer_block_roots_at_genesis() { .unwrap() .unwrap(); - chunk.values[1] = Hash256::ZERO; - chunk.values[2] = Hash256::ZERO; + chunk.values[1] = Hash256::zero(); + chunk.values[2] = Hash256::zero(); let mut ops = vec![]; chunk @@ -319,8 +319,8 @@ async fn heal_freezer_block_roots_at_genesis() { assert_eq!( block_roots, vec![ - (Hash256::ZERO, Slot::new(1)), - (Hash256::ZERO, Slot::new(2)) + (Hash256::zero(), Slot::new(1)), + (Hash256::zero(), Slot::new(2)) ] ); @@ -1447,7 +1447,7 @@ async fn pruning_does_not_touch_abandoned_block_shared_with_canonical_chain() { let chain_dump = rig.chain.chain_dump().unwrap(); assert_eq!( get_finalized_epoch_boundary_blocks(&chain_dump), - vec![Hash256::ZERO.into()].into_iter().collect(), + vec![Hash256::zero().into()].into_iter().collect(), ); assert!(get_blocks(&chain_dump).contains(&shared_head)); @@ -2187,7 +2187,7 @@ async fn pruning_test( let chain_dump = harness.chain.chain_dump().unwrap(); assert_eq!( get_finalized_epoch_boundary_blocks(&chain_dump), - vec![Hash256::ZERO.into()].into_iter().collect(), + vec![Hash256::zero().into()].into_iter().collect(), ); // Trigger finalization @@ -2584,7 +2584,7 @@ async fn weak_subjectivity_sync_test(slots: Vec, checkpoint_slot: Slot) { assert_eq!(forwards, expected); // All blocks can be loaded. - let mut prev_block_root = Hash256::ZERO; + let mut prev_block_root = Hash256::zero(); for (block_root, slot) in beacon_chain .forwards_iter_block_roots(Slot::new(0)) .unwrap() diff --git a/beacon_node/beacon_chain/tests/sync_committee_verification.rs b/beacon_node/beacon_chain/tests/sync_committee_verification.rs index 6944b2e1205..242ed558475 100644 --- a/beacon_node/beacon_chain/tests/sync_committee_verification.rs +++ b/beacon_node/beacon_chain/tests/sync_committee_verification.rs @@ -180,7 +180,7 @@ async fn aggregated_gossip_verification() { harness .add_attested_blocks_at_slots( state, - Hash256::ZERO, + Hash256::zero(), &[Slot::new(1), Slot::new(2)], (0..VALIDATOR_COUNT).collect::>().as_slice(), ) @@ -490,7 +490,7 @@ async fn aggregated_gossip_verification() { ); harness - .add_attested_block_at_slot(target_slot, state, Hash256::ZERO, &[]) + .add_attested_block_at_slot(target_slot, state, Hash256::zero(), &[]) .await .expect("should add block"); @@ -514,7 +514,7 @@ async fn unaggregated_gossip_verification() { harness .add_attested_blocks_at_slots( state, - Hash256::ZERO, + Hash256::zero(), &[Slot::new(1), Slot::new(2)], (0..VALIDATOR_COUNT).collect::>().as_slice(), ) @@ -793,7 +793,7 @@ async fn unaggregated_gossip_verification() { ); harness - .add_attested_block_at_slot(target_slot, state, Hash256::ZERO, &[]) + .add_attested_block_at_slot(target_slot, state, Hash256::zero(), &[]) .await .expect("should add block"); diff --git a/beacon_node/eth1/src/block_cache.rs b/beacon_node/eth1/src/block_cache.rs index 399634a9fab..35054afaa4a 100644 --- a/beacon_node/eth1/src/block_cache.rs +++ b/beacon_node/eth1/src/block_cache.rs @@ -195,6 +195,8 @@ impl BlockCache { #[cfg(test)] mod tests { + use types::Hash256Extended; + use super::*; fn get_block(i: u64, interval_secs: u64) -> Eth1Block { diff --git a/beacon_node/eth1/src/deposit_cache.rs b/beacon_node/eth1/src/deposit_cache.rs index b443f739e81..731ac089c71 100644 --- a/beacon_node/eth1/src/deposit_cache.rs +++ b/beacon_node/eth1/src/deposit_cache.rs @@ -471,7 +471,7 @@ impl DepositCache { pub mod tests { use super::*; use execution_layer::http::deposit_log::Log; - use types::{EthSpec, MainnetEthSpec}; + use types::{EthSpec, Hash256Extended, MainnetEthSpec}; /// The data from a deposit event, using the v0.8.3 version of the deposit contract. pub const EXAMPLE_LOG: &[u8] = &[ diff --git a/beacon_node/eth1/tests/test.rs b/beacon_node/eth1/tests/test.rs index 3310caa3a31..6725a33f2f1 100644 --- a/beacon_node/eth1/tests/test.rs +++ b/beacon_node/eth1/tests/test.rs @@ -11,7 +11,10 @@ use sloggers::{null::NullLoggerBuilder, Build}; use std::ops::Range; use std::time::Duration; use tree_hash::TreeHash; -use types::{DepositData, EthSpec, Hash256, Keypair, MainnetEthSpec, MinimalEthSpec, Signature}; +use types::{ + DepositData, EthSpec, Hash256, Hash256Extended, Keypair, MainnetEthSpec, MinimalEthSpec, + Signature, +}; const DEPOSIT_CONTRACT_TREE_DEPTH: usize = 32; @@ -39,7 +42,7 @@ fn random_deposit_data() -> DepositData { let mut deposit = DepositData { pubkey: keypair.pk.into(), - withdrawal_credentials: Hash256::ZERO, + withdrawal_credentials: Hash256::zero(), amount: 32_000_000_000, signature: Signature::empty().into(), }; diff --git a/beacon_node/execution_layer/src/block_hash.rs b/beacon_node/execution_layer/src/block_hash.rs index 74712bc4449..c378ce967be 100644 --- a/beacon_node/execution_layer/src/block_hash.rs +++ b/beacon_node/execution_layer/src/block_hash.rs @@ -2,7 +2,7 @@ use crate::{ json_structures::JsonWithdrawal, keccak::{keccak256, KeccakHasher}, }; -use ethers_core::utils::rlp::RlpStream; +use alloy_rlp::Encodable; use keccak_hash::KECCAK_EMPTY_LIST_RLP; use triehash::ordered_trie_root; use types::{ @@ -60,36 +60,36 @@ pub fn calculate_execution_block_hash( /// RLP encode a withdrawal. pub fn rlp_encode_withdrawal(withdrawal: &JsonWithdrawal) -> Vec { - let mut rlp_stream = RlpStream::new(); - rlp_stream.begin_list(4); - rlp_stream.append(&withdrawal.index); - rlp_stream.append(&withdrawal.validator_index); - rlp_stream.append(&withdrawal.address.as_slice()); - rlp_stream.append(&withdrawal.amount); - rlp_stream.out().into() + let mut rlp_buffer = Vec::::new(); + withdrawal.index.encode(&mut rlp_buffer); + withdrawal.validator_index.encode(&mut rlp_buffer); + withdrawal.address.as_slice().encode(&mut rlp_buffer); + withdrawal.amount.encode(&mut rlp_buffer); + + rlp_buffer } /// RLP encode an execution block header. pub fn rlp_encode_block_header(header: &ExecutionBlockHeader) -> Vec { - let mut rlp_header_stream = RlpStream::new(); - rlp_header_stream.begin_unbounded_list(); + let mut rlp_buffer = Vec::::new(); + map_execution_block_header_fields_base!(&header, |_, field| { - rlp_header_stream.append(field); + field.encode(&mut rlp_buffer); }); if let Some(withdrawals_root) = &header.withdrawals_root { - rlp_header_stream.append(withdrawals_root); + withdrawals_root.encode(&mut rlp_buffer); } if let Some(blob_gas_used) = &header.blob_gas_used { - rlp_header_stream.append(blob_gas_used); + blob_gas_used.encode(&mut rlp_buffer); } if let Some(excess_blob_gas) = &header.excess_blob_gas { - rlp_header_stream.append(excess_blob_gas); + excess_blob_gas.encode(&mut rlp_buffer); } if let Some(parent_beacon_block_root) = &header.parent_beacon_block_root { - rlp_header_stream.append(parent_beacon_block_root); + parent_beacon_block_root.encode(&mut rlp_buffer); } - rlp_header_stream.finalize_unbounded_list(); - rlp_header_stream.out().into() + + rlp_buffer } #[cfg(test)] diff --git a/beacon_node/execution_layer/src/engine_api/http.rs b/beacon_node/execution_layer/src/engine_api/http.rs index 52d72bd43e0..bf5043438ca 100644 --- a/beacon_node/execution_layer/src/engine_api/http.rs +++ b/beacon_node/execution_layer/src/engine_api/http.rs @@ -1330,7 +1330,7 @@ mod test { use std::future::Future; use std::str::FromStr; use std::sync::Arc; - use types::{MainnetEthSpec, Unsigned}; + use types::{Hash256Extended, MainnetEthSpec, Unsigned}; struct Tester { server: MockServer, @@ -1620,7 +1620,7 @@ mod test { }, Some(PayloadAttributes::V1(PayloadAttributesV1 { timestamp: 5, - prev_randao: Hash256::ZERO, + prev_randao: Hash256::zero(), suggested_fee_recipient: Address::repeat_byte(0), })), ) @@ -1655,7 +1655,7 @@ mod test { }, Some(PayloadAttributes::V1(PayloadAttributesV1 { timestamp: 5, - prev_randao: Hash256::ZERO, + prev_randao: Hash256::zero(), suggested_fee_recipient: Address::repeat_byte(0), })), ) @@ -1842,7 +1842,7 @@ mod test { }, Some(PayloadAttributes::V1(PayloadAttributesV1 { timestamp: 5, - prev_randao: Hash256::ZERO, + prev_randao: Hash256::zero(), suggested_fee_recipient: Address::from_str("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b").unwrap(), })) ) @@ -1889,7 +1889,7 @@ mod test { }, Some(PayloadAttributes::V1(PayloadAttributesV1 { timestamp: 5, - prev_randao: Hash256::ZERO, + prev_randao: Hash256::zero(), suggested_fee_recipient: Address::from_str("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b").unwrap(), })) ) @@ -1957,7 +1957,7 @@ mod test { state_root: Hash256::from_str("0xca3149fa9e37db08d1cd49c9061db1002ef1cd58db2210f2115c8c989b2bdf45").unwrap(), receipts_root: Hash256::from_str("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").unwrap(), logs_bloom: vec![0; 256].into(), - prev_randao: Hash256::ZERO, + prev_randao: Hash256::zero(), block_number: 1, gas_limit: u64::from_str_radix("1c95111",16).unwrap(), gas_used: 0, @@ -1982,7 +1982,7 @@ mod test { state_root: Hash256::from_str("0xca3149fa9e37db08d1cd49c9061db1002ef1cd58db2210f2115c8c989b2bdf45").unwrap(), receipts_root: Hash256::from_str("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421").unwrap(), logs_bloom: vec![0; 256].into(), - prev_randao: Hash256::ZERO, + prev_randao: Hash256::zero(), block_number: 1, gas_limit: u64::from_str_radix("1c9c380",16).unwrap(), gas_used: 0, diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index d7818168e87..c28adb0ef28 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -1132,9 +1132,8 @@ impl ExecutionLayer { let relay_value = *relay.data.message.value(); let boosted_relay_value = match builder_boost_factor { - Some(builder_boost_factor) => { - (relay_value / Uint256::from(100)).saturating_mul(Uint256::from(builder_boost_factor)) - } + Some(builder_boost_factor) => (relay_value / Uint256::from(100)) + .saturating_mul(Uint256::from(builder_boost_factor)), None => relay_value, }; @@ -2195,10 +2194,8 @@ fn verify_builder_bid( metrics::set_gauge_vec( &metrics::EXECUTION_LAYER_PAYLOAD_BIDS, &[metrics::BUILDER], - // TODO(alloy) display as a u64 - 0 - // payload_value_gwei.to_base_le(10) as i64, + 0, // payload_value_gwei.to_base_le(10) as i64, ); } diff --git a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs index 3521dd2c7cd..588f9a42bf0 100644 --- a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs +++ b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs @@ -23,7 +23,7 @@ use tree_hash_derive::TreeHash; use types::{ Blob, ChainSpec, EthSpec, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadBellatrix, ExecutionPayloadCapella, ExecutionPayloadDeneb, ExecutionPayloadElectra, - ExecutionPayloadHeader, ForkName, Hash256, Transaction, Transactions, Uint256, + ExecutionPayloadHeader, ForkName, Hash256, Hash256Extended, Transaction, Transactions, Uint256, }; use super::DEFAULT_TERMINAL_BLOCK; @@ -368,7 +368,7 @@ impl ExecutionBlockGenerator { // Hack the block hash to make this block distinct from any other block with a different // `unique_id` (the default is 0). - block.block_hash = ExecutionBlockHash::from_root(Hash256::from_slice(&unique_id.to_be_bytes())); + block.block_hash = ExecutionBlockHash::from_root(Hash256::from_low_u64_be(unique_id)); block.block_hash = ExecutionBlockHash::from_root(block.tree_hash_root()); let hash = self.insert_block(Block::PoW(block))?; diff --git a/beacon_node/execution_layer/src/test_utils/mock_builder.rs b/beacon_node/execution_layer/src/test_utils/mock_builder.rs index 1c7a3472c51..56c98cb2642 100644 --- a/beacon_node/execution_layer/src/test_utils/mock_builder.rs +++ b/beacon_node/execution_layer/src/test_utils/mock_builder.rs @@ -20,9 +20,9 @@ use types::builder_bid::{ }; use types::{ Address, BeaconState, ChainSpec, EthSpec, ExecPayload, ExecutionPayload, - ExecutionPayloadHeaderRefMut, ForkName, ForkVersionedResponse, Hash256, PublicKeyBytes, - Signature, SignedBlindedBeaconBlock, SignedRoot, SignedValidatorRegistrationData, Slot, - Uint256, + ExecutionPayloadHeaderRefMut, ForkName, ForkVersionedResponse, Hash256, Hash256Extended, + PublicKeyBytes, Signature, SignedBlindedBeaconBlock, SignedRoot, + SignedValidatorRegistrationData, Slot, Uint256, }; use types::{ExecutionBlockHash, SecretKey}; use warp::{Filter, Rejection}; @@ -521,7 +521,7 @@ pub fn serve( .await; let forkchoice_update_params = ForkchoiceUpdateParameters { - head_root: Hash256::ZERO, + head_root: Hash256::zero(), head_hash: None, justified_hash: Some(justified_execution_hash), finalized_hash: Some(finalized_execution_hash), diff --git a/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs b/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs index 4950b89965f..265abb86e93 100644 --- a/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs +++ b/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs @@ -4,10 +4,10 @@ use crate::{ }, *, }; -use kzg::Kzg; use alloy_primitives::B256 as H256; +use kzg::Kzg; use tempfile::NamedTempFile; -use types::MainnetEthSpec; +use types::{Hash256Extended, MainnetEthSpec}; pub struct MockExecutionLayer { pub server: MockServer, @@ -92,7 +92,7 @@ impl MockExecutionLayer { let parent_hash = latest_execution_block.block_hash(); let block_number = latest_execution_block.block_number() + 1; let timestamp = block_number; - let prev_randao = Hash256::from_slice(&block_number.to_be_bytes()); + let prev_randao = Hash256::from_low_u64_be(block_number); let head_block_root = Hash256::repeat_byte(42); let forkchoice_update_params = ForkchoiceUpdateParameters { head_root: head_block_root, diff --git a/beacon_node/genesis/src/eth1_genesis_service.rs b/beacon_node/genesis/src/eth1_genesis_service.rs index 1ee8eeac903..8615a69c0c1 100644 --- a/beacon_node/genesis/src/eth1_genesis_service.rs +++ b/beacon_node/genesis/src/eth1_genesis_service.rs @@ -13,7 +13,7 @@ use std::sync::{ }; use std::time::Duration; use tokio::time::sleep; -use types::{BeaconState, ChainSpec, Deposit, Eth1Data, EthSpec, Hash256}; +use types::{BeaconState, ChainSpec, Deposit, Eth1Data, EthSpec, Hash256, Hash256Extended}; /// The number of blocks that are pulled per request whilst waiting for genesis. const BLOCKS_PER_GENESIS_POLL: usize = 99; @@ -402,8 +402,8 @@ impl Eth1GenesisService { let mut state: BeaconState = BeaconState::new( genesis_time, Eth1Data { - block_hash: Hash256::ZERO, - deposit_root: Hash256::ZERO, + block_hash: Hash256::zero(), + deposit_root: Hash256::zero(), deposit_count: 0, }, spec, @@ -416,7 +416,7 @@ impl Eth1GenesisService { // // The deposits are coming directly from our own deposit tree to there's no need to // make proofs about their inclusion in it. - proof: vec![Hash256::ZERO; spec.deposit_contract_tree_depth as usize].into(), + proof: vec![Hash256::zero(); spec.deposit_contract_tree_depth as usize].into(), data: deposit_log.deposit_data.clone(), }) .try_for_each(|deposit| { diff --git a/beacon_node/genesis/src/interop.rs b/beacon_node/genesis/src/interop.rs index 4c78b8efd8f..90c4ad6e665 100644 --- a/beacon_node/genesis/src/interop.rs +++ b/beacon_node/genesis/src/interop.rs @@ -180,12 +180,12 @@ mod test { for v in state.validators() { let creds = v.withdrawal_credentials; assert_eq!( - creds.as_bytes()[0], + creds.as_slice()[0], spec.bls_withdrawal_prefix_byte, "first byte of withdrawal creds should be bls prefix" ); assert_eq!( - &creds.as_bytes()[1..], + &creds.as_slice()[1..], &hash(&v.pubkey.as_ssz_bytes())[1..], "rest of withdrawal creds should be pubkey hash" ) @@ -242,7 +242,7 @@ mod test { for (index, v) in state.validators().iter().enumerate() { let withdrawal_credientials = v.withdrawal_credentials; - let creds = withdrawal_credientials.as_bytes(); + let creds = withdrawal_credientials.as_slice(); if index % 2 == 0 { assert_eq!( creds[0], spec.bls_withdrawal_prefix_byte, diff --git a/beacon_node/genesis/tests/tests.rs b/beacon_node/genesis/tests/tests.rs index 1252e0100b6..84ca1665d0f 100644 --- a/beacon_node/genesis/tests/tests.rs +++ b/beacon_node/genesis/tests/tests.rs @@ -65,7 +65,7 @@ fn basic() { .map(|i| { deposit_contract.deposit_helper::( generate_deterministic_keypair(i as usize), - Hash256::from_low_u64_le(i), + Hash256::from_slice(&i.to_le_bytes()), 32_000_000_000, ) }) diff --git a/beacon_node/http_api/src/block_id.rs b/beacon_node/http_api/src/block_id.rs index 347fc1a1212..3f5d0680c75 100644 --- a/beacon_node/http_api/src/block_id.rs +++ b/beacon_node/http_api/src/block_id.rs @@ -5,7 +5,10 @@ use eth2::types::BlockId as CoreBlockId; use std::fmt; use std::str::FromStr; use std::sync::Arc; -use types::{BlobSidecarList, EthSpec, Hash256, SignedBeaconBlock, SignedBlindedBeaconBlock, Slot}; +use types::{ + BlobSidecarList, EthSpec, Hash256, Hash256Extended, SignedBeaconBlock, + SignedBlindedBeaconBlock, Slot, +}; /// Wraps `eth2::types::BlockId` and provides a simple way to obtain a block or root for a given /// `BlockId`. @@ -81,7 +84,7 @@ impl BlockId { } CoreBlockId::Root(root) => { // This matches the behaviour of other consensus clients (e.g. Teku). - if root == &Hash256::ZERO { + if root == &Hash256::zero() { return Err(warp_utils::reject::custom_not_found(format!( "beacon block with root {}", root diff --git a/beacon_node/http_api/tests/broadcast_validation_tests.rs b/beacon_node/http_api/tests/broadcast_validation_tests.rs index 30442cfe08d..6a3f7947e6b 100644 --- a/beacon_node/http_api/tests/broadcast_validation_tests.rs +++ b/beacon_node/http_api/tests/broadcast_validation_tests.rs @@ -66,8 +66,8 @@ pub async fn gossip_invalid() { let ((block, blobs), _) = tester .harness .make_block_with_modifier(chain_state_before, slot, |b| { - *b.state_root_mut() = Hash256::ZERO; - *b.parent_root_mut() = Hash256::ZERO; + *b.state_root_mut() = Hash256::zero(); + *b.parent_root_mut() = Hash256::zero(); }) .await; @@ -254,8 +254,8 @@ pub async fn consensus_invalid() { let ((block, blobs), _) = tester .harness .make_block_with_modifier(chain_state_before, slot, |b| { - *b.state_root_mut() = Hash256::ZERO; - *b.parent_root_mut() = Hash256::ZERO; + *b.state_root_mut() = Hash256::zero(); + *b.parent_root_mut() = Hash256::zero(); }) .await; @@ -305,7 +305,7 @@ pub async fn consensus_gossip() { let state_a = tester.harness.get_current_state(); let ((block, blobs), _) = tester .harness - .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::ZERO) + .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::zero()) .await; let response: Result<(), eth2::Error> = tester @@ -466,8 +466,8 @@ pub async fn equivocation_invalid() { let ((block, blobs), _) = tester .harness .make_block_with_modifier(chain_state_before, slot, |b| { - *b.state_root_mut() = Hash256::ZERO; - *b.parent_root_mut() = Hash256::ZERO; + *b.state_root_mut() = Hash256::zero(); + *b.parent_root_mut() = Hash256::zero(); }) .await; @@ -589,7 +589,7 @@ pub async fn equivocation_gossip() { let state_a = tester.harness.get_current_state(); let ((block, blobs), _) = tester .harness - .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::ZERO) + .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::zero()) .await; let response: Result<(), eth2::Error> = tester @@ -760,8 +760,8 @@ pub async fn blinded_gossip_invalid() { let (block_contents_tuple, _) = tester .harness .make_block_with_modifier(chain_state_before, slot, |b| { - *b.state_root_mut() = Hash256::ZERO; - *b.parent_root_mut() = Hash256::ZERO; + *b.state_root_mut() = Hash256::zero(); + *b.parent_root_mut() = Hash256::zero(); }) .await; @@ -812,7 +812,7 @@ pub async fn blinded_gossip_partial_pass() { let (block_contents_tuple, _) = tester .harness .make_block_with_modifier(chain_state_before, slot, |b| { - *b.state_root_mut() = Hash256::ZERO + *b.state_root_mut() = Hash256::zero() }) .await; @@ -941,8 +941,8 @@ pub async fn blinded_consensus_invalid() { let (block_contents_tuple, _) = tester .harness .make_block_with_modifier(chain_state_before, slot, |b| { - *b.state_root_mut() = Hash256::ZERO; - *b.parent_root_mut() = Hash256::ZERO; + *b.state_root_mut() = Hash256::zero(); + *b.parent_root_mut() = Hash256::zero(); }) .await; @@ -992,7 +992,7 @@ pub async fn blinded_consensus_gossip() { let state_a = tester.harness.get_current_state(); let (block_contents_tuple, _) = tester .harness - .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::ZERO) + .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::zero()) .await; let response: Result<(), eth2::Error> = tester @@ -1085,8 +1085,8 @@ pub async fn blinded_equivocation_invalid() { let (block_contents_tuple, _) = tester .harness .make_block_with_modifier(chain_state_before, slot, |b| { - *b.state_root_mut() = Hash256::ZERO; - *b.parent_root_mut() = Hash256::ZERO; + *b.state_root_mut() = Hash256::zero(); + *b.parent_root_mut() = Hash256::zero(); }) .await; @@ -1204,7 +1204,7 @@ pub async fn blinded_equivocation_gossip() { let state_a = tester.harness.get_current_state(); let (block_contents_tuple, _) = tester .harness - .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::ZERO) + .make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::zero()) .await; let response: Result<(), eth2::Error> = tester diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index 58b853d00a1..4213fd4ab8d 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -444,7 +444,7 @@ impl ApiTester { StateId(CoreStateId::Slot(Slot::from(SKIPPED_SLOTS[1]))), StateId(CoreStateId::Slot(Slot::from(SKIPPED_SLOTS[2]))), StateId(CoreStateId::Slot(Slot::from(SKIPPED_SLOTS[3]))), - StateId(CoreStateId::Root(Hash256::ZERO)), + StateId(CoreStateId::Root(Hash256::zero())), ]; ids.push(StateId(CoreStateId::Root( self.chain.canonical_head.cached_head().head_state_root(), @@ -464,7 +464,7 @@ impl ApiTester { BlockId(CoreBlockId::Slot(Slot::from(SKIPPED_SLOTS[1]))), BlockId(CoreBlockId::Slot(Slot::from(SKIPPED_SLOTS[2]))), BlockId(CoreBlockId::Slot(Slot::from(SKIPPED_SLOTS[3]))), - BlockId(CoreBlockId::Root(Hash256::ZERO)), + BlockId(CoreBlockId::Root(Hash256::zero())), ]; ids.push(BlockId(CoreBlockId::Root( self.chain.canonical_head.cached_head().head_block_root(), @@ -1322,7 +1322,7 @@ impl ApiTester { self.harness.get_current_state(), self.harness.get_current_slot(), |b| { - *b.state_root_mut() = Hash256::ZERO; + *b.state_root_mut() = Hash256::zero(); }, ) .await @@ -1349,7 +1349,7 @@ impl ApiTester { self.harness.get_current_state(), self.harness.get_current_slot(), |b| { - *b.state_root_mut() = Hash256::ZERO; + *b.state_root_mut() = Hash256::zero(); }, ) .await @@ -3405,7 +3405,7 @@ impl ApiTester { genesis_epoch, Domain::ApplicationMask(ApplicationDomain::Builder), &fork, - Hash256::ZERO, + Hash256::zero(), ); let message = data.signing_root(domain); let signature = keypair.sk.sign(message); @@ -3488,7 +3488,7 @@ impl ApiTester { genesis_epoch, Domain::ApplicationMask(ApplicationDomain::Builder), &fork, - Hash256::ZERO, + Hash256::zero(), ); let message = data.signing_root(domain); let signature = keypair.sk.sign(message); @@ -5440,7 +5440,7 @@ impl ApiTester { } pub async fn test_get_expected_withdrawals_invalid_state(self) -> Self { - let state_id = CoreStateId::Root(Hash256::ZERO); + let state_id = CoreStateId::Root(Hash256::zero()); let result = self.client.get_expected_withdrawals(&state_id).await; diff --git a/beacon_node/lighthouse_network/src/rpc/codec/base.rs b/beacon_node/lighthouse_network/src/rpc/codec/base.rs index 975bad23703..6e196fb965d 100644 --- a/beacon_node/lighthouse_network/src/rpc/codec/base.rs +++ b/beacon_node/lighthouse_network/src/rpc/codec/base.rs @@ -176,7 +176,7 @@ mod tests { use crate::rpc::protocol::*; use std::sync::Arc; - use types::{Epoch, ForkContext, ForkName, Hash256, Slot}; + use types::{Epoch, ForkContext, ForkName, Hash256, Hash256Extended, Slot}; use unsigned_varint::codec::Uvi; type Spec = types::MainnetEthSpec; @@ -203,7 +203,7 @@ mod tests { ForkName::Deneb => deneb_fork_epoch.start_slot(Spec::slots_per_epoch()), ForkName::Electra => electra_fork_epoch.start_slot(Spec::slots_per_epoch()), }; - ForkContext::new::(current_slot, Hash256::ZERO, &chain_spec) + ForkContext::new::(current_slot, Hash256::zero(), &chain_spec) } #[test] diff --git a/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs b/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs index f986cff235f..428c6367240 100644 --- a/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs +++ b/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs @@ -747,7 +747,7 @@ mod tests { use crate::types::{EnrAttestationBitfield, EnrSyncCommitteeBitfield}; use types::{ blob_sidecar::BlobIdentifier, BeaconBlock, BeaconBlockAltair, BeaconBlockBase, - BeaconBlockBellatrix, EmptyBlock, Epoch, FullPayload, Signature, Slot, + BeaconBlockBellatrix, EmptyBlock, Epoch, FullPayload, Hash256Extended, Signature, Slot, }; type Spec = types::MainnetEthSpec; @@ -774,7 +774,7 @@ mod tests { ForkName::Deneb => deneb_fork_epoch.start_slot(Spec::slots_per_epoch()), ForkName::Electra => electra_fork_epoch.start_slot(Spec::slots_per_epoch()), }; - ForkContext::new::(current_slot, Hash256::ZERO, &chain_spec) + ForkContext::new::(current_slot, Hash256::zero(), &chain_spec) } /// Smallest sized block across all current forks. Useful for testing @@ -833,9 +833,9 @@ mod tests { fn status_message() -> StatusMessage { StatusMessage { fork_digest: [0; 4], - finalized_root: Hash256::ZERO, + finalized_root: Hash256::zero(), finalized_epoch: Epoch::new(1), - head_root: Hash256::ZERO, + head_root: Hash256::zero(), head_slot: Slot::new(1), } } @@ -856,17 +856,17 @@ mod tests { } fn bbroot_request_v1(spec: &ChainSpec) -> BlocksByRootRequest { - BlocksByRootRequest::new_v1(vec![Hash256::ZERO], spec) + BlocksByRootRequest::new_v1(vec![Hash256::zero()], spec) } fn bbroot_request_v2(spec: &ChainSpec) -> BlocksByRootRequest { - BlocksByRootRequest::new(vec![Hash256::ZERO], spec) + BlocksByRootRequest::new(vec![Hash256::zero()], spec) } fn blbroot_request(spec: &ChainSpec) -> BlobsByRootRequest { BlobsByRootRequest::new( vec![BlobIdentifier { - block_root: Hash256::ZERO, + block_root: Hash256::zero(), index: 0, }], spec, @@ -1517,9 +1517,9 @@ mod tests { // Status message is 84 bytes uncompressed. `max_compressed_len` is 32 + 84 + 84/6 = 130. let status_message_bytes = StatusMessage { fork_digest: [0; 4], - finalized_root: Hash256::ZERO, + finalized_root: Hash256::zero(), finalized_epoch: Epoch::new(1), - head_root: Hash256::ZERO, + head_root: Hash256::zero(), head_slot: Slot::new(1), } .as_ssz_bytes(); @@ -1640,9 +1640,9 @@ mod tests { // Status message is 84 bytes uncompressed. `max_compressed_len` is 32 + 84 + 84/6 = 130. let status_message_bytes = StatusMessage { fork_digest: [0; 4], - finalized_root: Hash256::ZERO, + finalized_root: Hash256::zero(), finalized_epoch: Epoch::new(1), - head_root: Hash256::ZERO, + head_root: Hash256::zero(), head_slot: Slot::new(1), } .as_ssz_bytes(); diff --git a/beacon_node/lighthouse_network/tests/common.rs b/beacon_node/lighthouse_network/tests/common.rs index c2deb42162f..04adfe97ddf 100644 --- a/beacon_node/lighthouse_network/tests/common.rs +++ b/beacon_node/lighthouse_network/tests/common.rs @@ -9,7 +9,8 @@ use std::sync::Arc; use std::sync::Weak; use tokio::runtime::Runtime; use types::{ - ChainSpec, EnrForkId, Epoch, EthSpec, ForkContext, ForkName, Hash256, MinimalEthSpec, Slot, + ChainSpec, EnrForkId, Epoch, EthSpec, ForkContext, ForkName, Hash256, Hash256Extended, + MinimalEthSpec, Slot, }; type E = MinimalEthSpec; @@ -39,7 +40,7 @@ pub fn fork_context(fork_name: ForkName) -> ForkContext { ForkName::Deneb => deneb_fork_epoch.start_slot(E::slots_per_epoch()), ForkName::Electra => electra_fork_epoch.start_slot(E::slots_per_epoch()), }; - ForkContext::new::(current_slot, Hash256::ZERO, &chain_spec) + ForkContext::new::(current_slot, Hash256::zero(), &chain_spec) } pub struct Libp2pInstance( diff --git a/beacon_node/lighthouse_network/tests/rpc_tests.rs b/beacon_node/lighthouse_network/tests/rpc_tests.rs index 13346a93266..68615ce077e 100644 --- a/beacon_node/lighthouse_network/tests/rpc_tests.rs +++ b/beacon_node/lighthouse_network/tests/rpc_tests.rs @@ -15,8 +15,8 @@ use tokio::runtime::Runtime; use tokio::time::sleep; use types::{ BeaconBlock, BeaconBlockAltair, BeaconBlockBase, BeaconBlockBellatrix, BlobSidecar, ChainSpec, - EmptyBlock, Epoch, EthSpec, ForkContext, ForkName, Hash256, MinimalEthSpec, Signature, - SignedBeaconBlock, Slot, + EmptyBlock, Epoch, EthSpec, ForkContext, ForkName, Hash256, Hash256Extended, MinimalEthSpec, + Signature, SignedBeaconBlock, Slot, }; type E = MinimalEthSpec; @@ -77,18 +77,18 @@ fn test_tcp_status_rpc() { // Dummy STATUS RPC message let rpc_request = Request::Status(StatusMessage { fork_digest: [0; 4], - finalized_root: Hash256::ZERO, + finalized_root: Hash256::zero(), finalized_epoch: Epoch::new(1), - head_root: Hash256::ZERO, + head_root: Hash256::zero(), head_slot: Slot::new(1), }); // Dummy STATUS RPC message let rpc_response = Response::Status(StatusMessage { fork_digest: [0; 4], - finalized_root: Hash256::ZERO, + finalized_root: Hash256::zero(), finalized_epoch: Epoch::new(1), - head_root: Hash256::ZERO, + head_root: Hash256::zero(), head_slot: Slot::new(1), }); @@ -756,12 +756,12 @@ fn test_tcp_blocks_by_root_chunked_rpc() { // BlocksByRoot Request let rpc_request = Request::BlocksByRoot(BlocksByRootRequest::new( vec![ - Hash256::ZERO, - Hash256::ZERO, - Hash256::ZERO, - Hash256::ZERO, - Hash256::ZERO, - Hash256::ZERO, + Hash256::zero(), + Hash256::zero(), + Hash256::zero(), + Hash256::zero(), + Hash256::zero(), + Hash256::zero(), ], &spec, )); @@ -894,16 +894,16 @@ fn test_tcp_blocks_by_root_chunked_rpc_terminates_correctly() { // BlocksByRoot Request let rpc_request = Request::BlocksByRoot(BlocksByRootRequest::new( vec![ - Hash256::ZERO, - Hash256::ZERO, - Hash256::ZERO, - Hash256::ZERO, - Hash256::ZERO, - Hash256::ZERO, - Hash256::ZERO, - Hash256::ZERO, - Hash256::ZERO, - Hash256::ZERO, + Hash256::zero(), + Hash256::zero(), + Hash256::zero(), + Hash256::zero(), + Hash256::zero(), + Hash256::zero(), + Hash256::zero(), + Hash256::zero(), + Hash256::zero(), + Hash256::zero(), ], &spec, )); diff --git a/beacon_node/network/src/network_beacon_processor/rpc_methods.rs b/beacon_node/network/src/network_beacon_processor/rpc_methods.rs index ab5f31007bd..6af340fd364 100644 --- a/beacon_node/network/src/network_beacon_processor/rpc_methods.rs +++ b/beacon_node/network/src/network_beacon_processor/rpc_methods.rs @@ -13,7 +13,7 @@ use std::collections::{hash_map::Entry, HashMap}; use std::sync::Arc; use tokio_stream::StreamExt; use types::blob_sidecar::BlobIdentifier; -use types::{Epoch, EthSpec, ForkName, Hash256, Slot}; +use types::{Epoch, EthSpec, ForkName, Hash256, Hash256Extended, Slot}; impl NetworkBeaconProcessor { /* Auxiliary functions */ @@ -85,8 +85,8 @@ impl NetworkBeaconProcessor { // their or our system's clock is incorrect. Some("Different system clocks or genesis time".to_string()) } else if remote.finalized_epoch <= local.finalized_epoch - && remote.finalized_root != Hash256::ZERO - && local.finalized_root != Hash256::ZERO + && remote.finalized_root != Hash256::zero() + && local.finalized_root != Hash256::zero() && self .chain .block_root_at_slot(start_slot(remote.finalized_epoch), WhenSlotSkipped::Prev) diff --git a/beacon_node/network/src/status.rs b/beacon_node/network/src/status.rs index 8d9b3cfe900..9ba146d9bcd 100644 --- a/beacon_node/network/src/status.rs +++ b/beacon_node/network/src/status.rs @@ -1,5 +1,5 @@ use beacon_chain::{BeaconChain, BeaconChainTypes}; -use types::{EthSpec, Hash256}; +use types::{EthSpec, Hash256, Hash256Extended}; use lighthouse_network::rpc::StatusMessage; /// Trait to produce a `StatusMessage` representing the state of the given `beacon_chain`. @@ -26,7 +26,7 @@ pub(crate) fn status_message(beacon_chain: &BeaconChain) let spec = &beacon_chain.spec; let genesis_epoch = spec.genesis_slot.epoch(T::EthSpec::slots_per_epoch()); if finalized_checkpoint.epoch == genesis_epoch { - finalized_checkpoint.root = Hash256::ZERO; + finalized_checkpoint.root = Hash256::zero(); } StatusMessage { diff --git a/beacon_node/network/src/sync/block_lookups/parent_chain.rs b/beacon_node/network/src/sync/block_lookups/parent_chain.rs index 7f4fe5119f6..c9e3fdcdd37 100644 --- a/beacon_node/network/src/sync/block_lookups/parent_chain.rs +++ b/beacon_node/network/src/sync/block_lookups/parent_chain.rs @@ -118,7 +118,7 @@ pub(crate) fn find_oldest_fork_ancestor( #[cfg(test)] mod tests { use super::{compute_parent_chains, find_oldest_fork_ancestor, Node}; - use types::Hash256; + use types::{Hash256, Hash256Extended}; fn h(n: u64) -> Hash256 { Hash256::from_low_u64_be(n) diff --git a/beacon_node/network/src/sync/range_sync/range.rs b/beacon_node/network/src/sync/range_sync/range.rs index f0f521d90f5..ab086b43e1e 100644 --- a/beacon_node/network/src/sync/range_sync/range.rs +++ b/beacon_node/network/src/sync/range_sync/range.rs @@ -399,7 +399,7 @@ mod tests { use std::collections::HashSet; use store::MemoryStore; use tokio::sync::mpsc; - use types::{ForkName, MinimalEthSpec as E}; + use types::{ForkName, Hash256Extended, MinimalEthSpec as E}; #[derive(Debug)] struct FakeStorage { @@ -413,9 +413,9 @@ mod tests { known_blocks: RwLock::new(HashSet::new()), status: RwLock::new(StatusMessage { fork_digest: [0; 4], - finalized_root: Hash256::ZERO, + finalized_root: Hash256::zero(), finalized_epoch: 0usize.into(), - head_root: Hash256::ZERO, + head_root: Hash256::zero(), head_slot: 0usize.into(), }), } diff --git a/beacon_node/operation_pool/src/lib.rs b/beacon_node/operation_pool/src/lib.rs index 91a76162c0c..a1c9ada03a0 100644 --- a/beacon_node/operation_pool/src/lib.rs +++ b/beacon_node/operation_pool/src/lib.rs @@ -865,7 +865,7 @@ mod release_tests { harness .add_attested_blocks_at_slots( state, - Hash256::ZERO, + Hash256::zero(), &[Slot::new(1)], (0..num_validators).collect::>().as_slice(), ) @@ -898,8 +898,8 @@ mod release_tests { let attestations = harness.make_attestations( (0..num_validators).collect::>().as_slice(), &state, - Hash256::ZERO, - SignedBeaconBlockHash::from(Hash256::ZERO), + Hash256::zero(), + SignedBeaconBlockHash::from(Hash256::zero()), slot, ); @@ -987,8 +987,8 @@ mod release_tests { let attestations = harness.make_attestations( (0..num_validators).collect::>().as_slice(), &state, - Hash256::ZERO, - SignedBeaconBlockHash::from(Hash256::ZERO), + Hash256::zero(), + SignedBeaconBlockHash::from(Hash256::zero()), slot, ); @@ -1058,8 +1058,8 @@ mod release_tests { let attestations = harness.make_attestations( (0..num_validators).collect::>().as_slice(), &state, - Hash256::ZERO, - SignedBeaconBlockHash::from(Hash256::ZERO), + Hash256::zero(), + SignedBeaconBlockHash::from(Hash256::zero()), slot, ); @@ -1102,8 +1102,8 @@ mod release_tests { let attestations = harness.make_attestations( (0..num_validators).collect::>().as_slice(), &state, - Hash256::ZERO, - SignedBeaconBlockHash::from(Hash256::ZERO), + Hash256::zero(), + SignedBeaconBlockHash::from(Hash256::zero()), slot, ); @@ -1204,8 +1204,8 @@ mod release_tests { let attestations = harness.make_attestations( (0..num_validators).collect::>().as_slice(), &state, - Hash256::ZERO, - SignedBeaconBlockHash::from(Hash256::ZERO), + Hash256::zero(), + SignedBeaconBlockHash::from(Hash256::zero()), slot, ); @@ -1324,8 +1324,8 @@ mod release_tests { let attestations = harness.make_attestations( (0..num_validators).collect::>().as_slice(), &state, - Hash256::ZERO, - SignedBeaconBlockHash::from(Hash256::ZERO), + Hash256::zero(), + SignedBeaconBlockHash::from(Hash256::zero()), slot, ); diff --git a/beacon_node/operation_pool/src/reward_cache.rs b/beacon_node/operation_pool/src/reward_cache.rs index 92d47a13e3a..04f2be87262 100644 --- a/beacon_node/operation_pool/src/reward_cache.rs +++ b/beacon_node/operation_pool/src/reward_cache.rs @@ -1,6 +1,8 @@ use crate::OpPoolError; use bitvec::vec::BitVec; -use types::{BeaconState, BeaconStateError, Epoch, EthSpec, Hash256, ParticipationFlags}; +use types::{ + BeaconState, BeaconStateError, Epoch, EthSpec, Hash256, Hash256Extended, ParticipationFlags, +}; #[derive(Debug, PartialEq, Eq, Clone)] struct Initialization { @@ -54,7 +56,7 @@ impl RewardCache { /// re-calculation in `update`. fn latest_block_root(state: &BeaconState) -> Result { if state.slot() == 0 { - Ok( Hash256::ZERO) + Ok(Hash256::zero()) } else { Ok(*state .get_block_root(state.slot() - 1) diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index 27f8ba38361..11b2d3b4255 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -339,7 +339,7 @@ impl HotColdDB, LevelDB> { pub fn iter_temporary_state_roots(&self) -> impl Iterator> + '_ { let column = DBColumn::BeaconStateTemporary; let start_key = - BytesKey::from_vec(get_key_for_col(column.into(), Hash256::ZERO.as_slice())); + BytesKey::from_vec(get_key_for_col(column.into(), Hash256::zero().as_slice())); let keys_iter = self.hot_db.keys_iter(); keys_iter.seek(&start_key); @@ -1404,7 +1404,7 @@ impl, Cold: ItemStore> HotColdDB let state_root_iter = self.forwards_state_roots_iterator_until( low_slot, slot, - || Ok((high_restore_point, Hash256::ZERO)), + || Ok((high_restore_point, Hash256::zero())), &self.spec, )?; @@ -1898,7 +1898,7 @@ impl, Cold: ItemStore> HotColdDB /// Convert a `restore_point_index` into a database key. fn restore_point_key(restore_point_index: u64) -> Hash256 { - Hash256::from_slice(&restore_point_index.to_le_bytes()) + Hash256::from_low_u64_be(restore_point_index) } /// Load a frozen state's slot, given its root. @@ -2422,7 +2422,7 @@ impl, Cold: ItemStore> HotColdDB AnchorInfo { anchor_slot: Slot::new(0), oldest_block_slot: Slot::new(0), - oldest_block_parent: Hash256::ZERO, + oldest_block_parent: Hash256::zero(), state_upper_limit: STATE_UPPER_LIMIT_NO_RETAIN, state_lower_limit: Slot::new(0), } diff --git a/beacon_node/store/src/iter.rs b/beacon_node/store/src/iter.rs index 03090ca14c5..2181469eb8e 100644 --- a/beacon_node/store/src/iter.rs +++ b/beacon_node/store/src/iter.rs @@ -385,6 +385,7 @@ mod test { use beacon_chain::test_utils::BeaconChainHarness; use beacon_chain::types::{ChainSpec, MainnetEthSpec}; use sloggers::{null::NullLoggerBuilder, Build}; + use types::Hash256Extended; fn get_state() -> BeaconState { let harness = BeaconChainHarness::builder(E::default()) diff --git a/common/eth2_network_config/src/lib.rs b/common/eth2_network_config/src/lib.rs index ddb543784e3..3c13bf2a768 100644 --- a/common/eth2_network_config/src/lib.rs +++ b/common/eth2_network_config/src/lib.rs @@ -462,7 +462,7 @@ mod tests { use super::*; use ssz::Encode; use tempfile::Builder as TempBuilder; - use types::{Eth1Data, GnosisEthSpec, MainnetEthSpec}; + use types::{Eth1Data, GnosisEthSpec, Hash256Extended, MainnetEthSpec}; type E = MainnetEthSpec; @@ -545,9 +545,9 @@ mod tests { let spec = &E::default_spec(); let eth1_data = Eth1Data { - deposit_root: Hash256::ZERO, + deposit_root: Hash256::zero(), deposit_count: 0, - block_hash: Hash256::ZERO, + block_hash: Hash256::zero(), }; // TODO: figure out how to generate ENR and add some here. diff --git a/consensus/fork_choice/src/fork_choice.rs b/consensus/fork_choice/src/fork_choice.rs index 338bb35875b..af60a402d86 100644 --- a/consensus/fork_choice/src/fork_choice.rs +++ b/consensus/fork_choice/src/fork_choice.rs @@ -15,8 +15,8 @@ use std::time::Duration; use types::{ consts::bellatrix::INTERVALS_PER_SLOT, AbstractExecPayload, AttestationShufflingId, AttesterSlashingRef, BeaconBlockRef, BeaconState, BeaconStateError, ChainSpec, Checkpoint, - Epoch, EthSpec, ExecPayload, ExecutionBlockHash, Hash256, IndexedAttestationRef, RelativeEpoch, - SignedBeaconBlock, Slot, + Epoch, EthSpec, ExecPayload, ExecutionBlockHash, Hash256, Hash256Extended, + IndexedAttestationRef, RelativeEpoch, SignedBeaconBlock, Slot, }; #[derive(Debug)] @@ -397,7 +397,7 @@ where justified_hash: None, finalized_hash: None, // This will be updated during the next call to `Self::get_head`. - head_root: Hash256::ZERO, + head_root: Hash256::zero(), }, _phantom: PhantomData, }; @@ -1055,7 +1055,7 @@ where // (1) becomes weird once we hit finality and fork choice drops the genesis block. (2) is // fine because votes to the genesis block are not useful; all validators implicitly attest // to genesis just by being present in the chain. - if attestation.data().beacon_block_root == Hash256::ZERO { + if attestation.data().beacon_block_root == Hash256::zero() { return Ok(()); } @@ -1139,7 +1139,7 @@ where // Reset proposer boost if this is a new slot. if current_slot > previous_slot { - store.set_proposer_boost_root(Hash256::ZERO); + store.set_proposer_boost_root(Hash256::zero()); } // Not a new epoch, return. @@ -1465,7 +1465,7 @@ where justified_hash: None, finalized_hash: None, // Will be updated in the following call to `Self::get_head`. - head_root: Hash256::ZERO, + head_root: Hash256::zero(), }, _phantom: PhantomData, }; @@ -1546,7 +1546,7 @@ mod tests { .map(|i| QueuedAttestation { slot: Slot::new(i), attesting_indices: vec![], - block_root: Hash256::ZERO, + block_root: Hash256::zero(), target_epoch: Epoch::new(0), }) .collect() diff --git a/consensus/fork_choice/tests/tests.rs b/consensus/fork_choice/tests/tests.rs index 477332febb1..d2935dbca45 100644 --- a/consensus/fork_choice/tests/tests.rs +++ b/consensus/fork_choice/tests/tests.rs @@ -527,12 +527,12 @@ fn justified_and_finalized_blocks() { let justified_checkpoint = fork_choice.justified_checkpoint(); assert_eq!(justified_checkpoint.epoch, 0); - assert!(justified_checkpoint.root != Hash256::ZERO); + assert!(justified_checkpoint.root != Hash256::zero()); assert!(fork_choice.get_justified_block().is_ok()); let finalized_checkpoint = fork_choice.finalized_checkpoint(); assert_eq!(finalized_checkpoint.epoch, 0); - assert!(finalized_checkpoint.root != Hash256::ZERO); + assert!(finalized_checkpoint.root != Hash256::zero()); assert!(fork_choice.get_finalized_block().is_ok()); } @@ -772,7 +772,7 @@ async fn invalid_block_finalized_slot() { /// https://github.com/ethereum/eth2.0-specs/pull/1884 #[tokio::test] async fn invalid_block_finalized_descendant() { - let invalid_ancestor = Mutex::new(Hash256::ZERO); + let invalid_ancestor = Mutex::new(Hash256::zero()); ForkChoiceTest::new() .apply_blocks_while(|_, state| state.finalized_checkpoint().epoch == 0) @@ -1116,7 +1116,7 @@ fn weak_subjectivity_fail_on_startup() { #[tokio::test] async fn weak_subjectivity_pass_on_startup() { let epoch = Epoch::new(0); - let root = Hash256::ZERO; + let root = Hash256::zero(); let chain_config = ChainConfig { weak_subjectivity_checkpoint: Some(Checkpoint { epoch, root }), @@ -1222,7 +1222,7 @@ async fn weak_subjectivity_check_fails_incorrect_root() { let mut checkpoint = setup_harness.harness.finalized_checkpoint(); - checkpoint.root = Hash256::ZERO; + checkpoint.root = Hash256::zero(); let chain_config = ChainConfig { weak_subjectivity_checkpoint: Some(checkpoint), diff --git a/consensus/proto_array/src/fork_choice_test_definition.rs b/consensus/proto_array/src/fork_choice_test_definition.rs index 78b7ed816de..3354fa1545b 100644 --- a/consensus/proto_array/src/fork_choice_test_definition.rs +++ b/consensus/proto_array/src/fork_choice_test_definition.rs @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; use std::collections::BTreeSet; use types::{ AttestationShufflingId, Checkpoint, Epoch, EthSpec, ExecutionBlockHash, Hash256, - MainnetEthSpec, Slot, + Hash256Extended, MainnetEthSpec, Slot, }; pub use execution_status::*; @@ -78,11 +78,11 @@ impl ForkChoiceTestDefinition { spec.proposer_score_boost = Some(50); let junk_shuffling_id = - AttestationShufflingId::from_components(Epoch::new(0), Hash256::ZERO); + AttestationShufflingId::from_components(Epoch::new(0), Hash256::zero()); let mut fork_choice = ProtoArrayForkChoice::new::( self.finalized_block_slot, self.finalized_block_slot, - Hash256::ZERO, + Hash256::zero(), self.justified_checkpoint, self.finalized_checkpoint, junk_shuffling_id.clone(), @@ -108,7 +108,7 @@ impl ForkChoiceTestDefinition { justified_checkpoint, finalized_checkpoint, &justified_balances, - Hash256::ZERO, + Hash256::zero(), &equivocating_indices, Slot::new(0), &spec, @@ -167,7 +167,7 @@ impl ForkChoiceTestDefinition { justified_checkpoint, finalized_checkpoint, &justified_balances, - Hash256::ZERO, + Hash256::zero(), &equivocating_indices, Slot::new(0), &spec, @@ -192,15 +192,15 @@ impl ForkChoiceTestDefinition { slot, root, parent_root: Some(parent_root), - state_root: Hash256::ZERO, - target_root: Hash256::ZERO, + state_root: Hash256::zero(), + target_root: Hash256::zero(), current_epoch_shuffling_id: AttestationShufflingId::from_components( Epoch::new(0), - Hash256::ZERO, + Hash256::zero(), ), next_epoch_shuffling_id: AttestationShufflingId::from_components( Epoch::new(0), - Hash256::ZERO, + Hash256::zero(), ), justified_checkpoint, finalized_checkpoint, @@ -287,7 +287,7 @@ impl ForkChoiceTestDefinition { /// Gives a root that is not the zero hash (unless i is `usize::MAX)`. fn get_root(i: u64) -> Hash256 { - Hash256::from_slice(&(i + 1).to_be_bytes()) + Hash256::from_low_u64_be(i + 1) } /// Gives a hash that is not the zero hash (unless i is `usize::MAX)`. diff --git a/consensus/proto_array/src/fork_choice_test_definition/no_votes.rs b/consensus/proto_array/src/fork_choice_test_definition/no_votes.rs index 65f430226f6..534b0d41c6e 100644 --- a/consensus/proto_array/src/fork_choice_test_definition/no_votes.rs +++ b/consensus/proto_array/src/fork_choice_test_definition/no_votes.rs @@ -1,3 +1,5 @@ +use types::Hash256Extended; + use super::*; pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { @@ -8,14 +10,14 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { Operation::FindHead { justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, justified_state_balances: balances.clone(), - expected_head: Hash256::ZERO, + expected_head: Hash256::zero(), }, // Add block 2 // @@ -25,14 +27,14 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { Operation::ProcessBlock { slot: Slot::new(1), root: get_root(2), - parent_root: Hash256::ZERO, + parent_root: Hash256::zero(), justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, }, // Ensure the head is 2 @@ -43,11 +45,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { Operation::FindHead { justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, justified_state_balances: balances.clone(), expected_head: get_root(2), @@ -63,11 +65,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { parent_root: get_root(0), justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, }, // Ensure the head is still 2 @@ -78,11 +80,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { Operation::FindHead { justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, justified_state_balances: balances.clone(), expected_head: get_root(2), @@ -100,11 +102,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { parent_root: get_root(1), justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, }, // Ensure 2 is still the head @@ -117,11 +119,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { Operation::FindHead { justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, justified_state_balances: balances.clone(), expected_head: get_root(2), @@ -139,11 +141,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { parent_root: get_root(2), justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, }, // Ensure the head is 4. @@ -156,11 +158,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { Operation::FindHead { justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, justified_state_balances: balances.clone(), expected_head: get_root(4), @@ -181,7 +183,7 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { justified_checkpoint: get_checkpoint(2), finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, }, // Ensure the head is now 5 whilst the justified epoch is 0. @@ -196,11 +198,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { Operation::FindHead { justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, justified_state_balances: balances.clone(), expected_head: get_root(5), @@ -226,7 +228,7 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, justified_state_balances: balances.clone(), expected_head: get_root(5), @@ -244,7 +246,7 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { justified_checkpoint: get_checkpoint(2), finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, justified_state_balances: balances.clone(), expected_head: get_root(5), @@ -267,7 +269,7 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { justified_checkpoint: get_checkpoint(2), finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, }, // Ensure 6 is the head @@ -285,7 +287,7 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { justified_checkpoint: get_checkpoint(2), finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, justified_state_balances: balances, expected_head: get_root(6), @@ -296,11 +298,11 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition { finalized_block_slot: Slot::new(0), justified_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, finalized_checkpoint: Checkpoint { epoch: Epoch::new(1), - root: Hash256::ZERO, + root: Hash256::zero(), }, operations, } diff --git a/consensus/proto_array/src/proto_array.rs b/consensus/proto_array/src/proto_array.rs index 7314dd4cbb0..348d8ec5e07 100644 --- a/consensus/proto_array/src/proto_array.rs +++ b/consensus/proto_array/src/proto_array.rs @@ -8,7 +8,7 @@ use std::collections::{HashMap, HashSet}; use superstruct::superstruct; use types::{ AttestationShufflingId, ChainSpec, Checkpoint, Epoch, EthSpec, ExecutionBlockHash, Hash256, - Slot, + Hash256Extended, Slot, }; // Define a "legacy" implementation of `Option` which uses four bytes for encoding the union @@ -119,7 +119,7 @@ pub struct ProposerBoost { impl Default for ProposerBoost { fn default() -> Self { Self { - root: Hash256::ZERO, + root: Hash256::zero(), score: 0, } } @@ -189,7 +189,7 @@ impl ProtoArray { // There is no need to adjust the balances or manage parent of the zero hash since it // is an alias to the genesis block. The weight applied to the genesis block is // irrelevant as we _always_ choose it and it's impossible for it to have a parent. - if node.root == Hash256::ZERO { + if node.root == Hash256::zero() { continue; } @@ -209,7 +209,7 @@ impl ProtoArray { // If we find the node for which the proposer boost was previously applied, decrease // the delta by the previous score amount. - if self.previous_proposer_boost.root != Hash256::ZERO + if self.previous_proposer_boost.root != Hash256::zero() && self.previous_proposer_boost.root == node.root // Invalid nodes will always have a weight of zero so there's no need to subtract // the proposer boost delta. @@ -224,7 +224,7 @@ impl ProtoArray { // // https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/fork-choice.md#get_latest_attesting_balance if let Some(proposer_score_boost) = spec.proposer_score_boost { - if proposer_boost_root != Hash256::ZERO + if proposer_boost_root != Hash256::zero() && proposer_boost_root == node.root // Invalid nodes (or their ancestors) should not receive a proposer boost. && !execution_status_is_invalid diff --git a/consensus/proto_array/src/proto_array_fork_choice.rs b/consensus/proto_array/src/proto_array_fork_choice.rs index 7957109d8fb..1411bddc895 100644 --- a/consensus/proto_array/src/proto_array_fork_choice.rs +++ b/consensus/proto_array/src/proto_array_fork_choice.rs @@ -16,7 +16,7 @@ use std::{ }; use types::{ AttestationShufflingId, ChainSpec, Checkpoint, Epoch, EthSpec, ExecutionBlockHash, Hash256, - Slot, + Hash256Extended, Slot, }; pub const DEFAULT_PRUNE_THRESHOLD: usize = 256; @@ -895,7 +895,7 @@ impl ProtoArrayForkChoice { /// ## Errors /// /// - If a value in `indices` is greater to or equal to `indices.len()`. -/// - If some `Hash256` in `votes` is not a key in `indices` (except for `Hash256::ZERO`, this is +/// - If some `Hash256` in `votes` is not a key in `indices` (except for `Hash256::zero()`, this is /// always valid). fn compute_deltas( indices: &HashMap, @@ -909,7 +909,7 @@ fn compute_deltas( for (val_index, vote) in votes.iter_mut().enumerate() { // There is no need to create a score change if the validator has never voted or both their // votes are for the zero hash (alias to the genesis block). - if vote.current_root == Hash256::ZERO && vote.next_root == Hash256::ZERO { + if vote.current_root == Hash256::zero() && vote.next_root == Hash256::zero() { continue; } @@ -939,7 +939,7 @@ fn compute_deltas( deltas[current_delta_index] = delta; } - vote.current_root = Hash256::ZERO; + vote.current_root = Hash256::zero(); } // We've handled this slashed validator, continue without applying an ordinary delta. continue; @@ -993,11 +993,11 @@ fn compute_deltas( #[cfg(test)] mod test_compute_deltas { use super::*; - use types::MainnetEthSpec; + use types::{Hash256Extended, MainnetEthSpec}; /// Gives a hash that is not the zero hash (unless i is `usize::MAX)`. fn hash_from_index(i: usize) -> Hash256 { - Hash256::from_slice(&(i as u64 + 1).to_be_bytes()) + Hash256::from_low_u64_be(i as u64 + 1) } #[test] @@ -1005,13 +1005,13 @@ mod test_compute_deltas { let genesis_slot = Slot::new(0); let genesis_epoch = Epoch::new(0); - let state_root = Hash256::ZERO; - let finalized_root = Hash256::from_slice(&1u64.to_be_bytes()); - let finalized_desc = Hash256::from_slice(&2u64.to_be_bytes()); - let not_finalized_desc = Hash256::from_slice(&3u64.to_be_bytes()); - let unknown = Hash256::from_slice(&4u64.to_be_bytes()); + let state_root = Hash256::from_low_u64_be(0); + let finalized_root = Hash256::from_low_u64_be(1); + let finalized_desc = Hash256::from_low_u64_be(2); + let not_finalized_desc = Hash256::from_low_u64_be(3); + let unknown = Hash256::from_low_u64_be(4); let junk_shuffling_id = - AttestationShufflingId::from_components(Epoch::new(0), Hash256::ZERO); + AttestationShufflingId::from_components(Epoch::new(0), Hash256::zero()); let execution_status = ExecutionStatus::irrelevant(); let genesis_checkpoint = Checkpoint { @@ -1137,16 +1137,16 @@ mod test_compute_deltas { /// *checkpoint*, not just the finalized *block*. #[test] fn finalized_descendant_edge_case() { - let get_block_root = Hash256::from_slice; + let get_block_root = Hash256::from_low_u64_be; let genesis_slot = Slot::new(0); - let junk_state_root = Hash256::ZERO; + let junk_state_root = Hash256::zero(); let junk_shuffling_id = - AttestationShufflingId::from_components(Epoch::new(0), Hash256::ZERO); + AttestationShufflingId::from_components(Epoch::new(0), Hash256::zero()); let execution_status = ExecutionStatus::irrelevant(); let genesis_checkpoint = Checkpoint { epoch: Epoch::new(0), - root: Hash256::ZERO, + root: get_block_root(0), }; let mut fc = ProtoArrayForkChoice::new::( @@ -1172,15 +1172,15 @@ mod test_compute_deltas { .on_block::( Block { slot: Slot::from(block.slot), - root: get_block_root(&block.root.to_be_bytes()), - parent_root: Some(get_block_root(&block.parent_root.to_be_bytes())), - state_root: Hash256::ZERO, - target_root: Hash256::ZERO, + root: get_block_root(block.root), + parent_root: Some(get_block_root(block.parent_root)), + state_root: Hash256::zero(), + target_root: Hash256::zero(), current_epoch_shuffling_id: junk_shuffling_id.clone(), next_epoch_shuffling_id: junk_shuffling_id.clone(), justified_checkpoint: Checkpoint { epoch: Epoch::new(0), - root: Hash256::ZERO, + root: get_block_root(0), }, finalized_checkpoint: genesis_checkpoint, execution_status, @@ -1238,7 +1238,7 @@ mod test_compute_deltas { }, ); - let finalized_root = get_block_root(&last_slot_of_epoch_0.to_be_bytes()); + let finalized_root = get_block_root(last_slot_of_epoch_0); // Set the finalized checkpoint to finalize the first slot of epoch 1 on // the canonical chain. @@ -1256,14 +1256,14 @@ mod test_compute_deltas { assert!( fc.proto_array .is_finalized_checkpoint_or_descendant::(get_block_root( - &canonical_slot.to_be_bytes() + canonical_slot )), "the canonical block is a descendant of the finalized checkpoint" ); assert!( !fc.proto_array .is_finalized_checkpoint_or_descendant::(get_block_root( - &non_canonical_slot.to_be_bytes() + non_canonical_slot )), "although the non-canonical block is a descendant of the finalized block, \ it's not a descendant of the finalized checkpoint" @@ -1283,8 +1283,8 @@ mod test_compute_deltas { for i in 0..validator_count { indices.insert(hash_from_index(i), i); votes.0.push(VoteTracker { - current_root: Hash256::ZERO, - next_root: Hash256::ZERO, + current_root: Hash256::zero(), + next_root: Hash256::zero(), next_epoch: Epoch::new(0), }); old_balances.push(0); @@ -1334,7 +1334,7 @@ mod test_compute_deltas { for i in 0..validator_count { indices.insert(hash_from_index(i), i); votes.0.push(VoteTracker { - current_root: Hash256::ZERO, + current_root: Hash256::zero(), next_root: hash_from_index(0), next_epoch: Epoch::new(0), }); @@ -1392,7 +1392,7 @@ mod test_compute_deltas { for i in 0..validator_count { indices.insert(hash_from_index(i), i); votes.0.push(VoteTracker { - current_root: Hash256::ZERO, + current_root: Hash256::zero(), next_root: hash_from_index(i), next_epoch: Epoch::new(0), }); @@ -1510,14 +1510,14 @@ mod test_compute_deltas { // One validator moves their vote from the block to the zero hash. votes.0.push(VoteTracker { current_root: hash_from_index(1), - next_root: Hash256::ZERO, + next_root: Hash256::zero(), next_epoch: Epoch::new(0), }); // One validator moves their vote from the block to something outside the tree. votes.0.push(VoteTracker { current_root: hash_from_index(1), - next_root: Hash256::from_slice(&1337u64.to_be_bytes()), + next_root: Hash256::from_low_u64_be(1337), next_epoch: Epoch::new(0), }); @@ -1772,7 +1772,7 @@ mod test_compute_deltas { ); // Validator 0's current root should have been reset. - assert_eq!(votes.0[0].current_root, Hash256::ZERO); + assert_eq!(votes.0[0].current_root, Hash256::zero()); assert_eq!(votes.0[0].next_root, hash_from_index(2)); // Validator 1's current root should have been updated. diff --git a/consensus/state_processing/src/all_caches.rs b/consensus/state_processing/src/all_caches.rs index f6071f6f8fa..b5d3d2192a3 100644 --- a/consensus/state_processing/src/all_caches.rs +++ b/consensus/state_processing/src/all_caches.rs @@ -1,6 +1,8 @@ use crate::common::update_progressive_balances_cache::initialize_progressive_balances_cache; use crate::epoch_cache::initialize_epoch_cache; -use types::{BeaconState, ChainSpec, EpochCacheError, EthSpec, Hash256, RelativeEpoch}; +use types::{ + BeaconState, ChainSpec, EpochCacheError, EthSpec, Hash256, Hash256Extended, RelativeEpoch, +}; /// Mixin trait for the beacon state that provides operations on *all* caches. /// @@ -31,7 +33,7 @@ impl AllCaches for BeaconState { fn all_caches_built(&self) -> bool { let current_epoch = self.current_epoch(); let Ok(epoch_cache_decision_block_root) = - self.proposer_shuffling_decision_root(Hash256::ZERO) + self.proposer_shuffling_decision_root(Hash256::zero()) else { return false; }; diff --git a/consensus/state_processing/src/epoch_cache.rs b/consensus/state_processing/src/epoch_cache.rs index f31ed2b418c..e367eeba9f0 100644 --- a/consensus/state_processing/src/epoch_cache.rs +++ b/consensus/state_processing/src/epoch_cache.rs @@ -3,7 +3,7 @@ use crate::common::base::SqrtTotalActiveBalance; use crate::common::{altair, base}; use safe_arith::SafeArith; use types::epoch_cache::{EpochCache, EpochCacheError, EpochCacheKey}; -use types::{ActivationQueue, BeaconState, ChainSpec, EthSpec, ForkName, Hash256}; +use types::{ActivationQueue, BeaconState, ChainSpec, EthSpec, ForkName, Hash256, Hash256Extended}; /// Precursor to an `EpochCache`. pub struct PreEpochCache { @@ -119,7 +119,7 @@ pub fn is_epoch_cache_initialized( let current_epoch = state.current_epoch(); let epoch_cache: &EpochCache = state.epoch_cache(); let decision_block_root = state - .proposer_shuffling_decision_root(Hash256::ZERO) + .proposer_shuffling_decision_root(Hash256::zero()) .map_err(EpochCacheError::BeaconState)?; Ok(epoch_cache @@ -139,7 +139,7 @@ pub fn initialize_epoch_cache( let current_epoch = state.current_epoch(); let next_epoch = state.next_epoch().map_err(EpochCacheError::BeaconState)?; let decision_block_root = state - .proposer_shuffling_decision_root(Hash256::ZERO) + .proposer_shuffling_decision_root(Hash256::zero()) .map_err(EpochCacheError::BeaconState)?; state.build_total_active_balance_cache(spec)?; diff --git a/consensus/state_processing/src/genesis.rs b/consensus/state_processing/src/genesis.rs index 510ee06ce36..c73417077ae 100644 --- a/consensus/state_processing/src/genesis.rs +++ b/consensus/state_processing/src/genesis.rs @@ -21,7 +21,7 @@ pub fn initialize_beacon_state_from_eth1( let genesis_time = eth2_genesis_time(eth1_timestamp, spec)?; let eth1_data = Eth1Data { // Temporary deposit root - deposit_root: Hash256::ZERO, + deposit_root: Hash256::zero(), deposit_count: deposits.len() as u64, block_hash: eth1_block_hash, }; diff --git a/consensus/state_processing/src/per_block_processing/tests.rs b/consensus/state_processing/src/per_block_processing/tests.rs index d7744ce1afd..2774dd3d87f 100644 --- a/consensus/state_processing/src/per_block_processing/tests.rs +++ b/consensus/state_processing/src/per_block_processing/tests.rs @@ -44,7 +44,7 @@ async fn get_harness( harness .add_attested_blocks_at_slots( state, - Hash256::ZERO, + Hash256::zero(), (1..last_slot_of_epoch.as_u64()) .map(Slot::new) .collect::>() diff --git a/consensus/state_processing/src/per_epoch_processing/tests.rs b/consensus/state_processing/src/per_epoch_processing/tests.rs index 58ec963a015..e142cb3b006 100644 --- a/consensus/state_processing/src/per_epoch_processing/tests.rs +++ b/consensus/state_processing/src/per_epoch_processing/tests.rs @@ -2,7 +2,7 @@ use crate::per_epoch_processing::process_epoch; use beacon_chain::test_utils::BeaconChainHarness; use beacon_chain::types::{EthSpec, MinimalEthSpec}; -use bls::Hash256; +use bls::{Hash256, Hash256Extended}; use env_logger::{Builder, Env}; use types::Slot; @@ -25,7 +25,7 @@ async fn runs_without_error() { harness .add_attested_blocks_at_slots( state, - Hash256::ZERO, + Hash256::zero(), (1..target_slot.as_u64()) .map(Slot::new) .collect::>() diff --git a/consensus/state_processing/src/per_slot_processing.rs b/consensus/state_processing/src/per_slot_processing.rs index dd6f5ca06cc..6554423199f 100644 --- a/consensus/state_processing/src/per_slot_processing.rs +++ b/consensus/state_processing/src/per_slot_processing.rs @@ -101,7 +101,7 @@ fn cache_state( state.set_state_root(previous_slot, previous_state_root)?; // Cache latest block header state root - if state.latest_block_header().state_root == Hash256::ZERO { + if state.latest_block_header().state_root == Hash256::zero() { state.latest_block_header_mut().state_root = previous_state_root; } diff --git a/consensus/state_processing/src/state_advance.rs b/consensus/state_processing/src/state_advance.rs index c28f5ef49c2..3214faa474a 100644 --- a/consensus/state_processing/src/state_advance.rs +++ b/consensus/state_processing/src/state_advance.rs @@ -5,7 +5,7 @@ //! duplication and protect against some easy-to-make mistakes when performing state advances. use crate::*; -use types::{BeaconState, ChainSpec, EthSpec, Hash256, Slot}; +use types::{BeaconState, ChainSpec, EthSpec, Hash256, Hash256Extended, Slot}; #[derive(Debug, PartialEq)] pub enum Error { @@ -73,7 +73,7 @@ pub fn partial_state_advance( // `state.block_roots` array, since the `state.latest_block_header` would contain an invalid // (all-zeros) state root. let mut initial_state_root = Some(if state.slot() > state.latest_block_header().slot { - state_root_opt.unwrap_or_else(|| Hash256::ZERO) + state_root_opt.unwrap_or_else(|| Hash256::zero()) } else { state_root_opt.ok_or(Error::StateRootNotProvided)? }); @@ -85,7 +85,7 @@ pub fn partial_state_advance( // Failing to provide the correct state root on the initial iteration may result in // corrupting the `state.block_roots` array since the latest block header may not be updated // with the correct state root. - let state_root = initial_state_root.take().unwrap_or_else(|| Hash256::ZERO); + let state_root = initial_state_root.take().unwrap_or_else(|| Hash256::zero()); per_slot_processing(state, Some(state_root), spec).map_err(Error::PerSlotProcessing)?; } diff --git a/consensus/types/benches/benches.rs b/consensus/types/benches/benches.rs index 3b3ad99e6e8..e6a069b1c51 100644 --- a/consensus/types/benches/benches.rs +++ b/consensus/types/benches/benches.rs @@ -5,15 +5,15 @@ use ssz::Encode; use std::sync::Arc; use types::{ test_utils::generate_deterministic_keypair, BeaconState, Epoch, Eth1Data, EthSpec, Hash256, - MainnetEthSpec, Validator, + Hash256Extended, MainnetEthSpec, Validator, }; fn get_state(validator_count: usize) -> BeaconState { let spec = &E::default_spec(); let eth1_data = Eth1Data { - deposit_root: Hash256::ZERO, + deposit_root: Hash256::zero(), deposit_count: 0, - block_hash: Hash256::ZERO, + block_hash: Hash256::zero(), }; let mut state = BeaconState::new(0, eth1_data, spec); diff --git a/consensus/types/src/beacon_block.rs b/consensus/types/src/beacon_block.rs index df07d45b4d0..173fb6af7d3 100644 --- a/consensus/types/src/beacon_block.rs +++ b/consensus/types/src/beacon_block.rs @@ -169,7 +169,7 @@ impl> BeaconBlock { self.to_ref().block_header() } - /// Returns a "temporary" header, where the `state_root` is `Hash256::ZERO`. + /// Returns a "temporary" header, where the `state_root` is `Hash256::zero()`. pub fn temporary_block_header(&self) -> BeaconBlockHeader { self.to_ref().temporary_block_header() } @@ -263,10 +263,10 @@ impl<'a, E: EthSpec, Payload: AbstractExecPayload> BeaconBlockRef<'a, E, Payl } } - /// Returns a "temporary" header, where the `state_root` is `Hash256::ZERO`. + /// Returns a "temporary" header, where the `state_root` is `Hash256::zero()`. pub fn temporary_block_header(self) -> BeaconBlockHeader { BeaconBlockHeader { - state_root: Hash256::ZERO, + state_root: Hash256::zero(), ..self.block_header() } } @@ -292,13 +292,13 @@ impl> EmptyBlock for BeaconBlockBase BeaconBlockBase { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::ZERO, - state_root: Hash256::ZERO, + parent_root: Hash256::zero(), + state_root: Hash256::zero(), body: BeaconBlockBodyBase { randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::ZERO, - block_hash: Hash256::ZERO, + deposit_root: Hash256::zero(), + block_hash: Hash256::zero(), deposit_count: 0, }, graffiti: Graffiti::default(), @@ -319,9 +319,9 @@ impl> BeaconBlockBase { let header = BeaconBlockHeader { slot: Slot::new(1), proposer_index: 0, - parent_root: Hash256::ZERO, - state_root: Hash256::ZERO, - body_root: Hash256::ZERO, + parent_root: Hash256::zero(), + state_root: Hash256::zero(), + body_root: Hash256::zero(), }; let signed_header = SignedBeaconBlockHeader { @@ -340,7 +340,7 @@ impl> BeaconBlockBase { let deposit_data = DepositData { pubkey: PublicKeyBytes::empty(), - withdrawal_credentials: Hash256::ZERO, + withdrawal_credentials: Hash256::zero(), amount: 0, signature: SignatureBytes::empty(), }; @@ -362,7 +362,7 @@ impl> BeaconBlockBase { }; let deposit = Deposit { - proof: FixedVector::from_elem(Hash256::ZERO), + proof: FixedVector::from_elem(Hash256::zero()), data: deposit_data, }; @@ -415,13 +415,13 @@ impl> EmptyBlock for BeaconBlockAlta BeaconBlockAltair { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::ZERO, - state_root: Hash256::ZERO, + parent_root: Hash256::zero(), + state_root: Hash256::zero(), body: BeaconBlockBodyAltair { randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::ZERO, - block_hash: Hash256::ZERO, + deposit_root: Hash256::zero(), + block_hash: Hash256::zero(), deposit_count: 0, }, graffiti: Graffiti::default(), @@ -448,8 +448,8 @@ impl> BeaconBlockAltair BeaconBlockAltair { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::ZERO, - state_root: Hash256::ZERO, + parent_root: Hash256::zero(), + state_root: Hash256::zero(), body: BeaconBlockBodyAltair { proposer_slashings: base_block.body.proposer_slashings, attester_slashings: base_block.body.attester_slashings, @@ -459,8 +459,8 @@ impl> BeaconBlockAltair sync_aggregate, randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::ZERO, - block_hash: Hash256::ZERO, + deposit_root: Hash256::zero(), + block_hash: Hash256::zero(), deposit_count: 0, }, graffiti: Graffiti::default(), @@ -476,13 +476,13 @@ impl> EmptyBlock for BeaconBlockBell BeaconBlockBellatrix { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::ZERO, - state_root: Hash256::ZERO, + parent_root: Hash256::zero(), + state_root: Hash256::zero(), body: BeaconBlockBodyBellatrix { randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::ZERO, - block_hash: Hash256::ZERO, + deposit_root: Hash256::zero(), + block_hash: Hash256::zero(), deposit_count: 0, }, graffiti: Graffiti::default(), @@ -521,8 +521,8 @@ impl> BeaconBlockCapella BeaconBlockCapella { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::ZERO, - state_root: Hash256::ZERO, + parent_root: Hash256::zero(), + state_root: Hash256::zero(), body: BeaconBlockBodyCapella { proposer_slashings: base_block.body.proposer_slashings, attester_slashings: base_block.body.attester_slashings, @@ -533,8 +533,8 @@ impl> BeaconBlockCapella sync_aggregate, randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::ZERO, - block_hash: Hash256::ZERO, + deposit_root: Hash256::zero(), + block_hash: Hash256::zero(), deposit_count: 0, }, graffiti: Graffiti::default(), @@ -550,13 +550,13 @@ impl> EmptyBlock for BeaconBlockCape BeaconBlockCapella { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::ZERO, - state_root: Hash256::ZERO, + parent_root: Hash256::zero(), + state_root: Hash256::zero(), body: BeaconBlockBodyCapella { randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::ZERO, - block_hash: Hash256::ZERO, + deposit_root: Hash256::zero(), + block_hash: Hash256::zero(), deposit_count: 0, }, graffiti: Graffiti::default(), @@ -579,13 +579,13 @@ impl> EmptyBlock for BeaconBlockDene BeaconBlockDeneb { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::ZERO, - state_root: Hash256::ZERO, + parent_root: Hash256::zero(), + state_root: Hash256::zero(), body: BeaconBlockBodyDeneb { randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::ZERO, - block_hash: Hash256::ZERO, + deposit_root: Hash256::zero(), + block_hash: Hash256::zero(), deposit_count: 0, }, graffiti: Graffiti::default(), @@ -651,8 +651,8 @@ impl> BeaconBlockElectra BeaconBlockElectra { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::ZERO, - state_root: Hash256::ZERO, + parent_root: Hash256::zero(), + state_root: Hash256::zero(), body: BeaconBlockBodyElectra { proposer_slashings: base_block.body.proposer_slashings, attester_slashings, @@ -663,8 +663,8 @@ impl> BeaconBlockElectra sync_aggregate, randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::ZERO, - block_hash: Hash256::ZERO, + deposit_root: Hash256::zero(), + block_hash: Hash256::zero(), deposit_count: 0, }, graffiti: Graffiti::default(), @@ -682,13 +682,13 @@ impl> EmptyBlock for BeaconBlockElec BeaconBlockElectra { slot: spec.genesis_slot, proposer_index: 0, - parent_root: Hash256::ZERO, - state_root: Hash256::ZERO, + parent_root: Hash256::zero(), + state_root: Hash256::zero(), body: BeaconBlockBodyElectra { randao_reveal: Signature::empty(), eth1_data: Eth1Data { - deposit_root: Hash256::ZERO, - block_hash: Hash256::ZERO, + deposit_root: Hash256::zero(), + block_hash: Hash256::zero(), deposit_count: 0, }, graffiti: Graffiti::default(), diff --git a/consensus/types/src/beacon_state.rs b/consensus/types/src/beacon_state.rs index c7fb8197d4f..4111f577530 100644 --- a/consensus/types/src/beacon_state.rs +++ b/consensus/types/src/beacon_state.rs @@ -565,7 +565,7 @@ impl BeaconState { BeaconState::Base(BeaconStateBase { // Versioning genesis_time, - genesis_validators_root: Hash256::ZERO, // Set later. + genesis_validators_root: Hash256::zero(), // Set later. slot: spec.genesis_slot, fork: Fork { previous_version: spec.genesis_fork_version, diff --git a/consensus/types/src/beacon_state/committee_cache/tests.rs b/consensus/types/src/beacon_state/committee_cache/tests.rs index 69b50612928..4dc06feab38 100644 --- a/consensus/types/src/beacon_state/committee_cache/tests.rs +++ b/consensus/types/src/beacon_state/committee_cache/tests.rs @@ -42,7 +42,7 @@ async fn new_state(validator_count: usize, slot: Slot) -> BeaconStat harness .add_attested_blocks_at_slots( head_state, - Hash256::ZERO, + Hash256::zero(), (1..=slot.as_u64()) .map(Slot::new) .collect::>() diff --git a/consensus/types/src/beacon_state/tests.rs b/consensus/types/src/beacon_state/tests.rs index dfa68a88684..4ca3a727959 100644 --- a/consensus/types/src/beacon_state/tests.rs +++ b/consensus/types/src/beacon_state/tests.rs @@ -3,8 +3,8 @@ use crate::test_utils::*; use beacon_chain::test_utils::{BeaconChainHarness, EphemeralHarnessType}; use beacon_chain::types::{ test_utils::TestRandom, BeaconState, BeaconStateAltair, BeaconStateBase, BeaconStateError, - ChainSpec, Domain, Epoch, EthSpec, Hash256, Keypair, MainnetEthSpec, MinimalEthSpec, - RelativeEpoch, Slot, Vector, + ChainSpec, Domain, Epoch, EthSpec, Hash256, Hash256Extended, Keypair, MainnetEthSpec, + MinimalEthSpec, RelativeEpoch, Slot, Vector, }; use lazy_static::lazy_static; use ssz::Encode; @@ -38,7 +38,7 @@ async fn get_harness( harness .add_attested_blocks_at_slots( state, - Hash256::ZERO, + Hash256::zero(), slots.as_slice(), (0..validator_count).collect::>().as_slice(), ) diff --git a/consensus/types/src/chain_spec.rs b/consensus/types/src/chain_spec.rs index 5ad9b96e16e..48f77bf1cea 100644 --- a/consensus/types/src/chain_spec.rs +++ b/consensus/types/src/chain_spec.rs @@ -483,7 +483,7 @@ impl ChainSpec { /// /// Spec v0.12.1 pub fn get_deposit_domain(&self) -> Hash256 { - self.compute_domain(Domain::Deposit, self.genesis_fork_version, Hash256::ZERO) + self.compute_domain(Domain::Deposit, self.genesis_fork_version, Hash256::zero()) } // This should be updated to include the current fork and the genesis validators root, but discussion is ongoing: @@ -493,7 +493,7 @@ impl ChainSpec { self.compute_domain( Domain::ApplicationMask(ApplicationDomain::Builder), self.genesis_fork_version, - Hash256::ZERO, + Hash256::zero(), ) } @@ -1338,7 +1338,7 @@ fn default_electra_fork_version() -> [u8; 4] { /// /// Taken from https://github.com/ethereum/consensus-specs/blob/d5e4828aecafaf1c57ef67a5f23c4ae7b08c5137/configs/mainnet.yaml#L15-L16 const fn default_terminal_total_difficulty() -> Uint256 { - // TODO(alloy) + // TODO(alloy) todo!() // Uint256([ // 18446744073709550592, @@ -1451,7 +1451,7 @@ const fn default_maximum_gossip_clock_disparity_millis() -> u64 { fn max_blocks_by_root_request_common(max_request_blocks: u64) -> usize { let max_request_blocks = max_request_blocks as usize; RuntimeVariableList::::from_vec( - vec![Hash256::ZERO; max_request_blocks], + vec![Hash256::zero(); max_request_blocks], max_request_blocks, ) .as_ssz_bytes() @@ -1461,7 +1461,7 @@ fn max_blocks_by_root_request_common(max_request_blocks: u64) -> usize { fn max_blobs_by_root_request_common(max_request_blob_sidecars: u64) -> usize { let max_request_blob_sidecars = max_request_blob_sidecars as usize; let empty_blob_identifier = BlobIdentifier { - block_root: Hash256::ZERO, + block_root: Hash256::zero(), index: 0, }; @@ -1799,7 +1799,7 @@ mod tests { let domain2 = spec.compute_domain(domain_type, version, genesis_validators_root); assert_eq!(domain1, domain2); - assert_eq!(&domain1.as_bytes()[0..4], &int_to_bytes4(raw_domain)[..]); + assert_eq!(&domain1.as_slice()[0..4], &int_to_bytes4(raw_domain)[..]); } } @@ -2034,9 +2034,8 @@ mod yaml_tests { fn test_total_terminal_difficulty() { assert_eq!( Ok(default_terminal_total_difficulty()), - Uint256::from_dec_str( - "115792089237316195423570985008687907853269984665640564039457584007913129638912" - ) + "115792089237316195423570985008687907853269984665640564039457584007913129638912" + .parse() ); } diff --git a/consensus/types/src/deposit_tree_snapshot.rs b/consensus/types/src/deposit_tree_snapshot.rs index 8104721c12a..df1064daba0 100644 --- a/consensus/types/src/deposit_tree_snapshot.rs +++ b/consensus/types/src/deposit_tree_snapshot.rs @@ -40,9 +40,9 @@ impl Default for DepositTreeSnapshot { fn default() -> Self { let mut result = Self { finalized: vec![], - deposit_root: Hash256::ZERO, + deposit_root: Hash256::zero(), deposit_count: 0, - execution_block_hash: Hash256::ZERO, + execution_block_hash: Hash256::zero(), execution_block_height: 0, }; // properly set the empty deposit root diff --git a/consensus/types/src/execution_block_hash.rs b/consensus/types/src/execution_block_hash.rs index 8c5a19dd48f..f58a04e9154 100644 --- a/consensus/types/src/execution_block_hash.rs +++ b/consensus/types/src/execution_block_hash.rs @@ -1,5 +1,6 @@ use crate::test_utils::TestRandom; use crate::Hash256; +use crate::Hash256Extended; use derivative::Derivative; use rand::RngCore; use serde::{Deserialize, Serialize}; @@ -24,7 +25,7 @@ pub struct ExecutionBlockHash(pub Hash256); impl ExecutionBlockHash { pub fn zero() -> Self { - Self(Hash256::ZERO) + Self(Hash256::zero()) } pub fn repeat_byte(b: u8) -> Self { diff --git a/consensus/types/src/execution_payload_header.rs b/consensus/types/src/execution_payload_header.rs index e92c53c93b1..962e7a16fbc 100644 --- a/consensus/types/src/execution_payload_header.rs +++ b/consensus/types/src/execution_payload_header.rs @@ -153,7 +153,7 @@ impl ExecutionPayloadHeaderBellatrix { base_fee_per_gas: self.base_fee_per_gas, block_hash: self.block_hash, transactions_root: self.transactions_root, - withdrawals_root: Hash256::ZERO, + withdrawals_root: Hash256::zero(), } } } @@ -202,8 +202,8 @@ impl ExecutionPayloadHeaderDeneb { withdrawals_root: self.withdrawals_root, blob_gas_used: self.blob_gas_used, excess_blob_gas: self.excess_blob_gas, - deposit_receipts_root: Hash256::ZERO, - withdrawal_requests_root: Hash256::ZERO, + deposit_receipts_root: Hash256::zero(), + withdrawal_requests_root: Hash256::zero(), } } } diff --git a/consensus/types/src/lib.rs b/consensus/types/src/lib.rs index 795a592e232..0cc906f5c77 100644 --- a/consensus/types/src/lib.rs +++ b/consensus/types/src/lib.rs @@ -271,3 +271,23 @@ pub use kzg::{KzgCommitment, KzgProof, VERSIONED_HASH_VERSION_KZG}; pub use milhouse::{self, List, Vector}; pub use ssz_types::{typenum, typenum::Unsigned, BitList, BitVector, FixedVector, VariableList}; pub use superstruct::superstruct; + +pub trait Hash256Extended { + fn from_low_u64_be(value: u64) -> alloy_primitives::B256; + fn from_low_u64_le(value: u64) -> alloy_primitives::B256; + fn zero() -> alloy_primitives::B256; +} + +impl Hash256Extended for alloy_primitives::B256 { + fn from_low_u64_be(value: u64) -> alloy_primitives::B256 { + alloy_primitives::B256::from_slice(&value.to_be_bytes()) + } + + fn from_low_u64_le(value: u64) -> alloy_primitives::B256 { + alloy_primitives::B256::from_slice(&value.to_le_bytes()) + } + + fn zero() -> alloy_primitives::B256 { + alloy_primitives::B256::ZERO + } +} diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index da1847c3ca3..2063fc40155 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -192,7 +192,7 @@ mod tests { "60930578857433095740782970114409273483106482059893286066493409689627770333527", "103822458477361691467064888613019442068586830412598673713899771287914656699997", ] - .map(|v| ethereum_types::U256::from_dec_str(v).unwrap()); + .map(|v| v.parse::().unwrap()); let epochs = [ 54321u64, 1017090249, 1827566880, 846255942, 766597383, 1204990115, 1616209495, diff --git a/consensus/types/src/sync_selection_proof.rs b/consensus/types/src/sync_selection_proof.rs index b7f08b63087..204f1d5ca17 100644 --- a/consensus/types/src/sync_selection_proof.rs +++ b/consensus/types/src/sync_selection_proof.rs @@ -105,7 +105,7 @@ impl From for SyncSelectionProof { #[cfg(test)] mod test { use super::*; - use crate::MainnetEthSpec; + use crate::{Hash256Extended, MainnetEthSpec}; use eth2_interop_keypairs::keypair; #[test] @@ -114,7 +114,7 @@ mod test { let subcommittee_index = 12; let key = keypair(1); let fork = &Fork::default(); - let genesis_validators_root = Hash256::ZERO; + let genesis_validators_root = Hash256::zero(); let spec = &ChainSpec::mainnet(); let proof = SyncSelectionProof::new::( diff --git a/consensus/types/src/validator.rs b/consensus/types/src/validator.rs index 9e12a61f02b..038d65305d2 100644 --- a/consensus/types/src/validator.rs +++ b/consensus/types/src/validator.rs @@ -1,6 +1,6 @@ use crate::{ test_utils::TestRandom, Address, BeaconState, ChainSpec, Checkpoint, Epoch, EthSpec, ForkName, - Hash256, PublicKeyBytes, + Hash256, Hash256Extended, PublicKeyBytes, }; use serde::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; @@ -282,7 +282,7 @@ impl Default for Validator { fn default() -> Self { Self { pubkey: PublicKeyBytes::empty(), - withdrawal_credentials: Hash256::ZERO, + withdrawal_credentials: Hash256::zero(), activation_eligibility_epoch: Epoch::from(u64::MAX), activation_epoch: Epoch::from(u64::MAX), exit_epoch: Epoch::from(u64::MAX), diff --git a/consensus/types/src/withdrawal_credentials.rs b/consensus/types/src/withdrawal_credentials.rs index d0a9bb1af7e..52d51ed559c 100644 --- a/consensus/types/src/withdrawal_credentials.rs +++ b/consensus/types/src/withdrawal_credentials.rs @@ -39,7 +39,7 @@ mod test { get_withdrawal_credentials(&keypair.pk, spec.bls_withdrawal_prefix_byte); let hash: Hash256 = credentials.into(); assert_eq!(hash[0], spec.bls_withdrawal_prefix_byte); - assert_eq!(hash.as_bytes(), &manually_generated_credentials); + assert_eq!(hash.as_slice(), &manually_generated_credentials); } #[test] diff --git a/crypto/bls/src/lib.rs b/crypto/bls/src/lib.rs index 0f52b88a1b9..82e78f8568b 100644 --- a/crypto/bls/src/lib.rs +++ b/crypto/bls/src/lib.rs @@ -45,6 +45,25 @@ pub use zeroize_hash::ZeroizeHash; use blst::BLST_ERROR as BlstError; pub type Hash256 = alloy_primitives::B256; +pub trait Hash256Extended { + fn from_low_u64_be(value: u64) -> alloy_primitives::B256; + fn from_low_u64_le(value: u64) -> alloy_primitives::B256; + fn zero() -> alloy_primitives::B256; +} + +impl Hash256Extended for alloy_primitives::B256 { + fn from_low_u64_be(value: u64) -> alloy_primitives::B256 { + alloy_primitives::B256::from_slice(&value.to_be_bytes()) + } + + fn from_low_u64_le(value: u64) -> alloy_primitives::B256 { + alloy_primitives::B256::from_slice(&value.to_le_bytes()) + } + + fn zero() -> alloy_primitives::B256 { + alloy_primitives::B256::ZERO + } +} #[derive(Clone, Debug, PartialEq)] pub enum Error { diff --git a/crypto/bls/tests/tests.rs b/crypto/bls/tests/tests.rs index e435d1c93e1..521f5d1e8d5 100644 --- a/crypto/bls/tests/tests.rs +++ b/crypto/bls/tests/tests.rs @@ -1,4 +1,4 @@ -use bls::{Hash256, INFINITY_SIGNATURE, SECRET_KEY_BYTES_LEN}; +use bls::{Hash256, Hash256Extended, INFINITY_SIGNATURE, SECRET_KEY_BYTES_LEN}; use ssz::{Decode, Encode}; use std::borrow::Cow; use std::fmt::Debug; @@ -42,7 +42,7 @@ macro_rules! test_suite { let mut agg_sig = AggregateSignature::infinity(); ssz_round_trip(agg_sig.clone()); - let msg = Hash256::from_slice(&42u64.to_be_bytes()); + let msg = Hash256::from_low_u64_be(42); let secret = secret_from_u64(42); let sig = secret.sign(msg); @@ -121,7 +121,7 @@ macro_rules! test_suite { fn default() -> Self { let secret = SecretKey::deserialize(&[42; 32]).unwrap(); let pubkey = secret.public_key(); - let msg = Hash256::from_slice(&42u64.to_be_bytes()); + let msg = Hash256::from_low_u64_be(42); Self { sig: secret.sign(msg), @@ -172,7 +172,7 @@ macro_rules! test_suite { fn new_with_single_msg(num_pubkeys: u64) -> Self { let mut pubkeys = Vec::with_capacity(num_pubkeys as usize); let mut sig = AggregateSignature::infinity(); - let msg = Hash256::from_slice(&42u64.to_be_bytes()); + let msg = Hash256::from_low_u64_be(42); for i in 0..num_pubkeys { let secret = secret_from_u64(i); @@ -195,8 +195,7 @@ macro_rules! test_suite { pub fn wrong_sig(mut self) -> Self { let sk = SecretKey::deserialize(&[1; 32]).unwrap(); self.sig = AggregateSignature::infinity(); - self.sig - .add_assign(&sk.sign(Hash256::from_slice(&1u64.to_be_bytes()))); + self.sig.add_assign(&sk.sign(Hash256::from_low_u64_be(1))); self } @@ -381,7 +380,7 @@ macro_rules! test_suite { impl SignatureSetTester { pub fn push_valid_set(mut self, num_signers: usize) -> Self { let mut signature = AggregateSignature::infinity(); - let message = Hash256::from_slice(&42u64.to_be_bytes()); + let message = Hash256::from_low_u64_be(42); let signing_keys = (0..num_signers) .map(|i| { @@ -404,7 +403,7 @@ macro_rules! test_suite { pub fn push_invalid_set(mut self) -> Self { let mut signature = AggregateSignature::infinity(); - let message = Hash256::from_slice(&42u64.to_be_bytes()); + let message = Hash256::from_low_u64_be(42); signature.add_assign(&secret_from_u64(0).sign(message)); @@ -422,7 +421,7 @@ macro_rules! test_suite { self.owned_sets.push(OwnedSignatureSet { signature: AggregateSignature::deserialize(&INFINITY_SIGNATURE).unwrap(), signing_keys: vec![secret_from_u64(42).public_key()], - message: Hash256::ZERO, + message: Hash256::zero(), should_be_valid: false, }); self diff --git a/lcli/src/generate_bootnode_enr.rs b/lcli/src/generate_bootnode_enr.rs index 3f61cfb9e3f..6f6e47e6a64 100644 --- a/lcli/src/generate_bootnode_enr.rs +++ b/lcli/src/generate_bootnode_enr.rs @@ -8,7 +8,7 @@ use std::io::Write; use std::path::PathBuf; use std::{fs, net::Ipv4Addr}; use std::{fs::File, num::NonZeroU16}; -use types::{ChainSpec, EnrForkId, Epoch, EthSpec, Hash256}; +use types::{ChainSpec, EnrForkId, Epoch, EthSpec, Hash256, Hash256Extended}; pub fn run(matches: &ArgMatches) -> Result<(), String> { let ip: Ipv4Addr = clap_utils::parse_required(matches, "ip")?; @@ -33,7 +33,7 @@ pub fn run(matches: &ArgMatches) -> Result<(), String> { let secp256k1_keypair = secp256k1::Keypair::generate(); let enr_key = CombinedKey::from_secp256k1(&secp256k1_keypair); let enr_fork_id = EnrForkId { - fork_digest: ChainSpec::compute_fork_digest(genesis_fork_version, Hash256::ZERO), + fork_digest: ChainSpec::compute_fork_digest(genesis_fork_version, Hash256::zero()), next_fork_version: genesis_fork_version, next_fork_epoch: Epoch::max_value(), // FAR_FUTURE_EPOCH }; diff --git a/slasher/src/test_utils.rs b/slasher/src/test_utils.rs index aa27dc3dcb7..e85c2bbaad5 100644 --- a/slasher/src/test_utils.rs +++ b/slasher/src/test_utils.rs @@ -4,7 +4,7 @@ use types::{ indexed_attestation::{IndexedAttestationBase, IndexedAttestationElectra}, AggregateSignature, AttestationData, AttesterSlashing, AttesterSlashingBase, AttesterSlashingElectra, BeaconBlockHeader, ChainSpec, Checkpoint, Epoch, EthSpec, Hash256, - IndexedAttestation, MainnetEthSpec, Signature, SignedBeaconBlockHeader, Slot, + Hash256Extended, IndexedAttestation, MainnetEthSpec, Signature, SignedBeaconBlockHeader, Slot, }; pub type E = MainnetEthSpec; @@ -20,14 +20,14 @@ pub fn indexed_att_electra( data: AttestationData { slot: Slot::new(0), index: 0, - beacon_block_root: Hash256::ZERO, + beacon_block_root: Hash256::zero(), source: Checkpoint { epoch: Epoch::new(source_epoch), - root: Hash256::ZERO, + root: Hash256::from_low_u64_be(0), }, target: Checkpoint { epoch: Epoch::new(target_epoch), - root: Hash256::from_slice(&target_root.to_be_bytes()), + root: Hash256::from_low_u64_be(target_root), }, }, signature: AggregateSignature::empty(), @@ -45,14 +45,14 @@ pub fn indexed_att( data: AttestationData { slot: Slot::new(0), index: 0, - beacon_block_root: Hash256::ZERO, + beacon_block_root: Hash256::zero(), source: Checkpoint { epoch: Epoch::new(source_epoch), - root: Hash256::ZERO, + root: Hash256::from_low_u64_be(0), }, target: Checkpoint { epoch: Epoch::new(target_epoch), - root: Hash256::from_slice(&target_root.to_be_bytes()), + root: Hash256::from_low_u64_be(target_root), }, }, signature: AggregateSignature::empty(), @@ -139,9 +139,9 @@ pub fn block(slot: u64, proposer_index: u64, block_root: u64) -> SignedBeaconBlo message: BeaconBlockHeader { slot: Slot::new(slot), proposer_index, - parent_root: Hash256::ZERO, - state_root: Hash256::ZERO, - body_root: Hash256::from_slice(&block_root.to_be_bytes()), + parent_root: Hash256::zero(), + state_root: Hash256::zero(), + body_root: Hash256::from_low_u64_be(block_root), }, signature: Signature::empty(), } diff --git a/testing/ef_tests/src/cases/common.rs b/testing/ef_tests/src/cases/common.rs index 6763edbe22b..b9dab4b044a 100644 --- a/testing/ef_tests/src/cases/common.rs +++ b/testing/ef_tests/src/cases/common.rs @@ -5,47 +5,49 @@ use std::fmt::Debug; use tree_hash::TreeHash; use types::ForkName; -/// Macro to wrap U128 and U256 so they deserialize correctly. -macro_rules! uint_wrapper { - ($wrapper_name:ident, $wrapped_type:ty) => { - #[derive(Debug, Clone, Copy, Default, PartialEq, Decode, Encode, Deserialize)] - #[serde(try_from = "String")] - pub struct $wrapper_name { - pub x: $wrapped_type, - } +// TODO(alloy) do we need this? - impl TryFrom for $wrapper_name { - type Error = String; +// /// Macro to wrap U128 and U256 so they deserialize correctly. +// macro_rules! uint_wrapper { +// ($wrapper_name:ident, $wrapped_type:ty) => { +// #[derive(Debug, Clone, Copy, Default, PartialEq, Decode, Encode, Deserialize)] +// #[serde(try_from = "String")] +// pub struct $wrapper_name { +// pub x: $wrapped_type, +// } - fn try_from(s: String) -> Result { - <$wrapped_type>::from_dec_str(&s) - .map(|x| Self { x }) - .map_err(|e| format!("{:?}", e)) - } - } +// impl TryFrom for $wrapper_name { +// type Error = String; - impl tree_hash::TreeHash for $wrapper_name { - fn tree_hash_type() -> tree_hash::TreeHashType { - <$wrapped_type>::tree_hash_type() - } +// fn try_from(s: String) -> Result { +// <$wrapped_type>::from_dec_str(&s) +// .map(|x| Self { x }) +// .map_err(|e| format!("{:?}", e)) +// } +// } - fn tree_hash_packed_encoding(&self) -> tree_hash::PackedEncoding { - self.x.tree_hash_packed_encoding() - } +// impl tree_hash::TreeHash for $wrapper_name { +// fn tree_hash_type() -> tree_hash::TreeHashType { +// <$wrapped_type>::tree_hash_type() +// } - fn tree_hash_packing_factor() -> usize { - <$wrapped_type>::tree_hash_packing_factor() - } +// fn tree_hash_packed_encoding(&self) -> tree_hash::PackedEncoding { +// self.x.tree_hash_packed_encoding() +// } - fn tree_hash_root(&self) -> tree_hash::Hash256 { - self.x.tree_hash_root() - } - } - }; -} +// fn tree_hash_packing_factor() -> usize { +// <$wrapped_type>::tree_hash_packing_factor() +// } + +// fn tree_hash_root(&self) -> tree_hash::Hash256 { +// self.x.tree_hash_root() +// } +// } +// }; +// } -uint_wrapper!(TestU128, ethereum_types::U128); -uint_wrapper!(TestU256, ethereum_types::U256); +// uint_wrapper!(TestU128, ethereum_types::U128); +// uint_wrapper!(TestU256, ethereum_types::U256); /// Trait for types that can be used in SSZ static tests. pub trait SszStaticType: diff --git a/testing/ef_tests/src/cases/ssz_generic.rs b/testing/ef_tests/src/cases/ssz_generic.rs index 8de3e217f00..1fb23da2246 100644 --- a/testing/ef_tests/src/cases/ssz_generic.rs +++ b/testing/ef_tests/src/cases/ssz_generic.rs @@ -1,7 +1,7 @@ #![allow(non_snake_case)] use super::*; -use crate::cases::common::{SszStaticType, TestU128, TestU256}; +use crate::cases::common::SszStaticType; use crate::cases::ssz_static::{check_serialization, check_tree_hash}; use crate::decode::{log_file_access, snappy_decode_file, yaml_decode_file}; use serde::{de::Error as SerdeError, Deserialize, Deserializer}; @@ -55,8 +55,8 @@ macro_rules! type_dispatch { "uint16" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* u16>, $($rest)*), "uint32" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* u32>, $($rest)*), "uint64" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* u64>, $($rest)*), - "uint128" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* TestU128>, $($rest)*), - "uint256" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* TestU256>, $($rest)*), + // "uint128" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* TestU128>, $($rest)*), + // "uint256" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* TestU256>, $($rest)*), _ => Err(Error::FailedToParseTest(format!("unsupported: {}", $value))), } }; @@ -230,7 +230,7 @@ fn ssz_generic_test(path: &Path) -> Result<(), E check_serialization(&value, &serialized, T::from_ssz_bytes)?; if let Some(ref meta) = meta { - check_tree_hash(&meta.root, value.tree_hash_root().as_bytes())?; + check_tree_hash(&meta.root, value.tree_hash_root().as_slice())?; } } // Invalid diff --git a/testing/ef_tests/src/cases/ssz_static.rs b/testing/ef_tests/src/cases/ssz_static.rs index 5f0ac3525c4..52c52519c99 100644 --- a/testing/ef_tests/src/cases/ssz_static.rs +++ b/testing/ef_tests/src/cases/ssz_static.rs @@ -104,7 +104,7 @@ pub fn check_tree_hash(expected_str: &str, actual_root: &[u8]) -> Result<(), Err impl Case for SszStatic { fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> { check_serialization(&self.value, &self.serialized, T::from_ssz_bytes)?; - check_tree_hash(&self.roots.root, self.value.tree_hash_root().as_bytes())?; + check_tree_hash(&self.roots.root, self.value.tree_hash_root().as_slice())?; Ok(()) } } @@ -115,11 +115,11 @@ impl Case for SszStaticTHC> { check_serialization(&self.value, &self.serialized, |bytes| { BeaconState::from_ssz_bytes(bytes, spec) })?; - check_tree_hash(&self.roots.root, self.value.tree_hash_root().as_bytes())?; + check_tree_hash(&self.roots.root, self.value.tree_hash_root().as_slice())?; let mut state = self.value.clone(); let cached_tree_hash_root = state.update_tree_hash_cache().unwrap(); - check_tree_hash(&self.roots.root, cached_tree_hash_root.as_bytes())?; + check_tree_hash(&self.roots.root, cached_tree_hash_root.as_slice())?; Ok(()) } @@ -131,7 +131,7 @@ impl Case for SszStaticWithSpec> { check_serialization(&self.value, &self.serialized, |bytes| { BeaconBlock::from_ssz_bytes(bytes, spec) })?; - check_tree_hash(&self.roots.root, self.value.tree_hash_root().as_bytes())?; + check_tree_hash(&self.roots.root, self.value.tree_hash_root().as_slice())?; Ok(()) } } @@ -142,7 +142,7 @@ impl Case for SszStaticWithSpec> { check_serialization(&self.value, &self.serialized, |bytes| { SignedBeaconBlock::from_ssz_bytes(bytes, spec) })?; - check_tree_hash(&self.roots.root, self.value.tree_hash_root().as_bytes())?; + check_tree_hash(&self.roots.root, self.value.tree_hash_root().as_slice())?; Ok(()) } } diff --git a/testing/eth1_test_rig/src/lib.rs b/testing/eth1_test_rig/src/lib.rs index 921db9a0875..e60297c99d9 100644 --- a/testing/eth1_test_rig/src/lib.rs +++ b/testing/eth1_test_rig/src/lib.rs @@ -19,8 +19,8 @@ use ethers_core::{ pub use ethers_providers::{Http, Middleware, Provider}; use std::time::Duration; use tokio::time::sleep; -use types::DepositData; use types::{test_utils::generate_deterministic_keypair, EthSpec, Hash256, Keypair, Signature}; +use types::{DepositData, Hash256Extended}; pub const DEPLOYER_ACCOUNTS_INDEX: usize = 0; pub const DEPOSIT_ACCOUNTS_INDEX: usize = 0; @@ -137,7 +137,7 @@ impl DepositContract { let mut deposit = DepositData { pubkey: keypair.pk.into(), - withdrawal_credentials: Hash256::ZERO, + withdrawal_credentials: Hash256::zero(), amount: 32_000_000_000, signature: Signature::empty().into(), }; @@ -163,7 +163,7 @@ impl DepositContract { let mut deposit = DepositData { pubkey: keypair.pk.into(), - withdrawal_credentials: Hash256::ZERO, + withdrawal_credentials: Hash256::zero(), amount, signature: Signature::empty().into(), }; diff --git a/testing/execution_engine_integration/Cargo.toml b/testing/execution_engine_integration/Cargo.toml index bb1045efc7f..ce40d9738a2 100644 --- a/testing/execution_engine_integration/Cargo.toml +++ b/testing/execution_engine_integration/Cargo.toml @@ -16,6 +16,7 @@ sensitive_url = { workspace = true } types = { workspace = true } unused_port = { workspace = true } ethers-providers = { workspace = true } +ethers-core = { workspace = true } deposit_contract = { workspace = true } reqwest = { workspace = true } hex = { workspace = true } diff --git a/testing/execution_engine_integration/src/test_rig.rs b/testing/execution_engine_integration/src/test_rig.rs index 72410223dd7..c5d4e751b52 100644 --- a/testing/execution_engine_integration/src/test_rig.rs +++ b/testing/execution_engine_integration/src/test_rig.rs @@ -18,7 +18,7 @@ use tokio::time::sleep; use types::payload::BlockProductionVersion; use types::{ Address, ChainSpec, EthSpec, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadHeader, - ForkName, Hash256, MainnetEthSpec, PublicKeyBytes, Slot, Uint256, + ForkName, Hash256, Hash256Extended, MainnetEthSpec, PublicKeyBytes, Slot, Uint256, }; const EXECUTION_ENGINE_START_TIMEOUT: Duration = Duration::from_secs(60); @@ -115,7 +115,7 @@ impl TestRig { let (shutdown_tx, _) = futures::channel::mpsc::channel(1); let executor = TaskExecutor::new(Arc::downgrade(&runtime), exit, log.clone(), shutdown_tx); let mut spec = TEST_FORK.make_genesis_spec(MainnetEthSpec::default_spec()); - spec.terminal_total_difficulty = Uint256::zero(); + spec.terminal_total_difficulty = Uint256::ZERO; let fee_recipient = None; @@ -252,8 +252,8 @@ impl TestRig { let parent_hash = terminal_pow_block_hash; let timestamp = timestamp_now(); - let prev_randao = Hash256::ZERO; - let head_root = Hash256::ZERO; + let prev_randao = Hash256::zero(); + let head_root = Hash256::zero(); let justified_block_hash = ExecutionBlockHash::zero(); let finalized_block_hash = ExecutionBlockHash::zero(); let forkchoice_update_params = ForkchoiceUpdateParameters { @@ -294,7 +294,7 @@ impl TestRig { justified_block_hash, finalized_block_hash, Slot::new(0), - Hash256::ZERO, + Hash256::zero(), ) .await .unwrap(); @@ -457,7 +457,7 @@ impl TestRig { let parent_hash = valid_payload.block_hash(); let timestamp = valid_payload.timestamp() + 1; - let prev_randao = Hash256::ZERO; + let prev_randao = Hash256::zero(); let proposer_index = 0; let builder_params = BuilderParams { pubkey: PublicKeyBytes::empty(), diff --git a/testing/execution_engine_integration/src/transactions.rs b/testing/execution_engine_integration/src/transactions.rs index 0e321834828..4d4693a18e3 100644 --- a/testing/execution_engine_integration/src/transactions.rs +++ b/testing/execution_engine_integration/src/transactions.rs @@ -3,7 +3,7 @@ use ethers_core::types::{ transaction::{eip2718::TypedTransaction, eip2930::AccessList}, Address, Bytes, Eip1559TransactionRequest, TransactionRequest, U256, }; -use types::{DepositData, EthSpec, Hash256, Keypair, Signature}; +use types::{DepositData, EthSpec, Hash256, Hash256Extended, Keypair, Signature}; /// Hardcoded deposit contract address based on sender address and nonce pub const DEPOSIT_CONTRACT_ADDRESS: &str = "64f43BEc7F86526686C931d65362bB8698872F90"; @@ -75,7 +75,7 @@ impl Transaction { let amount: u64 = 32_000_000_000; let mut deposit = DepositData { pubkey: keypair.pk.into(), - withdrawal_credentials: Hash256::ZERO, + withdrawal_credentials: Hash256::zero(), amount, signature: Signature::empty().into(), }; diff --git a/testing/state_transition_vectors/src/main.rs b/testing/state_transition_vectors/src/main.rs index 020108b7ae7..9a8a746fa8a 100644 --- a/testing/state_transition_vectors/src/main.rs +++ b/testing/state_transition_vectors/src/main.rs @@ -13,7 +13,7 @@ use std::process::exit; use types::{ test_utils::generate_deterministic_keypairs, BeaconState, EthSpec, Keypair, SignedBeaconBlock, }; -use types::{Hash256, MainnetEthSpec, Slot}; +use types::{Hash256, Hash256Extended, MainnetEthSpec, Slot}; type E = MainnetEthSpec; @@ -65,7 +65,7 @@ async fn get_harness( harness .add_attested_blocks_at_slots( state, - Hash256::ZERO, + Hash256::zero(), (skip_to_slot.as_u64()..slot.as_u64()) .map(Slot::new) .collect::>() diff --git a/testing/web3signer_tests/src/lib.rs b/testing/web3signer_tests/src/lib.rs index 40eeac71284..4187844cecc 100644 --- a/testing/web3signer_tests/src/lib.rs +++ b/testing/web3signer_tests/src/lib.rs @@ -683,7 +683,7 @@ mod tests { "sync_committee_signature", |pubkey, validator_store| async move { validator_store - .produce_sync_committee_signature(altair_fork_slot, Hash256::ZERO, 0, &pubkey) + .produce_sync_committee_signature(altair_fork_slot, Hash256::zero(), 0, &pubkey) .await .unwrap() }, diff --git a/validator_client/slashing_protection/src/attestation_tests.rs b/validator_client/slashing_protection/src/attestation_tests.rs index fb2787e2c76..1f555d3ddf9 100644 --- a/validator_client/slashing_protection/src/attestation_tests.rs +++ b/validator_client/slashing_protection/src/attestation_tests.rs @@ -2,12 +2,12 @@ use crate::test_utils::*; use crate::*; -use types::{AttestationData, Checkpoint, Epoch, Slot}; +use types::{AttestationData, Checkpoint, Epoch, Hash256Extended, Slot}; pub fn build_checkpoint(epoch_num: u64) -> Checkpoint { Checkpoint { epoch: Epoch::from(epoch_num), - root: Hash256::ZERO, + root: Hash256::zero(), } } @@ -20,7 +20,7 @@ pub fn attestation_data_builder(source: u64, target: u64) -> AttestationData { AttestationData { slot, index, - beacon_block_root: Hash256::ZERO, + beacon_block_root: Hash256::zero(), source, target, } @@ -230,8 +230,8 @@ fn invalid_double_vote_diff_data() { #[test] fn invalid_double_vote_diff_domain() { let first = attestation_data_builder(0, 2); - let domain1 = Hash256::from_slice(&1u64.to_be_bytes()); - let domain2 = Hash256::from_slice(&2u64.to_be_bytes()); + let domain1 = Hash256::from_low_u64_le(1); + let domain2 = Hash256::from_low_u64_le(2); StreamTest { cases: vec![ diff --git a/validator_client/slashing_protection/src/bin/test_generator.rs b/validator_client/slashing_protection/src/bin/test_generator.rs index c53c9890896..1072bdea4ef 100644 --- a/validator_client/slashing_protection/src/bin/test_generator.rs +++ b/validator_client/slashing_protection/src/bin/test_generator.rs @@ -7,7 +7,7 @@ use slashing_protection::SUPPORTED_INTERCHANGE_FORMAT_VERSION; use std::fs::{self, File}; use std::io::Write; use std::path::Path; -use types::{Epoch, Hash256, Slot}; +use types::{Epoch, Hash256, Hash256Extended, Slot}; fn metadata(genesis_validators_root: Hash256) -> InterchangeMetadata { InterchangeMetadata { @@ -50,7 +50,7 @@ fn interchange_with_signing_roots( .into_iter() .map(|(slot, signing_root)| SignedBlock { slot: Slot::new(slot), - signing_root: signing_root.map(|root| Hash256::from_slice(&root.to_be_bytes())), + signing_root: signing_root.map(Hash256::from_low_u64_be), }) .collect(), signed_attestations: attestations @@ -58,7 +58,7 @@ fn interchange_with_signing_roots( .map(|(source, target, signing_root)| SignedAttestation { source_epoch: Epoch::new(source), target_epoch: Epoch::new(target), - signing_root: signing_root.map(|root| Hash256::from_slice(&root.to_be_bytes())), + signing_root: signing_root.map(Hash256::from_low_u64_be), }) .collect(), }) @@ -199,7 +199,7 @@ fn main() { "wrong_genesis_validators_root", TestCase::new(interchange(vec![])).should_fail(), ) - .gvr(Hash256::from_slice(&1u64.to_le_bytes())), + .gvr(Hash256::from_low_u64_be(1)), MultiTestCase::new( "multiple_interchanges_single_validator_single_message_gap", vec![ diff --git a/validator_client/slashing_protection/src/block_tests.rs b/validator_client/slashing_protection/src/block_tests.rs index 0499744442e..cee37525652 100644 --- a/validator_client/slashing_protection/src/block_tests.rs +++ b/validator_client/slashing_protection/src/block_tests.rs @@ -2,7 +2,7 @@ use super::*; use crate::test_utils::*; -use types::{BeaconBlockHeader, Slot}; +use types::{BeaconBlockHeader, Hash256Extended, Slot}; pub fn block(slot: u64) -> BeaconBlockHeader { BeaconBlockHeader { @@ -93,8 +93,8 @@ fn invalid_double_block_proposal() { #[test] fn invalid_double_block_proposal_diff_domain() { let first_block = block(1); - let domain1 = Hash256::from_slice(&1u64.to_be_bytes()); - let domain2 = Hash256::from_slice(&2u64.to_be_bytes()); + let domain1 = Hash256::from_low_u64_be(1); + let domain2 = Hash256::from_low_u64_be(2); StreamTest { cases: vec![ Test::single(first_block.clone()).with_domain(domain1), diff --git a/validator_client/slashing_protection/src/extra_interchange_tests.rs b/validator_client/slashing_protection/src/extra_interchange_tests.rs index d6f0ee8f210..4f19f745fd2 100644 --- a/validator_client/slashing_protection/src/extra_interchange_tests.rs +++ b/validator_client/slashing_protection/src/extra_interchange_tests.rs @@ -3,6 +3,7 @@ use crate::test_utils::pubkey; use crate::*; use tempfile::tempdir; +use types::Hash256Extended; #[test] fn export_non_existent_key() { @@ -15,7 +16,7 @@ fn export_non_existent_key() { // Exporting two non-existent keys should fail on the first one. let err = slashing_db - .export_interchange_info(Hash256::ZERO, Some(&[key1, key2])) + .export_interchange_info(Hash256::zero(), Some(&[key1, key2])) .unwrap_err(); assert!(matches!( err, @@ -26,7 +27,7 @@ fn export_non_existent_key() { // Exporting one key that exists and one that doesn't should fail on the one that doesn't. let err = slashing_db - .export_interchange_info(Hash256::ZERO, Some(&[key1, key2])) + .export_interchange_info(Hash256::zero(), Some(&[key1, key2])) .unwrap_err(); assert!(matches!( err, @@ -35,7 +36,7 @@ fn export_non_existent_key() { // Exporting only keys that exist should work. let interchange = slashing_db - .export_interchange_info(Hash256::ZERO, Some(&[key1])) + .export_interchange_info(Hash256::zero(), Some(&[key1])) .unwrap(); assert_eq!(interchange.data.len(), 1); assert_eq!(interchange.data[0].pubkey, key1); @@ -52,10 +53,10 @@ fn export_same_key_twice() { slashing_db.register_validator(key1).unwrap(); let export_single = slashing_db - .export_interchange_info(Hash256::ZERO, Some(&[key1])) + .export_interchange_info(Hash256::zero(), Some(&[key1])) .unwrap(); let export_double = slashing_db - .export_interchange_info(Hash256::ZERO, Some(&[key1, key1])) + .export_interchange_info(Hash256::zero(), Some(&[key1, key1])) .unwrap(); assert_eq!(export_single.data.len(), 1); diff --git a/validator_client/slashing_protection/src/interchange_test.rs b/validator_client/slashing_protection/src/interchange_test.rs index 8f7977d209d..a89162d630b 100644 --- a/validator_client/slashing_protection/src/interchange_test.rs +++ b/validator_client/slashing_protection/src/interchange_test.rs @@ -6,7 +6,7 @@ use crate::{ use serde::{Deserialize, Serialize}; use std::collections::HashSet; use tempfile::tempdir; -use types::{Epoch, Hash256, PublicKeyBytes, Slot}; +use types::{Epoch, Hash256, Hash256Extended, PublicKeyBytes, Slot}; #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))] @@ -200,7 +200,7 @@ impl TestCase { TestBlock { pubkey: pubkey(pk), slot: Slot::new(slot), - signing_root: Hash256::from_slice(&signing_root.to_be_bytes()), + signing_root: Hash256::from_low_u64_be(signing_root), should_succeed, should_succeed_complete, } @@ -234,7 +234,7 @@ impl TestCase { pubkey: pubkey(pk), source_epoch: Epoch::new(source), target_epoch: Epoch::new(target), - signing_root: Hash256::from_slice(&signing_root.to_be_bytes()), + signing_root: Hash256::from_low_u64_be(signing_root), should_succeed, should_succeed_complete, } diff --git a/validator_client/slashing_protection/src/lib.rs b/validator_client/slashing_protection/src/lib.rs index e8ca93204aa..100c70c0cc2 100644 --- a/validator_client/slashing_protection/src/lib.rs +++ b/validator_client/slashing_protection/src/lib.rs @@ -130,12 +130,14 @@ impl Display for NotSafe { #[cfg(test)] mod test { + use types::Hash256Extended; + use super::*; #[test] #[allow(clippy::eq_op)] fn signing_root_partial_eq() { - let h0 = SigningRoot(Hash256::ZERO); + let h0 = SigningRoot(Hash256::zero()); let h1 = SigningRoot(Hash256::repeat_byte(1)); let h2 = SigningRoot(Hash256::repeat_byte(2)); assert_ne!(h0, h0); diff --git a/validator_client/slashing_protection/tests/migration.rs b/validator_client/slashing_protection/tests/migration.rs index 3107470fea6..9cf430a06e0 100644 --- a/validator_client/slashing_protection/tests/migration.rs +++ b/validator_client/slashing_protection/tests/migration.rs @@ -4,7 +4,7 @@ use std::collections::HashMap; use std::fs; use std::path::{Path, PathBuf}; use tempfile::tempdir; -use types::Hash256; +use types::{Hash256, Hash256Extended}; fn test_data_dir() -> PathBuf { Path::new(&std::env::var("CARGO_MANIFEST_DIR").unwrap()).join("migration-tests") @@ -30,7 +30,7 @@ fn add_enabled_column() { let db = SlashingDatabase::open(&path).unwrap(); // Check that exporting an interchange file lists all the validators. - let interchange = db.export_all_interchange_info(Hash256::ZERO).unwrap(); + let interchange = db.export_all_interchange_info(Hash256::zero()).unwrap(); assert_eq!(interchange.data.len(), num_expected_validators); db.with_transaction(|txn| { diff --git a/validator_client/src/http_api/tests/keystores.rs b/validator_client/src/http_api/tests/keystores.rs index f28286495a6..b6923d1c788 100644 --- a/validator_client/src/http_api/tests/keystores.rs +++ b/validator_client/src/http_api/tests/keystores.rs @@ -571,7 +571,7 @@ async fn import_invalid_slashing_protection() { let slashing_protection = Interchange { metadata: InterchangeMetadata { interchange_format_version: 0, - genesis_validators_root: Hash256::ZERO, + genesis_validators_root: Hash256::zero(), }, data: vec![], }; diff --git a/watch/src/database/watch_types.rs b/watch/src/database/watch_types.rs index 0b3ba2c304d..c2b67084c94 100644 --- a/watch/src/database/watch_types.rs +++ b/watch/src/database/watch_types.rs @@ -72,7 +72,7 @@ impl WatchHash { } pub fn as_bytes(&self) -> &[u8] { - self.0.as_bytes() + self.0.as_slice() } pub fn from_bytes(src: &[u8]) -> Result { From 8966da2436d6891ce3991d4a36345c2e3ab47d91 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 15 Jul 2024 18:37:26 +0100 Subject: [PATCH 18/62] revert some uneeded diffs --- beacon_node/genesis/tests/tests.rs | 4 +-- consensus/merkle_proof/src/lib.rs | 33 ++++++++++++++----- .../state_processing/src/state_advance.rs | 4 +-- consensus/types/src/execution_block_header.rs | 8 +++-- consensus/types/src/subnet_id.rs | 14 +++++--- 5 files changed, 42 insertions(+), 21 deletions(-) diff --git a/beacon_node/genesis/tests/tests.rs b/beacon_node/genesis/tests/tests.rs index 84ca1665d0f..de8c34b702b 100644 --- a/beacon_node/genesis/tests/tests.rs +++ b/beacon_node/genesis/tests/tests.rs @@ -6,7 +6,7 @@ use genesis::{Eth1Config, Eth1GenesisService}; use sensitive_url::SensitiveUrl; use state_processing::is_valid_genesis_state; use std::time::Duration; -use types::{test_utils::generate_deterministic_keypair, Hash256, MinimalEthSpec}; +use types::{test_utils::generate_deterministic_keypair, Hash256, Hash256Extended, MinimalEthSpec}; pub fn new_env() -> Environment { EnvironmentBuilder::minimal() @@ -65,7 +65,7 @@ fn basic() { .map(|i| { deposit_contract.deposit_helper::( generate_deterministic_keypair(i as usize), - Hash256::from_slice(&i.to_le_bytes()), + Hash256::from_low_u64_le(i), 32_000_000_000, ) }) diff --git a/consensus/merkle_proof/src/lib.rs b/consensus/merkle_proof/src/lib.rs index 90993ba32c7..bf0ca595d82 100644 --- a/consensus/merkle_proof/src/lib.rs +++ b/consensus/merkle_proof/src/lib.rs @@ -1,8 +1,29 @@ -use alloy_primitives::B256 as H256; use ethereum_hashing::{hash, hash32_concat, ZERO_HASHES}; use lazy_static::lazy_static; use safe_arith::ArithError; +type H256 = alloy_primitives::B256; + +pub trait Hash256Extended { + fn from_low_u64_be(value: u64) -> alloy_primitives::B256; + fn from_low_u64_le(value: u64) -> alloy_primitives::B256; + fn zero() -> alloy_primitives::B256; +} + +impl Hash256Extended for alloy_primitives::B256 { + fn from_low_u64_be(value: u64) -> alloy_primitives::B256 { + alloy_primitives::B256::from_slice(&value.to_be_bytes()) + } + + fn from_low_u64_le(value: u64) -> alloy_primitives::B256 { + alloy_primitives::B256::from_slice(&value.to_le_bytes()) + } + + fn zero() -> alloy_primitives::B256 { + alloy_primitives::B256::ZERO + } +} + const MAX_TREE_DEPTH: usize = 32; const EMPTY_SLICE: &[H256] = &[]; @@ -415,10 +436,7 @@ mod tests { return TestResult::discard(); } - let leaves: Vec<_> = int_leaves - .into_iter() - .map(|leaf| H256::from_slice(&leaf.to_le_bytes())) - .collect(); + let leaves: Vec<_> = int_leaves.into_iter().map(H256::from_low_u64_be).collect(); let merkle_tree = MerkleTree::create(&leaves, depth); let merkle_root = merkle_tree.hash(); @@ -438,10 +456,7 @@ mod tests { return TestResult::discard(); } - let leaves_iter = int_leaves - .into_iter() - .map(|leaf| H256::from_slice(&leaf.to_le_bytes())); - + let leaves_iter = int_leaves.into_iter().map(H256::from_low_u64_be); let mut merkle_tree = MerkleTree::create(&[], depth); let proofs_ok = leaves_iter.enumerate().all(|(i, leaf)| { diff --git a/consensus/state_processing/src/state_advance.rs b/consensus/state_processing/src/state_advance.rs index 3214faa474a..b54c02d417c 100644 --- a/consensus/state_processing/src/state_advance.rs +++ b/consensus/state_processing/src/state_advance.rs @@ -73,7 +73,7 @@ pub fn partial_state_advance( // `state.block_roots` array, since the `state.latest_block_header` would contain an invalid // (all-zeros) state root. let mut initial_state_root = Some(if state.slot() > state.latest_block_header().slot { - state_root_opt.unwrap_or_else(|| Hash256::zero()) + state_root_opt.unwrap_or_else(Hash256::zero) } else { state_root_opt.ok_or(Error::StateRootNotProvided)? }); @@ -85,7 +85,7 @@ pub fn partial_state_advance( // Failing to provide the correct state root on the initial iteration may result in // corrupting the `state.block_roots` array since the latest block header may not be updated // with the correct state root. - let state_root = initial_state_root.take().unwrap_or_else(|| Hash256::zero()); + let state_root = initial_state_root.take().unwrap_or_else(Hash256::zero); per_slot_processing(state, Some(state_root), spec).map_err(Error::PerSlotProcessing)?; } diff --git a/consensus/types/src/execution_block_header.rs b/consensus/types/src/execution_block_header.rs index 9d81a23ee26..7c75ac57722 100644 --- a/consensus/types/src/execution_block_header.rs +++ b/consensus/types/src/execution_block_header.rs @@ -74,9 +74,11 @@ impl ExecutionBlockHeader { receipts_root: payload.receipts_root(), logs_bloom: payload.logs_bloom().clone().into(), difficulty: Uint256::ZERO, - number: Uint256::from_le_bytes(payload.block_number().to_le_bytes()), - gas_limit: Uint256::from_le_bytes(payload.gas_limit().to_le_bytes()), - gas_used: Uint256::from_le_bytes(payload.gas_used().to_le_bytes()), + + // TODO(alloy) are these big edian or little? + number: Uint256::from_be_bytes(payload.block_number().from_be_bytes()), + gas_limit: Uint256::from_be_bytes(payload.gas_limit().from_be_bytes()), + gas_used: Uint256::from_be_bytes(payload.gas_used().from_be_bytes()), timestamp: payload.timestamp(), extra_data: payload.extra_data().clone().into(), mix_hash: payload.prev_randao(), diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index 2063fc40155..c5667a7492f 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -1,6 +1,9 @@ //! Identifies each shard by an integer identifier. -use crate::{AttestationRef, ChainSpec, CommitteeIndex, Epoch, EthSpec, Slot}; -use alloy_primitives::B256 as H256; +use crate::{ + AttestationRef, ChainSpec, CommitteeIndex, Epoch, EthSpec, Hash256 as H256, Hash256Extended, + Slot, +}; + use lazy_static::lazy_static; use safe_arith::{ArithError, SafeArith}; use serde::{Deserialize, Serialize}; @@ -90,9 +93,10 @@ impl SubnetId { let shuffling_prefix_bits = spec.attestation_subnet_shuffling_prefix_bits as u64; // calculate the prefixes used to compute the subnet and shuffling - // TODO(alloy) rshift impl - let node_id_prefix = 064; // (node_id >> (256 - prefix_bits)).as_u64(); - let shuffling_prefix = 064; // (node_id >> (256 - (prefix_bits + shuffling_prefix_bits))).as_u64(); + // TODO(alloy) little endian or big? + let node_id_slice = u64::from_le_bytes(node_id.as_slice().try_into().map_err(|_| "error")?); + let node_id_prefix = node_id_slice >> 256 - prefix_bits; + let shuffling_prefix = node_id_slice >> (256 - (prefix_bits + shuffling_prefix_bits)); // number of groups the shuffling creates let shuffling_groups = 1 << shuffling_prefix_bits; From 228510db162bf6ecbbf83e5b8b04d0f4d75abda5 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 15 Jul 2024 18:49:55 +0100 Subject: [PATCH 19/62] fix subnet id rshift calc --- consensus/types/src/subnet_id.rs | 25 +++++++++++++++--------- testing/ef_tests/src/cases/ssz_static.rs | 2 +- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index c5667a7492f..d1183b5ff49 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -1,9 +1,7 @@ //! Identifies each shard by an integer identifier. -use crate::{ - AttestationRef, ChainSpec, CommitteeIndex, Epoch, EthSpec, Hash256 as H256, Hash256Extended, - Slot, -}; +use crate::{AttestationRef, ChainSpec, CommitteeIndex, Epoch, EthSpec, Slot}; +use alloy_primitives::U256; use lazy_static::lazy_static; use safe_arith::{ArithError, SafeArith}; use serde::{Deserialize, Serialize}; @@ -83,7 +81,7 @@ impl SubnetId { /// along with the first epoch in which these subscriptions are no longer valid. #[allow(clippy::arithmetic_side_effects)] pub fn compute_subnets_for_epoch( - node_id: H256, + node_id: U256, epoch: Epoch, spec: &ChainSpec, ) -> Result<(impl Iterator, Epoch), &'static str> { @@ -93,10 +91,19 @@ impl SubnetId { let shuffling_prefix_bits = spec.attestation_subnet_shuffling_prefix_bits as u64; // calculate the prefixes used to compute the subnet and shuffling - // TODO(alloy) little endian or big? - let node_id_slice = u64::from_le_bytes(node_id.as_slice().try_into().map_err(|_| "error")?); - let node_id_prefix = node_id_slice >> 256 - prefix_bits; - let shuffling_prefix = node_id_slice >> (256 - (prefix_bits + shuffling_prefix_bits)); + // TODO(alloy) improve error messaging + let node_id_prefix = u64::from_le_bytes( + (node_id >> 256 - prefix_bits) + .as_le_slice() + .try_into() + .map_err(|_| "error")?, + ); + let shuffling_prefix = u64::from_le_bytes( + (node_id >> (256 - (prefix_bits + shuffling_prefix_bits))) + .as_le_slice() + .try_into() + .map_err(|_| "error")?, + ); // number of groups the shuffling creates let shuffling_groups = 1 << shuffling_prefix_bits; diff --git a/testing/ef_tests/src/cases/ssz_static.rs b/testing/ef_tests/src/cases/ssz_static.rs index 6832612f615..c80977a8ac7 100644 --- a/testing/ef_tests/src/cases/ssz_static.rs +++ b/testing/ef_tests/src/cases/ssz_static.rs @@ -115,7 +115,7 @@ impl Case for SszStaticTHC> { check_serialization(&self.value, &self.serialized, |bytes| { BeaconState::from_ssz_bytes(bytes, spec) })?; - + let mut state = self.value.clone(); let cached_tree_hash_root = state.update_tree_hash_cache().unwrap(); check_tree_hash(&self.roots.root, cached_tree_hash_root.as_slice())?; From fe8ef17eca18adf21aea135466ab04ed79db9b38 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Wed, 17 Jul 2024 12:06:42 +0100 Subject: [PATCH 20/62] rename to FixedBytesExtended --- Cargo.lock | 1 + Cargo.toml | 2 +- beacon_node/beacon_chain/Cargo.toml | 1 + .../beacon_chain/src/attester_cache.rs | 2 +- .../beacon_chain/src/beacon_block_streamer.rs | 2 +- .../src/beacon_fork_choice_store.rs | 2 +- .../beacon_chain/src/block_times_cache.rs | 2 +- beacon_node/beacon_chain/src/builder.rs | 2 +- .../overflow_lru_cache.rs | 2 +- beacon_node/beacon_chain/src/eth1_chain.rs | 2 +- beacon_node/beacon_chain/src/head_tracker.rs | 2 +- .../beacon_chain/src/historical_blocks.rs | 2 +- beacon_node/beacon_chain/src/metrics.rs | 5 +- beacon_node/beacon_chain/src/migrate.rs | 2 +- .../src/naive_aggregation_pool.rs | 2 +- .../beacon_chain/src/observed_attesters.rs | 2 +- .../src/validator_pubkey_cache.rs | 2 +- beacon_node/eth1/src/block_cache.rs | 2 +- beacon_node/eth1/src/deposit_cache.rs | 2 +- beacon_node/eth1/tests/test.rs | 2 +- beacon_node/execution_layer/Cargo.toml | 2 +- .../execution_layer/src/engine_api/http.rs | 2 +- beacon_node/execution_layer/src/lib.rs | 14 ++-- .../test_utils/execution_block_generator.rs | 2 +- .../src/test_utils/mock_builder.rs | 2 +- .../src/test_utils/mock_execution_layer.rs | 2 +- .../genesis/src/eth1_genesis_service.rs | 2 +- beacon_node/genesis/tests/tests.rs | 2 +- beacon_node/http_api/src/block_id.rs | 2 +- .../tests/broadcast_validation_tests.rs | 2 +- beacon_node/http_api/tests/fork_tests.rs | 2 +- .../http_api/tests/interactive_tests.rs | 17 ++--- beacon_node/http_api/tests/status_tests.rs | 4 +- .../lighthouse_network/src/rpc/codec/base.rs | 2 +- .../src/rpc/codec/ssz_snappy.rs | 2 +- .../lighthouse_network/tests/common.rs | 2 +- .../lighthouse_network/tests/rpc_tests.rs | 2 +- .../network_beacon_processor/rpc_methods.rs | 2 +- beacon_node/network/src/status.rs | 2 +- .../src/subnet_service/attestation_subnets.rs | 4 +- .../src/sync/block_lookups/parent_chain.rs | 2 +- .../network/src/sync/range_sync/range.rs | 2 +- .../operation_pool/src/reward_cache.rs | 2 +- beacon_node/store/src/iter.rs | 2 +- common/eth2_network_config/src/lib.rs | 2 +- consensus/fork_choice/src/fork_choice.rs | 2 +- consensus/fork_choice/tests/tests.rs | 2 +- consensus/merkle_proof/src/lib.rs | 4 +- .../src/fork_choice_test_definition.rs | 2 +- .../fork_choice_test_definition/no_votes.rs | 2 +- consensus/proto_array/src/proto_array.rs | 2 +- .../src/proto_array_fork_choice.rs | 4 +- consensus/state_processing/src/all_caches.rs | 2 +- consensus/state_processing/src/epoch_cache.rs | 2 +- .../src/per_epoch_processing/tests.rs | 2 +- .../state_processing/src/state_advance.rs | 2 +- consensus/types/Cargo.toml | 2 +- consensus/types/benches/benches.rs | 2 +- consensus/types/src/beacon_state/tests.rs | 2 +- consensus/types/src/chain_spec.rs | 14 ++-- consensus/types/src/execution_block_hash.rs | 2 +- consensus/types/src/execution_block_header.rs | 8 +-- consensus/types/src/lib.rs | 44 +++++++++--- consensus/types/src/subnet_id.rs | 20 ++---- consensus/types/src/sync_selection_proof.rs | 2 +- consensus/types/src/validator.rs | 2 +- crypto/bls/src/lib.rs | 4 +- crypto/bls/tests/tests.rs | 2 +- lcli/src/generate_bootnode_enr.rs | 2 +- slasher/src/test_utils.rs | 2 +- testing/ef_tests/src/cases/common.rs | 70 +++++++++---------- testing/ef_tests/src/cases/ssz_generic.rs | 6 +- testing/eth1_test_rig/src/lib.rs | 2 +- .../src/test_rig.rs | 2 +- .../src/transactions.rs | 2 +- testing/state_transition_vectors/src/main.rs | 2 +- .../src/attestation_tests.rs | 2 +- .../src/bin/test_generator.rs | 2 +- .../slashing_protection/src/block_tests.rs | 2 +- .../src/extra_interchange_tests.rs | 2 +- .../src/interchange_test.rs | 2 +- .../slashing_protection/src/lib.rs | 2 +- .../slashing_protection/tests/migration.rs | 2 +- validator_manager/src/create_validators.rs | 8 +-- 84 files changed, 186 insertions(+), 176 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b7048077da4..8ec78c4fb6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -832,6 +832,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" name = "beacon_chain" version = "0.2.0" dependencies = [ + "alloy-primitives 0.7.7", "bitvec 1.0.1", "bls", "derivative", diff --git a/Cargo.toml b/Cargo.toml index 0b7ad598637..3f12aabc853 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,7 +95,7 @@ edition = "2021" [workspace.dependencies] alloy-core = "0.7.0" -alloy-primitives = { version = "0.7.0", features =["arbitrary", "serde", "ssz", "getrandom"] } +alloy-primitives = { version = "0.7.0", features =["arbitrary", "serde", "ssz", "getrandom", "std"] } anyhow = "1" arbitrary = { version = "1", features = ["derive"] } async-channel = "1.9.0" diff --git a/beacon_node/beacon_chain/Cargo.toml b/beacon_node/beacon_chain/Cargo.toml index 32a1056c10e..f12b3121bbb 100644 --- a/beacon_node/beacon_chain/Cargo.toml +++ b/beacon_node/beacon_chain/Cargo.toml @@ -19,6 +19,7 @@ environment = { workspace = true } serde_json = { workspace = true } [dependencies] +alloy-primitives = { workspace = true, features = ["std"] } bitvec = { workspace = true } bls = { workspace = true } derivative = { workspace = true } diff --git a/beacon_node/beacon_chain/src/attester_cache.rs b/beacon_node/beacon_chain/src/attester_cache.rs index d12d11ef84d..50411bdbf23 100644 --- a/beacon_node/beacon_chain/src/attester_cache.rs +++ b/beacon_node/beacon_chain/src/attester_cache.rs @@ -19,7 +19,7 @@ use types::{ beacon_state::{ compute_committee_index_in_epoch, compute_committee_range_in_epoch, epoch_committee_count, }, - BeaconState, BeaconStateError, ChainSpec, Checkpoint, Epoch, EthSpec, Hash256, Hash256Extended, + BeaconState, BeaconStateError, ChainSpec, Checkpoint, Epoch, EthSpec, Hash256, FixedBytesExtended, RelativeEpoch, Slot, }; diff --git a/beacon_node/beacon_chain/src/beacon_block_streamer.rs b/beacon_node/beacon_chain/src/beacon_block_streamer.rs index 3766f022edd..9793f38986e 100644 --- a/beacon_node/beacon_chain/src/beacon_block_streamer.rs +++ b/beacon_node/beacon_chain/src/beacon_block_streamer.rs @@ -716,7 +716,7 @@ mod tests { use std::time::Duration; use tokio::sync::mpsc; use types::{ - ChainSpec, Epoch, EthSpec, Hash256, Hash256Extended, Keypair, MinimalEthSpec, Slot, + ChainSpec, Epoch, EthSpec, Hash256, FixedBytesExtended, Keypair, MinimalEthSpec, Slot, }; const VALIDATOR_COUNT: usize = 48; diff --git a/beacon_node/beacon_chain/src/beacon_fork_choice_store.rs b/beacon_node/beacon_chain/src/beacon_fork_choice_store.rs index c5fbcc23f4e..b126c35ca1b 100644 --- a/beacon_node/beacon_chain/src/beacon_fork_choice_store.rs +++ b/beacon_node/beacon_chain/src/beacon_fork_choice_store.rs @@ -17,7 +17,7 @@ use store::{Error as StoreError, HotColdDB, ItemStore}; use superstruct::superstruct; use types::{ AbstractExecPayload, BeaconBlockRef, BeaconState, BeaconStateError, Checkpoint, Epoch, EthSpec, - Hash256, Hash256Extended, Slot, + Hash256, FixedBytesExtended, Slot, }; #[derive(Debug)] diff --git a/beacon_node/beacon_chain/src/block_times_cache.rs b/beacon_node/beacon_chain/src/block_times_cache.rs index 4a6bacaeb2c..91b0f1f5326 100644 --- a/beacon_node/beacon_chain/src/block_times_cache.rs +++ b/beacon_node/beacon_chain/src/block_times_cache.rs @@ -242,7 +242,7 @@ impl BlockTimesCache { #[cfg(test)] mod test { use super::*; - use types::Hash256Extended; + use types::FixedBytesExtended; #[test] fn observed_time_uses_minimum() { diff --git a/beacon_node/beacon_chain/src/builder.rs b/beacon_node/beacon_chain/src/builder.rs index 43838a5ddef..edd6f4ac029 100644 --- a/beacon_node/beacon_chain/src/builder.rs +++ b/beacon_node/beacon_chain/src/builder.rs @@ -40,7 +40,7 @@ use store::{Error as StoreError, HotColdDB, ItemStore, KeyValueStoreOp}; use task_executor::{ShutdownReason, TaskExecutor}; use types::{ BeaconBlock, BeaconState, BlobSidecarList, ChainSpec, Checkpoint, Epoch, EthSpec, Hash256, - Hash256Extended, Signature, SignedBeaconBlock, Slot, + FixedBytesExtended, Signature, SignedBeaconBlock, Slot, }; /// An empty struct used to "witness" all the `BeaconChainTypes` traits. It has no user-facing diff --git a/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs b/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs index 63cc41d2e7e..869a1ca4eb4 100644 --- a/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs +++ b/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs @@ -847,7 +847,7 @@ mod pending_components_tests { use rand::SeedableRng; use state_processing::ConsensusContext; use types::test_utils::TestRandom; - use types::{BeaconState, ForkName, Hash256Extended, MainnetEthSpec, SignedBeaconBlock, Slot}; + use types::{BeaconState, ForkName, FixedBytesExtended, MainnetEthSpec, SignedBeaconBlock, Slot}; type E = MainnetEthSpec; diff --git a/beacon_node/beacon_chain/src/eth1_chain.rs b/beacon_node/beacon_chain/src/eth1_chain.rs index 8741402cdd8..df9a2ccd953 100644 --- a/beacon_node/beacon_chain/src/eth1_chain.rs +++ b/beacon_node/beacon_chain/src/eth1_chain.rs @@ -678,7 +678,7 @@ fn is_candidate_block(block: &Eth1Block, period_start: u64, spec: &ChainSpec) -> mod test { use super::*; use environment::null_logger; - use types::{DepositData, Hash256Extended, MinimalEthSpec, Signature}; + use types::{DepositData, FixedBytesExtended, MinimalEthSpec, Signature}; type E = MinimalEthSpec; diff --git a/beacon_node/beacon_chain/src/head_tracker.rs b/beacon_node/beacon_chain/src/head_tracker.rs index 9a8927198ed..9c06ef33a18 100644 --- a/beacon_node/beacon_chain/src/head_tracker.rs +++ b/beacon_node/beacon_chain/src/head_tracker.rs @@ -105,7 +105,7 @@ impl SszHeadTracker { mod test { use super::*; use ssz::{Decode, Encode}; - use types::{BeaconBlock, EthSpec, Hash256Extended, MainnetEthSpec}; + use types::{BeaconBlock, EthSpec, FixedBytesExtended, MainnetEthSpec}; type E = MainnetEthSpec; diff --git a/beacon_node/beacon_chain/src/historical_blocks.rs b/beacon_node/beacon_chain/src/historical_blocks.rs index 3402d38d4e2..3dd35f2f6c7 100644 --- a/beacon_node/beacon_chain/src/historical_blocks.rs +++ b/beacon_node/beacon_chain/src/historical_blocks.rs @@ -10,7 +10,7 @@ use std::borrow::Cow; use std::iter; use std::time::Duration; use store::{chunked_vector::BlockRoots, AnchorInfo, BlobInfo, ChunkWriter, KeyValueStore}; -use types::{Hash256, Hash256Extended, Slot}; +use types::{Hash256, FixedBytesExtended, Slot}; /// Use a longer timeout on the pubkey cache. /// diff --git a/beacon_node/beacon_chain/src/metrics.rs b/beacon_node/beacon_chain/src/metrics.rs index 16157d05590..c2cb559db6e 100644 --- a/beacon_node/beacon_chain/src/metrics.rs +++ b/beacon_node/beacon_chain/src/metrics.rs @@ -1,6 +1,7 @@ use crate::observed_attesters::SlotSubcommitteeIndex; use crate::types::consts::altair::SYNC_COMMITTEE_SUBNET_COUNT; use crate::{BeaconChain, BeaconChainError, BeaconChainTypes}; +use alloy_primitives::bytes::Buf; use lazy_static::lazy_static; pub use lighthouse_metrics::*; use slot_clock::SlotClock; @@ -1394,9 +1395,7 @@ fn set_gauge_by_epoch(gauge: &Result, value: Epoch) { } fn set_gauge_by_hash(gauge: &Result, value: Hash256) { - // TODO(alloy) implement this - // set_gauge(gauge, value.to_low_u64_le() as i64); - todo!() + set_gauge(gauge, value.as_slice().get_i64()); } fn set_gauge_by_usize(gauge: &Result, value: usize) { diff --git a/beacon_node/beacon_chain/src/migrate.rs b/beacon_node/beacon_chain/src/migrate.rs index b444ac1deec..cf997da4072 100644 --- a/beacon_node/beacon_chain/src/migrate.rs +++ b/beacon_node/beacon_chain/src/migrate.rs @@ -15,7 +15,7 @@ use store::{Error, ItemStore, StoreItem, StoreOp}; pub use store::{HotColdDB, MemoryStore}; use types::{ BeaconState, BeaconStateError, BeaconStateHash, Checkpoint, Epoch, EthSpec, Hash256, - Hash256Extended, SignedBeaconBlockHash, Slot, + FixedBytesExtended, SignedBeaconBlockHash, Slot, }; /// Compact at least this frequently, finalization permitting (7 days). diff --git a/beacon_node/beacon_chain/src/naive_aggregation_pool.rs b/beacon_node/beacon_chain/src/naive_aggregation_pool.rs index 280c0c4f2e4..bef47f2ac90 100644 --- a/beacon_node/beacon_chain/src/naive_aggregation_pool.rs +++ b/beacon_node/beacon_chain/src/naive_aggregation_pool.rs @@ -582,7 +582,7 @@ mod tests { use tree_hash::TreeHash; use types::{ test_utils::{generate_deterministic_keypair, test_random_instance}, - Attestation, AttestationBase, AttestationElectra, Fork, Hash256, Hash256Extended, + Attestation, AttestationBase, AttestationElectra, Fork, Hash256, FixedBytesExtended, SyncCommitteeMessage, }; diff --git a/beacon_node/beacon_chain/src/observed_attesters.rs b/beacon_node/beacon_chain/src/observed_attesters.rs index ee14300525b..efb95f57a96 100644 --- a/beacon_node/beacon_chain/src/observed_attesters.rs +++ b/beacon_node/beacon_chain/src/observed_attesters.rs @@ -619,7 +619,7 @@ impl SlotSubcommitteeIndex { #[cfg(test)] mod tests { use super::*; - use types::Hash256Extended; + use types::FixedBytesExtended; type E = types::MainnetEthSpec; diff --git a/beacon_node/beacon_chain/src/validator_pubkey_cache.rs b/beacon_node/beacon_chain/src/validator_pubkey_cache.rs index 7cfc9b9e2ba..f65479c8444 100644 --- a/beacon_node/beacon_chain/src/validator_pubkey_cache.rs +++ b/beacon_node/beacon_chain/src/validator_pubkey_cache.rs @@ -7,7 +7,7 @@ use ssz_derive::{Decode, Encode}; use std::collections::HashMap; use std::marker::PhantomData; use store::{DBColumn, Error as StoreError, StoreItem, StoreOp}; -use types::{BeaconState, Hash256, Hash256Extended, PublicKey, PublicKeyBytes}; +use types::{BeaconState, Hash256, FixedBytesExtended, PublicKey, PublicKeyBytes}; /// Provides a mapping of `validator_index -> validator_publickey`. /// diff --git a/beacon_node/eth1/src/block_cache.rs b/beacon_node/eth1/src/block_cache.rs index 35054afaa4a..1a7e36558b2 100644 --- a/beacon_node/eth1/src/block_cache.rs +++ b/beacon_node/eth1/src/block_cache.rs @@ -195,7 +195,7 @@ impl BlockCache { #[cfg(test)] mod tests { - use types::Hash256Extended; + use types::FixedBytesExtended; use super::*; diff --git a/beacon_node/eth1/src/deposit_cache.rs b/beacon_node/eth1/src/deposit_cache.rs index 731ac089c71..a2d4a1cf06d 100644 --- a/beacon_node/eth1/src/deposit_cache.rs +++ b/beacon_node/eth1/src/deposit_cache.rs @@ -471,7 +471,7 @@ impl DepositCache { pub mod tests { use super::*; use execution_layer::http::deposit_log::Log; - use types::{EthSpec, Hash256Extended, MainnetEthSpec}; + use types::{EthSpec, FixedBytesExtended, MainnetEthSpec}; /// The data from a deposit event, using the v0.8.3 version of the deposit contract. pub const EXAMPLE_LOG: &[u8] = &[ diff --git a/beacon_node/eth1/tests/test.rs b/beacon_node/eth1/tests/test.rs index 6725a33f2f1..1bcd469d859 100644 --- a/beacon_node/eth1/tests/test.rs +++ b/beacon_node/eth1/tests/test.rs @@ -12,7 +12,7 @@ use std::ops::Range; use std::time::Duration; use tree_hash::TreeHash; use types::{ - DepositData, EthSpec, Hash256, Hash256Extended, Keypair, MainnetEthSpec, MinimalEthSpec, + DepositData, EthSpec, Hash256, FixedBytesExtended, Keypair, MainnetEthSpec, MinimalEthSpec, Signature, }; diff --git a/beacon_node/execution_layer/Cargo.toml b/beacon_node/execution_layer/Cargo.toml index 775c84e1313..c051603724e 100644 --- a/beacon_node/execution_layer/Cargo.toml +++ b/beacon_node/execution_layer/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -alloy-primitives = { workspace = true } +alloy-primitives = { workspace = true, features = ["std"] } types = { workspace = true } tokio = { workspace = true } slog = { workspace = true } diff --git a/beacon_node/execution_layer/src/engine_api/http.rs b/beacon_node/execution_layer/src/engine_api/http.rs index bf5043438ca..37fa4630ad5 100644 --- a/beacon_node/execution_layer/src/engine_api/http.rs +++ b/beacon_node/execution_layer/src/engine_api/http.rs @@ -1330,7 +1330,7 @@ mod test { use std::future::Future; use std::str::FromStr; use std::sync::Arc; - use types::{Hash256Extended, MainnetEthSpec, Unsigned}; + use types::{FixedBytesExtended, MainnetEthSpec, Unsigned}; struct Tester { server: MockServer, diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index c28adb0ef28..eb259364fb2 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -9,6 +9,7 @@ use arc_swap::ArcSwapOption; use auth::{strip_prefix, Auth, JwtKey}; pub use block_hash::calculate_execution_block_hash; use builder_client::BuilderHttpClient; +use bytes::Buf; pub use engine_api::EngineCapabilities; use engine_api::Error as ApiError; pub use engine_api::*; @@ -2190,14 +2191,11 @@ fn verify_builder_bid( // Avoid logging values that we can't represent with our Prometheus library. let payload_value_gwei = bid.data.message.value() / Uint256::from(1_000_000_000); - if payload_value_gwei <= Uint256::from(i64::MAX) { - metrics::set_gauge_vec( - &metrics::EXECUTION_LAYER_PAYLOAD_BIDS, - &[metrics::BUILDER], - // TODO(alloy) display as a u64 - 0, // payload_value_gwei.to_base_le(10) as i64, - ); - } + metrics::set_gauge_vec( + &metrics::EXECUTION_LAYER_PAYLOAD_BIDS, + &[metrics::BUILDER], + payload_value_gwei.as_le_slice().get_i64(), + ); let expected_withdrawals_root = payload_attributes .withdrawals() diff --git a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs index 588f9a42bf0..8ff48cf22a0 100644 --- a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs +++ b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs @@ -23,7 +23,7 @@ use tree_hash_derive::TreeHash; use types::{ Blob, ChainSpec, EthSpec, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadBellatrix, ExecutionPayloadCapella, ExecutionPayloadDeneb, ExecutionPayloadElectra, - ExecutionPayloadHeader, ForkName, Hash256, Hash256Extended, Transaction, Transactions, Uint256, + ExecutionPayloadHeader, ForkName, Hash256, FixedBytesExtended, Transaction, Transactions, Uint256, }; use super::DEFAULT_TERMINAL_BLOCK; diff --git a/beacon_node/execution_layer/src/test_utils/mock_builder.rs b/beacon_node/execution_layer/src/test_utils/mock_builder.rs index 56c98cb2642..d14697c1caa 100644 --- a/beacon_node/execution_layer/src/test_utils/mock_builder.rs +++ b/beacon_node/execution_layer/src/test_utils/mock_builder.rs @@ -20,7 +20,7 @@ use types::builder_bid::{ }; use types::{ Address, BeaconState, ChainSpec, EthSpec, ExecPayload, ExecutionPayload, - ExecutionPayloadHeaderRefMut, ForkName, ForkVersionedResponse, Hash256, Hash256Extended, + ExecutionPayloadHeaderRefMut, ForkName, ForkVersionedResponse, Hash256, FixedBytesExtended, PublicKeyBytes, Signature, SignedBlindedBeaconBlock, SignedRoot, SignedValidatorRegistrationData, Slot, Uint256, }; diff --git a/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs b/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs index 265abb86e93..a9f1313e462 100644 --- a/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs +++ b/beacon_node/execution_layer/src/test_utils/mock_execution_layer.rs @@ -7,7 +7,7 @@ use crate::{ use alloy_primitives::B256 as H256; use kzg::Kzg; use tempfile::NamedTempFile; -use types::{Hash256Extended, MainnetEthSpec}; +use types::{FixedBytesExtended, MainnetEthSpec}; pub struct MockExecutionLayer { pub server: MockServer, diff --git a/beacon_node/genesis/src/eth1_genesis_service.rs b/beacon_node/genesis/src/eth1_genesis_service.rs index 8615a69c0c1..729ca210ad0 100644 --- a/beacon_node/genesis/src/eth1_genesis_service.rs +++ b/beacon_node/genesis/src/eth1_genesis_service.rs @@ -13,7 +13,7 @@ use std::sync::{ }; use std::time::Duration; use tokio::time::sleep; -use types::{BeaconState, ChainSpec, Deposit, Eth1Data, EthSpec, Hash256, Hash256Extended}; +use types::{BeaconState, ChainSpec, Deposit, Eth1Data, EthSpec, Hash256, FixedBytesExtended}; /// The number of blocks that are pulled per request whilst waiting for genesis. const BLOCKS_PER_GENESIS_POLL: usize = 99; diff --git a/beacon_node/genesis/tests/tests.rs b/beacon_node/genesis/tests/tests.rs index de8c34b702b..5091389d18e 100644 --- a/beacon_node/genesis/tests/tests.rs +++ b/beacon_node/genesis/tests/tests.rs @@ -6,7 +6,7 @@ use genesis::{Eth1Config, Eth1GenesisService}; use sensitive_url::SensitiveUrl; use state_processing::is_valid_genesis_state; use std::time::Duration; -use types::{test_utils::generate_deterministic_keypair, Hash256, Hash256Extended, MinimalEthSpec}; +use types::{test_utils::generate_deterministic_keypair, Hash256, FixedBytesExtended, MinimalEthSpec}; pub fn new_env() -> Environment { EnvironmentBuilder::minimal() diff --git a/beacon_node/http_api/src/block_id.rs b/beacon_node/http_api/src/block_id.rs index 3f5d0680c75..0ab9befe80d 100644 --- a/beacon_node/http_api/src/block_id.rs +++ b/beacon_node/http_api/src/block_id.rs @@ -6,7 +6,7 @@ use std::fmt; use std::str::FromStr; use std::sync::Arc; use types::{ - BlobSidecarList, EthSpec, Hash256, Hash256Extended, SignedBeaconBlock, + BlobSidecarList, EthSpec, Hash256, FixedBytesExtended, SignedBeaconBlock, SignedBlindedBeaconBlock, Slot, }; diff --git a/beacon_node/http_api/tests/broadcast_validation_tests.rs b/beacon_node/http_api/tests/broadcast_validation_tests.rs index 78f9c819888..5ed9297fb47 100644 --- a/beacon_node/http_api/tests/broadcast_validation_tests.rs +++ b/beacon_node/http_api/tests/broadcast_validation_tests.rs @@ -7,7 +7,7 @@ use eth2::types::{BroadcastValidation, PublishBlockRequest}; use http_api::test_utils::InteractiveTester; use http_api::{publish_blinded_block, publish_block, reconstruct_block, ProvenancedBlock}; use std::sync::Arc; -use types::{Epoch, EthSpec, ForkName, Hash256, MainnetEthSpec, Slot}; +use types::{Epoch, EthSpec, ForkName, Hash256, FixedBytesExtended, MainnetEthSpec, Slot}; use warp::Rejection; use warp_utils::reject::CustomBadRequest; diff --git a/beacon_node/http_api/tests/fork_tests.rs b/beacon_node/http_api/tests/fork_tests.rs index 1e20280da11..570494ffa3f 100644 --- a/beacon_node/http_api/tests/fork_tests.rs +++ b/beacon_node/http_api/tests/fork_tests.rs @@ -10,7 +10,7 @@ use http_api::test_utils::*; use std::collections::HashSet; use types::{ test_utils::{generate_deterministic_keypair, generate_deterministic_keypairs}, - Address, ChainSpec, Epoch, EthSpec, Hash256, MinimalEthSpec, Slot, + Address, ChainSpec, Epoch, EthSpec, Hash256, FixedBytesExtended, MinimalEthSpec, Slot, }; type E = MinimalEthSpec; diff --git a/beacon_node/http_api/tests/interactive_tests.rs b/beacon_node/http_api/tests/interactive_tests.rs index 14673d23e12..16163b87659 100644 --- a/beacon_node/http_api/tests/interactive_tests.rs +++ b/beacon_node/http_api/tests/interactive_tests.rs @@ -19,7 +19,7 @@ use std::sync::Arc; use std::time::Duration; use types::{ Address, Epoch, EthSpec, ExecPayload, ExecutionBlockHash, ForkName, MainnetEthSpec, - MinimalEthSpec, ProposerPreparationData, Slot, + MinimalEthSpec, ProposerPreparationData, Slot, Hash256, Uint256, FixedBytesExtended }; type E = MainnetEthSpec; @@ -394,7 +394,7 @@ pub async fn proposer_boost_re_org_test( // Test using the latest fork so that we simulate conditions as similar to mainnet as possible. let mut spec = ForkName::latest().make_genesis_spec(E::default_spec()); - spec.terminal_total_difficulty = 1.into(); + spec.terminal_total_difficulty = Uint256::from(1); // Ensure there are enough validators to have `attesters_per_slot`. let attesters_per_slot = 10; @@ -639,18 +639,19 @@ pub async fn proposer_boost_re_org_test( if should_re_org { // Block C should build on A. - assert_eq!(block_c.parent_root(), block_a_root.into()); + assert_eq!(block_c.parent_root(), Hash256::from(block_a_root)); } else { // Block C should build on B. assert_eq!(block_c.parent_root(), block_b_root); } // Applying block C should cause it to become head regardless (re-org or continuation). - let block_root_c = harness + let block_root_c = Hash256::from(harness .process_block_result((block_c.clone(), block_c_blobs)) .await .unwrap() - .into(); + ); + assert_eq!(harness.head_block_root(), block_root_c); // Check the fork choice updates that were sent. @@ -814,7 +815,7 @@ pub async fn fork_choice_before_proposal() { // Due to proposer boost, the head should be C during slot C. assert_eq!( harness.chain.canonical_head.cached_head().head_block_root(), - block_root_c.into() + Hash256::from(block_root_c) ); // Ensure that building a block via the HTTP API re-runs fork choice and builds block D upon B. @@ -841,10 +842,10 @@ pub async fn fork_choice_before_proposal() { // Head is now B. assert_eq!( harness.chain.canonical_head.cached_head().head_block_root(), - block_root_b.into() + Hash256::from(block_root_b) ); // D's parent is B. - assert_eq!(block_d.parent_root(), block_root_b.into()); + assert_eq!(block_d.parent_root(), Hash256::from(block_root_b)); } // Test that attestations to unknown blocks are requeued and processed when their block arrives. diff --git a/beacon_node/http_api/tests/status_tests.rs b/beacon_node/http_api/tests/status_tests.rs index d37026d406e..c8ff054c3b0 100644 --- a/beacon_node/http_api/tests/status_tests.rs +++ b/beacon_node/http_api/tests/status_tests.rs @@ -6,7 +6,7 @@ use beacon_chain::{ use eth2::StatusCode; use execution_layer::{PayloadStatusV1, PayloadStatusV1Status}; use http_api::test_utils::InteractiveTester; -use types::{EthSpec, ExecPayload, ForkName, MinimalEthSpec, Slot}; +use types::{EthSpec, ExecPayload, ForkName, MinimalEthSpec, Slot, Uint256}; type E = MinimalEthSpec; @@ -14,7 +14,7 @@ type E = MinimalEthSpec; async fn post_merge_tester(chain_depth: u64, validator_count: u64) -> InteractiveTester { // Test using latest fork so that we simulate conditions as similar to mainnet as possible. let mut spec = ForkName::latest().make_genesis_spec(E::default_spec()); - spec.terminal_total_difficulty = 1.into(); + spec.terminal_total_difficulty = Uint256::from(1); let tester = InteractiveTester::::new(Some(spec), validator_count as usize).await; let harness = &tester.harness; diff --git a/beacon_node/lighthouse_network/src/rpc/codec/base.rs b/beacon_node/lighthouse_network/src/rpc/codec/base.rs index 6e196fb965d..7d5f239c2a4 100644 --- a/beacon_node/lighthouse_network/src/rpc/codec/base.rs +++ b/beacon_node/lighthouse_network/src/rpc/codec/base.rs @@ -176,7 +176,7 @@ mod tests { use crate::rpc::protocol::*; use std::sync::Arc; - use types::{Epoch, ForkContext, ForkName, Hash256, Hash256Extended, Slot}; + use types::{Epoch, ForkContext, ForkName, Hash256, FixedBytesExtended, Slot}; use unsigned_varint::codec::Uvi; type Spec = types::MainnetEthSpec; diff --git a/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs b/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs index 428c6367240..c54bbc9de6e 100644 --- a/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs +++ b/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs @@ -747,7 +747,7 @@ mod tests { use crate::types::{EnrAttestationBitfield, EnrSyncCommitteeBitfield}; use types::{ blob_sidecar::BlobIdentifier, BeaconBlock, BeaconBlockAltair, BeaconBlockBase, - BeaconBlockBellatrix, EmptyBlock, Epoch, FullPayload, Hash256Extended, Signature, Slot, + BeaconBlockBellatrix, EmptyBlock, Epoch, FullPayload, FixedBytesExtended, Signature, Slot, }; type Spec = types::MainnetEthSpec; diff --git a/beacon_node/lighthouse_network/tests/common.rs b/beacon_node/lighthouse_network/tests/common.rs index 04adfe97ddf..fd5e0b5aba7 100644 --- a/beacon_node/lighthouse_network/tests/common.rs +++ b/beacon_node/lighthouse_network/tests/common.rs @@ -9,7 +9,7 @@ use std::sync::Arc; use std::sync::Weak; use tokio::runtime::Runtime; use types::{ - ChainSpec, EnrForkId, Epoch, EthSpec, ForkContext, ForkName, Hash256, Hash256Extended, + ChainSpec, EnrForkId, Epoch, EthSpec, ForkContext, ForkName, Hash256, FixedBytesExtended, MinimalEthSpec, Slot, }; diff --git a/beacon_node/lighthouse_network/tests/rpc_tests.rs b/beacon_node/lighthouse_network/tests/rpc_tests.rs index 68615ce077e..8610b22e0c3 100644 --- a/beacon_node/lighthouse_network/tests/rpc_tests.rs +++ b/beacon_node/lighthouse_network/tests/rpc_tests.rs @@ -15,7 +15,7 @@ use tokio::runtime::Runtime; use tokio::time::sleep; use types::{ BeaconBlock, BeaconBlockAltair, BeaconBlockBase, BeaconBlockBellatrix, BlobSidecar, ChainSpec, - EmptyBlock, Epoch, EthSpec, ForkContext, ForkName, Hash256, Hash256Extended, MinimalEthSpec, + EmptyBlock, Epoch, EthSpec, ForkContext, ForkName, Hash256, FixedBytesExtended, MinimalEthSpec, Signature, SignedBeaconBlock, Slot, }; diff --git a/beacon_node/network/src/network_beacon_processor/rpc_methods.rs b/beacon_node/network/src/network_beacon_processor/rpc_methods.rs index 6af340fd364..9421e7cfc4e 100644 --- a/beacon_node/network/src/network_beacon_processor/rpc_methods.rs +++ b/beacon_node/network/src/network_beacon_processor/rpc_methods.rs @@ -13,7 +13,7 @@ use std::collections::{hash_map::Entry, HashMap}; use std::sync::Arc; use tokio_stream::StreamExt; use types::blob_sidecar::BlobIdentifier; -use types::{Epoch, EthSpec, ForkName, Hash256, Hash256Extended, Slot}; +use types::{Epoch, EthSpec, ForkName, Hash256, FixedBytesExtended, Slot}; impl NetworkBeaconProcessor { /* Auxiliary functions */ diff --git a/beacon_node/network/src/status.rs b/beacon_node/network/src/status.rs index 9ba146d9bcd..4379c8fc7ba 100644 --- a/beacon_node/network/src/status.rs +++ b/beacon_node/network/src/status.rs @@ -1,5 +1,5 @@ use beacon_chain::{BeaconChain, BeaconChainTypes}; -use types::{EthSpec, Hash256, Hash256Extended}; +use types::{EthSpec, Hash256, FixedBytesExtended}; use lighthouse_network::rpc::StatusMessage; /// Trait to produce a `StatusMessage` representing the state of the given `beacon_chain`. diff --git a/beacon_node/network/src/subnet_service/attestation_subnets.rs b/beacon_node/network/src/subnet_service/attestation_subnets.rs index 830c43cbb18..c10d2672097 100644 --- a/beacon_node/network/src/subnet_service/attestation_subnets.rs +++ b/beacon_node/network/src/subnet_service/attestation_subnets.rs @@ -16,7 +16,7 @@ use futures::prelude::*; use lighthouse_network::{discv5::enr::NodeId, NetworkConfig, Subnet, SubnetDiscovery}; use slog::{debug, error, info, o, trace, warn}; use slot_clock::SlotClock; -use types::{Attestation, EthSpec, Slot, SubnetId, ValidatorSubscription}; +use types::{Attestation, EthSpec, Slot, SubnetId, Uint256, ValidatorSubscription}; use crate::metrics; @@ -315,7 +315,7 @@ impl AttestationService { })?; let (subnets, next_subscription_epoch) = SubnetId::compute_subnets_for_epoch::( - self.node_id.raw().into(), + Uint256::from_le_slice(self.node_id.raw().as_slice()), current_epoch, &self.beacon_chain.spec, ) diff --git a/beacon_node/network/src/sync/block_lookups/parent_chain.rs b/beacon_node/network/src/sync/block_lookups/parent_chain.rs index c9e3fdcdd37..cef90928af6 100644 --- a/beacon_node/network/src/sync/block_lookups/parent_chain.rs +++ b/beacon_node/network/src/sync/block_lookups/parent_chain.rs @@ -118,7 +118,7 @@ pub(crate) fn find_oldest_fork_ancestor( #[cfg(test)] mod tests { use super::{compute_parent_chains, find_oldest_fork_ancestor, Node}; - use types::{Hash256, Hash256Extended}; + use types::{Hash256, FixedBytesExtended}; fn h(n: u64) -> Hash256 { Hash256::from_low_u64_be(n) diff --git a/beacon_node/network/src/sync/range_sync/range.rs b/beacon_node/network/src/sync/range_sync/range.rs index ab086b43e1e..bffe5ea7e19 100644 --- a/beacon_node/network/src/sync/range_sync/range.rs +++ b/beacon_node/network/src/sync/range_sync/range.rs @@ -399,7 +399,7 @@ mod tests { use std::collections::HashSet; use store::MemoryStore; use tokio::sync::mpsc; - use types::{ForkName, Hash256Extended, MinimalEthSpec as E}; + use types::{ForkName, FixedBytesExtended, MinimalEthSpec as E}; #[derive(Debug)] struct FakeStorage { diff --git a/beacon_node/operation_pool/src/reward_cache.rs b/beacon_node/operation_pool/src/reward_cache.rs index 04f2be87262..7d717eea8c0 100644 --- a/beacon_node/operation_pool/src/reward_cache.rs +++ b/beacon_node/operation_pool/src/reward_cache.rs @@ -1,7 +1,7 @@ use crate::OpPoolError; use bitvec::vec::BitVec; use types::{ - BeaconState, BeaconStateError, Epoch, EthSpec, Hash256, Hash256Extended, ParticipationFlags, + BeaconState, BeaconStateError, Epoch, EthSpec, Hash256, FixedBytesExtended, ParticipationFlags, }; #[derive(Debug, PartialEq, Eq, Clone)] diff --git a/beacon_node/store/src/iter.rs b/beacon_node/store/src/iter.rs index 2181469eb8e..a7e0c09ed1f 100644 --- a/beacon_node/store/src/iter.rs +++ b/beacon_node/store/src/iter.rs @@ -385,7 +385,7 @@ mod test { use beacon_chain::test_utils::BeaconChainHarness; use beacon_chain::types::{ChainSpec, MainnetEthSpec}; use sloggers::{null::NullLoggerBuilder, Build}; - use types::Hash256Extended; + use types::FixedBytesExtended; fn get_state() -> BeaconState { let harness = BeaconChainHarness::builder(E::default()) diff --git a/common/eth2_network_config/src/lib.rs b/common/eth2_network_config/src/lib.rs index 3c13bf2a768..283940f65f9 100644 --- a/common/eth2_network_config/src/lib.rs +++ b/common/eth2_network_config/src/lib.rs @@ -462,7 +462,7 @@ mod tests { use super::*; use ssz::Encode; use tempfile::Builder as TempBuilder; - use types::{Eth1Data, GnosisEthSpec, Hash256Extended, MainnetEthSpec}; + use types::{Eth1Data, GnosisEthSpec, FixedBytesExtended, MainnetEthSpec}; type E = MainnetEthSpec; diff --git a/consensus/fork_choice/src/fork_choice.rs b/consensus/fork_choice/src/fork_choice.rs index af60a402d86..b5cc86aff19 100644 --- a/consensus/fork_choice/src/fork_choice.rs +++ b/consensus/fork_choice/src/fork_choice.rs @@ -15,7 +15,7 @@ use std::time::Duration; use types::{ consts::bellatrix::INTERVALS_PER_SLOT, AbstractExecPayload, AttestationShufflingId, AttesterSlashingRef, BeaconBlockRef, BeaconState, BeaconStateError, ChainSpec, Checkpoint, - Epoch, EthSpec, ExecPayload, ExecutionBlockHash, Hash256, Hash256Extended, + Epoch, EthSpec, ExecPayload, ExecutionBlockHash, Hash256, FixedBytesExtended, IndexedAttestationRef, RelativeEpoch, SignedBeaconBlock, Slot, }; diff --git a/consensus/fork_choice/tests/tests.rs b/consensus/fork_choice/tests/tests.rs index d2935dbca45..324dc8f40ec 100644 --- a/consensus/fork_choice/tests/tests.rs +++ b/consensus/fork_choice/tests/tests.rs @@ -16,7 +16,7 @@ use std::time::Duration; use store::MemoryStore; use types::{ test_utils::generate_deterministic_keypair, BeaconBlockRef, BeaconState, ChainSpec, Checkpoint, - Epoch, EthSpec, ForkName, Hash256, IndexedAttestation, MainnetEthSpec, RelativeEpoch, + Epoch, EthSpec, ForkName, Hash256, FixedBytesExtended, IndexedAttestation, MainnetEthSpec, RelativeEpoch, SignedBeaconBlock, Slot, SubnetId, }; diff --git a/consensus/merkle_proof/src/lib.rs b/consensus/merkle_proof/src/lib.rs index bf0ca595d82..59241b868c2 100644 --- a/consensus/merkle_proof/src/lib.rs +++ b/consensus/merkle_proof/src/lib.rs @@ -4,13 +4,13 @@ use safe_arith::ArithError; type H256 = alloy_primitives::B256; -pub trait Hash256Extended { +pub trait FixedBytesExtended { fn from_low_u64_be(value: u64) -> alloy_primitives::B256; fn from_low_u64_le(value: u64) -> alloy_primitives::B256; fn zero() -> alloy_primitives::B256; } -impl Hash256Extended for alloy_primitives::B256 { +impl FixedBytesExtended for alloy_primitives::B256 { fn from_low_u64_be(value: u64) -> alloy_primitives::B256 { alloy_primitives::B256::from_slice(&value.to_be_bytes()) } diff --git a/consensus/proto_array/src/fork_choice_test_definition.rs b/consensus/proto_array/src/fork_choice_test_definition.rs index 3354fa1545b..bbdec335a97 100644 --- a/consensus/proto_array/src/fork_choice_test_definition.rs +++ b/consensus/proto_array/src/fork_choice_test_definition.rs @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize}; use std::collections::BTreeSet; use types::{ AttestationShufflingId, Checkpoint, Epoch, EthSpec, ExecutionBlockHash, Hash256, - Hash256Extended, MainnetEthSpec, Slot, + FixedBytesExtended, MainnetEthSpec, Slot, }; pub use execution_status::*; diff --git a/consensus/proto_array/src/fork_choice_test_definition/no_votes.rs b/consensus/proto_array/src/fork_choice_test_definition/no_votes.rs index 534b0d41c6e..de84fbdd128 100644 --- a/consensus/proto_array/src/fork_choice_test_definition/no_votes.rs +++ b/consensus/proto_array/src/fork_choice_test_definition/no_votes.rs @@ -1,4 +1,4 @@ -use types::Hash256Extended; +use types::FixedBytesExtended; use super::*; diff --git a/consensus/proto_array/src/proto_array.rs b/consensus/proto_array/src/proto_array.rs index 348d8ec5e07..b90f569ae16 100644 --- a/consensus/proto_array/src/proto_array.rs +++ b/consensus/proto_array/src/proto_array.rs @@ -8,7 +8,7 @@ use std::collections::{HashMap, HashSet}; use superstruct::superstruct; use types::{ AttestationShufflingId, ChainSpec, Checkpoint, Epoch, EthSpec, ExecutionBlockHash, Hash256, - Hash256Extended, Slot, + FixedBytesExtended, Slot, }; // Define a "legacy" implementation of `Option` which uses four bytes for encoding the union diff --git a/consensus/proto_array/src/proto_array_fork_choice.rs b/consensus/proto_array/src/proto_array_fork_choice.rs index 1411bddc895..bcbd97df161 100644 --- a/consensus/proto_array/src/proto_array_fork_choice.rs +++ b/consensus/proto_array/src/proto_array_fork_choice.rs @@ -16,7 +16,7 @@ use std::{ }; use types::{ AttestationShufflingId, ChainSpec, Checkpoint, Epoch, EthSpec, ExecutionBlockHash, Hash256, - Hash256Extended, Slot, + FixedBytesExtended, Slot, }; pub const DEFAULT_PRUNE_THRESHOLD: usize = 256; @@ -993,7 +993,7 @@ fn compute_deltas( #[cfg(test)] mod test_compute_deltas { use super::*; - use types::{Hash256Extended, MainnetEthSpec}; + use types::{FixedBytesExtended, MainnetEthSpec}; /// Gives a hash that is not the zero hash (unless i is `usize::MAX)`. fn hash_from_index(i: usize) -> Hash256 { diff --git a/consensus/state_processing/src/all_caches.rs b/consensus/state_processing/src/all_caches.rs index b5d3d2192a3..94641fcc429 100644 --- a/consensus/state_processing/src/all_caches.rs +++ b/consensus/state_processing/src/all_caches.rs @@ -1,7 +1,7 @@ use crate::common::update_progressive_balances_cache::initialize_progressive_balances_cache; use crate::epoch_cache::initialize_epoch_cache; use types::{ - BeaconState, ChainSpec, EpochCacheError, EthSpec, Hash256, Hash256Extended, RelativeEpoch, + BeaconState, ChainSpec, EpochCacheError, EthSpec, Hash256, FixedBytesExtended, RelativeEpoch, }; /// Mixin trait for the beacon state that provides operations on *all* caches. diff --git a/consensus/state_processing/src/epoch_cache.rs b/consensus/state_processing/src/epoch_cache.rs index e367eeba9f0..dc4863a47f0 100644 --- a/consensus/state_processing/src/epoch_cache.rs +++ b/consensus/state_processing/src/epoch_cache.rs @@ -3,7 +3,7 @@ use crate::common::base::SqrtTotalActiveBalance; use crate::common::{altair, base}; use safe_arith::SafeArith; use types::epoch_cache::{EpochCache, EpochCacheError, EpochCacheKey}; -use types::{ActivationQueue, BeaconState, ChainSpec, EthSpec, ForkName, Hash256, Hash256Extended}; +use types::{ActivationQueue, BeaconState, ChainSpec, EthSpec, ForkName, Hash256, FixedBytesExtended}; /// Precursor to an `EpochCache`. pub struct PreEpochCache { diff --git a/consensus/state_processing/src/per_epoch_processing/tests.rs b/consensus/state_processing/src/per_epoch_processing/tests.rs index e142cb3b006..ab24bb5a42d 100644 --- a/consensus/state_processing/src/per_epoch_processing/tests.rs +++ b/consensus/state_processing/src/per_epoch_processing/tests.rs @@ -2,7 +2,7 @@ use crate::per_epoch_processing::process_epoch; use beacon_chain::test_utils::BeaconChainHarness; use beacon_chain::types::{EthSpec, MinimalEthSpec}; -use bls::{Hash256, Hash256Extended}; +use bls::{Hash256, FixedBytesExtended}; use env_logger::{Builder, Env}; use types::Slot; diff --git a/consensus/state_processing/src/state_advance.rs b/consensus/state_processing/src/state_advance.rs index b54c02d417c..3090dc2e354 100644 --- a/consensus/state_processing/src/state_advance.rs +++ b/consensus/state_processing/src/state_advance.rs @@ -5,7 +5,7 @@ //! duplication and protect against some easy-to-make mistakes when performing state advances. use crate::*; -use types::{BeaconState, ChainSpec, EthSpec, Hash256, Hash256Extended, Slot}; +use types::{BeaconState, ChainSpec, EthSpec, Hash256, FixedBytesExtended, Slot}; #[derive(Debug, PartialEq)] pub enum Error { diff --git a/consensus/types/Cargo.toml b/consensus/types/Cargo.toml index bca281a0048..254c963e5a2 100644 --- a/consensus/types/Cargo.toml +++ b/consensus/types/Cargo.toml @@ -9,7 +9,7 @@ name = "benches" harness = false [dependencies] -alloy-primitives = { workspace = true, features = ["ssz", "serde"]} +alloy-primitives = { workspace = true, features = ["ssz", "serde", "std"]} merkle_proof = { workspace = true } bls = { workspace = true, features = ["arbitrary"] } kzg = { workspace = true } diff --git a/consensus/types/benches/benches.rs b/consensus/types/benches/benches.rs index e6a069b1c51..a181acdc82a 100644 --- a/consensus/types/benches/benches.rs +++ b/consensus/types/benches/benches.rs @@ -5,7 +5,7 @@ use ssz::Encode; use std::sync::Arc; use types::{ test_utils::generate_deterministic_keypair, BeaconState, Epoch, Eth1Data, EthSpec, Hash256, - Hash256Extended, MainnetEthSpec, Validator, + FixedBytesExtended, MainnetEthSpec, Validator, }; fn get_state(validator_count: usize) -> BeaconState { diff --git a/consensus/types/src/beacon_state/tests.rs b/consensus/types/src/beacon_state/tests.rs index 4ca3a727959..6c9351810a4 100644 --- a/consensus/types/src/beacon_state/tests.rs +++ b/consensus/types/src/beacon_state/tests.rs @@ -3,7 +3,7 @@ use crate::test_utils::*; use beacon_chain::test_utils::{BeaconChainHarness, EphemeralHarnessType}; use beacon_chain::types::{ test_utils::TestRandom, BeaconState, BeaconStateAltair, BeaconStateBase, BeaconStateError, - ChainSpec, Domain, Epoch, EthSpec, Hash256, Hash256Extended, Keypair, MainnetEthSpec, + ChainSpec, Domain, Epoch, EthSpec, Hash256, FixedBytesExtended, Keypair, MainnetEthSpec, MinimalEthSpec, RelativeEpoch, Slot, Vector, }; use lazy_static::lazy_static; diff --git a/consensus/types/src/chain_spec.rs b/consensus/types/src/chain_spec.rs index 48f77bf1cea..9e68b93cc7d 100644 --- a/consensus/types/src/chain_spec.rs +++ b/consensus/types/src/chain_spec.rs @@ -1338,14 +1338,12 @@ fn default_electra_fork_version() -> [u8; 4] { /// /// Taken from https://github.com/ethereum/consensus-specs/blob/d5e4828aecafaf1c57ef67a5f23c4ae7b08c5137/configs/mainnet.yaml#L15-L16 const fn default_terminal_total_difficulty() -> Uint256 { - // TODO(alloy) - todo!() - // Uint256([ - // 18446744073709550592, - // 18446744073709551615, - // 18446744073709551615, - // 18446744073709551615, - // ]) + Uint256::from_limbs([ + 18446744073709550592, + 18446744073709551615, + 18446744073709551615, + 18446744073709551615 + ]) } fn default_terminal_block_hash() -> ExecutionBlockHash { diff --git a/consensus/types/src/execution_block_hash.rs b/consensus/types/src/execution_block_hash.rs index f58a04e9154..b03c184ad63 100644 --- a/consensus/types/src/execution_block_hash.rs +++ b/consensus/types/src/execution_block_hash.rs @@ -1,6 +1,6 @@ use crate::test_utils::TestRandom; use crate::Hash256; -use crate::Hash256Extended; +use crate::FixedBytesExtended; use derivative::Derivative; use rand::RngCore; use serde::{Deserialize, Serialize}; diff --git a/consensus/types/src/execution_block_header.rs b/consensus/types/src/execution_block_header.rs index 7c75ac57722..55f94f91fb7 100644 --- a/consensus/types/src/execution_block_header.rs +++ b/consensus/types/src/execution_block_header.rs @@ -74,11 +74,9 @@ impl ExecutionBlockHeader { receipts_root: payload.receipts_root(), logs_bloom: payload.logs_bloom().clone().into(), difficulty: Uint256::ZERO, - - // TODO(alloy) are these big edian or little? - number: Uint256::from_be_bytes(payload.block_number().from_be_bytes()), - gas_limit: Uint256::from_be_bytes(payload.gas_limit().from_be_bytes()), - gas_used: Uint256::from_be_bytes(payload.gas_used().from_be_bytes()), + number: Uint256::from_be_bytes(payload.block_number().to_be_bytes()), + gas_limit: Uint256::from_be_bytes(payload.gas_limit().to_be_bytes()), + gas_used: Uint256::from_be_bytes(payload.gas_used().to_be_bytes()), timestamp: payload.timestamp(), extra_data: payload.extra_data().clone().into(), mix_hash: payload.prev_randao(), diff --git a/consensus/types/src/lib.rs b/consensus/types/src/lib.rs index 0cc906f5c77..6949b1c912e 100644 --- a/consensus/types/src/lib.rs +++ b/consensus/types/src/lib.rs @@ -272,22 +272,48 @@ pub use milhouse::{self, List, Vector}; pub use ssz_types::{typenum, typenum::Unsigned, BitList, BitVector, FixedVector, VariableList}; pub use superstruct::superstruct; -pub trait Hash256Extended { - fn from_low_u64_be(value: u64) -> alloy_primitives::B256; - fn from_low_u64_le(value: u64) -> alloy_primitives::B256; - fn zero() -> alloy_primitives::B256; +pub trait FixedBytesExtended { + /// The given u64 value is interpreted as big endian. + /// Ignores the most significant bits of the given value if the hash type has less than 8 bytes. + fn from_low_u64_be(value: u64) -> Self; + fn from_low_u64_le(value: u64) -> Self; + fn zero() -> Self; } -impl Hash256Extended for alloy_primitives::B256 { - fn from_low_u64_be(value: u64) -> alloy_primitives::B256 { - alloy_primitives::B256::from_slice(&value.to_be_bytes()) +impl FixedBytesExtended for alloy_primitives::B256 { + + fn from_low_u64_be(value: u64) -> Self { + // Convert the u64 value to a big-endian byte array + let value_bytes = value.to_be_bytes(); + let mut large_array: [u8; 32] = [0; 32]; + // Determine the length of bytes to copy (ignoring the most significant bits if necessary) + let bytes_to_copy = value_bytes.len().min(large_array.len()); + // Copy the bytes to the target array + large_array[..bytes_to_copy].copy_from_slice(&value_bytes[..bytes_to_copy]); + println!("{:?}" large_array); + alloy_primitives::B256::new(large_array) } - fn from_low_u64_le(value: u64) -> alloy_primitives::B256 { + fn from_low_u64_le(value: u64) -> Self { alloy_primitives::B256::from_slice(&value.to_le_bytes()) } - fn zero() -> alloy_primitives::B256 { + fn zero() -> Self { alloy_primitives::B256::ZERO } } + +impl FixedBytesExtended for alloy_primitives::Address { + fn from_low_u64_be(value: u64) -> Self { + alloy_primitives::Address::from_slice(&value.to_le_bytes()) + } + + fn from_low_u64_le(value: u64) -> Self { + alloy_primitives::Address::from_slice(&value.to_be_bytes()) + + } + + fn zero() -> Self { + alloy_primitives::Address::ZERO + } +} \ No newline at end of file diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index d1183b5ff49..8c19747b409 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -1,7 +1,6 @@ //! Identifies each shard by an integer identifier. use crate::{AttestationRef, ChainSpec, CommitteeIndex, Epoch, EthSpec, Slot}; - -use alloy_primitives::U256; +use alloy_primitives::{bytes::Buf, U256}; use lazy_static::lazy_static; use safe_arith::{ArithError, SafeArith}; use serde::{Deserialize, Serialize}; @@ -91,19 +90,8 @@ impl SubnetId { let shuffling_prefix_bits = spec.attestation_subnet_shuffling_prefix_bits as u64; // calculate the prefixes used to compute the subnet and shuffling - // TODO(alloy) improve error messaging - let node_id_prefix = u64::from_le_bytes( - (node_id >> 256 - prefix_bits) - .as_le_slice() - .try_into() - .map_err(|_| "error")?, - ); - let shuffling_prefix = u64::from_le_bytes( - (node_id >> (256 - (prefix_bits + shuffling_prefix_bits))) - .as_le_slice() - .try_into() - .map_err(|_| "error")?, - ); + let node_id_prefix = node_id.as_le_slice().get_u64() >> (256 - prefix_bits); + let shuffling_prefix = node_id.as_le_slice().get_u64() >> (256 - prefix_bits + shuffling_prefix_bits); // number of groups the shuffling creates let shuffling_groups = 1 << shuffling_prefix_bits; @@ -203,7 +191,7 @@ mod tests { "60930578857433095740782970114409273483106482059893286066493409689627770333527", "103822458477361691467064888613019442068586830412598673713899771287914656699997", ] - .map(|v| v.parse::().unwrap()); + .map(|v| v.parse::().unwrap()); let epochs = [ 54321u64, 1017090249, 1827566880, 846255942, 766597383, 1204990115, 1616209495, diff --git a/consensus/types/src/sync_selection_proof.rs b/consensus/types/src/sync_selection_proof.rs index 204f1d5ca17..4adb90b26e2 100644 --- a/consensus/types/src/sync_selection_proof.rs +++ b/consensus/types/src/sync_selection_proof.rs @@ -105,7 +105,7 @@ impl From for SyncSelectionProof { #[cfg(test)] mod test { use super::*; - use crate::{Hash256Extended, MainnetEthSpec}; + use crate::{FixedBytesExtended, MainnetEthSpec}; use eth2_interop_keypairs::keypair; #[test] diff --git a/consensus/types/src/validator.rs b/consensus/types/src/validator.rs index 038d65305d2..70602a20508 100644 --- a/consensus/types/src/validator.rs +++ b/consensus/types/src/validator.rs @@ -1,6 +1,6 @@ use crate::{ test_utils::TestRandom, Address, BeaconState, ChainSpec, Checkpoint, Epoch, EthSpec, ForkName, - Hash256, Hash256Extended, PublicKeyBytes, + Hash256, FixedBytesExtended, PublicKeyBytes, }; use serde::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; diff --git a/crypto/bls/src/lib.rs b/crypto/bls/src/lib.rs index 82e78f8568b..25e1ffc0204 100644 --- a/crypto/bls/src/lib.rs +++ b/crypto/bls/src/lib.rs @@ -45,13 +45,13 @@ pub use zeroize_hash::ZeroizeHash; use blst::BLST_ERROR as BlstError; pub type Hash256 = alloy_primitives::B256; -pub trait Hash256Extended { +pub trait FixedBytesExtended { fn from_low_u64_be(value: u64) -> alloy_primitives::B256; fn from_low_u64_le(value: u64) -> alloy_primitives::B256; fn zero() -> alloy_primitives::B256; } -impl Hash256Extended for alloy_primitives::B256 { +impl FixedBytesExtended for alloy_primitives::B256 { fn from_low_u64_be(value: u64) -> alloy_primitives::B256 { alloy_primitives::B256::from_slice(&value.to_be_bytes()) } diff --git a/crypto/bls/tests/tests.rs b/crypto/bls/tests/tests.rs index 521f5d1e8d5..a8253ededff 100644 --- a/crypto/bls/tests/tests.rs +++ b/crypto/bls/tests/tests.rs @@ -1,4 +1,4 @@ -use bls::{Hash256, Hash256Extended, INFINITY_SIGNATURE, SECRET_KEY_BYTES_LEN}; +use bls::{Hash256, FixedBytesExtended, INFINITY_SIGNATURE, SECRET_KEY_BYTES_LEN}; use ssz::{Decode, Encode}; use std::borrow::Cow; use std::fmt::Debug; diff --git a/lcli/src/generate_bootnode_enr.rs b/lcli/src/generate_bootnode_enr.rs index 6f6e47e6a64..56c2ace113f 100644 --- a/lcli/src/generate_bootnode_enr.rs +++ b/lcli/src/generate_bootnode_enr.rs @@ -8,7 +8,7 @@ use std::io::Write; use std::path::PathBuf; use std::{fs, net::Ipv4Addr}; use std::{fs::File, num::NonZeroU16}; -use types::{ChainSpec, EnrForkId, Epoch, EthSpec, Hash256, Hash256Extended}; +use types::{ChainSpec, EnrForkId, Epoch, EthSpec, Hash256, FixedBytesExtended}; pub fn run(matches: &ArgMatches) -> Result<(), String> { let ip: Ipv4Addr = clap_utils::parse_required(matches, "ip")?; diff --git a/slasher/src/test_utils.rs b/slasher/src/test_utils.rs index e85c2bbaad5..526724aeaef 100644 --- a/slasher/src/test_utils.rs +++ b/slasher/src/test_utils.rs @@ -4,7 +4,7 @@ use types::{ indexed_attestation::{IndexedAttestationBase, IndexedAttestationElectra}, AggregateSignature, AttestationData, AttesterSlashing, AttesterSlashingBase, AttesterSlashingElectra, BeaconBlockHeader, ChainSpec, Checkpoint, Epoch, EthSpec, Hash256, - Hash256Extended, IndexedAttestation, MainnetEthSpec, Signature, SignedBeaconBlockHeader, Slot, + FixedBytesExtended, IndexedAttestation, MainnetEthSpec, Signature, SignedBeaconBlockHeader, Slot, }; pub type E = MainnetEthSpec; diff --git a/testing/ef_tests/src/cases/common.rs b/testing/ef_tests/src/cases/common.rs index 12ce16c6433..9668fa2b2e2 100644 --- a/testing/ef_tests/src/cases/common.rs +++ b/testing/ef_tests/src/cases/common.rs @@ -4,49 +4,49 @@ use ssz_derive::{Decode, Encode}; use std::fmt::Debug; use types::ForkName; -// TODO(alloy) do we need this? -// /// Macro to wrap U128 and U256 so they deserialize correctly. -// macro_rules! uint_wrapper { -// ($wrapper_name:ident, $wrapped_type:ty) => { -// #[derive(Debug, Clone, Copy, Default, PartialEq, Decode, Encode, Deserialize)] -// #[serde(try_from = "String")] -// pub struct $wrapper_name { -// pub x: $wrapped_type, -// } +/// Macro to wrap U128 and U256 so they deserialize correctly. +macro_rules! uint_wrapper { + ($wrapper_name:ident, $wrapped_type:ty) => { + #[derive(Debug, Clone, Copy, Default, PartialEq, Decode, Encode, Deserialize)] + #[serde(try_from = "String")] + pub struct $wrapper_name { + pub x: $wrapped_type, + } -// impl TryFrom for $wrapper_name { -// type Error = String; + impl TryFrom for $wrapper_name { + type Error = String; -// fn try_from(s: String) -> Result { -// <$wrapped_type>::from_dec_str(&s) -// .map(|x| Self { x }) -// .map_err(|e| format!("{:?}", e)) -// } -// } -// impl tree_hash::TreeHash for $wrapper_name { -// fn tree_hash_type() -> tree_hash::TreeHashType { -// <$wrapped_type>::tree_hash_type() -// } + fn try_from(s: String) -> Result { + <$wrapped_type>::from_str_radix(&s, 10) + .map(|x| Self { x }) + .map_err(|e| format!("{:?}", e)) + } + } -// fn tree_hash_packed_encoding(&self) -> tree_hash::PackedEncoding { -// self.x.tree_hash_packed_encoding() -// } + impl tree_hash::TreeHash for $wrapper_name { + fn tree_hash_type() -> tree_hash::TreeHashType { + <$wrapped_type>::tree_hash_type() + } -// fn tree_hash_packing_factor() -> usize { -// <$wrapped_type>::tree_hash_packing_factor() -// } + fn tree_hash_packed_encoding(&self) -> tree_hash::PackedEncoding { + self.x.tree_hash_packed_encoding() + } -// fn tree_hash_root(&self) -> tree_hash::Hash256 { -// self.x.tree_hash_root() -// } -// } -// }; -// } + fn tree_hash_packing_factor() -> usize { + <$wrapped_type>::tree_hash_packing_factor() + } + + fn tree_hash_root(&self) -> tree_hash::Hash256 { + self.x.tree_hash_root() + } + } + }; +} -// uint_wrapper!(TestU128, ethereum_types::U128); -// uint_wrapper!(TestU256, ethereum_types::U256); +uint_wrapper!(DecimalU128, alloy_primitives::U128); +uint_wrapper!(DecimalU256, alloy_primitives::U256); /// Trait for types that can be used in SSZ static tests. pub trait SszStaticType: diff --git a/testing/ef_tests/src/cases/ssz_generic.rs b/testing/ef_tests/src/cases/ssz_generic.rs index 3af2f114034..3dc2f179684 100644 --- a/testing/ef_tests/src/cases/ssz_generic.rs +++ b/testing/ef_tests/src/cases/ssz_generic.rs @@ -1,7 +1,7 @@ #![allow(non_snake_case)] use super::*; -use crate::cases::common::SszStaticType; +use crate::cases::common::{DecimalU128, DecimalU256, SszStaticType}; use crate::cases::ssz_static::{check_serialization, check_tree_hash}; use crate::decode::{log_file_access, snappy_decode_file, yaml_decode_file}; use serde::{de::Error as SerdeError, Deserialize, Deserializer}; @@ -56,8 +56,8 @@ macro_rules! type_dispatch { "uint16" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* u16>, $($rest)*), "uint32" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* u32>, $($rest)*), "uint64" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* u64>, $($rest)*), - // "uint128" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* TestU128>, $($rest)*), - // "uint256" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* TestU256>, $($rest)*), + "uint128" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* DecimalU128>, $($rest)*), + "uint256" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* DecimalU256>, $($rest)*), _ => Err(Error::FailedToParseTest(format!("unsupported: {}", $value))), } }; diff --git a/testing/eth1_test_rig/src/lib.rs b/testing/eth1_test_rig/src/lib.rs index e60297c99d9..015a632ff40 100644 --- a/testing/eth1_test_rig/src/lib.rs +++ b/testing/eth1_test_rig/src/lib.rs @@ -20,7 +20,7 @@ pub use ethers_providers::{Http, Middleware, Provider}; use std::time::Duration; use tokio::time::sleep; use types::{test_utils::generate_deterministic_keypair, EthSpec, Hash256, Keypair, Signature}; -use types::{DepositData, Hash256Extended}; +use types::{DepositData, FixedBytesExtended}; pub const DEPLOYER_ACCOUNTS_INDEX: usize = 0; pub const DEPOSIT_ACCOUNTS_INDEX: usize = 0; diff --git a/testing/execution_engine_integration/src/test_rig.rs b/testing/execution_engine_integration/src/test_rig.rs index c5d4e751b52..c2218fadbec 100644 --- a/testing/execution_engine_integration/src/test_rig.rs +++ b/testing/execution_engine_integration/src/test_rig.rs @@ -18,7 +18,7 @@ use tokio::time::sleep; use types::payload::BlockProductionVersion; use types::{ Address, ChainSpec, EthSpec, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadHeader, - ForkName, Hash256, Hash256Extended, MainnetEthSpec, PublicKeyBytes, Slot, Uint256, + ForkName, Hash256, FixedBytesExtended, MainnetEthSpec, PublicKeyBytes, Slot, Uint256, }; const EXECUTION_ENGINE_START_TIMEOUT: Duration = Duration::from_secs(60); diff --git a/testing/execution_engine_integration/src/transactions.rs b/testing/execution_engine_integration/src/transactions.rs index 4d4693a18e3..1f092a37984 100644 --- a/testing/execution_engine_integration/src/transactions.rs +++ b/testing/execution_engine_integration/src/transactions.rs @@ -3,7 +3,7 @@ use ethers_core::types::{ transaction::{eip2718::TypedTransaction, eip2930::AccessList}, Address, Bytes, Eip1559TransactionRequest, TransactionRequest, U256, }; -use types::{DepositData, EthSpec, Hash256, Hash256Extended, Keypair, Signature}; +use types::{DepositData, EthSpec, Hash256, FixedBytesExtended, Keypair, Signature}; /// Hardcoded deposit contract address based on sender address and nonce pub const DEPOSIT_CONTRACT_ADDRESS: &str = "64f43BEc7F86526686C931d65362bB8698872F90"; diff --git a/testing/state_transition_vectors/src/main.rs b/testing/state_transition_vectors/src/main.rs index 9a8a746fa8a..9cc73bec20d 100644 --- a/testing/state_transition_vectors/src/main.rs +++ b/testing/state_transition_vectors/src/main.rs @@ -13,7 +13,7 @@ use std::process::exit; use types::{ test_utils::generate_deterministic_keypairs, BeaconState, EthSpec, Keypair, SignedBeaconBlock, }; -use types::{Hash256, Hash256Extended, MainnetEthSpec, Slot}; +use types::{Hash256, FixedBytesExtended, MainnetEthSpec, Slot}; type E = MainnetEthSpec; diff --git a/validator_client/slashing_protection/src/attestation_tests.rs b/validator_client/slashing_protection/src/attestation_tests.rs index 1f555d3ddf9..b577ccd9d85 100644 --- a/validator_client/slashing_protection/src/attestation_tests.rs +++ b/validator_client/slashing_protection/src/attestation_tests.rs @@ -2,7 +2,7 @@ use crate::test_utils::*; use crate::*; -use types::{AttestationData, Checkpoint, Epoch, Hash256Extended, Slot}; +use types::{AttestationData, Checkpoint, Epoch, FixedBytesExtended, Slot}; pub fn build_checkpoint(epoch_num: u64) -> Checkpoint { Checkpoint { diff --git a/validator_client/slashing_protection/src/bin/test_generator.rs b/validator_client/slashing_protection/src/bin/test_generator.rs index 1072bdea4ef..c56ab7bf77e 100644 --- a/validator_client/slashing_protection/src/bin/test_generator.rs +++ b/validator_client/slashing_protection/src/bin/test_generator.rs @@ -7,7 +7,7 @@ use slashing_protection::SUPPORTED_INTERCHANGE_FORMAT_VERSION; use std::fs::{self, File}; use std::io::Write; use std::path::Path; -use types::{Epoch, Hash256, Hash256Extended, Slot}; +use types::{Epoch, Hash256, FixedBytesExtended, Slot}; fn metadata(genesis_validators_root: Hash256) -> InterchangeMetadata { InterchangeMetadata { diff --git a/validator_client/slashing_protection/src/block_tests.rs b/validator_client/slashing_protection/src/block_tests.rs index cee37525652..b3273015f42 100644 --- a/validator_client/slashing_protection/src/block_tests.rs +++ b/validator_client/slashing_protection/src/block_tests.rs @@ -2,7 +2,7 @@ use super::*; use crate::test_utils::*; -use types::{BeaconBlockHeader, Hash256Extended, Slot}; +use types::{BeaconBlockHeader, FixedBytesExtended, Slot}; pub fn block(slot: u64) -> BeaconBlockHeader { BeaconBlockHeader { diff --git a/validator_client/slashing_protection/src/extra_interchange_tests.rs b/validator_client/slashing_protection/src/extra_interchange_tests.rs index 4f19f745fd2..0f88ec8b1dc 100644 --- a/validator_client/slashing_protection/src/extra_interchange_tests.rs +++ b/validator_client/slashing_protection/src/extra_interchange_tests.rs @@ -3,7 +3,7 @@ use crate::test_utils::pubkey; use crate::*; use tempfile::tempdir; -use types::Hash256Extended; +use types::FixedBytesExtended; #[test] fn export_non_existent_key() { diff --git a/validator_client/slashing_protection/src/interchange_test.rs b/validator_client/slashing_protection/src/interchange_test.rs index a89162d630b..0409034aaf5 100644 --- a/validator_client/slashing_protection/src/interchange_test.rs +++ b/validator_client/slashing_protection/src/interchange_test.rs @@ -6,7 +6,7 @@ use crate::{ use serde::{Deserialize, Serialize}; use std::collections::HashSet; use tempfile::tempdir; -use types::{Epoch, Hash256, Hash256Extended, PublicKeyBytes, Slot}; +use types::{Epoch, Hash256, FixedBytesExtended, PublicKeyBytes, Slot}; #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))] diff --git a/validator_client/slashing_protection/src/lib.rs b/validator_client/slashing_protection/src/lib.rs index 100c70c0cc2..51dd3e31642 100644 --- a/validator_client/slashing_protection/src/lib.rs +++ b/validator_client/slashing_protection/src/lib.rs @@ -130,7 +130,7 @@ impl Display for NotSafe { #[cfg(test)] mod test { - use types::Hash256Extended; + use types::FixedBytesExtended; use super::*; diff --git a/validator_client/slashing_protection/tests/migration.rs b/validator_client/slashing_protection/tests/migration.rs index 9cf430a06e0..5e384be3dc6 100644 --- a/validator_client/slashing_protection/tests/migration.rs +++ b/validator_client/slashing_protection/tests/migration.rs @@ -4,7 +4,7 @@ use std::collections::HashMap; use std::fs; use std::path::{Path, PathBuf}; use tempfile::tempdir; -use types::{Hash256, Hash256Extended}; +use types::{Hash256, FixedBytesExtended}; fn test_data_dir() -> PathBuf { Path::new(&std::env::var("CARGO_MANIFEST_DIR").unwrap()).join("migration-tests") diff --git a/validator_manager/src/create_validators.rs b/validator_manager/src/create_validators.rs index d53e92deb30..80d8a54f916 100644 --- a/validator_manager/src/create_validators.rs +++ b/validator_manager/src/create_validators.rs @@ -725,16 +725,16 @@ pub mod tests { assert_eq!(deposit.pubkey, validator_pubkey.clone().into()); if let Some(address) = config.eth1_withdrawal_address { assert_eq!( - deposit.withdrawal_credentials.as_bytes()[0], + deposit.withdrawal_credentials.as_slice()[0], spec.eth1_address_withdrawal_prefix_byte ); assert_eq!( - &deposit.withdrawal_credentials.as_bytes()[12..], - address.as_bytes() + &deposit.withdrawal_credentials.as_slice()[12..], + address.as_slice() ); } else { assert_eq!( - deposit.withdrawal_credentials.as_bytes()[0], + deposit.withdrawal_credentials.as_slice()[0], spec.bls_withdrawal_prefix_byte ); } From a96cd6a817e187853cd035fdfc59ab4e1d2aa12f Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Wed, 17 Jul 2024 16:04:08 +0100 Subject: [PATCH 21/62] debugging --- Cargo.lock | 1 + Cargo.toml | 1 + consensus/types/Cargo.toml | 1 + consensus/types/src/lib.rs | 21 ++++++++++++++++++--- lighthouse/environment/src/lib.rs | 3 +++ 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8ec78c4fb6b..a36b8736ffc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8923,6 +8923,7 @@ dependencies = [ "criterion", "derivative", "eth2_interop_keypairs", + "ethereum-types 0.14.1", "ethereum_hashing", "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", diff --git a/Cargo.toml b/Cargo.toml index 3f12aabc853..63a40886e93 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -182,6 +182,7 @@ uuid = { version = "0.8", features = ["serde", "v4"] } warp = { version = "0.3.7", default-features = false, features = ["tls"] } zeroize = { version = "1", features = ["zeroize_derive"] } zip = "0.6" +ethereum-types = "0.14" # Local crates. account_utils = { path = "common/account_utils" } diff --git a/consensus/types/Cargo.toml b/consensus/types/Cargo.toml index 254c963e5a2..04fecd6d647 100644 --- a/consensus/types/Cargo.toml +++ b/consensus/types/Cargo.toml @@ -10,6 +10,7 @@ harness = false [dependencies] alloy-primitives = { workspace = true, features = ["ssz", "serde", "std"]} +ethereum-types = {workspace = true } merkle_proof = { workspace = true } bls = { workspace = true, features = ["arbitrary"] } kzg = { workspace = true } diff --git a/consensus/types/src/lib.rs b/consensus/types/src/lib.rs index 6949b1c912e..80b37d642bf 100644 --- a/consensus/types/src/lib.rs +++ b/consensus/types/src/lib.rs @@ -109,6 +109,7 @@ pub mod light_client_header; pub mod non_zero_usize; pub mod runtime_var_list; +use alloy_primitives::bytes::{BufMut, BytesMut}; use alloy_primitives::{Address as H160, B256 as H256}; pub use crate::activation_queue::ActivationQueue; @@ -288,13 +289,27 @@ impl FixedBytesExtended for alloy_primitives::B256 { let mut large_array: [u8; 32] = [0; 32]; // Determine the length of bytes to copy (ignoring the most significant bits if necessary) let bytes_to_copy = value_bytes.len().min(large_array.len()); + let start_index = large_array.len() - bytes_to_copy; // Copy the bytes to the target array - large_array[..bytes_to_copy].copy_from_slice(&value_bytes[..bytes_to_copy]); - println!("{:?}" large_array); - alloy_primitives::B256::new(large_array) + large_array[start_index..].copy_from_slice(&value_bytes[..bytes_to_copy]); + println!("{:?}", large_array); + let x = alloy_primitives::B256::new(large_array); + let y = ethereum_types::H256::from_low_u64_be(value); + println!("x: {:?}", x); + println!("y: {:?}", y); + + let mut bytes = BytesMut::with_capacity(32); + bytes.put_u64(value); + bytes.resize(32, 0); + bytes.to_vec(); + let z = alloy_primitives::B256::from_slice(&bytes); + + println!("z: {:?}", z); + x } fn from_low_u64_le(value: u64) -> Self { + println!("check?"); alloy_primitives::B256::from_slice(&value.to_le_bytes()) } diff --git a/lighthouse/environment/src/lib.rs b/lighthouse/environment/src/lib.rs index a83a7a91571..204bb4ee707 100644 --- a/lighthouse/environment/src/lib.rs +++ b/lighthouse/environment/src/lib.rs @@ -343,8 +343,11 @@ impl EnvironmentBuilder { /// Consumes the builder, returning an `Environment`. pub fn build(self) -> Result, String> { + println!("2"); let (signal, exit) = async_channel::bounded(1); + println!("3"); let (signal_tx, signal_rx) = channel(1); + println!("4"); Ok(Environment { runtime: self .runtime From b8417855e5a915d98d6b1c6be90e6e944a2d968c Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Fri, 19 Jul 2024 00:47:25 +0100 Subject: [PATCH 22/62] fix failed test --- beacon_node/beacon_chain/src/builder.rs | 2 +- .../beacon_chain/src/observed_aggregates.rs | 2 +- .../tests/attestation_verification.rs | 2 +- .../tests/payload_invalidation.rs | 4 +- beacon_node/beacon_chain/tests/store_tests.rs | 2 +- .../tests/sync_committee_verification.rs | 2 +- beacon_node/network/src/service/tests.rs | 4 +- consensus/merkle_proof/src/lib.rs | 28 +++++++-- consensus/types/src/chain_spec.rs | 3 +- consensus/types/src/graffiti.rs | 4 +- consensus/types/src/lib.rs | 63 +++++++++++++------ consensus/types/src/subnet_id.rs | 2 + lighthouse/environment/src/lib.rs | 3 - testing/web3signer_tests/src/lib.rs | 1 + 14 files changed, 85 insertions(+), 37 deletions(-) diff --git a/beacon_node/beacon_chain/src/builder.rs b/beacon_node/beacon_chain/src/builder.rs index edd6f4ac029..d1028ba0299 100644 --- a/beacon_node/beacon_chain/src/builder.rs +++ b/beacon_node/beacon_chain/src/builder.rs @@ -1267,7 +1267,7 @@ mod test { } for v in state.validators() { - let creds = v.withdrawal_credentials.as_bytes(); + let creds = v.withdrawal_credentials.as_slice(); assert_eq!( creds[0], spec.bls_withdrawal_prefix_byte, "first byte of withdrawal creds should be bls prefix" diff --git a/beacon_node/beacon_chain/src/observed_aggregates.rs b/beacon_node/beacon_chain/src/observed_aggregates.rs index 00476bfe7af..23366631ae7 100644 --- a/beacon_node/beacon_chain/src/observed_aggregates.rs +++ b/beacon_node/beacon_chain/src/observed_aggregates.rs @@ -473,7 +473,7 @@ where #[cfg(not(debug_assertions))] mod tests { use super::*; - use types::{test_utils::test_random_instance, AttestationBase, Hash256}; + use types::{test_utils::test_random_instance, AttestationBase, Hash256, FixedBytesExtended}; type E = types::MainnetEthSpec; diff --git a/beacon_node/beacon_chain/tests/attestation_verification.rs b/beacon_node/beacon_chain/tests/attestation_verification.rs index 19efe10c6d0..ef4b15fbf31 100644 --- a/beacon_node/beacon_chain/tests/attestation_verification.rs +++ b/beacon_node/beacon_chain/tests/attestation_verification.rs @@ -24,7 +24,7 @@ use types::{ signed_aggregate_and_proof::SignedAggregateAndProofRefMut, test_utils::generate_deterministic_keypair, Address, AggregateSignature, Attestation, AttestationRef, AttestationRefMut, BeaconStateError, BitList, ChainSpec, Epoch, EthSpec, - ForkName, Hash256, Keypair, MainnetEthSpec, SecretKey, SelectionProof, SignedAggregateAndProof, + ForkName, Hash256, FixedBytesExtended, Keypair, MainnetEthSpec, SecretKey, SelectionProof, SignedAggregateAndProof, Slot, SubnetId, Unsigned, }; diff --git a/beacon_node/beacon_chain/tests/payload_invalidation.rs b/beacon_node/beacon_chain/tests/payload_invalidation.rs index 4dc7d20e227..c7195e51ebf 100644 --- a/beacon_node/beacon_chain/tests/payload_invalidation.rs +++ b/beacon_node/beacon_chain/tests/payload_invalidation.rs @@ -1280,7 +1280,7 @@ struct OptimisticTransitionSetup { impl OptimisticTransitionSetup { async fn new(num_blocks: usize, ttd: u64) -> Self { let mut spec = E::default_spec(); - spec.terminal_total_difficulty = ttd.into(); + spec.terminal_total_difficulty = Uint256::from(ttd); let mut rig = InvalidPayloadRig::new_with_spec(spec).enable_attestations(); rig.move_to_terminal_block(); @@ -1323,7 +1323,7 @@ async fn build_optimistic_chain( // Build a brand-new testing harness. We will apply the blocks from the previous harness to // this one. let mut spec = E::default_spec(); - spec.terminal_total_difficulty = rig_ttd.into(); + spec.terminal_total_difficulty = Uint256::from(rig_ttd); let rig = InvalidPayloadRig::new_with_spec(spec); let spec = &rig.harness.chain.spec; diff --git a/beacon_node/beacon_chain/tests/store_tests.rs b/beacon_node/beacon_chain/tests/store_tests.rs index e675d6956e8..957dac30693 100644 --- a/beacon_node/beacon_chain/tests/store_tests.rs +++ b/beacon_node/beacon_chain/tests/store_tests.rs @@ -844,7 +844,7 @@ async fn delete_blocks_and_states() { assert_eq!( harness.head_block_root(), - honest_head.into(), + Hash256::from(honest_head), "the honest chain should be the canonical chain", ); diff --git a/beacon_node/beacon_chain/tests/sync_committee_verification.rs b/beacon_node/beacon_chain/tests/sync_committee_verification.rs index 242ed558475..676a58b3644 100644 --- a/beacon_node/beacon_chain/tests/sync_committee_verification.rs +++ b/beacon_node/beacon_chain/tests/sync_committee_verification.rs @@ -13,7 +13,7 @@ use store::{SignedContributionAndProof, SyncCommitteeMessage}; use tree_hash::TreeHash; use types::consts::altair::SYNC_COMMITTEE_SUBNET_COUNT; use types::{ - AggregateSignature, Epoch, EthSpec, Hash256, Keypair, MainnetEthSpec, SecretKey, Slot, + AggregateSignature, Epoch, EthSpec, Hash256, FixedBytesExtended, Keypair, MainnetEthSpec, SecretKey, Slot, SyncContributionData, SyncSelectionProof, SyncSubnetId, Unsigned, }; diff --git a/beacon_node/network/src/service/tests.rs b/beacon_node/network/src/service/tests.rs index b5731876968..392c0bfb0ad 100644 --- a/beacon_node/network/src/service/tests.rs +++ b/beacon_node/network/src/service/tests.rs @@ -14,7 +14,7 @@ mod tests { use std::str::FromStr; use std::sync::Arc; use tokio::runtime::Runtime; - use types::{Epoch, EthSpec, ForkName, MinimalEthSpec, SubnetId}; + use types::{Epoch, EthSpec, ForkName, MinimalEthSpec, SubnetId, Uint256}; impl NetworkService { fn get_topic_params(&self, topic: GossipTopic) -> Option<&gossipsub::TopicScoreParams> { @@ -176,7 +176,7 @@ mod tests { // Make sure the service is subscribed to the topics. let (old_topic1, old_topic2) = { let mut subnets = SubnetId::compute_subnets_for_epoch::( - network_globals.local_enr().node_id().raw().into(), + Uint256::from_le_slice(&network_globals.local_enr().node_id().raw()), beacon_chain.epoch().unwrap(), &spec, ) diff --git a/consensus/merkle_proof/src/lib.rs b/consensus/merkle_proof/src/lib.rs index 59241b868c2..a84251cf4a0 100644 --- a/consensus/merkle_proof/src/lib.rs +++ b/consensus/merkle_proof/src/lib.rs @@ -11,15 +11,33 @@ pub trait FixedBytesExtended { } impl FixedBytesExtended for alloy_primitives::B256 { - fn from_low_u64_be(value: u64) -> alloy_primitives::B256 { - alloy_primitives::B256::from_slice(&value.to_be_bytes()) + + fn from_low_u64_be(value: u64) -> Self { + // Convert the u64 value to a big-endian byte array + let value_bytes = value.to_be_bytes(); + let mut large_array: [u8; 32] = [0; 32]; + // Determine the length of bytes to copy (ignoring the most significant bits if necessary) + let bytes_to_copy = value_bytes.len().min(large_array.len()); + let start_index = large_array.len() - bytes_to_copy; + // Copy the bytes to the target array + large_array[start_index..].copy_from_slice(&value_bytes[..bytes_to_copy]); + + alloy_primitives::B256::new(large_array) } - fn from_low_u64_le(value: u64) -> alloy_primitives::B256 { - alloy_primitives::B256::from_slice(&value.to_le_bytes()) + fn from_low_u64_le(value: u64) -> Self { + // Convert the u64 value to a big-endian byte array + let value_bytes = value.to_le_bytes(); + let mut large_array: [u8; 32] = [0; 32]; + // Determine the length of bytes to copy (ignoring the most significant bits if necessary) + let bytes_to_copy = value_bytes.len().min(large_array.len()); + let start_index = large_array.len() - bytes_to_copy; + // Copy the bytes to the target array + large_array[start_index..].copy_from_slice(&value_bytes[..bytes_to_copy]); + alloy_primitives::B256::new(large_array) } - fn zero() -> alloy_primitives::B256 { + fn zero() -> Self { alloy_primitives::B256::ZERO } } diff --git a/consensus/types/src/chain_spec.rs b/consensus/types/src/chain_spec.rs index b63da0e8096..644b3a00c11 100644 --- a/consensus/types/src/chain_spec.rs +++ b/consensus/types/src/chain_spec.rs @@ -1967,6 +1967,7 @@ mod yaml_tests { assert_eq!(new_spec, ChainSpec::minimal()); } + // TODO(alloy) fix test #[test] fn test_defaults() { // Spec yaml string. Fields that serialize/deserialize with a default value are commented out. @@ -2000,7 +2001,7 @@ mod yaml_tests { PROPOSER_SCORE_BOOST: 40 DEPOSIT_CHAIN_ID: 1 DEPOSIT_NETWORK_ID: 1 - DEPOSIT_CONTRACT_ADDRESS: 0x00000000219ab540356cBB839Cbe05303d7705Fa + DEPOSIT_CONTRACT_ADDRESS: 00000000219ab540356cBB839Cbe05303d7705Fa "#; let chain_spec: Config = serde_yaml::from_str(spec).unwrap(); diff --git a/consensus/types/src/graffiti.rs b/consensus/types/src/graffiti.rs index 2c8305ad5ab..1873cfaa748 100644 --- a/consensus/types/src/graffiti.rs +++ b/consensus/types/src/graffiti.rs @@ -79,6 +79,7 @@ impl<'de> Deserialize<'de> for GraffitiString { impl From for Graffiti { fn from(from: GraffitiString) -> Graffiti { + let graffiti_bytes = from.0.as_bytes(); let mut graffiti = [0; GRAFFITI_BYTES_LEN]; @@ -87,10 +88,11 @@ impl From for Graffiti { // Copy the provided bytes over. // // Panic-free because `graffiti_bytes.len()` <= `GRAFFITI_BYTES_LEN`. + // TODO(alloy) review why this was no longer panic free w/o my changes graffiti .get_mut(..graffiti_len) .expect("graffiti_len <= GRAFFITI_BYTES_LEN") - .copy_from_slice(graffiti_bytes); + .copy_from_slice(&graffiti_bytes[..graffiti_len]); graffiti.into() } } diff --git a/consensus/types/src/lib.rs b/consensus/types/src/lib.rs index e0290a5105e..aec99cf316e 100644 --- a/consensus/types/src/lib.rs +++ b/consensus/types/src/lib.rs @@ -256,7 +256,7 @@ pub use crate::withdrawal_credentials::WithdrawalCredentials; pub type CommitteeIndex = u64; pub type Hash256 = alloy_primitives::B256; pub type Uint256 = alloy_primitives::U256; -pub type Address = H160; +pub type Address = alloy_primitives::Address; pub type ForkVersion = [u8; 4]; pub type BLSFieldElement = Uint256; pub type Blob = FixedVector::BytesPerBlob>; @@ -292,25 +292,30 @@ impl FixedBytesExtended for alloy_primitives::B256 { let start_index = large_array.len() - bytes_to_copy; // Copy the bytes to the target array large_array[start_index..].copy_from_slice(&value_bytes[..bytes_to_copy]); - println!("{:?}", large_array); - let x = alloy_primitives::B256::new(large_array); - let y = ethereum_types::H256::from_low_u64_be(value); - println!("x: {:?}", x); - println!("y: {:?}", y); - - let mut bytes = BytesMut::with_capacity(32); - bytes.put_u64(value); - bytes.resize(32, 0); - bytes.to_vec(); - let z = alloy_primitives::B256::from_slice(&bytes); - println!("z: {:?}", z); - x + alloy_primitives::B256::new(large_array) + // bytes.put_u64(value); + // bytes.resize(32, 0); + // bytes.to_vec(); + // let z = alloy_primitives::B256::from_slice(&bytes); } fn from_low_u64_le(value: u64) -> Self { - println!("check?"); - alloy_primitives::B256::from_slice(&value.to_le_bytes()) + // Convert the u64 value to a big-endian byte array + let value_bytes = value.to_le_bytes(); + let mut large_array: [u8; 32] = [0; 32]; + // Determine the length of bytes to copy (ignoring the most significant bits if necessary) + let bytes_to_copy = value_bytes.len().min(large_array.len()); + let start_index = large_array.len() - bytes_to_copy; + // Copy the bytes to the target array + large_array[start_index..].copy_from_slice(&value_bytes[..bytes_to_copy]); + let x = ethereum_types::H256::from_low_u64_le(value); + let y = alloy_primitives::B256::new(large_array); + + println!("x: {:?}", x); + println!("y: {:?}", y); + + y } fn zero() -> Self { @@ -320,12 +325,34 @@ impl FixedBytesExtended for alloy_primitives::B256 { impl FixedBytesExtended for alloy_primitives::Address { fn from_low_u64_be(value: u64) -> Self { - alloy_primitives::Address::from_slice(&value.to_le_bytes()) + // Convert the u64 value to a big-endian byte array + let value_bytes = value.to_be_bytes(); + let mut large_array: [u8; 20] = [0; 20]; + // Determine the length of bytes to copy (ignoring the most significant bits if necessary) + let bytes_to_copy = value_bytes.len().min(large_array.len()); + let start_index = large_array.len() - bytes_to_copy; + // Copy the bytes to the target array + large_array[start_index..].copy_from_slice(&value_bytes[..bytes_to_copy]); + + alloy_primitives::Address::new(large_array) } fn from_low_u64_le(value: u64) -> Self { - alloy_primitives::Address::from_slice(&value.to_be_bytes()) + // Convert the u64 value to a big-endian byte array + let value_bytes = value.to_le_bytes(); + let mut large_array: [u8; 20] = [0; 20]; + // Determine the length of bytes to copy (ignoring the most significant bits if necessary) + let bytes_to_copy = value_bytes.len().min(large_array.len()); + let start_index = large_array.len() - bytes_to_copy; + // Copy the bytes to the target array + large_array[start_index..].copy_from_slice(&value_bytes[..bytes_to_copy]); + let x = ethereum_types::Address::from_low_u64_le(value); + let y = alloy_primitives::Address::new(large_array); + + println!("x address: {:?}", x); + println!("y address: {:?}", y); + y } fn zero() -> Self { diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index 8c19747b409..fc3e4183bd6 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -90,6 +90,7 @@ impl SubnetId { let shuffling_prefix_bits = spec.attestation_subnet_shuffling_prefix_bits as u64; // calculate the prefixes used to compute the subnet and shuffling + // TODO(alloy) I think node id is being miscalculated. we should compare to eth_types let node_id_prefix = node_id.as_le_slice().get_u64() >> (256 - prefix_bits); let shuffling_prefix = node_id.as_le_slice().get_u64() >> (256 - prefix_bits + shuffling_prefix_bits); @@ -176,6 +177,7 @@ mod tests { use super::*; /// A set of tests compared to the python specification + /// TODO(Alloy) fix test #[test] fn compute_subnets_for_epoch_unit_test() { // Randomized variables used generated with the python specification diff --git a/lighthouse/environment/src/lib.rs b/lighthouse/environment/src/lib.rs index 204bb4ee707..a83a7a91571 100644 --- a/lighthouse/environment/src/lib.rs +++ b/lighthouse/environment/src/lib.rs @@ -343,11 +343,8 @@ impl EnvironmentBuilder { /// Consumes the builder, returning an `Environment`. pub fn build(self) -> Result, String> { - println!("2"); let (signal, exit) = async_channel::bounded(1); - println!("3"); let (signal_tx, signal_rx) = channel(1); - println!("4"); Ok(Environment { runtime: self .runtime diff --git a/testing/web3signer_tests/src/lib.rs b/testing/web3signer_tests/src/lib.rs index 4187844cecc..54953238b7f 100644 --- a/testing/web3signer_tests/src/lib.rs +++ b/testing/web3signer_tests/src/lib.rs @@ -726,6 +726,7 @@ mod tests { /// Test all the Bellatrix types. async fn test_bellatrix_types(network: &str, listen_port: u16) { + println!("{}", network); let network_config = Eth2NetworkConfig::constant(network).unwrap().unwrap(); let spec = &network_config.chain_spec::().unwrap(); let bellatrix_fork_slot = spec From 22ee8d8ec3b58adc1828cffbba8c005e1c5c58a7 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Sun, 21 Jul 2024 18:16:02 -0700 Subject: [PATCH 23/62] fixing more tests --- Cargo.lock | 181 ++++++++++-------- Cargo.toml | 2 +- beacon_node/execution_layer/src/engine_api.rs | 5 + .../src/engine_api/json_structures.rs | 9 + .../test_utils/execution_block_generator.rs | 2 + common/eth2/src/lighthouse_vc/std_types.rs | 1 + common/eth2/src/lighthouse_vc/types.rs | 1 + common/eth2/src/types.rs | 3 + .../types/src/bls_to_execution_change.rs | 1 + consensus/types/src/chain_spec.rs | 5 +- consensus/types/src/execution_block_hash.rs | 5 +- .../src/execution_layer_withdrawal_request.rs | 1 + consensus/types/src/execution_payload.rs | 3 + .../types/src/execution_payload_header.rs | 3 + .../types/src/proposer_preparation_data.rs | 1 + .../types/src/validator_registration_data.rs | 1 + consensus/types/src/withdrawal.rs | 1 + testing/ef_tests/src/cases/fork_choice.rs | 2 + testing/web3signer_tests/src/lib.rs | 1 - .../src/initialized_validators.rs | 8 +- 20 files changed, 144 insertions(+), 92 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a36b8736ffc..82b59facc4f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -298,7 +298,7 @@ checksum = "d83524c1f6162fcb5b0decf775498a125066c86dda6066ed609531b0e912f85a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -567,7 +567,7 @@ checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", "synstructure", ] @@ -579,7 +579,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -637,7 +637,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -707,7 +707,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -727,7 +727,7 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", "hyper 1.4.1", "hyper-util", @@ -760,7 +760,7 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", "mime", "pin-project-lite", @@ -841,7 +841,7 @@ dependencies = [ "eth2", "eth2_network_config", "ethereum_hashing", - "ethereum_serde_utils", + "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "ethereum_ssz_derive", "execution_layer", @@ -970,7 +970,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -1066,7 +1066,7 @@ dependencies = [ "arbitrary", "blst", "ethereum_hashing", - "ethereum_serde_utils", + "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "hex", "rand", @@ -1165,9 +1165,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" dependencies = [ "serde", ] @@ -1246,13 +1246,12 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.0" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" +checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052" dependencies = [ "jobserver", "libc", - "once_cell", ] [[package]] @@ -1402,7 +1401,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -1774,7 +1773,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -1822,7 +1821,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -1844,7 +1843,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -2009,7 +2008,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -2022,7 +2021,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -2049,7 +2048,7 @@ dependencies = [ "dsl_auto_type", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -2069,7 +2068,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" dependencies = [ - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -2182,7 +2181,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -2196,7 +2195,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -2376,7 +2375,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -2508,7 +2507,7 @@ dependencies = [ "account_utils", "bytes", "eth2_keystore", - "ethereum_serde_utils", + "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "ethereum_ssz_derive", "futures", @@ -2737,6 +2736,18 @@ dependencies = [ "sha2 0.10.8", ] +[[package]] +name = "ethereum_serde_utils" +version = "0.5.2" +source = "git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy#d62af01f0c240706bec464113094137e0e12e294" +dependencies = [ + "alloy-primitives 0.7.7", + "hex", + "serde", + "serde_derive", + "serde_json", +] + [[package]] name = "ethereum_serde_utils" version = "0.5.2" @@ -2968,7 +2979,7 @@ dependencies = [ "environment", "eth2", "eth2_network_config", - "ethereum_serde_utils", + "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "ethers-core", "fork_choice", @@ -3286,7 +3297,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -3444,7 +3455,7 @@ checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -3812,9 +3823,9 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http 1.1.0", @@ -3829,7 +3840,7 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "pin-project-lite", ] @@ -3845,7 +3856,7 @@ dependencies = [ "environment", "eth1", "eth2", - "ethereum_serde_utils", + "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "execution_layer", "futures", @@ -3953,7 +3964,7 @@ dependencies = [ "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "httparse", "httpdate", "itoa", @@ -3998,7 +4009,7 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "hyper 1.4.1", "pin-project-lite", "tokio", @@ -4419,7 +4430,7 @@ dependencies = [ "c-kzg", "derivative", "ethereum_hashing", - "ethereum_serde_utils", + "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "ethereum_ssz_derive", "hex", @@ -4863,7 +4874,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -4885,9 +4896,9 @@ dependencies = [ [[package]] name = "libp2p-tls" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "251b17aebdd29df7e8f80e4d94b782fae42e934c49086e1a81ba23b60a8314f2" +checksum = "72b7b831e55ce2aa6c354e6861a85fdd4dd0a2b97d5e276fabac0e4810a71776" dependencies = [ "futures", "futures-rustls", @@ -5346,18 +5357,18 @@ dependencies = [ [[package]] name = "metastruct" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccfbb8826226b09b05bb62a0937cf6abb16f1f7d4b746eb95a83db14aec60f06" +checksum = "f00a5ba4a0f3453c31c397b214e1675d95b697c33763aa58add57ea833424384" dependencies = [ "metastruct_macro", ] [[package]] name = "metastruct_macro" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37cb4045d5677b7da537f8cb5d0730d5b6414e3cc81c61e4b50e1f0cbdc73909" +checksum = "7c3a991d4536c933306e52f0e8ab303757185ec13a09d1f3e1cbde5a0d8410bf" dependencies = [ "darling 0.13.4", "itertools 0.10.5", @@ -5374,7 +5385,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd01039851e82f8799046eabbb354056283fb265c8ec0996af940f4e85a380ff" dependencies = [ "serde", - "toml 0.8.14", + "toml 0.8.15", ] [[package]] @@ -5905,7 +5916,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -6078,7 +6089,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.2", + "redox_syscall 0.5.3", "smallvec", "windows-targets 0.52.6", ] @@ -6211,7 +6222,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -6490,9 +6501,9 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ca959da22a332509f2a73ae9e5f23f9dcfc31fd3a54d71f159495bd5909baa" +checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" dependencies = [ "dtoa", "itoa", @@ -6508,7 +6519,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -6833,9 +6844,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ "bitflags 2.6.0", ] @@ -7430,9 +7441,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags 2.6.0", "core-foundation", @@ -7443,9 +7454,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -7519,7 +7530,7 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -7551,7 +7562,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -7822,7 +7833,7 @@ name = "slashing_protection" version = "0.1.0" dependencies = [ "arbitrary", - "ethereum_serde_utils", + "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", "filesystem", "lazy_static", "r2d2", @@ -8038,7 +8049,7 @@ source = "git+https://github.com/eserilev/ssz_types?branch=alloy-tweaks#2adab87c dependencies = [ "arbitrary", "derivative", - "ethereum_serde_utils", + "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "itertools 0.10.5", "serde", @@ -8212,9 +8223,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.70" +version = "2.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" +checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" dependencies = [ "proc-macro2", "quote", @@ -8241,7 +8252,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -8407,22 +8418,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -8541,9 +8552,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" dependencies = [ "backtrace", "bytes", @@ -8575,7 +8586,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -8673,14 +8684,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.14" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" +checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.15", + "toml_edit 0.22.16", ] [[package]] @@ -8716,9 +8727,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.15" +version = "0.22.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1" +checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" dependencies = [ "indexmap 2.2.6", "serde", @@ -8787,7 +8798,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -8925,7 +8936,7 @@ dependencies = [ "eth2_interop_keypairs", "ethereum-types 0.14.1", "ethereum_hashing", - "ethereum_serde_utils", + "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "ethereum_ssz_derive", "hex", @@ -9145,7 +9156,7 @@ dependencies = [ "environment", "eth2", "eth2_keystore", - "ethereum_serde_utils", + "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", "fdlimit", "filesystem", "futures", @@ -9215,7 +9226,7 @@ dependencies = [ "eth2", "eth2_network_config", "eth2_wallet", - "ethereum_serde_utils", + "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", "hex", "regex", "serde", @@ -9367,7 +9378,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", "wasm-bindgen-shared", ] @@ -9401,7 +9412,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -9999,7 +10010,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] @@ -10019,7 +10030,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.71", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 23d751ba25e..f9ad99c7a26 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -117,7 +117,7 @@ discv5 = { version = "0.4.1", features = ["libp2p"] } env_logger = "0.9" error-chain = "0.12" ethereum_hashing = "0.6.0" -ethereum_serde_utils = { git = "https://github.com/sigp/ethereum_serde_utils", branch = "alloy"} +ethereum_serde_utils = { git = "https://github.com/eserilev/ethereum_serde_utils", branch = "alloy"} ethereum_ssz = { git = "https://github.com/sigp/ethereum_ssz", branch = "alloy" } ethereum_ssz_derive = { git = "https://github.com/sigp/ethereum_ssz", branch = "alloy" } ethers-core = "1" diff --git a/beacon_node/execution_layer/src/engine_api.rs b/beacon_node/execution_layer/src/engine_api.rs index 6a56a5d076f..06192d5e273 100644 --- a/beacon_node/execution_layer/src/engine_api.rs +++ b/beacon_node/execution_layer/src/engine_api.rs @@ -149,9 +149,11 @@ pub enum BlockByNumberQuery<'a> { #[serde(rename_all = "camelCase")] pub struct ExecutionBlock { #[serde(rename = "hash")] + pub block_hash: ExecutionBlockHash, #[serde(rename = "number", with = "serde_utils::u64_hex_be")] pub block_number: u64, + pub parent_hash: ExecutionBlockHash, pub total_difficulty: Uint256, #[serde(with = "serde_utils::u64_hex_be")] @@ -171,8 +173,10 @@ pub struct ExecutionBlock { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(bound = "E: EthSpec", rename_all = "camelCase", untagged)] pub struct ExecutionBlockWithTransactions { + pub parent_hash: ExecutionBlockHash, #[serde(alias = "miner")] + #[serde(with = "serde_utils::address_hex")] pub fee_recipient: Address, pub state_root: Hash256, pub receipts_root: Hash256, @@ -192,6 +196,7 @@ pub struct ExecutionBlockWithTransactions { pub extra_data: VariableList, pub base_fee_per_gas: Uint256, #[serde(rename = "hash")] + pub block_hash: ExecutionBlockHash, pub transactions: Vec, #[superstruct(only(Capella, Deneb, Electra))] diff --git a/beacon_node/execution_layer/src/engine_api/json_structures.rs b/beacon_node/execution_layer/src/engine_api/json_structures.rs index fbffc47e29e..9c9b9c0f622 100644 --- a/beacon_node/execution_layer/src/engine_api/json_structures.rs +++ b/beacon_node/execution_layer/src/engine_api/json_structures.rs @@ -74,7 +74,9 @@ pub struct JsonPayloadIdResponse { #[derive(Debug, PartialEq, Serialize, Deserialize)] #[serde(bound = "E: EthSpec", rename_all = "camelCase", untagged)] pub struct JsonExecutionPayload { + pub parent_hash: ExecutionBlockHash, + #[serde(with = "serde_utils::address_hex")] pub fee_recipient: Address, pub state_root: Hash256, pub receipts_root: Hash256, @@ -93,6 +95,7 @@ pub struct JsonExecutionPayload { pub extra_data: VariableList, #[serde(with = "serde_utils::u256_hex_be")] pub base_fee_per_gas: Uint256, + pub block_hash: ExecutionBlockHash, #[serde(with = "ssz_types::serde_utils::list_of_hex_var_list")] pub transactions: Transactions, @@ -437,6 +440,7 @@ pub struct JsonWithdrawal { pub index: u64, #[serde(with = "serde_utils::u64_hex_be")] pub validator_index: u64, + #[serde(with = "serde_utils::address_hex")] pub address: Address, #[serde(with = "serde_utils::u64_hex_be")] pub amount: u64, @@ -479,6 +483,7 @@ pub struct JsonPayloadAttributes { #[serde(with = "serde_utils::u64_hex_be")] pub timestamp: u64, pub prev_randao: Hash256, + #[serde(with = "serde_utils::address_hex")] pub suggested_fee_recipient: Address, #[superstruct(only(V2, V3))] pub withdrawals: Vec, @@ -567,8 +572,11 @@ impl From> for BlobsBundle { #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct JsonForkchoiceStateV1 { + pub head_block_hash: ExecutionBlockHash, + pub safe_block_hash: ExecutionBlockHash, + pub finalized_block_hash: ExecutionBlockHash, } @@ -767,6 +775,7 @@ impl From> for ExecutionPayloadBodyV1< pub struct TransitionConfigurationV1 { #[serde(with = "serde_utils::u256_hex_be")] pub terminal_total_difficulty: Uint256, + pub terminal_block_hash: ExecutionBlockHash, #[serde(with = "serde_utils::u64_hex_be")] pub terminal_block_number: u64, diff --git a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs index 8ff48cf22a0..98eb1d78f4a 100644 --- a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs +++ b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs @@ -107,7 +107,9 @@ impl Block { #[serde(rename_all = "camelCase")] pub struct PoWBlock { pub block_number: u64, + pub block_hash: ExecutionBlockHash, + pub parent_hash: ExecutionBlockHash, pub total_difficulty: Uint256, pub timestamp: u64, diff --git a/common/eth2/src/lighthouse_vc/std_types.rs b/common/eth2/src/lighthouse_vc/std_types.rs index ab90d336fa4..ee05c298399 100644 --- a/common/eth2/src/lighthouse_vc/std_types.rs +++ b/common/eth2/src/lighthouse_vc/std_types.rs @@ -8,6 +8,7 @@ pub use slashing_protection::interchange::Interchange; #[derive(Debug, Deserialize, Serialize, PartialEq)] pub struct GetFeeRecipientResponse { pub pubkey: PublicKeyBytes, + #[serde(with = "serde_utils::address_hex")] pub ethaddress: Address, } diff --git a/common/eth2/src/lighthouse_vc/types.rs b/common/eth2/src/lighthouse_vc/types.rs index d903d7b73d7..1921549bcb5 100644 --- a/common/eth2/src/lighthouse_vc/types.rs +++ b/common/eth2/src/lighthouse_vc/types.rs @@ -163,6 +163,7 @@ pub struct Web3SignerValidatorRequest { #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] pub struct UpdateFeeRecipientRequest { + #[serde(with = "serde_utils::address_hex")] pub ethaddress: Address, } diff --git a/common/eth2/src/types.rs b/common/eth2/src/types.rs index 518fd5450a7..b473c7e4c69 100644 --- a/common/eth2/src/types.rs +++ b/common/eth2/src/types.rs @@ -563,6 +563,7 @@ pub struct BlockHeaderData { pub struct DepositContractData { #[serde(with = "serde_utils::quoted_u64")] pub chain_id: u64, + #[serde(with = "serde_utils::address_hex")] pub address: Address, } @@ -1017,6 +1018,7 @@ pub struct SsePayloadAttributes { #[superstruct(getter(copy))] pub prev_randao: Hash256, #[superstruct(getter(copy))] + #[serde(with = "serde_utils::address_hex")] pub suggested_fee_recipient: Address, #[superstruct(only(V2, V3))] pub withdrawals: Vec, @@ -1032,6 +1034,7 @@ pub struct SseExtendedPayloadAttributesGeneric { pub parent_block_root: Hash256, #[serde(with = "serde_utils::quoted_u64")] pub parent_block_number: u64, + pub parent_block_hash: ExecutionBlockHash, pub payload_attributes: T, } diff --git a/consensus/types/src/bls_to_execution_change.rs b/consensus/types/src/bls_to_execution_change.rs index e6426e125ff..07d71b360f9 100644 --- a/consensus/types/src/bls_to_execution_change.rs +++ b/consensus/types/src/bls_to_execution_change.rs @@ -23,6 +23,7 @@ pub struct BlsToExecutionChange { #[serde(with = "serde_utils::quoted_u64")] pub validator_index: u64, pub from_bls_pubkey: PublicKeyBytes, + #[serde(with = "serde_utils::address_hex")] pub to_execution_address: Address, } diff --git a/consensus/types/src/chain_spec.rs b/consensus/types/src/chain_spec.rs index 644b3a00c11..eeddaadd3be 100644 --- a/consensus/types/src/chain_spec.rs +++ b/consensus/types/src/chain_spec.rs @@ -1168,6 +1168,7 @@ pub struct Config { #[serde(with = "serde_utils::quoted_u256")] pub terminal_total_difficulty: Uint256, #[serde(default = "default_terminal_block_hash")] + pub terminal_block_hash: ExecutionBlockHash, #[serde(default = "default_terminal_block_hash_activation_epoch")] pub terminal_block_hash_activation_epoch: Epoch, @@ -1257,6 +1258,7 @@ pub struct Config { deposit_chain_id: u64, #[serde(with = "serde_utils::quoted_u64")] deposit_network_id: u64, + #[serde(with = "serde_utils::address_hex")] deposit_contract_address: Address, #[serde(default = "default_gossip_max_size")] @@ -1967,7 +1969,6 @@ mod yaml_tests { assert_eq!(new_spec, ChainSpec::minimal()); } - // TODO(alloy) fix test #[test] fn test_defaults() { // Spec yaml string. Fields that serialize/deserialize with a default value are commented out. @@ -2001,7 +2002,7 @@ mod yaml_tests { PROPOSER_SCORE_BOOST: 40 DEPOSIT_CHAIN_ID: 1 DEPOSIT_NETWORK_ID: 1 - DEPOSIT_CONTRACT_ADDRESS: 00000000219ab540356cBB839Cbe05303d7705Fa + DEPOSIT_CONTRACT_ADDRESS: 0x00000000219ab540356cBB839Cbe05303d7705Fa "#; let chain_spec: Config = serde_yaml::from_str(spec).unwrap(); diff --git a/consensus/types/src/execution_block_hash.rs b/consensus/types/src/execution_block_hash.rs index b03c184ad63..89309274d8b 100644 --- a/consensus/types/src/execution_block_hash.rs +++ b/consensus/types/src/execution_block_hash.rs @@ -21,7 +21,10 @@ use std::fmt; )] #[derivative(Debug = "transparent")] #[serde(transparent)] -pub struct ExecutionBlockHash(pub Hash256); +pub struct ExecutionBlockHash( + #[serde(with = "serde_utils::b256_hex")] + pub Hash256 +); impl ExecutionBlockHash { pub fn zero() -> Self { diff --git a/consensus/types/src/execution_layer_withdrawal_request.rs b/consensus/types/src/execution_layer_withdrawal_request.rs index b1d814c2834..f289737b559 100644 --- a/consensus/types/src/execution_layer_withdrawal_request.rs +++ b/consensus/types/src/execution_layer_withdrawal_request.rs @@ -20,6 +20,7 @@ use tree_hash_derive::TreeHash; TestRandom, )] pub struct ExecutionLayerWithdrawalRequest { + #[serde(with = "serde_utils::address_hex")] pub source_address: Address, pub validator_pubkey: PublicKeyBytes, #[serde(with = "serde_utils::quoted_u64")] diff --git a/consensus/types/src/execution_payload.rs b/consensus/types/src/execution_payload.rs index 02300cc1927..044cf437a4e 100644 --- a/consensus/types/src/execution_payload.rs +++ b/consensus/types/src/execution_payload.rs @@ -53,8 +53,10 @@ pub type WithdrawalRequests = #[tree_hash(enum_behaviour = "transparent")] pub struct ExecutionPayload { #[superstruct(getter(copy))] + pub parent_hash: ExecutionBlockHash, #[superstruct(getter(copy))] + #[serde(with = "serde_utils::address_hex")] pub fee_recipient: Address, #[superstruct(getter(copy))] pub state_root: Hash256, @@ -82,6 +84,7 @@ pub struct ExecutionPayload { #[superstruct(getter(copy))] pub base_fee_per_gas: Uint256, #[superstruct(getter(copy))] + pub block_hash: ExecutionBlockHash, #[serde(with = "ssz_types::serde_utils::list_of_hex_var_list")] pub transactions: Transactions, diff --git a/consensus/types/src/execution_payload_header.rs b/consensus/types/src/execution_payload_header.rs index 149cc286ae9..42e17837c68 100644 --- a/consensus/types/src/execution_payload_header.rs +++ b/consensus/types/src/execution_payload_header.rs @@ -45,8 +45,10 @@ use tree_hash_derive::TreeHash; #[ssz(enum_behaviour = "transparent")] pub struct ExecutionPayloadHeader { #[superstruct(getter(copy))] + pub parent_hash: ExecutionBlockHash, #[superstruct(getter(copy))] + #[serde(with = "serde_utils::address_hex")] pub fee_recipient: Address, #[superstruct(getter(copy))] pub state_root: Hash256, @@ -74,6 +76,7 @@ pub struct ExecutionPayloadHeader { #[superstruct(getter(copy))] pub base_fee_per_gas: Uint256, #[superstruct(getter(copy))] + pub block_hash: ExecutionBlockHash, #[superstruct(getter(copy))] pub transactions_root: Hash256, diff --git a/consensus/types/src/proposer_preparation_data.rs b/consensus/types/src/proposer_preparation_data.rs index 2828b0d4d55..477fb3b9d15 100644 --- a/consensus/types/src/proposer_preparation_data.rs +++ b/consensus/types/src/proposer_preparation_data.rs @@ -9,5 +9,6 @@ pub struct ProposerPreparationData { #[serde(with = "serde_utils::quoted_u64")] pub validator_index: u64, /// The fee-recipient address. + #[serde(with = "serde_utils::address_hex")] pub fee_recipient: Address, } diff --git a/consensus/types/src/validator_registration_data.rs b/consensus/types/src/validator_registration_data.rs index 174014df8ec..cdafd355e7c 100644 --- a/consensus/types/src/validator_registration_data.rs +++ b/consensus/types/src/validator_registration_data.rs @@ -12,6 +12,7 @@ pub struct SignedValidatorRegistrationData { #[derive(PartialEq, Debug, Serialize, Deserialize, Clone, Encode, Decode, TreeHash)] pub struct ValidatorRegistrationData { + #[serde(with = "serde_utils::address_hex")] pub fee_recipient: Address, #[serde(with = "serde_utils::quoted_u64")] pub gas_limit: u64, diff --git a/consensus/types/src/withdrawal.rs b/consensus/types/src/withdrawal.rs index 3e611565541..7f98ff1e60a 100644 --- a/consensus/types/src/withdrawal.rs +++ b/consensus/types/src/withdrawal.rs @@ -24,6 +24,7 @@ pub struct Withdrawal { pub index: u64, #[serde(with = "serde_utils::quoted_u64")] pub validator_index: u64, + #[serde(with = "serde_utils::address_hex")] pub address: Address, #[serde(with = "serde_utils::quoted_u64")] pub amount: u64, diff --git a/testing/ef_tests/src/cases/fork_choice.rs b/testing/ef_tests/src/cases/fork_choice.rs index 2a2cc067e58..c7917c07db1 100644 --- a/testing/ef_tests/src/cases/fork_choice.rs +++ b/testing/ef_tests/src/cases/fork_choice.rs @@ -32,7 +32,9 @@ use types::{ #[derive(Default, Debug, PartialEq, Clone, Deserialize, Decode)] #[serde(deny_unknown_fields)] pub struct PowBlock { + pub block_hash: ExecutionBlockHash, + pub parent_hash: ExecutionBlockHash, pub total_difficulty: Uint256, } diff --git a/testing/web3signer_tests/src/lib.rs b/testing/web3signer_tests/src/lib.rs index 54953238b7f..4187844cecc 100644 --- a/testing/web3signer_tests/src/lib.rs +++ b/testing/web3signer_tests/src/lib.rs @@ -726,7 +726,6 @@ mod tests { /// Test all the Bellatrix types. async fn test_bellatrix_types(network: &str, listen_port: u16) { - println!("{}", network); let network_config = Eth2NetworkConfig::constant(network).unwrap().unwrap(); let spec = &network_config.chain_spec::().unwrap(); let bellatrix_fork_slot = spec diff --git a/validator_client/src/initialized_validators.rs b/validator_client/src/initialized_validators.rs index c94115e5ec5..b553363f931 100644 --- a/validator_client/src/initialized_validators.rs +++ b/validator_client/src/initialized_validators.rs @@ -382,12 +382,16 @@ pub fn load_pkcs12_identity>( password: &str, ) -> Result { let mut buf = Vec::new(); + println!("password {}", password); File::open(&pkcs12_path) .map_err(Error::InvalidWeb3SignerClientIdentityCertificateFile)? .read_to_end(&mut buf) .map_err(Error::InvalidWeb3SignerClientIdentityCertificateFile)?; - Identity::from_pkcs12_der(&buf, password) - .map_err(Error::InvalidWeb3SignerClientIdentityCertificate) + println!("1"); + let x = Identity::from_pkcs12_der(&buf, password) + .map_err(Error::InvalidWeb3SignerClientIdentityCertificate); + println!("2"); + x } fn build_web3_signer_url(base_url: &str, voting_public_key: &PublicKey) -> Result { From 94f64c0d05476ee6c42f5455c7f070dacf0f5d8c Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 22 Jul 2024 10:00:00 -0700 Subject: [PATCH 24/62] introduce a shim to convert between the two u256 types --- Cargo.lock | 41 +++++++++++++++---- consensus/types/Cargo.toml | 1 + consensus/types/src/execution_block_header.rs | 33 ++++++++++----- 3 files changed, 56 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b2d94a6dca..896ab614195 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -183,7 +183,7 @@ source = "git+https://github.com/alloy-rs/alloy.git?rev=974d488bab5e21e9f17452a3 dependencies = [ "alloy-eips", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.6.4", "alloy-rlp", ] @@ -192,7 +192,7 @@ name = "alloy-eips" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy.git?rev=974d488bab5e21e9f17452a39a4bfa56677367b2#974d488bab5e21e9f17452a39a4bfa56677367b2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.6.4", "alloy-rlp", "serde", "thiserror", @@ -203,7 +203,7 @@ name = "alloy-json-rpc" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy.git?rev=974d488bab5e21e9f17452a39a4bfa56677367b2#974d488bab5e21e9f17452a39a4bfa56677367b2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.6.4", "serde", "serde_json", "thiserror", @@ -216,7 +216,7 @@ source = "git+https://github.com/alloy-rs/alloy.git?rev=974d488bab5e21e9f17452a3 dependencies = [ "alloy-eips", "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.6.4", "alloy-rlp", "serde", ] @@ -243,6 +243,28 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "alloy-primitives" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "hex-literal", + "itoa", + "k256 0.13.3", + "keccak-asm", + "proptest", + "rand", + "ruint", + "serde", + "tiny-keccak", +] + [[package]] name = "alloy-rlp" version = "0.3.5" @@ -2864,7 +2886,7 @@ name = "execution_layer" version = "0.1.0" dependencies = [ "alloy-consensus", - "alloy-primitives", + "alloy-primitives 0.6.4", "alloy-rlp", "arc-swap", "builder_client", @@ -6944,9 +6966,9 @@ dependencies = [ [[package]] name = "ruint" -version = "1.12.1" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f308135fef9fc398342da5472ce7c484529df23743fb7c734e0f3d472971e62" +checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", @@ -6968,9 +6990,9 @@ dependencies = [ [[package]] name = "ruint-macro" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "rusqlite" @@ -8783,6 +8805,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" name = "types" version = "0.2.1" dependencies = [ + "alloy-primitives 0.7.7", "alloy-rlp", "arbitrary", "beacon_chain", diff --git a/consensus/types/Cargo.toml b/consensus/types/Cargo.toml index 6dc4f147088..404b2580380 100644 --- a/consensus/types/Cargo.toml +++ b/consensus/types/Cargo.toml @@ -9,6 +9,7 @@ name = "benches" harness = false [dependencies] +alloy-primitives = "0.7.7" merkle_proof = { workspace = true } bls = { workspace = true, features = ["arbitrary"] } kzg = { workspace = true } diff --git a/consensus/types/src/execution_block_header.rs b/consensus/types/src/execution_block_header.rs index 64f11dcfead..53b70ca6d1e 100644 --- a/consensus/types/src/execution_block_header.rs +++ b/consensus/types/src/execution_block_header.rs @@ -101,15 +101,15 @@ pub struct EncodableExecutionBlockHeader<'a> { pub transactions_root: &'a [u8], pub receipts_root: &'a [u8], pub logs_bloom: &'a [u8], - pub difficulty: u64, - pub number: u64, - pub gas_limit: u64, - pub gas_used: u64, + pub difficulty: alloy_primitives::U256, + pub number: alloy_primitives::U256, + pub gas_limit: alloy_primitives::U256, + pub gas_used: alloy_primitives::U256, pub timestamp: u64, pub extra_data: &'a [u8], pub mix_hash: &'a [u8], pub nonce: &'a [u8], - pub base_fee_per_gas: u64, + pub base_fee_per_gas: alloy_primitives::U256, pub withdrawals_root: Option<&'a [u8]>, pub blob_gas_used: Option, pub excess_blob_gas: Option, @@ -126,15 +126,15 @@ impl<'a> From<&'a ExecutionBlockHeader> for EncodableExecutionBlockHeader<'a> { transactions_root: header.transactions_root.as_bytes(), receipts_root: header.receipts_root.as_bytes(), logs_bloom: header.logs_bloom.as_slice(), - difficulty: header.difficulty.as_u64(), // TODO this might panic - number: header.number.as_u64(), // TODO this might panic - gas_limit: header.gas_limit.as_u64(), // TODO this might panic - gas_used: header.gas_used.as_u64(), // TODO this might panic + difficulty: U256Shim(header.difficulty).into(), + number: U256Shim(header.number).into(), + gas_limit: U256Shim(header.gas_limit).into(), + gas_used: U256Shim(header.gas_used).into(), timestamp: header.timestamp, extra_data: header.extra_data.as_slice(), mix_hash: header.mix_hash.as_bytes(), nonce: header.nonce.as_bytes(), - base_fee_per_gas: header.base_fee_per_gas.as_u64(), // TODO this might panic + base_fee_per_gas: U256Shim(header.base_fee_per_gas).into(), withdrawals_root: None, blob_gas_used: header.blob_gas_used, excess_blob_gas: header.excess_blob_gas, @@ -149,3 +149,16 @@ impl<'a> From<&'a ExecutionBlockHeader> for EncodableExecutionBlockHeader<'a> { encodable } } + + +// TODO(alloy) this shim can be removed once we fully migrate +// from ethereum types to alloy primitives +struct U256Shim(Uint256); + +impl From for alloy_primitives::U256 { + fn from(value: U256Shim) -> Self { + let mut buffer: [u8; 32] = [0; 32]; + value.0.to_little_endian(&mut buffer); + Self::from_le_slice(&buffer) + } +} \ No newline at end of file From 5cdb9606853ecab3a68dd52f83caa52045550257 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 22 Jul 2024 12:17:50 -0700 Subject: [PATCH 25/62] move alloy to wrokspace --- Cargo.toml | 1 + consensus/types/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d13f4f7a760..34f33b3936e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,6 +94,7 @@ resolver = "2" edition = "2021" [workspace.dependencies] +alloy-primitives = { version = "0.7.7" } anyhow = "1" arbitrary = { version = "1", features = ["derive"] } async-channel = "1.9.0" diff --git a/consensus/types/Cargo.toml b/consensus/types/Cargo.toml index 404b2580380..f623f3d101f 100644 --- a/consensus/types/Cargo.toml +++ b/consensus/types/Cargo.toml @@ -9,7 +9,7 @@ name = "benches" harness = false [dependencies] -alloy-primitives = "0.7.7" +alloy-primitives = { workspace = true, features = ["rlp"] } merkle_proof = { workspace = true } bls = { workspace = true, features = ["arbitrary"] } kzg = { workspace = true } From fd7c0bf48e9bccc0fae2e8a3aa9a8cb23866b3bd Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 22 Jul 2024 12:32:43 -0700 Subject: [PATCH 26/62] align alloy versions --- Cargo.lock | 2 +- beacon_node/execution_layer/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 896ab614195..e25ca5098d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2886,7 +2886,7 @@ name = "execution_layer" version = "0.1.0" dependencies = [ "alloy-consensus", - "alloy-primitives 0.6.4", + "alloy-primitives 0.7.7", "alloy-rlp", "arc-swap", "builder_client", diff --git a/beacon_node/execution_layer/Cargo.toml b/beacon_node/execution_layer/Cargo.toml index 06f0d3ab9e8..282e8e0591b 100644 --- a/beacon_node/execution_layer/Cargo.toml +++ b/beacon_node/execution_layer/Cargo.toml @@ -6,6 +6,7 @@ edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +alloy-primitives = { workspace = true } types = { workspace = true } tokio = { workspace = true } slog = { workspace = true } @@ -50,5 +51,4 @@ arc-swap = "1.6.0" eth2_network_config = { workspace = true } alloy-rlp = "0.3.4" alloy-consensus = { git = "https://github.com/alloy-rs/alloy.git", rev = "974d488bab5e21e9f17452a39a4bfa56677367b2" } -alloy-primitives = "0.6.2" lighthouse_version = { workspace = true } From 0e66c5075b74777edb0e1c514e5572d639865755 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 22 Jul 2024 14:00:54 -0700 Subject: [PATCH 27/62] update --- consensus/types/src/execution_block_header.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/consensus/types/src/execution_block_header.rs b/consensus/types/src/execution_block_header.rs index 53b70ca6d1e..2e5a498214c 100644 --- a/consensus/types/src/execution_block_header.rs +++ b/consensus/types/src/execution_block_header.rs @@ -150,15 +150,14 @@ impl<'a> From<&'a ExecutionBlockHeader> for EncodableExecutionBlockHeader<'a> { } } - // TODO(alloy) this shim can be removed once we fully migrate // from ethereum types to alloy primitives struct U256Shim(Uint256); -impl From for alloy_primitives::U256 { +impl From for alloy_primitives::U256 { fn from(value: U256Shim) -> Self { let mut buffer: [u8; 32] = [0; 32]; value.0.to_little_endian(&mut buffer); Self::from_le_slice(&buffer) } -} \ No newline at end of file +} From effd5910adf819d9a148e90b3b737523e1a0e121 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 22 Jul 2024 14:34:53 -0700 Subject: [PATCH 28/62] update web3signer test certs --- .../web3signer_tests/tls/lighthouse/cert.pem | 52 ++++----- .../web3signer_tests/tls/lighthouse/key.key | 100 +++++++++--------- .../web3signer_tests/tls/lighthouse/key.p12 | Bin 4371 -> 4387 bytes .../tls/lighthouse/web3signer.pem | 52 ++++----- .../web3signer_tests/tls/web3signer/cert.pem | 52 ++++----- .../web3signer_tests/tls/web3signer/key.key | 100 +++++++++--------- .../web3signer_tests/tls/web3signer/key.p12 | Bin 4371 -> 4387 bytes .../tls/web3signer/known_clients.txt | 2 +- 8 files changed, 179 insertions(+), 179 deletions(-) diff --git a/testing/web3signer_tests/tls/lighthouse/cert.pem b/testing/web3signer_tests/tls/lighthouse/cert.pem index 24b0a2e5c0e..c7e11c899d1 100644 --- a/testing/web3signer_tests/tls/lighthouse/cert.pem +++ b/testing/web3signer_tests/tls/lighthouse/cert.pem @@ -1,33 +1,33 @@ -----BEGIN CERTIFICATE----- -MIIFujCCA6KgAwIBAgIUXZijYo8W4/9dAq58ocFEbZDxohwwDQYJKoZIhvcNAQEL +MIIFujCCA6KgAwIBAgIUHh3hZe+HCC+SUxSoJHGJfEAlyugwDQYJKoZIhvcNAQEL BQAwazELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAlZBMREwDwYDVQQHDAhTb21lQ2l0 eTESMBAGA1UECgwJTXlDb21wYW55MRMwEQYDVQQLDApNeURpdmlzaW9uMRMwEQYD -VQQDDApsaWdodGhvdXNlMCAXDTIzMDkyMDAyNTYzNloYDzIxMjMwODI3MDI1NjM2 +VQQDDApsaWdodGhvdXNlMCAXDTI0MDcyMjIxMzQyN1oYDzIxMjQwNjI4MjEzNDI3 WjBrMQswCQYDVQQGEwJVUzELMAkGA1UECAwCVkExETAPBgNVBAcMCFNvbWVDaXR5 MRIwEAYDVQQKDAlNeUNvbXBhbnkxEzARBgNVBAsMCk15RGl2aXNpb24xEzARBgNV -BAMMCmxpZ2h0aG91c2UwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC1 -R1M9NnRwUsqFvJzNWPKuY1PW7llwRRWCixiWNvcxukGTa6AMLZDrYO1Y7qlw5m52 -aHSA2fs2KyeA61yajG/BsLn1vmTtJMZXgLsG0MIqvhgOoh+ZZbl8biO0gQJSRSDE -jf0ogUVM9TCEt6ydbGnzgs8EESqvyXcreaXfmLI7jiX/BkwCdf+Ru+H3MF96QgAw -Oz1d8/fxYJvIpT/DOx4NuMZouSAcUVXgwcVb6JXeTg0xVcL33lluquhYDR0gD5Fe -V0fPth+e9XMAH7udim8E5wn2Ep8CAVoeVq6K9mBM3NqP7+2YmU//jLbkd6UvKPaI -0vps1zF9Bo8QewiRbM0IRse99ikCVZcjOcZSitw3kwTg59NjZ0Vk9R/2YQt/gGWM -VcR//EtbOZGqzGrLPFKOcWO85Ggz746Saj15N+bqT20hXHyiwYL8DLgJkMR2W9Nr -67Vyi9SWSM6rdRQlezlHq/yNEh+JuY7eoC3VeVw9K1ZXP+OKAwbpcnvd3uLwV91f -kpT6kjc6d2h4bK8fhvF16Em42JypQCl0xMhgg/8MFO+6ZLy5otWAdsSYyO5k9CAa -3zLeqd89dS7HNLdLZ0Y5SFWm6y5Kqu89ErIENafX5DxupHWsruiBV7zhDHNPaGcf -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 -----END CERTIFICATE----- diff --git a/testing/web3signer_tests/tls/lighthouse/key.key b/testing/web3signer_tests/tls/lighthouse/key.key index d00b6c21229..45aef3bff7e 100644 --- a/testing/web3signer_tests/tls/lighthouse/key.key +++ b/testing/web3signer_tests/tls/lighthouse/key.key @@ -1,52 +1,52 @@ -----BEGIN PRIVATE KEY----- -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 -vc3Za4ClKSLmb3ZA9giTswYMev+3BQ== +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 +JW0s6PSlQuHlL3+1tQJ5fvM8kxP7gA== -----END PRIVATE KEY----- diff --git a/testing/web3signer_tests/tls/lighthouse/key.p12 b/testing/web3signer_tests/tls/lighthouse/key.p12 index 73468fa084b6f5f1b036afd643967e361d004fc4..56ace7eb08e1aad2d384de31fe067dd9fa541e63 100644 GIT binary patch literal 4387 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 O87(DS+1md-_5K6pekr^F literal 4371 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 diff --git a/testing/web3signer_tests/tls/lighthouse/web3signer.pem b/testing/web3signer_tests/tls/lighthouse/web3signer.pem index 6266cadf9bc..8120a09f261 100644 --- a/testing/web3signer_tests/tls/lighthouse/web3signer.pem +++ b/testing/web3signer_tests/tls/lighthouse/web3signer.pem @@ -1,33 +1,33 @@ -----BEGIN CERTIFICATE----- -MIIFujCCA6KgAwIBAgIUIP5CN0WpH5om1bGaFn17Xc5ITJIwDQYJKoZIhvcNAQEL +MIIFujCCA6KgAwIBAgIUbbE6BR8mhiO1HX6BUz0OYlUJbSswDQYJKoZIhvcNAQEL BQAwazELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAlZBMREwDwYDVQQHDAhTb21lQ2l0 eTESMBAGA1UECgwJTXlDb21wYW55MRMwEQYDVQQLDApNeURpdmlzaW9uMRMwEQYD -VQQDDAp3ZWIzc2lnbmVyMCAXDTIzMDkyMDAyNTYzNFoYDzIxMjMwODI3MDI1NjM0 +VQQDDAp3ZWIzc2lnbmVyMCAXDTI0MDcyMjIxMzQyN1oYDzIxMjQwNjI4MjEzNDI3 WjBrMQswCQYDVQQGEwJVUzELMAkGA1UECAwCVkExETAPBgNVBAcMCFNvbWVDaXR5 MRIwEAYDVQQKDAlNeUNvbXBhbnkxEzARBgNVBAsMCk15RGl2aXNpb24xEzARBgNV -BAMMCndlYjNzaWduZXIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDS -cvshqu3747j4KMaGyGW0CA2GAznogVyKqNt4lan/8mdYUI2PUeezaUOnmoyM9oWz -1FPflpj7pVWagWlSOgZ9vOElqQhe+la4ZEdGmOpe44c1rBoeHK314Gbmr2EuCxaa -J3smHx2+VOhaMWDeebRHQqy/s5tf3Um7G2iXU2iexriz42I8d6efWGmaL2sTLQ6H -9C0UBIzXP7PnGrMlef9eR+7pu/ai9MjD1M7CWpwvPhEjanA2InwKugiDXj+A5/6G -WLtJvk5ekfOVlRHPZQbKJc/SG9tbbH9dHLEezIbZ6a5Y0iTcIfoiBxUpX5KyK/pB -YKPThE5zW5KhIxXcpqFIMaTW/nK33BlOJ0fPNtX/SWLyoBsTtxCo1XFFUjHCkXK8 -4y5L4BXxxohG0DAuO4BtQHE5hgyswGQX2t4RjDvzvSm4tN02m9HUh7gu/d2FbgX8 -HtmSgkPEgfSVRxegmbA71qHqKS0/i5BbnQjLkeWiWKRWGJoHFfhGN1sY0jUGFvQr -rrIUQAuXDcQX11UzgwkX5/cowtlm8IB/RWggPfC4gfCL4QvNz4pMxuMUWjXUn0uS -8kbmmuhxshsnZUL+l+nnpRSobZqHRvvqiFKg8q9GsBUTGu0fFbjDeVQyYF2UOWeN -/IC4PpwtYUO3/gR0babEffgYOWwWbQQGSPcmG7Y4zwIDAQABo1QwUjALBgNVHQ8E +BAMMCndlYjNzaWduZXIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC0 +kdzQuqEngn6yL4+yTeUJdF3kZ0qm1iZxAYVJEzHJgePa1g+bjbyfJ62IkOY18jDD +2SWsRF210bb19tI53qV8+NAW9HduRwPmKEdsH8B5JlZch1bi1sop2UnAiqCPTvIh +VkmpHH2pstXmT1No7hgVGBamGMbTvy4Iv2cTYRQ+xAY/XL9qQeZ9Afr9REIvQ12f +X/fmemgRb4/OV8b1vTAeeNnxpoNteB/zP4Oe3kVTZjjADu+/uroSnVleCbZJJiIL +Ykhm4Hham0dyZZ24ypgehCxumobD998dNYaeq0yf8ew66M8BLf+tcNATMrnZCamw +51zWxtnc3vqFL6/Fa/o4L8PVenDkCRu1ADx9kCIDRdyUwXZVpPOP5YoDCvlpm1eI ++hHnp/AKtAoYDoPMLUaa6u3i24PM0EvI5c+7Kn++78SKGkut8ARFLiPrfMfiDvNT +jL9kyguEUGDTdeInZGLsydvHZvXRiE8BPwLM4rnuPk2ctgG33NulBO8jkkEmSfmf +9XTPqMbD2tfZVIljOM9ClvAYnWYcIQFNLX761Fidf7FBu1FZ5IG8+AzmCe23tvh5 +DgUpeZlIEnjRmxxzst3WR5y1KTdKsE04lh2sB9ErCnXHVvtcPUDgLQI9w/8VRh4s +ubt+xq2EHe8J4CyzLTzaS0ycwdhfIvqE+8y7GPO7IwIDAQABo1QwUjALBgNVHQ8E BAMCBDAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDwYDVR0RBAgwBocEfwAAATAdBgNV -HQ4EFgQURs+EV23UZh/nDfRX412nxbn4dc8wDQYJKoZIhvcNAQELBQADggIBAHbg -/YOp/MAf+inmH9Docup+Uj/WVJ32I1mMXlpoTKQ6YExR0DAtf1bmP65EGyvJkFTu -taGM4FNdsn4JCJxDfCY5X5M5YcPmjj6n58UcFr418DiZFCRT5MAdOxyYZVszFIc3 -RiYiOocbM30tGiqFm23NwWlAmaSjIeozERk2RgdRDnDG08xEbskn2yvsvvgnZJ8d -0wxyMPHvno664bCNOJfljXYclHBk2coOFDWJ5q8DFCBLXlt+Z95ceaNLA9bMXfhv -gVnKWn+1hcD33pMGyH7POXt+neZxIracTUJDIm39Vx0sQmHdeDxGSe7+qI2dYKbJ -v6srSWw4Y5TEPpkdXg2+R8zM2hO7kxDqjWDiCTjeMWMEdmUW/hYN6ndhfJ5ZLKut -OM/2jAf+ZijB1j7ORgP7haa//31YaPS4efnurDItI5dlQkLY2gKjLfdsEe1NsVR5 -mUjE8HZoVGRFfGca+39TjTTp+mVN0bQhoi+qu11QwB39hl/3I1jVjmUb71MAmva2 -4wh5RblJukbFVcs5Cco1+fpd7j9pSrWD/wsf+l7XM57Mvt9his8pk9yZolLgKT0Z -yio8eJVOfTr8JHmVpbvE3KQ8cLk0qwjs/iSzsSA0wau9RXNmJVVGHWqEjo+i7dzX -JzEM/ha455mjGbrAqJLFMC0yMMjQX4YIvGJENqRS +HQ4EFgQUtH/SlHNMvzhN5peK7TnQk6OAyrAwDQYJKoZIhvcNAQELBQADggIBAH0Q +KD+PHbsg4NcX6rrBQipXqitaFn3OowEcVxlrM1ihLZTpNu8YkhevwR1dy0hmB2xp +gJ2eTzUKv28aav6TBmllVkF2jpdiUv+xWNX4IVITTO4GytbWfqMdJlNDZhdlU8Jw +FiOb1hQ2EMU/JBd3/Zp68TTEWoD8uHUlzzMSTmUgomCrWlbbys+9zzSijNdvx+q1 +KexK2vsOL3/2m8JjUwwCQlv11CSRkDUDMim28HBf/20lxv19lbeEOhyFiszuyOL5 +OvLLCySebHCFLQhQx6ikjQO3Ja3Ajd78TWUL205ucDChSRIlMEEVOTFlBsb4hMXL +GjG+w16bFj0m3qwDuktYEi8ypse7JYFcYNZrrz8yz+qLVd9J+fUZlvMtpPrn0Jnj +Wa+dwt+7KakMyErEvCfzf8WRaiE/c3qNE8DBlRgy0asWJLWbXi5uIsC24Nw7i0AY +8Eu6IAgwj5mFfQ7A68ZimXBaZXwBmm3CbpeKtr60EH1q2mk9DtEAAxgcMHZx1Z/N +7nGiqmaz4uMZ/5Ur5brNR+BVInfhPWSBwg3by3ylRUAlAxp2YFR/XbpZ4ihONc1n +aM5wuIfPZf52kKPqGIpryrRRyq95YekRPCckG3gKeLURn0lW4D2Q594LP9TssNsn +Kh+1lwLdxMVpBb9tYufVQNitNUusSuNpYjt/IEc9 -----END CERTIFICATE----- diff --git a/testing/web3signer_tests/tls/web3signer/cert.pem b/testing/web3signer_tests/tls/web3signer/cert.pem index 6266cadf9bc..8120a09f261 100644 --- a/testing/web3signer_tests/tls/web3signer/cert.pem +++ b/testing/web3signer_tests/tls/web3signer/cert.pem @@ -1,33 +1,33 @@ -----BEGIN CERTIFICATE----- -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 -----END CERTIFICATE----- diff --git a/testing/web3signer_tests/tls/web3signer/key.key b/testing/web3signer_tests/tls/web3signer/key.key index d9697534064..ece249953cc 100644 --- a/testing/web3signer_tests/tls/web3signer/key.key +++ b/testing/web3signer_tests/tls/web3signer/key.key @@ -1,52 +1,52 @@ -----BEGIN PRIVATE KEY----- -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 -oJ/aHbXf6PdOO9MYiI/es/dfKK8ywA== +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 +BNyfjpeCsAvh8Q1liLMQ7Spy9yY1 -----END PRIVATE KEY----- diff --git a/testing/web3signer_tests/tls/web3signer/key.p12 b/testing/web3signer_tests/tls/web3signer/key.p12 index 792dc197f86dc4568df492f37bd1ac1ab3808a35..a7d772c99eec58fcde94e58000eabdf835fbfe02 100644 GIT binary patch literal 4387 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 literal 4371 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 CpCCy9 diff --git a/testing/web3signer_tests/tls/web3signer/known_clients.txt b/testing/web3signer_tests/tls/web3signer/known_clients.txt index c4722fe5876..6c8958cae07 100644 --- a/testing/web3signer_tests/tls/web3signer/known_clients.txt +++ b/testing/web3signer_tests/tls/web3signer/known_clients.txt @@ -1 +1 @@ -lighthouse 02:D0:A8:C0:6A:59:90:40:54:67:D4:BD:AE:5A:D4:F5:14:A9:79:38:98:E0:62:93:C1:77:13:FC:B4:60:65:CE +lighthouse DE:72:8C:AF:D4:1B:50:EF:66:BC:7D:E1:D8:02:87:DC:61:65:79:47:BD:E7:36:F8:10:7C:34:B2:5B:20:FD:6B From 9bd06d54ba37923b0e4693d8ada9197703cee7df Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 22 Jul 2024 14:58:14 -0700 Subject: [PATCH 29/62] refactor --- Cargo.lock | 2 + consensus/types/Cargo.toml | 1 + consensus/types/src/execution_block_header.rs | 8 +- consensus/types/src/fixed_bytes.rs | 62 ++++++++++++ consensus/types/src/lib.rs | 94 +------------------ crypto/bls/Cargo.toml | 1 + crypto/bls/src/lib.rs | 23 ++++- 7 files changed, 91 insertions(+), 100 deletions(-) create mode 100644 consensus/types/src/fixed_bytes.rs diff --git a/Cargo.lock b/Cargo.lock index 82b59facc4f..c9527094197 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1065,6 +1065,7 @@ dependencies = [ "alloy-primitives 0.7.7", "arbitrary", "blst", + "byteorder", "ethereum_hashing", "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", @@ -8929,6 +8930,7 @@ dependencies = [ "arbitrary", "beacon_chain", "bls", + "byteorder", "compare_fields", "compare_fields_derive", "criterion", diff --git a/consensus/types/Cargo.toml b/consensus/types/Cargo.toml index 04fecd6d647..44ac55b4e24 100644 --- a/consensus/types/Cargo.toml +++ b/consensus/types/Cargo.toml @@ -10,6 +10,7 @@ harness = false [dependencies] alloy-primitives = { workspace = true, features = ["ssz", "serde", "std"]} +byteorder = { workspace = true } ethereum-types = {workspace = true } merkle_proof = { workspace = true } bls = { workspace = true, features = ["arbitrary"] } diff --git a/consensus/types/src/execution_block_header.rs b/consensus/types/src/execution_block_header.rs index 55f94f91fb7..50844e1f55b 100644 --- a/consensus/types/src/execution_block_header.rs +++ b/consensus/types/src/execution_block_header.rs @@ -74,9 +74,9 @@ impl ExecutionBlockHeader { receipts_root: payload.receipts_root(), logs_bloom: payload.logs_bloom().clone().into(), difficulty: Uint256::ZERO, - number: Uint256::from_be_bytes(payload.block_number().to_be_bytes()), - gas_limit: Uint256::from_be_bytes(payload.gas_limit().to_be_bytes()), - gas_used: Uint256::from_be_bytes(payload.gas_used().to_be_bytes()), + number: Uint256::saturating_from(payload.block_number()), + gas_limit: Uint256::saturating_from(payload.gas_limit()), + gas_used: Uint256::saturating_from(payload.gas_used()), timestamp: payload.timestamp(), extra_data: payload.extra_data().clone().into(), mix_hash: payload.prev_randao(), @@ -88,4 +88,4 @@ impl ExecutionBlockHeader { parent_beacon_block_root: rlp_parent_beacon_block_root, } } -} +} \ No newline at end of file diff --git a/consensus/types/src/fixed_bytes.rs b/consensus/types/src/fixed_bytes.rs new file mode 100644 index 00000000000..a0cb2a95c94 --- /dev/null +++ b/consensus/types/src/fixed_bytes.rs @@ -0,0 +1,62 @@ +use byteorder::ByteOrder; + + +// TODO(alloy) review panic issues +pub trait FixedBytesExtended { + /// The given u64 value is interpreted as big endian. + /// Ignores the most significant bits of the given value if the hash type has less than 8 bytes. + fn from_low_u64_be(value: u64) -> Self; + fn from_low_u64_le(value: u64) -> Self; + fn zero() -> Self; +} + +impl FixedBytesExtended for alloy_primitives::B256 { + + fn from_low_u64_be(value: u64) -> Self { + let mut buf = [0x0; 8]; + byteorder::BigEndian::write_u64(&mut buf, value); + let capped = std::cmp::min(Self::len_bytes(), 8); + let mut bytes = [0x0; std::mem::size_of::()]; + bytes[(Self::len_bytes() - capped)..].copy_from_slice(&buf[..capped]); + Self::from_slice(&bytes) + } + + fn from_low_u64_le(value: u64) -> Self { + let mut buf = [0x0; 8]; + byteorder::LittleEndian::write_u64(&mut buf, value); + let capped = std::cmp::min(Self::len_bytes(), 8); + let mut bytes = [0x0; std::mem::size_of::()]; + bytes[(Self::len_bytes() - capped)..].copy_from_slice(&buf[..capped]); + Self::from_slice(&bytes) + } + + fn zero() -> Self { + alloy_primitives::B256::ZERO + } +} + + +// https://github.com/paritytech/parity-common/blob/d5e9c1d5b52e7a43f843855a0f4fbc319929a681/fixed-hash/src/hash.rs#L401-L411 +impl FixedBytesExtended for alloy_primitives::Address { + fn from_low_u64_be(value: u64) -> Self { + let mut buf = [0x0; 8]; + byteorder::BigEndian::write_u64(&mut buf, value); + let capped = std::cmp::min(Self::len_bytes(), 8); + let mut bytes = [0x0; std::mem::size_of::()]; + bytes[(Self::len_bytes() - capped)..].copy_from_slice(&buf[..capped]); + Self::from_slice(&bytes) + } + + fn from_low_u64_le(value: u64) -> Self { + let mut buf = [0x0; 8]; + byteorder::LittleEndian::write_u64(&mut buf, value); + let capped = std::cmp::min(Self::len_bytes(), 8); + let mut bytes = [0x0; std::mem::size_of::()]; + bytes[(Self::len_bytes() - capped)..].copy_from_slice(&buf[..capped]); + Self::from_slice(&bytes) + } + + fn zero() -> Self { + alloy_primitives::Address::ZERO + } +} \ No newline at end of file diff --git a/consensus/types/src/lib.rs b/consensus/types/src/lib.rs index aec99cf316e..75c48cd497e 100644 --- a/consensus/types/src/lib.rs +++ b/consensus/types/src/lib.rs @@ -42,6 +42,7 @@ pub mod execution_block_hash; pub mod execution_layer_withdrawal_request; pub mod execution_payload; pub mod execution_payload_header; +pub mod fixed_bytes; pub mod fork; pub mod fork_data; pub mod fork_name; @@ -109,9 +110,6 @@ pub mod light_client_header; pub mod non_zero_usize; pub mod runtime_var_list; -use alloy_primitives::bytes::{BufMut, BytesMut}; -use alloy_primitives::{Address as H160, B256 as H256}; - pub use crate::activation_queue::ActivationQueue; pub use crate::aggregate_and_proof::{ AggregateAndProof, AggregateAndProofBase, AggregateAndProofElectra, AggregateAndProofRef, @@ -169,6 +167,7 @@ pub use crate::execution_payload_header::{ ExecutionPayloadHeaderDeneb, ExecutionPayloadHeaderElectra, ExecutionPayloadHeaderRef, ExecutionPayloadHeaderRefMut, }; +pub use crate::fixed_bytes::FixedBytesExtended; pub use crate::fork::Fork; pub use crate::fork_context::ForkContext; pub use crate::fork_data::ForkData; @@ -271,91 +270,4 @@ pub use bls::{ pub use kzg::{KzgCommitment, KzgProof, VERSIONED_HASH_VERSION_KZG}; pub use milhouse::{self, List, Vector}; pub use ssz_types::{typenum, typenum::Unsigned, BitList, BitVector, FixedVector, VariableList}; -pub use superstruct::superstruct; - -pub trait FixedBytesExtended { - /// The given u64 value is interpreted as big endian. - /// Ignores the most significant bits of the given value if the hash type has less than 8 bytes. - fn from_low_u64_be(value: u64) -> Self; - fn from_low_u64_le(value: u64) -> Self; - fn zero() -> Self; -} - -impl FixedBytesExtended for alloy_primitives::B256 { - - fn from_low_u64_be(value: u64) -> Self { - // Convert the u64 value to a big-endian byte array - let value_bytes = value.to_be_bytes(); - let mut large_array: [u8; 32] = [0; 32]; - // Determine the length of bytes to copy (ignoring the most significant bits if necessary) - let bytes_to_copy = value_bytes.len().min(large_array.len()); - let start_index = large_array.len() - bytes_to_copy; - // Copy the bytes to the target array - large_array[start_index..].copy_from_slice(&value_bytes[..bytes_to_copy]); - - alloy_primitives::B256::new(large_array) - // bytes.put_u64(value); - // bytes.resize(32, 0); - // bytes.to_vec(); - // let z = alloy_primitives::B256::from_slice(&bytes); - } - - fn from_low_u64_le(value: u64) -> Self { - // Convert the u64 value to a big-endian byte array - let value_bytes = value.to_le_bytes(); - let mut large_array: [u8; 32] = [0; 32]; - // Determine the length of bytes to copy (ignoring the most significant bits if necessary) - let bytes_to_copy = value_bytes.len().min(large_array.len()); - let start_index = large_array.len() - bytes_to_copy; - // Copy the bytes to the target array - large_array[start_index..].copy_from_slice(&value_bytes[..bytes_to_copy]); - let x = ethereum_types::H256::from_low_u64_le(value); - let y = alloy_primitives::B256::new(large_array); - - println!("x: {:?}", x); - println!("y: {:?}", y); - - y - } - - fn zero() -> Self { - alloy_primitives::B256::ZERO - } -} - -impl FixedBytesExtended for alloy_primitives::Address { - fn from_low_u64_be(value: u64) -> Self { - // Convert the u64 value to a big-endian byte array - let value_bytes = value.to_be_bytes(); - let mut large_array: [u8; 20] = [0; 20]; - // Determine the length of bytes to copy (ignoring the most significant bits if necessary) - let bytes_to_copy = value_bytes.len().min(large_array.len()); - let start_index = large_array.len() - bytes_to_copy; - // Copy the bytes to the target array - large_array[start_index..].copy_from_slice(&value_bytes[..bytes_to_copy]); - - alloy_primitives::Address::new(large_array) - } - - fn from_low_u64_le(value: u64) -> Self { - // Convert the u64 value to a big-endian byte array - let value_bytes = value.to_le_bytes(); - let mut large_array: [u8; 20] = [0; 20]; - // Determine the length of bytes to copy (ignoring the most significant bits if necessary) - let bytes_to_copy = value_bytes.len().min(large_array.len()); - let start_index = large_array.len() - bytes_to_copy; - // Copy the bytes to the target array - large_array[start_index..].copy_from_slice(&value_bytes[..bytes_to_copy]); - let x = ethereum_types::Address::from_low_u64_le(value); - let y = alloy_primitives::Address::new(large_array); - - println!("x address: {:?}", x); - println!("y address: {:?}", y); - - y - } - - fn zero() -> Self { - alloy_primitives::Address::ZERO - } -} \ No newline at end of file +pub use superstruct::superstruct; \ No newline at end of file diff --git a/crypto/bls/Cargo.toml b/crypto/bls/Cargo.toml index 2d11f50aabb..1398a268a45 100644 --- a/crypto/bls/Cargo.toml +++ b/crypto/bls/Cargo.toml @@ -6,6 +6,7 @@ edition = { workspace = true } [dependencies] alloy-primitives = { workspace = true } +byteorder = { workspace = true } ethereum_ssz = { workspace = true } tree_hash = { workspace = true } rand = { workspace = true } diff --git a/crypto/bls/src/lib.rs b/crypto/bls/src/lib.rs index 25e1ffc0204..d321d406450 100644 --- a/crypto/bls/src/lib.rs +++ b/crypto/bls/src/lib.rs @@ -33,6 +33,7 @@ mod zeroize_hash; pub mod impls; +use byteorder::ByteOrder; pub use generic_public_key::{ INFINITY_PUBLIC_KEY, PUBLIC_KEY_BYTES_LEN, PUBLIC_KEY_UNCOMPRESSED_BYTES_LEN, }; @@ -52,19 +53,31 @@ pub trait FixedBytesExtended { } impl FixedBytesExtended for alloy_primitives::B256 { - fn from_low_u64_be(value: u64) -> alloy_primitives::B256 { - alloy_primitives::B256::from_slice(&value.to_be_bytes()) + + fn from_low_u64_be(value: u64) -> Self { + let mut buf = [0x0; 8]; + byteorder::BigEndian::write_u64(&mut buf, value); + let capped = std::cmp::min(Self::len_bytes(), 8); + let mut bytes = [0x0; std::mem::size_of::()]; + bytes[(Self::len_bytes() - capped)..].copy_from_slice(&buf[..capped]); + Self::from_slice(&bytes) } - fn from_low_u64_le(value: u64) -> alloy_primitives::B256 { - alloy_primitives::B256::from_slice(&value.to_le_bytes()) + fn from_low_u64_le(value: u64) -> Self { + let mut buf = [0x0; 8]; + byteorder::LittleEndian::write_u64(&mut buf, value); + let capped = std::cmp::min(Self::len_bytes(), 8); + let mut bytes = [0x0; std::mem::size_of::()]; + bytes[(Self::len_bytes() - capped)..].copy_from_slice(&buf[..capped]); + Self::from_slice(&bytes) } - fn zero() -> alloy_primitives::B256 { + fn zero() -> Self { alloy_primitives::B256::ZERO } } + #[derive(Clone, Debug, PartialEq)] pub enum Error { /// An error was raised from the Supranational BLST BLS library. From 2dd7d03af537173785bd559780e644a4e4f1a3df Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Tue, 23 Jul 2024 07:15:46 -0700 Subject: [PATCH 30/62] linting --- Cargo.lock | 1 + consensus/merkle_proof/src/lib.rs | 9 +++++---- consensus/types/src/beacon_state.rs | 4 +++- consensus/types/src/fixed_bytes.rs | 12 +++++------- consensus/types/src/graffiti.rs | 2 +- crypto/bls/Cargo.toml | 1 + crypto/bls/src/lib.rs | 10 ++++++---- 7 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6240e216581..c728c58ca72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1071,6 +1071,7 @@ dependencies = [ "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", "hex", "rand", + "safe_arith", "serde", "tree_hash", "zeroize", diff --git a/consensus/merkle_proof/src/lib.rs b/consensus/merkle_proof/src/lib.rs index 6a39a06e594..dc99ecfa5b7 100644 --- a/consensus/merkle_proof/src/lib.rs +++ b/consensus/merkle_proof/src/lib.rs @@ -1,7 +1,7 @@ use alloy_primitives::FixedBytes; use ethereum_hashing::{hash, hash32_concat, ZERO_HASHES}; use lazy_static::lazy_static; -use safe_arith::ArithError; +use safe_arith::{ArithError, SafeArith}; type H256 = alloy_primitives::B256; @@ -16,14 +16,15 @@ impl FixedBytesExtended for FixedBytes { let value_bytes = value.to_be_bytes(); let mut buffer = [0x0; N]; let bytes_to_copy = value_bytes.len().min(buffer.len()); - let start_index = buffer.len() - bytes_to_copy; + // Panic-free because bytes_to_copy <= buffer.len() + let start_index = buffer.len().safe_sub(bytes_to_copy).expect("bytes_to_copy <= buffer.len()"); // Panic-free because start_index <= buffer.len() // and bytes_to_copy <= value_bytes.len() buffer .get_mut(start_index..) .expect("start_index <= buffer.len()") .copy_from_slice( - &value_bytes + value_bytes .get(..bytes_to_copy) .expect("bytes_to_copy <= value_byte.len()"), ); @@ -40,7 +41,7 @@ impl FixedBytesExtended for FixedBytes { .get_mut(..bytes_to_copy) .expect("bytes_to_copy <= buffer.len()") .copy_from_slice( - &value_bytes + value_bytes .get(..bytes_to_copy) .expect("bytes_to_copy <= value_byte.len()"), ); diff --git a/consensus/types/src/beacon_state.rs b/consensus/types/src/beacon_state.rs index be3877feed1..760e86ed242 100644 --- a/consensus/types/src/beacon_state.rs +++ b/consensus/types/src/beacon_state.rs @@ -1,5 +1,6 @@ use self::committee_cache::get_active_validator_indices; use crate::historical_summary::HistoricalSummary; +use crate::fixed_bytes::FixedBytesExtended; use crate::test_utils::TestRandom; use crate::*; use compare_fields::CompareFields; @@ -2219,7 +2220,8 @@ impl BeaconState { .get_mut(validator_index) .ok_or(Error::UnknownValidator(validator_index))?; if validator.has_eth1_withdrawal_credential(spec) { - validator.withdrawal_credentials.as_mut_slice().to_owned()[0] = + *validator.withdrawal_credentials.as_mut_slice().to_owned().get_mut(0) + .ok_or(Error::UnknownValidator(validator_index))? = spec.compounding_withdrawal_prefix_byte; self.queue_excess_active_balance(validator_index, spec)?; } diff --git a/consensus/types/src/fixed_bytes.rs b/consensus/types/src/fixed_bytes.rs index 49d0041ffbf..140e0c1a97a 100644 --- a/consensus/types/src/fixed_bytes.rs +++ b/consensus/types/src/fixed_bytes.rs @@ -1,9 +1,6 @@ use alloy_primitives::{Address, FixedBytes}; -use byteorder::ByteOrder; +use safe_arith::SafeArith; -use crate::{Hash256, Uint256}; - -// TODO(alloy) review panic issues pub trait FixedBytesExtended { fn from_low_u64_be(value: u64) -> Self; fn from_low_u64_le(value: u64) -> Self; @@ -15,14 +12,15 @@ impl FixedBytesExtended for FixedBytes { let value_bytes = value.to_be_bytes(); let mut buffer = [0x0; N]; let bytes_to_copy = value_bytes.len().min(buffer.len()); - let start_index = buffer.len() - bytes_to_copy; + // Panic-free because bytes_to_copy <= buffer.len() + let start_index = buffer.len().safe_sub(bytes_to_copy).expect("byte_to_copy <= buffer.len()"); // Panic-free because start_index <= buffer.len() // and bytes_to_copy <= value_bytes.len() buffer .get_mut(start_index..) .expect("start_index <= buffer.len()") .copy_from_slice( - &value_bytes + value_bytes .get(..bytes_to_copy) .expect("bytes_to_copy <= value_byte.len()"), ); @@ -39,7 +37,7 @@ impl FixedBytesExtended for FixedBytes { .get_mut(..bytes_to_copy) .expect("bytes_to_copy <= buffer.len()") .copy_from_slice( - &value_bytes + value_bytes .get(..bytes_to_copy) .expect("bytes_to_copy <= value_byte.len()"), ); diff --git a/consensus/types/src/graffiti.rs b/consensus/types/src/graffiti.rs index fd8befdf3af..036c1f1ba82 100644 --- a/consensus/types/src/graffiti.rs +++ b/consensus/types/src/graffiti.rs @@ -92,7 +92,7 @@ impl From for Graffiti { .get_mut(..graffiti_len) .expect("graffiti_len <= GRAFFITI_BYTES_LEN") .copy_from_slice( - &graffiti_bytes + graffiti_bytes .get(..graffiti_len) .expect("graffiti_len <= GRAFFITI_BYTES_LEN"), ); diff --git a/crypto/bls/Cargo.toml b/crypto/bls/Cargo.toml index 1398a268a45..599d8aa7e36 100644 --- a/crypto/bls/Cargo.toml +++ b/crypto/bls/Cargo.toml @@ -17,6 +17,7 @@ ethereum_hashing = { workspace = true } arbitrary = { workspace = true } zeroize = { workspace = true } blst = { version = "0.3.3", optional = true } +safe_arith = { workspace = true } [features] arbitrary = [] diff --git a/crypto/bls/src/lib.rs b/crypto/bls/src/lib.rs index 10e8ac7ed42..e5752dd7334 100644 --- a/crypto/bls/src/lib.rs +++ b/crypto/bls/src/lib.rs @@ -40,6 +40,7 @@ pub use generic_public_key::{ pub use generic_secret_key::SECRET_KEY_BYTES_LEN; pub use generic_signature::{INFINITY_SIGNATURE, SIGNATURE_BYTES_LEN}; pub use get_withdrawal_credentials::get_withdrawal_credentials; +use safe_arith::SafeArith; pub use zeroize_hash::ZeroizeHash; #[cfg(feature = "supranational")] @@ -57,14 +58,15 @@ impl FixedBytesExtended for FixedBytes { let value_bytes = value.to_be_bytes(); let mut buffer = [0x0; N]; let bytes_to_copy = value_bytes.len().min(buffer.len()); - let start_index = buffer.len() - bytes_to_copy; + // Panic-free because bytes_to_copy <= buffer.len() + let start_index = buffer.len().safe_sub(bytes_to_copy).expect("bytes_to_copy <= buffer.len()"); // Panic-free because start_index <= buffer.len() // and bytes_to_copy <= value_bytes.len() buffer .get_mut(start_index..) .expect("start_index <= buffer.len()") .copy_from_slice( - &value_bytes + value_bytes .get(..bytes_to_copy) .expect("bytes_to_copy <= value_byte.len()"), ); @@ -75,13 +77,13 @@ impl FixedBytesExtended for FixedBytes { let value_bytes = value.to_le_bytes(); let mut buffer = [0x0; N]; let bytes_to_copy = value_bytes.len().min(buffer.len()); - // Panic-free because bytes_to_copy <= buffer.len() + // Panic-free because bytes_to_copy <= buffer.len(), // and bytes_to_copy <= value_bytes.len() buffer .get_mut(..bytes_to_copy) .expect("bytes_to_copy <= buffer.len()") .copy_from_slice( - &value_bytes + value_bytes .get(..bytes_to_copy) .expect("bytes_to_copy <= value_byte.len()"), ); From e152e1688191d5a4750da12192406953cf9ed194 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Tue, 23 Jul 2024 17:14:10 -0700 Subject: [PATCH 31/62] fix graffiti string test --- Cargo.lock | 791 ++++++++---------- beacon_node/beacon_chain/src/test_utils.rs | 1 + consensus/merkle_proof/src/lib.rs | 5 +- consensus/types/src/beacon_state.rs | 8 +- consensus/types/src/fixed_bytes.rs | 5 +- consensus/types/src/graffiti.rs | 3 +- crypto/bls/src/lib.rs | 5 +- .../src/initialized_validators.rs | 8 +- 8 files changed, 376 insertions(+), 450 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c728c58ca72..d4c32216786 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -265,7 +265,7 @@ dependencies = [ "const-hex", "derive_arbitrary", "derive_more", - "ethereum_ssz 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum_ssz 0.5.3", "getrandom", "hex-literal", "itoa", @@ -281,9 +281,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.7" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" +checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -292,13 +292,13 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.7" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83524c1f6162fcb5b0decf775498a125066c86dda6066ed609531b0e912f85a" +checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -354,9 +354,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ "windows-sys 0.52.0", ] @@ -431,7 +431,7 @@ dependencies = [ "ark-std 0.4.0", "derivative", "digest 0.10.7", - "itertools 0.10.5", + "itertools", "num-bigint", "num-traits", "paste", @@ -533,9 +533,9 @@ checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" [[package]] name = "arrayref" -version = "0.3.8" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" @@ -567,7 +567,7 @@ checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", "synstructure", ] @@ -579,7 +579,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -601,9 +601,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.3" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" dependencies = [ "async-lock", "cfg-if", @@ -620,24 +620,24 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.4.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener 5.3.1", + "event-listener 4.0.3", "event-listener-strategy", "pin-project-lite", ] [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -707,7 +707,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -727,9 +727,9 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.1", + "http-body 1.0.0", "http-body-util", - "hyper 1.4.1", + "hyper 1.3.1", "hyper-util", "itoa", "matchit", @@ -760,7 +760,7 @@ dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.1", + "http-body 1.0.0", "http-body-util", "mime", "pin-project-lite", @@ -773,9 +773,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" dependencies = [ "addr2line", "cc", @@ -842,7 +842,7 @@ dependencies = [ "eth2_network_config", "ethereum_hashing", "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "execution_layer", "fork_choice", @@ -850,7 +850,7 @@ dependencies = [ "genesis", "hex", "int_to_bytes", - "itertools 0.10.5", + "itertools", "kzg", "lazy_static", "lighthouse_metrics", @@ -906,7 +906,7 @@ dependencies = [ "genesis", "hex", "http_api", - "hyper 1.4.1", + "hyper 1.3.1", "lighthouse_network", "monitoring_api", "node_test_rig", @@ -927,7 +927,7 @@ version = "0.1.0" dependencies = [ "fnv", "futures", - "itertools 0.10.5", + "itertools", "lazy_static", "lighthouse_metrics", "lighthouse_network", @@ -959,10 +959,10 @@ version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "cexpr", "clang-sys", - "itertools 0.12.1", + "itertools", "lazy_static", "lazycell", "proc-macro2", @@ -970,7 +970,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -996,9 +996,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bitvec" @@ -1068,7 +1068,7 @@ dependencies = [ "byteorder", "ethereum_hashing", "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "hex", "rand", "safe_arith", @@ -1079,9 +1079,9 @@ dependencies = [ [[package]] name = "blst" -version = "0.3.12" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62dc83a094a71d43eeadd254b1ec2d24cb6a0bb6cadce00df51f0db594711a32" +checksum = "c94087b935a822949d3291a9989ad2b2051ea141eda0fd4e478a75f6aa3e604b" dependencies = [ "cc", "glob", @@ -1107,7 +1107,7 @@ dependencies = [ "clap", "clap_utils", "eth2_network_config", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "hex", "lighthouse_network", "log", @@ -1167,9 +1167,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" dependencies = [ "serde", ] @@ -1248,12 +1248,13 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.6" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -1310,7 +1311,7 @@ dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -1362,9 +1363,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +checksum = "f803f94ecf597339c7a34eed2036ef83f86aaba937f001f7c5b5e251f043f1f9" dependencies = [ "glob", "libc", @@ -1373,9 +1374,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.9" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -1383,9 +1384,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.9" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -1396,21 +1397,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.8" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "clap_utils" @@ -1420,7 +1421,7 @@ dependencies = [ "clap", "dirs", "eth2_network_config", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "hex", "serde", "serde_json", @@ -1441,7 +1442,7 @@ dependencies = [ "eth1", "eth2", "eth2_config", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "execution_layer", "futures", "genesis", @@ -1489,7 +1490,7 @@ name = "compare_fields" version = "0.2.0" dependencies = [ "compare_fields_derive", - "itertools 0.10.5", + "itertools", ] [[package]] @@ -1595,7 +1596,7 @@ dependencies = [ "clap", "criterion-plot", "is-terminal", - "itertools 0.10.5", + "itertools", "num-traits", "once_cell", "oorandom", @@ -1616,7 +1617,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", - "itertools 0.10.5", + "itertools", ] [[package]] @@ -1775,7 +1776,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -1784,18 +1785,8 @@ version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", -] - -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "darling_core", + "darling_macro", ] [[package]] @@ -1812,42 +1803,17 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.11.1", - "syn 2.0.72", -] - [[package]] name = "darling_macro" version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ - "darling_core 0.13.4", + "darling_core", "quote", "syn 1.0.109", ] -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core 0.20.10", - "quote", - "syn 2.0.72", -] - [[package]] name = "darwin-libproc" version = "0.1.2" @@ -1938,7 +1904,7 @@ name = "deposit_contract" version = "0.2.0" dependencies = [ "ethabi 16.0.0", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "hex", "reqwest", "serde_json", @@ -2010,29 +1976,29 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] name = "derive_more" -version = "0.99.18" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.72", + "syn 1.0.109", ] [[package]] name = "diesel" -version = "2.2.2" +version = "2.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf97ee7261bb708fa3402fa9c17a54b70e90e3cb98afb3dc8999d5512cb03f94" +checksum = "ff236accb9a5069572099f0b350a92e9560e8e63a9b8d546162f4a5e03026bb2" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "byteorder", "diesel_derives", "itoa", @@ -2042,22 +2008,21 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.2.2" +version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ff2be1e7312c858b2ef974f5c7089833ae57b5311b334b30923af58e5718d8" +checksum = "14701062d6bed917b5c7103bdffaee1e4609279e240488ad24e7bd979ca6866c" dependencies = [ "diesel_table_macro_syntax", - "dsl_auto_type", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] name = "diesel_migrations" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a73ce704bad4231f001bff3314d91dce4aba0770cee8b233991859abc15c1f6" +checksum = "6036b3f0120c5961381b570ee20a02432d7e2d27ea60de9578799cf9156914ac" dependencies = [ "diesel", "migrations_internals", @@ -2066,11 +2031,11 @@ dependencies = [ [[package]] name = "diesel_table_macro_syntax" -version = "0.2.0" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" +checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -2177,27 +2142,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "dsl_auto_type" -version = "0.1.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d9abe6314103864cc2d8901b7ae224e0ab1a103a0a416661b4097b0779b607" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ - "darling 0.20.10", - "either", - "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -2274,7 +2225,7 @@ dependencies = [ "compare_fields_derive", "derivative", "eth2_network_config", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "execution_layer", "fork_choice", @@ -2297,9 +2248,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" @@ -2377,7 +2328,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -2466,7 +2417,7 @@ dependencies = [ "environment", "eth1_test_rig", "eth2", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "execution_layer", "futures", @@ -2510,7 +2461,7 @@ dependencies = [ "bytes", "eth2_keystore", "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "futures", "futures-util", @@ -2596,7 +2547,7 @@ dependencies = [ "bytes", "discv5", "eth2_config", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "logging", "pretty_reqwest_error", "reqwest", @@ -2764,12 +2715,12 @@ dependencies = [ [[package]] name = "ethereum_ssz" -version = "0.5.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3627f83d8b87b432a5fad9934b4565260722a141a2c40f371f8080adec9425" +checksum = "e61ffea29f26e8249d35128a82ec8d3bd4fbc80179ea5f5e5e3daafef6a80fcb" dependencies = [ "ethereum-types 0.14.1", - "itertools 0.10.5", + "itertools", "smallvec", ] @@ -2779,7 +2730,7 @@ version = "0.5.4" source = "git+https://github.com/sigp/ethereum_ssz?branch=alloy#6baa1217c531ee4bc4e8ae00fa99a427806b5320" dependencies = [ "alloy-primitives 0.7.7", - "itertools 0.10.5", + "itertools", "smallvec", ] @@ -2788,7 +2739,7 @@ name = "ethereum_ssz_derive" version = "0.5.4" source = "git+https://github.com/sigp/ethereum_ssz?branch=alloy#6baa1217c531ee4bc4e8ae00fa99a427806b5320" dependencies = [ - "darling 0.13.4", + "darling", "proc-macro2", "quote", "syn 1.0.109", @@ -2925,9 +2876,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "5.3.1" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ "concurrent-queue", "parking", @@ -2936,11 +2887,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 5.3.1", + "event-listener 4.0.3", "pin-project-lite", ] @@ -2982,7 +2933,7 @@ dependencies = [ "eth2", "eth2_network_config", "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethers-core", "fork_choice", "hash-db", @@ -3181,7 +3132,7 @@ name = "fork_choice" version = "0.1.0" dependencies = [ "beacon_chain", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "proto_array", "slog", @@ -3239,9 +3190,9 @@ dependencies = [ [[package]] name = "futures-bounded" -version = "0.2.4" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91f328e7fb845fc832912fb6a34f40cf6d1888c92f974d1893a54e97b5ff542e" +checksum = "e1e2774cc104e198ef3d3e1ff4ab40f86fa3245d6cb6a3a46174f21463cee173" dependencies = [ "futures-timer", "futures-util", @@ -3299,7 +3250,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -3309,7 +3260,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.23.11", + "rustls 0.23.8", "rustls-pki-types", ] @@ -3388,7 +3339,7 @@ dependencies = [ "eth1", "eth1_test_rig", "ethereum_hashing", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "futures", "int_to_bytes", "merkle_proof", @@ -3457,7 +3408,7 @@ checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -3481,7 +3432,7 @@ dependencies = [ "futures-ticker", "futures-timer", "getrandom", - "hashlink 0.9.1", + "hashlink 0.9.0", "hex_fmt", "libp2p", "prometheus-client", @@ -3599,9 +3550,9 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.9.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +checksum = "692eaaf7f7607518dd3cef090f1474b61edc5301d8012f09579920df68b725ee" dependencies = [ "hashbrown 0.14.5", ] @@ -3657,12 +3608,6 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - [[package]] name = "hex" version = "0.4.3" @@ -3825,9 +3770,9 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", "http 1.1.0", @@ -3835,14 +3780,14 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" dependencies = [ "bytes", - "futures-util", + "futures-core", "http 1.1.0", - "http-body 1.0.1", + "http-body 1.0.0", "pin-project-lite", ] @@ -3859,7 +3804,7 @@ dependencies = [ "eth1", "eth2", "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "execution_layer", "futures", "genesis", @@ -3916,9 +3861,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -3934,9 +3879,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -3958,15 +3903,15 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.1", + "http-body 1.0.0", "httparse", "httpdate", "itoa", @@ -3983,7 +3928,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.28", "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", @@ -3996,7 +3941,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.30", + "hyper 0.14.28", "native-tls", "tokio", "tokio-native-tls", @@ -4004,15 +3949,15 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" dependencies = [ "bytes", "futures-util", "http 1.1.0", - "http-body 1.0.1", - "hyper 1.4.1", + "http-body 1.0.0", + "hyper 1.3.1", "pin-project-lite", "tokio", ] @@ -4106,7 +4051,7 @@ dependencies = [ "bytes", "futures", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.28", "log", "rand", "tokio", @@ -4290,15 +4235,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.11" @@ -4433,7 +4369,7 @@ dependencies = [ "derivative", "ethereum_hashing", "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "hex", "serde", @@ -4442,11 +4378,11 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin 0.9.8", + "spin 0.5.2", ] [[package]] @@ -4471,7 +4407,7 @@ dependencies = [ "eth2_network_config", "eth2_wallet", "ethereum_hashing", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "execution_layer", "hex", "lighthouse_network", @@ -4545,12 +4481,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -4633,14 +4569,15 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.41.3" +version = "0.41.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a8920cbd8540059a01950c1e5c96ea8d89eb50c51cd366fc18bdf540a6e48f" +checksum = "8130a8269e65a2554d55131c770bdf4bcd94d2b8d4efb24ca23699be65066c05" dependencies = [ "either", "fnv", "futures", "futures-timer", + "instant", "libp2p-identity", "multiaddr", "multihash", @@ -4656,7 +4593,6 @@ dependencies = [ "tracing", "unsigned-varint 0.8.0", "void", - "web-time", ] [[package]] @@ -4700,9 +4636,9 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.2.9" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8" +checksum = "999ec70441b2fb35355076726a6bc466c932e9bdc66f6a11c6c0aa17c7ab9be0" dependencies = [ "asn1_der", "bs58 0.5.1", @@ -4836,7 +4772,7 @@ dependencies = [ "quinn", "rand", "ring 0.17.8", - "rustls 0.23.11", + "rustls 0.23.8", "socket2 0.5.7", "thiserror", "tokio", @@ -4876,7 +4812,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -4898,9 +4834,9 @@ dependencies = [ [[package]] name = "libp2p-tls" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b7b831e55ce2aa6c354e6861a85fdd4dd0a2b97d5e276fabac0e4810a71776" +checksum = "251b17aebdd29df7e8f80e4d94b782fae42e934c49086e1a81ba23b60a8314f2" dependencies = [ "futures", "futures-rustls", @@ -4908,7 +4844,7 @@ dependencies = [ "libp2p-identity", "rcgen", "ring 0.17.8", - "rustls 0.23.11", + "rustls 0.23.8", "rustls-webpki 0.101.7", "thiserror", "x509-parser", @@ -4943,7 +4879,7 @@ dependencies = [ "thiserror", "tracing", "yamux 0.12.1", - "yamux 0.13.3", + "yamux 0.13.2", ] [[package]] @@ -4952,7 +4888,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "libc", ] @@ -5087,7 +5023,7 @@ dependencies = [ "discv5", "either", "error-chain", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "fnv", "futures", @@ -5197,9 +5133,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "logging" @@ -5332,9 +5268,9 @@ checksum = "8878cd8d1b3c8c8ae4b2ba0a36652b7cf192f618a599a7fbdfa25cffd4ea72dd" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memoffset" @@ -5359,21 +5295,21 @@ dependencies = [ [[package]] name = "metastruct" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00a5ba4a0f3453c31c397b214e1675d95b697c33763aa58add57ea833424384" +checksum = "ccfbb8826226b09b05bb62a0937cf6abb16f1f7d4b746eb95a83db14aec60f06" dependencies = [ "metastruct_macro", ] [[package]] name = "metastruct_macro" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c3a991d4536c933306e52f0e8ab303757185ec13a09d1f3e1cbde5a0d8410bf" +checksum = "37cb4045d5677b7da537f8cb5d0730d5b6414e3cc81c61e4b50e1f0cbdc73909" dependencies = [ - "darling 0.13.4", - "itertools 0.10.5", + "darling", + "itertools", "proc-macro2", "quote", "smallvec", @@ -5382,19 +5318,19 @@ dependencies = [ [[package]] name = "migrations_internals" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd01039851e82f8799046eabbb354056283fb265c8ec0996af940f4e85a380ff" +checksum = "0f23f71580015254b020e856feac3df5878c2c7a8812297edd6c0a485ac9dada" dependencies = [ "serde", - "toml 0.8.15", + "toml 0.7.8", ] [[package]] name = "migrations_macros" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb161cc72176cb37aa47f1fc520d3ef02263d67d661f44f05d05a079e1237fd" +checksum = "cce3325ac70e67bbab5bd837a31cae01f1a6db64e0e744a33cb03a543469ef08" dependencies = [ "migrations_internals", "proc-macro2", @@ -5410,9 +5346,9 @@ dependencies = [ "arbitrary", "derivative", "ethereum_hashing", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethereum_ssz_derive", - "itertools 0.10.5", + "itertools", "parking_lot 0.12.3", "rayon", "serde", @@ -5431,9 +5367,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.5" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" dependencies = [ "mime", "unicase", @@ -5447,9 +5383,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] @@ -5645,7 +5581,7 @@ dependencies = [ "derivative", "error-chain", "eth2", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "execution_layer", "fnv", "futures", @@ -5653,7 +5589,7 @@ dependencies = [ "gossipsub", "hex", "igd-next", - "itertools 0.10.5", + "itertools", "lazy_static", "lighthouse_metrics", "lighthouse_network", @@ -5696,7 +5632,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "cfg-if", "cfg_aliases", "libc", @@ -5755,9 +5691,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ "num-integer", "num-traits", @@ -5829,9 +5765,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.1" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" dependencies = [ "memchr", ] @@ -5860,9 +5796,9 @@ dependencies = [ [[package]] name = "oorandom" -version = "11.1.4" +version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "opaque-debug" @@ -5901,7 +5837,7 @@ version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "cfg-if", "foreign-types", "libc", @@ -5918,7 +5854,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -5929,9 +5865,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.3.1+3.3.1" +version = "300.3.0+3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" +checksum = "eba8804a1c5765b18c4b3f907e6897ebabeedebc9830e1a0046c4a4cf44663e1" dependencies = [ "cc", ] @@ -5956,9 +5892,9 @@ dependencies = [ "beacon_chain", "bitvec 1.0.1", "derivative", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethereum_ssz_derive", - "itertools 0.10.5", + "itertools", "lazy_static", "lighthouse_metrics", "maplit", @@ -6091,9 +6027,9 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -6170,9 +6106,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.11" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" dependencies = [ "memchr", "thiserror", @@ -6224,7 +6160,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -6301,13 +6237,13 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.2" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi 0.4.0", + "hermit-abi 0.3.9", "pin-project-lite", "rustix 0.38.34", "tracing", @@ -6351,11 +6287,11 @@ dependencies = [ [[package]] name = "postgres-protocol" -version = "0.6.7" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acda0ebdebc28befa84bee35e651e4c5f09073d668c7aed4cf7e23c3cda84b23" +checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" dependencies = [ - "base64 0.22.1", + "base64 0.21.7", "byteorder", "bytes", "fallible-iterator", @@ -6369,9 +6305,9 @@ dependencies = [ [[package]] name = "postgres-types" -version = "0.2.7" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02048d9e032fb3cc3413bbf7b83a15d84a5d419778e2628751896d856498eee9" +checksum = "8d2234cdee9408b523530a9b6d2d6b373d1db34f6a8e51dc03ded1828d7fb67c" dependencies = [ "bytes", "fallible-iterator", @@ -6392,9 +6328,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "pq-sys" -version = "0.6.1" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a24ff9e4cf6945c988f0db7005d87747bf72864965c3529d259ad155ac41d584" +checksum = "31c0052426df997c0cbd30789eb44ca097e3541717a7b8fa36b1c464ee7edebd" dependencies = [ "vcpkg", ] @@ -6464,9 +6400,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" dependencies = [ "unicode-ident", ] @@ -6503,9 +6439,9 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.22.3" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" +checksum = "c1ca959da22a332509f2a73ae9e5f23f9dcfc31fd3a54d71f159495bd5909baa" dependencies = [ "dtoa", "itoa", @@ -6521,24 +6457,24 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] name = "proptest" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.6.0", + "bitflags 2.5.0", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.8.4", + "regex-syntax 0.8.3", "rusty-fork", "tempfile", "unarray", @@ -6559,7 +6495,7 @@ dependencies = [ name = "proto_array" version = "0.2.0" dependencies = [ - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "safe_arith", "serde", @@ -6658,9 +6594,9 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +checksum = "904e3d3ba178131798c6d9375db2b13b34337d489b089fc5ba0825a2ff1bee73" dependencies = [ "bytes", "futures-io", @@ -6668,7 +6604,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.11", + "rustls 0.23.8", "thiserror", "tokio", "tracing", @@ -6676,15 +6612,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.3" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +checksum = "e974563a4b1c2206bbc61191ca4da9c22e4308b4c455e8906751cc7828393f08" dependencies = [ "bytes", "rand", "ring 0.17.8", "rustc-hash", - "rustls 0.23.11", + "rustls 0.23.8", "slab", "thiserror", "tinyvec", @@ -6693,13 +6629,14 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.4" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +checksum = "e4f0def2590301f4f667db5a77f9694fb004f82796dc1a8b1508fafa3d0e8b72" dependencies = [ "libc", "once_cell", "socket2 0.5.7", + "tracing", "windows-sys 0.52.0", ] @@ -6818,9 +6755,9 @@ dependencies = [ [[package]] name = "redb" -version = "2.1.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6dd20d3cdeb9c7d2366a0b16b93b35b75aec15309fbeb7ce477138c9f68c8c0" +checksum = "ed7508e692a49b6b2290b56540384ccae9b1fb4d77065640b165835b56ffe3bb" dependencies = [ "libc", ] @@ -6845,11 +6782,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", ] [[package]] @@ -6865,14 +6802,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -6886,13 +6823,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.3", ] [[package]] @@ -6903,9 +6840,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" @@ -6921,7 +6858,7 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.28", "hyper-rustls", "hyper-tls", "ipnet", @@ -7086,7 +7023,7 @@ dependencies = [ "ark-ff 0.3.0", "ark-ff 0.4.2", "bytes", - "ethereum_ssz 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum_ssz 0.5.3", "fastrlp", "num-bigint", "num-traits", @@ -7186,7 +7123,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys 0.4.14", @@ -7214,21 +7151,21 @@ dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.4", "subtle", "zeroize", ] [[package]] name = "rustls" -version = "0.23.11" +version = "0.23.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" +checksum = "79adb16721f56eb2d843e67676896a61ce7a0fa622dc18d3e372477a029d2740" dependencies = [ "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.4", "subtle", "zeroize", ] @@ -7270,9 +7207,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -7442,11 +7379,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", @@ -7455,9 +7392,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ "core-foundation-sys", "libc", @@ -7506,9 +7443,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.204" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] @@ -7525,20 +7462,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -7563,7 +7500,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -7603,7 +7540,7 @@ version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ - "darling 0.13.4", + "darling", "proc-macro2", "quote", "syn 1.0.109", @@ -7785,7 +7722,7 @@ dependencies = [ "bincode", "byteorder", "derivative", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "filesystem", "flate2", @@ -8051,8 +7988,8 @@ dependencies = [ "arbitrary", "derivative", "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "itertools 0.10.5", + "ethereum_ssz 0.5.4", + "itertools", "serde", "serde_derive", "smallvec", @@ -8076,11 +8013,11 @@ dependencies = [ "derivative", "env_logger 0.9.3", "ethereum_hashing", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "int_to_bytes", "integer-sqrt", - "itertools 0.10.5", + "itertools", "lazy_static", "lighthouse_metrics", "merkle_proof", @@ -8100,7 +8037,7 @@ name = "state_transition_vectors" version = "0.1.0" dependencies = [ "beacon_chain", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "lazy_static", "state_processing", "tokio", @@ -8120,9 +8057,9 @@ dependencies = [ "beacon_chain", "db-key", "directory", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethereum_ssz_derive", - "itertools 0.10.5", + "itertools", "lazy_static", "leveldb", "lighthouse_metrics", @@ -8184,9 +8121,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.6.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "superstruct" @@ -8194,8 +8131,8 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf0f31f730ad9e579364950e10d6172b4a9bd04b447edf5988b066a860cc340e" dependencies = [ - "darling 0.13.4", - "itertools 0.10.5", + "darling", + "itertools", "proc-macro2", "quote", "smallvec", @@ -8224,9 +8161,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -8253,7 +8190,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -8419,22 +8356,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -8538,9 +8475,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -8553,9 +8490,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.1" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -8581,13 +8518,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -8602,9 +8539,9 @@ dependencies = [ [[package]] name = "tokio-postgres" -version = "0.7.11" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03adcf0147e203b6032c0b2d30be1415ba03bc348901f3ff1cc0df6a733e60c3" +checksum = "d340244b32d920260ae7448cb72b6e238bddc3d4f7603394e7dd46ed8e48f5b8" dependencies = [ "async-trait", "byteorder", @@ -8685,14 +8622,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.15" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.16", + "toml_edit 0.19.15", ] [[package]] @@ -8711,8 +8648,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.2.6", + "serde", + "serde_spanned", "toml_datetime", - "winnow 0.5.40", + "winnow", ] [[package]] @@ -8723,20 +8662,7 @@ checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap 2.2.6", "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" -dependencies = [ - "indexmap 2.2.6", - "serde", - "serde_spanned", - "toml_datetime", - "winnow 0.6.15", + "winnow", ] [[package]] @@ -8799,7 +8725,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -8885,7 +8811,7 @@ name = "tree_hash_derive" version = "0.6.0" source = "git+https://github.com/eserilev/tree_hash?branch=alloy-deps#48ec4bf464168d202902de992df4a95c4c336fd2" dependencies = [ - "darling 0.13.4", + "darling", "quote", "syn 1.0.109", ] @@ -8902,9 +8828,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.13" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" +checksum = "1b2cb4fbb9995eeb36ac86fadf24031ccd58f99d6b4b2d7b911db70bddb80d90" dependencies = [ "serde", "stable_deref_trait", @@ -8940,11 +8866,11 @@ dependencies = [ "ethereum-types 0.14.1", "ethereum_hashing", "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "hex", "int_to_bytes", - "itertools 0.10.5", + "itertools", "kzg", "lazy_static", "log", @@ -9119,9 +9045,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna 0.5.0", @@ -9130,9 +9056,9 @@ dependencies = [ [[package]] name = "utf8parse" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" @@ -9164,8 +9090,8 @@ dependencies = [ "filesystem", "futures", "hex", - "hyper 1.4.1", - "itertools 0.10.5", + "hyper 1.3.1", + "itertools", "lazy_static", "libsecp256k1", "lighthouse_metrics", @@ -9310,7 +9236,7 @@ dependencies = [ "futures-util", "headers", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.28", "log", "mime", "mime_guess", @@ -9381,7 +9307,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -9415,7 +9341,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -9469,7 +9395,7 @@ dependencies = [ "env_logger 0.9.3", "eth2", "http_api", - "hyper 1.4.1", + "hyper 1.3.1", "log", "logging", "network", @@ -9631,7 +9557,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -9658,7 +9584,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.52.5", ] [[package]] @@ -9693,18 +9619,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -9721,9 +9647,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -9739,9 +9665,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -9757,15 +9683,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" [[package]] name = "windows_i686_gnullvm" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -9781,9 +9707,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -9799,9 +9725,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -9817,9 +9743,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -9835,9 +9761,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.6" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" @@ -9848,15 +9774,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winnow" -version = "0.6.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557404e450152cd6795bb558bca69e43c585055f4606e3bcae5894fc6dac9ba0" -dependencies = [ - "memchr", -] - [[package]] name = "winreg" version = "0.50.0" @@ -9947,9 +9864,9 @@ dependencies = [ [[package]] name = "yaml-rust2" -version = "0.8.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8902160c4e6f2fb145dbe9d6760a75e3c9522d8bf796ed7047c85919ac7115f8" +checksum = "498f4d102a79ea1c9d4dd27573c0fc96ad74c023e8da38484e47883076da25fb" dependencies = [ "arraydeque", "encoding_rs", @@ -9973,18 +9890,18 @@ dependencies = [ [[package]] name = "yamux" -version = "0.13.3" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31b5e376a8b012bee9c423acdbb835fc34d45001cfa3106236a624e4b738028" +checksum = "5f97202f6b125031b95d83e01dc57292b529384f80bfae4677e4bbc10178cf72" dependencies = [ "futures", + "instant", "log", "nohash-hasher", "parking_lot 0.12.3", "pin-project", "rand", "static_assertions", - "web-time", ] [[package]] @@ -9998,22 +9915,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -10033,7 +9950,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.66", ] [[package]] @@ -10077,9 +9994,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.12+zstd.1.5.6" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", "pkg-config", diff --git a/beacon_node/beacon_chain/src/test_utils.rs b/beacon_node/beacon_chain/src/test_utils.rs index 6b85d7aadf7..44c392627b1 100644 --- a/beacon_node/beacon_chain/src/test_utils.rs +++ b/beacon_node/beacon_chain/src/test_utils.rs @@ -2621,6 +2621,7 @@ pub fn generate_rand_block_and_blobs( let inner = map_fork_name!(fork_name, BeaconBlock, <_>::random_for_test(rng)); let mut block = SignedBeaconBlock::from_block(inner, types::Signature::random_for_test(rng)); + let mut blob_sidecars = vec![]; let bundle = match block { diff --git a/consensus/merkle_proof/src/lib.rs b/consensus/merkle_proof/src/lib.rs index dc99ecfa5b7..aa02bb7a731 100644 --- a/consensus/merkle_proof/src/lib.rs +++ b/consensus/merkle_proof/src/lib.rs @@ -17,7 +17,10 @@ impl FixedBytesExtended for FixedBytes { let mut buffer = [0x0; N]; let bytes_to_copy = value_bytes.len().min(buffer.len()); // Panic-free because bytes_to_copy <= buffer.len() - let start_index = buffer.len().safe_sub(bytes_to_copy).expect("bytes_to_copy <= buffer.len()"); + let start_index = buffer + .len() + .safe_sub(bytes_to_copy) + .expect("bytes_to_copy <= buffer.len()"); // Panic-free because start_index <= buffer.len() // and bytes_to_copy <= value_bytes.len() buffer diff --git a/consensus/types/src/beacon_state.rs b/consensus/types/src/beacon_state.rs index 760e86ed242..092f412f192 100644 --- a/consensus/types/src/beacon_state.rs +++ b/consensus/types/src/beacon_state.rs @@ -1,6 +1,6 @@ use self::committee_cache::get_active_validator_indices; -use crate::historical_summary::HistoricalSummary; use crate::fixed_bytes::FixedBytesExtended; +use crate::historical_summary::HistoricalSummary; use crate::test_utils::TestRandom; use crate::*; use compare_fields::CompareFields; @@ -2220,7 +2220,11 @@ impl BeaconState { .get_mut(validator_index) .ok_or(Error::UnknownValidator(validator_index))?; if validator.has_eth1_withdrawal_credential(spec) { - *validator.withdrawal_credentials.as_mut_slice().to_owned().get_mut(0) + *validator + .withdrawal_credentials + .as_mut_slice() + .to_owned() + .get_mut(0) .ok_or(Error::UnknownValidator(validator_index))? = spec.compounding_withdrawal_prefix_byte; self.queue_excess_active_balance(validator_index, spec)?; diff --git a/consensus/types/src/fixed_bytes.rs b/consensus/types/src/fixed_bytes.rs index 140e0c1a97a..6f9b867e751 100644 --- a/consensus/types/src/fixed_bytes.rs +++ b/consensus/types/src/fixed_bytes.rs @@ -13,7 +13,10 @@ impl FixedBytesExtended for FixedBytes { let mut buffer = [0x0; N]; let bytes_to_copy = value_bytes.len().min(buffer.len()); // Panic-free because bytes_to_copy <= buffer.len() - let start_index = buffer.len().safe_sub(bytes_to_copy).expect("byte_to_copy <= buffer.len()"); + let start_index = buffer + .len() + .safe_sub(bytes_to_copy) + .expect("byte_to_copy <= buffer.len()"); // Panic-free because start_index <= buffer.len() // and bytes_to_copy <= value_bytes.len() buffer diff --git a/consensus/types/src/graffiti.rs b/consensus/types/src/graffiti.rs index 036c1f1ba82..08f8573c6d1 100644 --- a/consensus/types/src/graffiti.rs +++ b/consensus/types/src/graffiti.rs @@ -87,7 +87,6 @@ impl From for Graffiti { // Copy the provided bytes over. // // Panic-free because `graffiti_bytes.len()` <= `GRAFFITI_BYTES_LEN`. - // TODO(alloy) review why this was no longer panic free w/o my changes graffiti .get_mut(..graffiti_len) .expect("graffiti_len <= GRAFFITI_BYTES_LEN") @@ -185,6 +184,6 @@ impl TreeHash for Graffiti { impl TestRandom for Graffiti { fn random_for_test(rng: &mut impl RngCore) -> Self { - Self::from(GraffitiString(Hash256::random_for_test(rng).to_string())) + Self::from(Hash256::random_for_test(rng).0) } } diff --git a/crypto/bls/src/lib.rs b/crypto/bls/src/lib.rs index e5752dd7334..5ae068f865a 100644 --- a/crypto/bls/src/lib.rs +++ b/crypto/bls/src/lib.rs @@ -59,7 +59,10 @@ impl FixedBytesExtended for FixedBytes { let mut buffer = [0x0; N]; let bytes_to_copy = value_bytes.len().min(buffer.len()); // Panic-free because bytes_to_copy <= buffer.len() - let start_index = buffer.len().safe_sub(bytes_to_copy).expect("bytes_to_copy <= buffer.len()"); + let start_index = buffer + .len() + .safe_sub(bytes_to_copy) + .expect("bytes_to_copy <= buffer.len()"); // Panic-free because start_index <= buffer.len() // and bytes_to_copy <= value_bytes.len() buffer diff --git a/validator_client/src/initialized_validators.rs b/validator_client/src/initialized_validators.rs index b553363f931..c94115e5ec5 100644 --- a/validator_client/src/initialized_validators.rs +++ b/validator_client/src/initialized_validators.rs @@ -382,16 +382,12 @@ pub fn load_pkcs12_identity>( password: &str, ) -> Result { let mut buf = Vec::new(); - println!("password {}", password); File::open(&pkcs12_path) .map_err(Error::InvalidWeb3SignerClientIdentityCertificateFile)? .read_to_end(&mut buf) .map_err(Error::InvalidWeb3SignerClientIdentityCertificateFile)?; - println!("1"); - let x = Identity::from_pkcs12_der(&buf, password) - .map_err(Error::InvalidWeb3SignerClientIdentityCertificate); - println!("2"); - x + Identity::from_pkcs12_der(&buf, password) + .map_err(Error::InvalidWeb3SignerClientIdentityCertificate) } fn build_web3_signer_url(base_url: &str, voting_public_key: &PublicKey) -> Result { From 45acf6abe55bc0ef883db3c5be4bcf0a244b38d7 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Tue, 23 Jul 2024 17:39:00 -0700 Subject: [PATCH 32/62] fmt --- beacon_node/beacon_chain/src/test_utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon_node/beacon_chain/src/test_utils.rs b/beacon_node/beacon_chain/src/test_utils.rs index 44c392627b1..ac0c75fd30b 100644 --- a/beacon_node/beacon_chain/src/test_utils.rs +++ b/beacon_node/beacon_chain/src/test_utils.rs @@ -2621,7 +2621,7 @@ pub fn generate_rand_block_and_blobs( let inner = map_fork_name!(fork_name, BeaconBlock, <_>::random_for_test(rng)); let mut block = SignedBeaconBlock::from_block(inner, types::Signature::random_for_test(rng)); - + let mut blob_sidecars = vec![]; let bundle = match block { From 4d2c553d75582f499a8ffb794fa9f0330a97b68e Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Tue, 23 Jul 2024 18:35:16 -0700 Subject: [PATCH 33/62] fix ef test --- consensus/types/src/beacon_state.rs | 8 ++------ testing/ef_tests/src/cases/epoch_processing.rs | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/consensus/types/src/beacon_state.rs b/consensus/types/src/beacon_state.rs index 092f412f192..6fc65d13cb8 100644 --- a/consensus/types/src/beacon_state.rs +++ b/consensus/types/src/beacon_state.rs @@ -2220,13 +2220,9 @@ impl BeaconState { .get_mut(validator_index) .ok_or(Error::UnknownValidator(validator_index))?; if validator.has_eth1_withdrawal_credential(spec) { - *validator - .withdrawal_credentials - .as_mut_slice() - .to_owned() - .get_mut(0) - .ok_or(Error::UnknownValidator(validator_index))? = + AsMut::<[u8; 32]>::as_mut(&mut validator.withdrawal_credentials)[0] = spec.compounding_withdrawal_prefix_byte; + self.queue_excess_active_balance(validator_index, spec)?; } Ok(()) diff --git a/testing/ef_tests/src/cases/epoch_processing.rs b/testing/ef_tests/src/cases/epoch_processing.rs index dfd782a22b3..7a292af6401 100644 --- a/testing/ef_tests/src/cases/epoch_processing.rs +++ b/testing/ef_tests/src/cases/epoch_processing.rs @@ -201,6 +201,7 @@ impl EpochTransition for PendingBalanceDeposits { } } +// TODO(alloy) test fails here impl EpochTransition for PendingConsolidations { fn run(state: &mut BeaconState, spec: &ChainSpec) -> Result<(), EpochProcessingError> { initialize_epoch_cache(state, spec)?; From 4e6c04f34c4852984cd3ee4dbf8db239d62377b9 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Tue, 23 Jul 2024 21:31:01 -0700 Subject: [PATCH 34/62] remove udep and revert cert --- Cargo.lock | 10 -- Cargo.toml | 1 - .../execution_engine_integration/Cargo.toml | 1 - .../web3signer_tests/tls/lighthouse/cert.pem | 52 ++++----- .../web3signer_tests/tls/lighthouse/key.key | 100 +++++++++--------- .../web3signer_tests/tls/lighthouse/key.p12 | Bin 4387 -> 4371 bytes .../tls/lighthouse/web3signer.pem | 52 ++++----- 7 files changed, 102 insertions(+), 114 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4f9825785c8..90960b9ce05 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -188,15 +188,6 @@ dependencies = [ "c-kzg", ] -[[package]] -name = "alloy-core" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "529fc6310dc1126c8de51c376cbc59c79c7f662bd742be7dc67055d5421a81b4" -dependencies = [ - "alloy-primitives", -] - [[package]] name = "alloy-eips" version = "0.2.0" @@ -2858,7 +2849,6 @@ dependencies = [ name = "execution_engine_integration" version = "0.1.0" dependencies = [ - "alloy-core", "async-channel", "deposit_contract", "ethers-core", diff --git a/Cargo.toml b/Cargo.toml index ecb0e6e37b6..57eb86f8c23 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,7 +95,6 @@ edition = "2021" [workspace.dependencies] alloy-primitives = "0.7.7" -alloy-core = "0.7.7" alloy-rlp = "0.3.4" alloy-consensus = "0.2.0" anyhow = "1" diff --git a/testing/execution_engine_integration/Cargo.toml b/testing/execution_engine_integration/Cargo.toml index ce40d9738a2..159561d5dd8 100644 --- a/testing/execution_engine_integration/Cargo.toml +++ b/testing/execution_engine_integration/Cargo.toml @@ -4,7 +4,6 @@ version = "0.1.0" edition = { workspace = true } [dependencies] -alloy-core = { workspace = true } async-channel = { workspace = true } tempfile = { workspace = true } serde_json = { workspace = true } diff --git a/testing/web3signer_tests/tls/lighthouse/cert.pem b/testing/web3signer_tests/tls/lighthouse/cert.pem index 05d165e6956..24b0a2e5c0e 100644 --- a/testing/web3signer_tests/tls/lighthouse/cert.pem +++ b/testing/web3signer_tests/tls/lighthouse/cert.pem @@ -1,33 +1,33 @@ -----BEGIN CERTIFICATE----- -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 -----END CERTIFICATE----- diff --git a/testing/web3signer_tests/tls/lighthouse/key.key b/testing/web3signer_tests/tls/lighthouse/key.key index f3979591f64..d00b6c21229 100644 --- a/testing/web3signer_tests/tls/lighthouse/key.key +++ b/testing/web3signer_tests/tls/lighthouse/key.key @@ -1,52 +1,52 @@ -----BEGIN PRIVATE KEY----- -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 -Uelq7j42hK56C+TjqwVYnsEyoS2q +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 +vc3Za4ClKSLmb3ZA9giTswYMev+3BQ== -----END PRIVATE KEY----- diff --git a/testing/web3signer_tests/tls/lighthouse/key.p12 b/testing/web3signer_tests/tls/lighthouse/key.p12 index 58fa8fbd9f41c075f02f6a31d3778120894d3a69..73468fa084b6f5f1b036afd643967e361d004fc4 100644 GIT binary patch literal 4371 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 literal 4387 zcmai&XE+-S_r{5c8bMmMSM3^=sIB%aDQcIh8MF3YMT}adM$Do{sa1-K*wjvG?Nxin zrbeZB`(FS5^*kTn59d19x$h6>eEZ$kfg&Mn074=tl6nF}${(!}eGVohA$*Ud?gb*L zyZ*{;P$a1QUkmge3Cj5^WdH~X{=S-DbKg=UluNeGUQUG} zLG0k^nYApc?|XXR1!Gy5?U*(AYh4;gZ}X+;YpyRI)@HJ+(aSll2Umj{pqSj92BA;1 zCh3N;po5=a!RzU5ne!nz^jX3O{f-A*(kFGDM)Mb*gd*oZytVmFjmA@LRw0htIJrmM z#TGhb1nKb2>bRfxZDAuKc^=8W(u`RcSe|m{V1SgR+C|qjv#ZCeiRHPo9%{@=#d(C~ zA@NMJKKo^VNo!+;tHAH}pmBxHGqoiU#a$Hb9C}`8VsLUp)BVL#;BGb@#=tPa@yh28 z)f>wl6z}wH#~nJ9Z(-4zFP#JDA8R#JmQAq4V$Du4uXlv^4cO*H0|xzsPicb_͟ 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 Qi>t0OlRG5`@!zQTAH@_(^Z)<= diff --git a/testing/web3signer_tests/tls/lighthouse/web3signer.pem b/testing/web3signer_tests/tls/lighthouse/web3signer.pem index 4505be85f5e..6266cadf9bc 100644 --- a/testing/web3signer_tests/tls/lighthouse/web3signer.pem +++ b/testing/web3signer_tests/tls/lighthouse/web3signer.pem @@ -1,33 +1,33 @@ -----BEGIN CERTIFICATE----- -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 -----END CERTIFICATE----- From 7d4e8772196f21fcfca36b5dd3d43e8e0f2d0a77 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Wed, 24 Jul 2024 06:00:19 -0700 Subject: [PATCH 35/62] cargo patch --- Cargo.lock | 34 +++++++++++----------------------- Cargo.toml | 5 ++++- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 90960b9ce05..f083e1efbb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -791,7 +791,7 @@ dependencies = [ "eth2", "eth2_network_config", "ethereum_hashing", - "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "execution_layer", @@ -1016,7 +1016,7 @@ dependencies = [ "arbitrary", "blst", "ethereum_hashing", - "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4", "hex", "rand", @@ -2410,7 +2410,7 @@ dependencies = [ "account_utils", "bytes", "eth2_keystore", - "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "futures", @@ -2639,18 +2639,6 @@ dependencies = [ "sha2 0.10.8", ] -[[package]] -name = "ethereum_serde_utils" -version = "0.5.2" -source = "git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy#d62af01f0c240706bec464113094137e0e12e294" -dependencies = [ - "alloy-primitives", - "hex", - "serde", - "serde_derive", - "serde_json", -] - [[package]] name = "ethereum_serde_utils" version = "0.5.2" @@ -2881,7 +2869,7 @@ dependencies = [ "environment", "eth2", "eth2_network_config", - "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4", "ethers-core", "fork_choice", @@ -3752,7 +3740,7 @@ dependencies = [ "environment", "eth1", "eth2", - "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4", "execution_layer", "futures", @@ -4317,7 +4305,7 @@ dependencies = [ "c-kzg", "derivative", "ethereum_hashing", - "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "hex", @@ -7720,7 +7708,7 @@ name = "slashing_protection" version = "0.1.0" dependencies = [ "arbitrary", - "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "filesystem", "lazy_static", "r2d2", @@ -7936,7 +7924,7 @@ source = "git+https://github.com/eserilev/ssz_types?branch=alloy-tweaks#2adab87c dependencies = [ "arbitrary", "derivative", - "ethereum_serde_utils 0.5.2 (git+https://github.com/sigp/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4", "itertools", "serde", @@ -8812,7 +8800,7 @@ dependencies = [ "derivative", "eth2_interop_keypairs", "ethereum_hashing", - "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "ethereum_ssz 0.5.4", "ethereum_ssz_derive", "hex", @@ -9032,7 +9020,7 @@ dependencies = [ "environment", "eth2", "eth2_keystore", - "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "fdlimit", "filesystem", "futures", @@ -9102,7 +9090,7 @@ dependencies = [ "eth2", "eth2_network_config", "eth2_wallet", - "ethereum_serde_utils 0.5.2 (git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy)", + "ethereum_serde_utils", "hex", "regex", "serde", diff --git a/Cargo.toml b/Cargo.toml index 57eb86f8c23..e7850f1f368 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,7 +118,7 @@ discv5 = { version = "0.4.1", features = ["libp2p"] } env_logger = "0.9" error-chain = "0.12" ethereum_hashing = "0.6.0" -ethereum_serde_utils = { git = "https://github.com/eserilev/ethereum_serde_utils", branch = "alloy"} +ethereum_serde_utils = "0.5.2" ethereum_ssz = { git = "https://github.com/sigp/ethereum_ssz", branch = "alloy" } ethereum_ssz_derive = { git = "https://github.com/sigp/ethereum_ssz", branch = "alloy" } ethers-core = "1" @@ -245,3 +245,6 @@ inherits = "release" lto = "fat" codegen-units = 1 incremental = false + +[patch.crates-io] +ethereum_serde_utils = { git = "https://github.com/sigp/ethereum_serde_utils", branch = "alloy"} \ No newline at end of file From 486fb17617e9e062b5fd515ec2de2b16b7585a47 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Wed, 24 Jul 2024 17:54:45 -0700 Subject: [PATCH 36/62] fix build error --- Cargo.toml | 8 ++++---- output.txt | 0 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 output.txt diff --git a/Cargo.toml b/Cargo.toml index a556d77277e..4e4319cd56a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -119,8 +119,8 @@ env_logger = "0.9" error-chain = "0.12" ethereum_hashing = "0.6.0" ethereum_serde_utils = "0.5.2" -ethereum_ssz = "0.5" -ethereum_ssz_derive = "0.5" +ethereum_ssz = { git = "https://github.com/eserilev/ethereum_ssz", branch = "alloy" } +ethereum_ssz_derive = { git = "https://github.com/eserilev/ethereum_ssz", branch = "alloy" } ethers-core = "1" ethers-providers = { version = "1", default-features = false } exit-future = "0.2" @@ -247,8 +247,8 @@ codegen-units = 1 incremental = false [patch.crates-io] -ethereum_ssz = { git = "https://github.com/eserilev/ethereum_ssz", branch = "alloy" } -ethereum_ssz_derive = { git = "https://github.com/eserilev/ethereum_ssz", branch = "alloy" } +# ethereum_ssz = { git = "https://github.com/eserilev/ethereum_ssz", branch = "alloy" } +# ethereum_ssz_derive = { git = "https://github.com/eserilev/ethereum_ssz", branch = "alloy" } ethereum_serde_utils = { git = "https://github.com/eserilev/ethereum_serde_utils", branch = "alloy"} ssz_types = { git = "https://github.com/eserilev/ssz_types", branch = "alloy-tweaks" } tree_hash = { git = "https://github.com/eserilev/tree_hash", branch = "alloy-deps"} diff --git a/output.txt b/output.txt new file mode 100644 index 00000000000..e69de29bb2d From a308c2ff5e9f3c3fdb53a05405b68e072650460a Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Fri, 26 Jul 2024 17:48:22 -0700 Subject: [PATCH 37/62] resolve conflicts, update deps --- Cargo.lock | 194 ++++++++---------- Cargo.toml | 18 +- beacon_node/lighthouse_network/Cargo.toml | 1 + .../src/discovery/subnet_predicate.rs | 3 +- consensus/types/src/data_column_subnet_id.rs | 12 +- 5 files changed, 97 insertions(+), 131 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81f52ec6767..2afee722316 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -274,9 +274,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", @@ -289,33 +289,33 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -793,7 +793,7 @@ dependencies = [ "ethereum_hashing", "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "execution_layer", "fork_choice", "futures", @@ -835,7 +835,7 @@ dependencies = [ "tempfile", "tokio", "tokio-stream", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "tree_hash_derive", "types", ] @@ -1022,7 +1022,7 @@ dependencies = [ "rand", "safe_arith", "serde", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "zeroize", ] @@ -1323,9 +1323,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.10" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6b81fb3c84f5563d509c59b5a48d935f689e993afa90fe39047f05adef9142" +checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3" dependencies = [ "clap_builder", "clap_derive", @@ -1333,9 +1333,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.10" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca6706fd5224857d9ac5eb9355f6683563cc0541c7cd9d014043b57cbec78ac" +checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa" dependencies = [ "anstream", "anstyle", @@ -1346,9 +1346,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.8" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" +checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -1358,9 +1358,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "clap_utils" @@ -1430,9 +1430,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "compare_fields" @@ -1893,7 +1893,7 @@ dependencies = [ "reqwest", "serde_json", "sha2 0.9.9", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", ] @@ -2225,7 +2225,7 @@ dependencies = [ "derivative", "eth2_network_config", "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "execution_layer", "fork_choice", "fs2", @@ -2240,7 +2240,7 @@ dependencies = [ "snap", "state_processing", "swap_or_not_shuffle", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "tree_hash_derive", "types", ] @@ -2417,7 +2417,7 @@ dependencies = [ "eth1_test_rig", "eth2", "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "execution_layer", "futures", "lazy_static", @@ -2433,7 +2433,7 @@ dependencies = [ "superstruct", "task_executor", "tokio", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", ] @@ -2461,7 +2461,7 @@ dependencies = [ "eth2_keystore", "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "futures", "futures-util", "libsecp256k1", @@ -2691,7 +2691,7 @@ dependencies = [ [[package]] name = "ethereum_serde_utils" version = "0.5.2" -source = "git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy#d62af01f0c240706bec464113094137e0e12e294" +source = "git+https://github.com/eserilev/ethereum_serde_utils?branch=alloy#acc7839e7e26eb29c2bffafc5d372928e27e823c" dependencies = [ "alloy-primitives", "hex", @@ -2714,17 +2714,7 @@ dependencies = [ [[package]] name = "ethereum_ssz" version = "0.5.4" -source = "git+https://github.com/eserilev/ethereum_ssz?branch=alloy#1022d0e892bfd253cd631188964b009d18e6d72e" -dependencies = [ - "alloy-primitives", - "itertools 0.10.5", - "smallvec", -] - -[[package]] -name = "ethereum_ssz" -version = "0.5.4" -source = "git+https://github.com/sigp/ethereum_ssz?branch=alloy#0c88b6c43b5e2997d246e17165c8d3f190b2a61f" +source = "git+https://github.com/eserilev/ethereum_ssz?branch=alloy#078f5b8b204b6190eabff6876eb4b1467ad835f4" dependencies = [ "alloy-primitives", "itertools 0.10.5", @@ -2734,18 +2724,7 @@ dependencies = [ [[package]] name = "ethereum_ssz_derive" version = "0.5.4" -source = "git+https://github.com/eserilev/ethereum_ssz?branch=alloy#1022d0e892bfd253cd631188964b009d18e6d72e" -dependencies = [ - "darling 0.13.4", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ethereum_ssz_derive" -version = "0.5.4" -source = "git+https://github.com/sigp/ethereum_ssz?branch=alloy#0c88b6c43b5e2997d246e17165c8d3f190b2a61f" +source = "git+https://github.com/eserilev/ethereum_ssz?branch=alloy#078f5b8b204b6190eabff6876eb4b1467ad835f4" dependencies = [ "darling 0.13.4", "proc-macro2", @@ -2970,7 +2949,7 @@ dependencies = [ "tempfile", "tokio", "tokio-stream", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "tree_hash_derive", "triehash", "types", @@ -3140,7 +3119,7 @@ version = "0.1.0" dependencies = [ "beacon_chain", "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "proto_array", "slog", "state_processing", @@ -3355,7 +3334,7 @@ dependencies = [ "slog", "state_processing", "tokio", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", ] @@ -3845,7 +3824,7 @@ dependencies = [ "task_executor", "tokio", "tokio-stream", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", "warp", "warp_utils", @@ -4235,9 +4214,9 @@ dependencies = [ [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -4392,10 +4371,10 @@ dependencies = [ "ethereum_hashing", "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "hex", "serde", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", ] [[package]] @@ -4443,7 +4422,7 @@ dependencies = [ "snap", "state_processing", "store", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", "validator_dir", ] @@ -5037,6 +5016,7 @@ dependencies = [ name = "lighthouse_network" version = "0.2.0" dependencies = [ + "alloy-primitives", "async-channel", "bytes", "delay_map", @@ -5046,7 +5026,7 @@ dependencies = [ "either", "error-chain", "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "fnv", "futures", "gossipsub", @@ -5346,7 +5326,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd01039851e82f8799046eabbb354056283fb265c8ec0996af940f4e85a380ff" dependencies = [ "serde", - "toml 0.8.15", + "toml 0.8.16", ] [[package]] @@ -5363,20 +5343,20 @@ dependencies = [ [[package]] name = "milhouse" version = "0.1.0" -source = "git+https://github.com/eserilev/milhouse?branch=alloy#bf532ed1108664ec5059bfcbbe4b85115613422d" +source = "git+https://github.com/eserilev/milhouse?branch=alloy#fa68baa2996746493a0921181dd81f92688faef0" dependencies = [ "alloy-primitives", "arbitrary", "derivative", "ethereum_hashing", - "ethereum_ssz 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/sigp/ethereum_ssz?branch=alloy)", + "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "itertools 0.10.5", "parking_lot 0.12.3", "rayon", "serde", "smallvec", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "triomphe", "typenum", "vec_map", @@ -5917,7 +5897,7 @@ dependencies = [ "bitvec 1.0.1", "derivative", "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "itertools 0.10.5", "lazy_static", "lighthouse_metrics", @@ -6520,7 +6500,7 @@ name = "proto_array" version = "0.2.0" dependencies = [ "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "safe_arith", "serde", "serde_yaml", @@ -7046,7 +7026,6 @@ dependencies = [ "ark-ff 0.3.0", "ark-ff 0.4.2", "bytes", - "ethereum_ssz 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "fastrlp", "num-bigint", "num-traits", @@ -7528,9 +7507,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -7746,7 +7725,7 @@ dependencies = [ "byteorder", "derivative", "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "filesystem", "flate2", "lazy_static", @@ -7767,7 +7746,7 @@ dependencies = [ "ssz_types", "strum", "tempfile", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "tree_hash_derive", "types", ] @@ -8006,17 +7985,17 @@ dependencies = [ [[package]] name = "ssz_types" version = "0.6.0" -source = "git+https://github.com/eserilev/ssz_types?branch=alloy-tweaks#39e9fe8ab5fa22edafbc853fc3e165d0f01c7180" +source = "git+https://github.com/eserilev/ssz_types?branch=alloy-tweaks#fc42634d4638e77ea5c281786d0f59b035293088" dependencies = [ "arbitrary", "derivative", "ethereum_serde_utils", - "ethereum_ssz 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", "itertools 0.10.5", "serde", "serde_derive", "smallvec", - "tree_hash 0.6.0 (git+https://github.com/sigp/tree_hash?branch=alloy)", + "tree_hash", "typenum", ] @@ -8037,7 +8016,7 @@ dependencies = [ "env_logger 0.9.3", "ethereum_hashing", "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "int_to_bytes", "integer-sqrt", "itertools 0.10.5", @@ -8051,7 +8030,7 @@ dependencies = [ "ssz_types", "test_random_derive", "tokio", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", ] @@ -8081,7 +8060,7 @@ dependencies = [ "db-key", "directory", "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "itertools 0.10.5", "lazy_static", "leveldb", @@ -8644,21 +8623,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" +checksum = "81967dd0dd2c1ab0bc3468bd7caecc32b8a4aa47d0c8c695d8c2b2108168d62c" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.16", + "toml_edit 0.22.17", ] [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "f8fb9f64314842840f1d940ac544da178732128f1c78c21772e876579e0da1db" dependencies = [ "serde", ] @@ -8687,15 +8666,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.16" +version = "0.22.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" +checksum = "8d9f8729f5aea9562aac1cc0441f5d6de3cff1ee0c5d67293eeca5eb36ee7c16" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.15", + "winnow 0.6.16", ] [[package]] @@ -8832,17 +8811,7 @@ dependencies = [ [[package]] name = "tree_hash" version = "0.6.0" -source = "git+https://github.com/sigp/tree_hash?branch=alloy#0df21e420154c4c8e300a8e7afddcf6aac54bd93" -dependencies = [ - "alloy-primitives", - "ethereum_hashing", - "smallvec", -] - -[[package]] -name = "tree_hash" -version = "0.6.0" -source = "git+https://github.com/eserilev/tree_hash?branch=alloy-deps#48ec4bf464168d202902de992df4a95c4c336fd2" +source = "git+https://github.com/eserilev/tree_hash?branch=alloy-deps#bff906186482f2570ecb2a4359e42e713a3ce6d8" dependencies = [ "alloy-primitives", "ethereum_hashing", @@ -8852,11 +8821,12 @@ dependencies = [ [[package]] name = "tree_hash_derive" version = "0.6.0" -source = "git+https://github.com/eserilev/tree_hash?branch=alloy-deps#a96b9f7e1910e15bd3a39db011f560f2063b3c34" +source = "git+https://github.com/eserilev/tree_hash?branch=alloy-deps#bff906186482f2570ecb2a4359e42e713a3ce6d8" dependencies = [ - "darling 0.13.4", + "darling 0.20.10", + "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] @@ -8908,7 +8878,7 @@ dependencies = [ "ethereum_hashing", "ethereum_serde_utils", "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", - "ethereum_ssz_derive 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz_derive", "hex", "int_to_bytes", "itertools 0.10.5", @@ -8940,7 +8910,7 @@ dependencies = [ "tempfile", "test_random_derive", "tokio", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "tree_hash_derive", ] @@ -9159,7 +9129,7 @@ dependencies = [ "tempfile", "tokio", "tokio-stream", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", "url", "validator_dir", @@ -9181,7 +9151,7 @@ dependencies = [ "lockfile", "rand", "tempfile", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", ] @@ -9203,7 +9173,7 @@ dependencies = [ "serde_json", "tempfile", "tokio", - "tree_hash 0.6.0 (git+https://github.com/eserilev/tree_hash?branch=alloy-deps)", + "tree_hash", "types", "validator_client", ] @@ -9228,9 +9198,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "void" @@ -9817,9 +9787,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.15" +version = "0.6.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557404e450152cd6795bb558bca69e43c585055f4606e3bcae5894fc6dac9ba0" +checksum = "b480ae9340fc261e6be3e95a1ba86d54ae3f9171132a73ce8d4bbaf68339507c" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 4e4319cd56a..4618fa9b063 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,7 +118,7 @@ discv5 = { version = "0.4.1", features = ["libp2p"] } env_logger = "0.9" error-chain = "0.12" ethereum_hashing = "0.6.0" -ethereum_serde_utils = "0.5.2" +ethereum_serde_utils = { git = "https://github.com/eserilev/ethereum_serde_utils", branch = "alloy"} ethereum_ssz = { git = "https://github.com/eserilev/ethereum_ssz", branch = "alloy" } ethereum_ssz_derive = { git = "https://github.com/eserilev/ethereum_ssz", branch = "alloy" } ethers-core = "1" @@ -162,7 +162,7 @@ slog-term = "2" sloggers = { version = "2", features = ["json"] } smallvec = { version = "1.11.2", features = ["arbitrary"] } snap = "1" -ssz_types = "0.6" +ssz_types = { git = "https://github.com/eserilev/ssz_types", branch = "alloy-tweaks" } strum = { version = "0.24", features = ["derive"] } superstruct = "0.8" syn = "1" @@ -176,8 +176,8 @@ tracing-appender = "0.2" tracing-core = "0.1" tracing-log = "0.2" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -tree_hash = "0.6" -tree_hash_derive = "0.6" +tree_hash = { git = "https://github.com/eserilev/tree_hash", branch = "alloy-deps"} +tree_hash_derive = { git = "https://github.com/eserilev/tree_hash", branch = "alloy-deps"} url = "2" uuid = { version = "0.8", features = ["serde", "v4"] } warp = { version = "0.3.7", default-features = false, features = ["tls"] } @@ -244,12 +244,4 @@ warp_utils = { path = "common/warp_utils" } inherits = "release" lto = "fat" codegen-units = 1 -incremental = false - -[patch.crates-io] -# ethereum_ssz = { git = "https://github.com/eserilev/ethereum_ssz", branch = "alloy" } -# ethereum_ssz_derive = { git = "https://github.com/eserilev/ethereum_ssz", branch = "alloy" } -ethereum_serde_utils = { git = "https://github.com/eserilev/ethereum_serde_utils", branch = "alloy"} -ssz_types = { git = "https://github.com/eserilev/ssz_types", branch = "alloy-tweaks" } -tree_hash = { git = "https://github.com/eserilev/tree_hash", branch = "alloy-deps"} -tree_hash_derive = { git = "https://github.com/eserilev/tree_hash", branch = "alloy-deps"} \ No newline at end of file +incremental = false \ No newline at end of file diff --git a/beacon_node/lighthouse_network/Cargo.toml b/beacon_node/lighthouse_network/Cargo.toml index 3dfa24d467b..6bc2a4abe1c 100644 --- a/beacon_node/lighthouse_network/Cargo.toml +++ b/beacon_node/lighthouse_network/Cargo.toml @@ -5,6 +5,7 @@ authors = ["Sigma Prime "] edition = { workspace = true } [dependencies] +alloy-primitives = { workspace = true} discv5 = { workspace = true } gossipsub = { workspace = true } unsigned-varint = { version = "0.8", features = ["codec"] } diff --git a/beacon_node/lighthouse_network/src/discovery/subnet_predicate.rs b/beacon_node/lighthouse_network/src/discovery/subnet_predicate.rs index b53afe556db..bb78afa317c 100644 --- a/beacon_node/lighthouse_network/src/discovery/subnet_predicate.rs +++ b/beacon_node/lighthouse_network/src/discovery/subnet_predicate.rs @@ -1,6 +1,7 @@ //! The subnet predicate used for searching for a particular subnet. use super::*; use crate::types::{EnrAttestationBitfield, EnrSyncCommitteeBitfield}; +use alloy_primitives::U256; use itertools::Itertools; use slog::trace; use std::ops::Deref; @@ -41,7 +42,7 @@ where .map_or(false, |b| b.get(*s.deref() as usize).unwrap_or(false)), Subnet::DataColumn(s) => { let mut subnets = DataColumnSubnetId::compute_custody_subnets::( - enr.node_id().raw().into(), + U256::from_le_slice(enr.node_id().raw().as_slice()), custody_subnet_count, &spec, ); diff --git a/consensus/types/src/data_column_subnet_id.rs b/consensus/types/src/data_column_subnet_id.rs index dd58c6c36b4..915f9180066 100644 --- a/consensus/types/src/data_column_subnet_id.rs +++ b/consensus/types/src/data_column_subnet_id.rs @@ -1,7 +1,7 @@ //! Identifies each data column subnet by an integer identifier. use crate::data_column_sidecar::ColumnIndex; use crate::{ChainSpec, EthSpec}; -use ethereum_types::U256; +use alloy_primitives::U256; use itertools::Itertools; use safe_arith::{ArithError, SafeArith}; use serde::{Deserialize, Serialize}; @@ -49,7 +49,7 @@ impl DataColumnSubnetId { let mut current_id = node_id; while (subnets.len() as u64) < custody_subnet_count { let mut node_id_bytes = [0u8; 32]; - current_id.to_little_endian(&mut node_id_bytes); + node_id_bytes.copy_from_slice(current_id.as_le_slice()); let hash = ethereum_hashing::hash_fixed(&node_id_bytes); let hash_prefix: [u8; 8] = hash[0..8] .try_into() @@ -62,9 +62,9 @@ impl DataColumnSubnetId { } if current_id == U256::MAX { - current_id = U256::zero() + current_id = U256::ZERO } - current_id += U256::one() + current_id += U256::from(1u64) } subnets.into_iter().map(DataColumnSubnetId::new) } @@ -131,6 +131,8 @@ impl From for Error { #[cfg(test)] mod test { + use alloy_primitives::U256; + use crate::data_column_subnet_id::DataColumnSubnetId; use crate::EthSpec; use crate::MainnetEthSpec; @@ -153,7 +155,7 @@ mod test { "103822458477361691467064888613019442068586830412598673713899771287914656699997", ] .into_iter() - .map(|v| ethereum_types::U256::from_dec_str(v).unwrap()) + .map(|v| U256::from_str_radix(v, 10).unwrap()) .collect::>(); let custody_requirement = 4; From 959ad7ab52f6af62001ce5c180cef43cb13b9943 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 29 Jul 2024 16:02:41 -0700 Subject: [PATCH 38/62] fmt --- consensus/merkle_proof/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/consensus/merkle_proof/src/lib.rs b/consensus/merkle_proof/src/lib.rs index 2587d0a228d..015afb55569 100644 --- a/consensus/merkle_proof/src/lib.rs +++ b/consensus/merkle_proof/src/lib.rs @@ -1,7 +1,7 @@ use alloy_primitives::FixedBytes; use ethereum_hashing::{hash, hash32_concat, ZERO_HASHES}; -use std::sync::LazyLock; use safe_arith::{ArithError, SafeArith}; +use std::sync::LazyLock; type H256 = alloy_primitives::B256; @@ -56,7 +56,6 @@ impl FixedBytesExtended for FixedBytes { } } - const MAX_TREE_DEPTH: usize = 32; const EMPTY_SLICE: &[H256] = &[]; From 1c4c1fa39cabae9acda1beb09ed36c76be3b2171 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Tue, 30 Jul 2024 09:12:40 -0700 Subject: [PATCH 39/62] fix deps --- Cargo.lock | 115 ++++++++++++++++++++++++----------------------------- Cargo.toml | 26 ++++++++---- 2 files changed, 71 insertions(+), 70 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 05a67d86b95..96a5d9eabe3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -205,8 +205,7 @@ dependencies = [ [[package]] name = "alloy-primitives" version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" +source = "git+https://github.com/eserilev/core?branch=remove-ethereum-ssz-dep#c9a4f5fe258a760ccf274a38b6b6f5076b2e81b4" dependencies = [ "alloy-rlp", "arbitrary", @@ -215,7 +214,6 @@ dependencies = [ "const-hex", "derive_arbitrary", "derive_more", - "ethereum_ssz 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "getrandom", "hex-literal", "itoa", @@ -792,7 +790,7 @@ dependencies = [ "eth2_network_config", "ethereum_hashing", "ethereum_serde_utils", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethereum_ssz_derive", "execution_layer", "fork_choice", @@ -1015,7 +1013,7 @@ dependencies = [ "blst", "ethereum_hashing", "ethereum_serde_utils", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "hex", "rand", "safe_arith", @@ -1054,7 +1052,7 @@ dependencies = [ "clap", "clap_utils", "eth2_network_config", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "hex", "lighthouse_network", "log", @@ -1196,9 +1194,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" +checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" dependencies = [ "jobserver", "libc", @@ -1368,7 +1366,7 @@ dependencies = [ "clap", "dirs", "eth2_network_config", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "hex", "serde", "serde_json", @@ -1389,7 +1387,7 @@ dependencies = [ "eth1", "eth2", "eth2_config", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "execution_layer", "futures", "genesis", @@ -1885,7 +1883,7 @@ name = "deposit_contract" version = "0.2.0" dependencies = [ "ethabi 16.0.0", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "hex", "reqwest", "serde_json", @@ -2221,7 +2219,7 @@ dependencies = [ "compare_fields_derive", "derivative", "eth2_network_config", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethereum_ssz_derive", "execution_layer", "fork_choice", @@ -2413,7 +2411,7 @@ dependencies = [ "environment", "eth1_test_rig", "eth2", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethereum_ssz_derive", "execution_layer", "futures", @@ -2456,7 +2454,7 @@ dependencies = [ "bytes", "eth2_keystore", "ethereum_serde_utils", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethereum_ssz_derive", "futures", "futures-util", @@ -2541,7 +2539,7 @@ dependencies = [ "bytes", "discv5", "eth2_config", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "logging", "pretty_reqwest_error", "reqwest", @@ -2698,18 +2696,7 @@ dependencies = [ [[package]] name = "ethereum_ssz" version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3627f83d8b87b432a5fad9934b4565260722a141a2c40f371f8080adec9425" -dependencies = [ - "ethereum-types 0.14.1", - "itertools 0.10.5", - "smallvec", -] - -[[package]] -name = "ethereum_ssz" -version = "0.5.4" -source = "git+https://github.com/eserilev/ethereum_ssz?branch=alloy#078f5b8b204b6190eabff6876eb4b1467ad835f4" +source = "git+https://github.com/eserilev/ethereum_ssz?branch=alloy#3ee0ef4436af467995b8a6056ed46fc5178503b2" dependencies = [ "alloy-primitives", "itertools 0.10.5", @@ -2719,7 +2706,7 @@ dependencies = [ [[package]] name = "ethereum_ssz_derive" version = "0.5.4" -source = "git+https://github.com/eserilev/ethereum_ssz?branch=alloy#078f5b8b204b6190eabff6876eb4b1467ad835f4" +source = "git+https://github.com/eserilev/ethereum_ssz?branch=alloy#3ee0ef4436af467995b8a6056ed46fc5178503b2" dependencies = [ "darling 0.13.4", "proc-macro2", @@ -2914,7 +2901,7 @@ dependencies = [ "eth2", "eth2_network_config", "ethereum_serde_utils", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethers-core", "fork_choice", "hash-db", @@ -3068,7 +3055,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ - "arbitrary", "byteorder", "rand", "rustc-hex", @@ -3112,7 +3098,7 @@ name = "fork_choice" version = "0.1.0" dependencies = [ "beacon_chain", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethereum_ssz_derive", "proto_array", "slog", @@ -3319,7 +3305,7 @@ dependencies = [ "eth1", "eth1_test_rig", "ethereum_hashing", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "futures", "int_to_bytes", "merkle_proof", @@ -3790,7 +3776,7 @@ dependencies = [ "eth1", "eth2", "ethereum_serde_utils", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "execution_layer", "futures", "genesis", @@ -4363,7 +4349,7 @@ dependencies = [ "derivative", "ethereum_hashing", "ethereum_serde_utils", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethereum_ssz_derive", "hex", "serde", @@ -4401,7 +4387,7 @@ dependencies = [ "eth2_network_config", "eth2_wallet", "ethereum_hashing", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "execution_layer", "hex", "lighthouse_network", @@ -5017,7 +5003,7 @@ dependencies = [ "discv5", "either", "error-chain", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethereum_ssz_derive", "fnv", "futures", @@ -5314,7 +5300,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd01039851e82f8799046eabbb354056283fb265c8ec0996af940f4e85a380ff" dependencies = [ "serde", - "toml 0.8.16", + "toml 0.8.17", ] [[package]] @@ -5337,7 +5323,7 @@ dependencies = [ "arbitrary", "derivative", "ethereum_hashing", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethereum_ssz_derive", "itertools 0.10.5", "parking_lot 0.12.3", @@ -5572,7 +5558,7 @@ dependencies = [ "derivative", "error-chain", "eth2", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "execution_layer", "fnv", "futures", @@ -5882,7 +5868,7 @@ dependencies = [ "beacon_chain", "bitvec 1.0.1", "derivative", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethereum_ssz_derive", "itertools 0.10.5", "lighthouse_metrics", @@ -6311,9 +6297,13 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "2288c0e17cc8d342c712bb43a257a80ebffce59cdb33d5000d8348f3ec02528b" +dependencies = [ + "zerocopy", + "zerocopy-derive", +] [[package]] name = "pq-sys" @@ -6484,7 +6474,7 @@ dependencies = [ name = "proto_array" version = "0.2.0" dependencies = [ - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethereum_ssz_derive", "safe_arith", "serde", @@ -7460,11 +7450,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -7709,7 +7700,7 @@ dependencies = [ "bincode", "byteorder", "derivative", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethereum_ssz_derive", "filesystem", "flate2", @@ -7967,12 +7958,12 @@ dependencies = [ [[package]] name = "ssz_types" version = "0.6.0" -source = "git+https://github.com/eserilev/ssz_types?branch=alloy-tweaks#fc42634d4638e77ea5c281786d0f59b035293088" +source = "git+https://github.com/eserilev/ssz_types?branch=alloy-tweaks#83389701ccedc217f412ac33048a6dcd6c6a5aee" dependencies = [ "arbitrary", "derivative", "ethereum_serde_utils", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "itertools 0.10.5", "serde", "serde_derive", @@ -7997,7 +7988,7 @@ dependencies = [ "derivative", "env_logger 0.9.3", "ethereum_hashing", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethereum_ssz_derive", "int_to_bytes", "integer-sqrt", @@ -8020,7 +8011,7 @@ name = "state_transition_vectors" version = "0.1.0" dependencies = [ "beacon_chain", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "state_processing", "tokio", "types", @@ -8039,7 +8030,7 @@ dependencies = [ "beacon_chain", "db-key", "directory", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethereum_ssz_derive", "itertools 0.10.5", "leveldb", @@ -8470,9 +8461,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.1" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d040ac2b29ab03b09d4129c2f5bbd012a3ac2f79d38ff506a4bf8dd34b0eac8a" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "bytes", @@ -8601,21 +8592,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.16" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81967dd0dd2c1ab0bc3468bd7caecc32b8a4aa47d0c8c695d8c2b2108168d62c" +checksum = "7a44eede9b727419af8095cb2d72fab15487a541f54647ad4414b34096ee4631" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.17", + "toml_edit 0.22.18", ] [[package]] name = "toml_datetime" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fb9f64314842840f1d940ac544da178732128f1c78c21772e876579e0da1db" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] @@ -8644,9 +8635,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.17" +version = "0.22.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9f8729f5aea9562aac1cc0441f5d6de3cff1ee0c5d67293eeca5eb36ee7c16" +checksum = "1490595c74d930da779e944f5ba2ecdf538af67df1a9848cbd156af43c1b7cf0" dependencies = [ "indexmap 2.2.6", "serde", @@ -8855,7 +8846,7 @@ dependencies = [ "eth2_interop_keypairs", "ethereum_hashing", "ethereum_serde_utils", - "ethereum_ssz 0.5.4 (git+https://github.com/eserilev/ethereum_ssz?branch=alloy)", + "ethereum_ssz", "ethereum_ssz_derive", "hex", "int_to_bytes", @@ -8903,7 +8894,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ - "arbitrary", "byteorder", "crunchy", "hex", @@ -9912,6 +9902,7 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] diff --git a/Cargo.toml b/Cargo.toml index 84e6e423ddf..6de31203562 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,9 +118,9 @@ discv5 = { version = "0.4.1", features = ["libp2p"] } env_logger = "0.9" error-chain = "0.12" ethereum_hashing = "0.6.0" -ethereum_serde_utils = { git = "https://github.com/eserilev/ethereum_serde_utils", branch = "alloy"} -ethereum_ssz = { git = "https://github.com/eserilev/ethereum_ssz", branch = "alloy" } -ethereum_ssz_derive = { git = "https://github.com/eserilev/ethereum_ssz", branch = "alloy" } +ethereum_serde_utils = "0.5.2" +ethereum_ssz = "0.5" +ethereum_ssz_derive = "0.5" ethers-core = "1" ethers-providers = { version = "1", default-features = false } exit-future = "0.2" @@ -135,7 +135,7 @@ libsecp256k1 = "0.7" log = "0.4" lru = "0.12" maplit = "1" -milhouse = { git = "https://github.com/eserilev/milhouse", branch = "alloy"} +milhouse = "0.1" num_cpus = "1" parking_lot = "0.12" paste = "1" @@ -161,7 +161,7 @@ slog-term = "2" sloggers = { version = "2", features = ["json"] } smallvec = { version = "1.11.2", features = ["arbitrary"] } snap = "1" -ssz_types = { git = "https://github.com/eserilev/ssz_types", branch = "alloy-tweaks" } +ssz_types = "0.6" strum = { version = "0.24", features = ["derive"] } superstruct = "0.8" syn = "1" @@ -175,8 +175,8 @@ tracing-appender = "0.2" tracing-core = "0.1" tracing-log = "0.2" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -tree_hash = { git = "https://github.com/eserilev/tree_hash", branch = "alloy-deps"} -tree_hash_derive = { git = "https://github.com/eserilev/tree_hash", branch = "alloy-deps"} +tree_hash = "0.6" +tree_hash_derive = "0.6" url = "2" uuid = { version = "0.8", features = ["serde", "v4"] } warp = { version = "0.3.7", default-features = false, features = ["tls"] } @@ -243,4 +243,14 @@ warp_utils = { path = "common/warp_utils" } inherits = "release" lto = "fat" codegen-units = 1 -incremental = false \ No newline at end of file +incremental = false + +[patch.crates-io] +alloy-primitives = { git = "https://github.com/eserilev/core", branch = "remove-ethereum-ssz-dep" } +ethereum_ssz = { git = "https://github.com/eserilev/ethereum_ssz", branch = "alloy" } +ethereum_serde_utils = { git = "https://github.com/eserilev/ethereum_serde_utils", branch = "alloy"} +ethereum_ssz_derive = { git = "https://github.com/eserilev/ethereum_ssz", branch = "alloy" } +milhouse = { git = "https://github.com/eserilev/milhouse", branch = "alloy"} +ssz_types = { git = "https://github.com/eserilev/ssz_types", branch = "alloy-tweaks" } +tree_hash = { git = "https://github.com/eserilev/tree_hash", branch = "alloy-deps"} +tree_hash_derive = { git = "https://github.com/eserilev/tree_hash", branch = "alloy-deps"} \ No newline at end of file From 2c0d3fede5fe67887f394cc186382b3f159f8138 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Tue, 20 Aug 2024 13:47:08 -0700 Subject: [PATCH 40/62] Remove patch --- Cargo.lock | 71 +++++++++++++++++++++++++++++++++--------------------- Cargo.toml | 3 +-- 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba325f71d46..3e1e78d0863 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -211,7 +211,8 @@ dependencies = [ [[package]] name = "alloy-primitives" version = "0.7.7" -source = "git+https://github.com/eserilev/core?branch=remove-ethereum-ssz-dep#24e2fa0f551ac6f0058bce4a9834ca457349d8aa" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" dependencies = [ "alloy-rlp", "arbitrary", @@ -220,6 +221,7 @@ dependencies = [ "const-hex", "derive_arbitrary", "derive_more", + "ethereum_ssz 0.5.4", "getrandom", "hex-literal", "itoa", @@ -795,7 +797,7 @@ dependencies = [ "eth2_network_config", "ethereum_hashing 0.6.0", "ethereum_serde_utils", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethereum_ssz_derive", "execution_layer", "fork_choice", @@ -1019,7 +1021,7 @@ dependencies = [ "blst", "ethereum_hashing 0.6.0", "ethereum_serde_utils", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "hex", "rand", "safe_arith", @@ -1074,7 +1076,7 @@ dependencies = [ "clap", "clap_utils", "eth2_network_config", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "hex", "lighthouse_network", "log", @@ -1389,7 +1391,7 @@ dependencies = [ "clap", "dirs", "eth2_network_config", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "hex", "serde", "serde_json", @@ -1410,7 +1412,7 @@ dependencies = [ "eth1", "eth2", "eth2_config", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "execution_layer", "futures", "genesis", @@ -1952,7 +1954,7 @@ name = "deposit_contract" version = "0.2.0" dependencies = [ "ethabi 16.0.0", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "hex", "reqwest", "serde_json", @@ -2288,7 +2290,7 @@ dependencies = [ "compare_fields_derive", "derivative", "eth2_network_config", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethereum_ssz_derive", "execution_layer", "fork_choice", @@ -2480,7 +2482,7 @@ dependencies = [ "environment", "eth1_test_rig", "eth2", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethereum_ssz_derive", "execution_layer", "futures", @@ -2524,7 +2526,7 @@ dependencies = [ "bytes", "eth2_keystore", "ethereum_serde_utils", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethereum_ssz_derive", "futures", "futures-util", @@ -2609,7 +2611,7 @@ dependencies = [ "bytes", "discv5", "eth2_config", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "logging", "pretty_reqwest_error", "reqwest", @@ -2775,6 +2777,17 @@ dependencies = [ "serde_json", ] +[[package]] +name = "ethereum_ssz" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d3627f83d8b87b432a5fad9934b4565260722a141a2c40f371f8080adec9425" +dependencies = [ + "ethereum-types 0.14.1", + "itertools 0.10.5", + "smallvec", +] + [[package]] name = "ethereum_ssz" version = "0.6.0" @@ -2984,7 +2997,7 @@ dependencies = [ "eth2", "eth2_network_config", "ethereum_serde_utils", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethers-core", "fork_choice", "hash-db", @@ -3140,6 +3153,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ + "arbitrary", "byteorder", "rand", "rustc-hex", @@ -3183,7 +3197,7 @@ name = "fork_choice" version = "0.1.0" dependencies = [ "beacon_chain", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethereum_ssz_derive", "lighthouse_metrics", "proto_array", @@ -3391,7 +3405,7 @@ dependencies = [ "eth1", "eth1_test_rig", "ethereum_hashing 0.6.0", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "futures", "int_to_bytes", "merkle_proof", @@ -3863,7 +3877,7 @@ dependencies = [ "eth1", "eth2", "ethereum_serde_utils", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "execution_layer", "futures", "genesis", @@ -4447,7 +4461,7 @@ dependencies = [ "eth2_network_config", "ethereum_hashing 0.6.0", "ethereum_serde_utils", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethereum_ssz_derive", "hex", "rust_eth_kzg", @@ -4487,7 +4501,7 @@ dependencies = [ "eth2_network_config", "eth2_wallet", "ethereum_hashing 0.6.0", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "execution_layer", "hex", "lighthouse_network", @@ -5104,7 +5118,7 @@ dependencies = [ "discv5", "either", "error-chain", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethereum_ssz_derive", "fnv", "futures", @@ -5425,7 +5439,7 @@ dependencies = [ "arbitrary", "derivative", "ethereum_hashing 0.7.0", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethereum_ssz_derive", "itertools 0.13.0", "parking_lot 0.12.3", @@ -5670,7 +5684,7 @@ dependencies = [ "derivative", "error-chain", "eth2", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "execution_layer", "fnv", "futures", @@ -5980,7 +5994,7 @@ dependencies = [ "beacon_chain", "bitvec 1.0.1", "derivative", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethereum_ssz_derive", "itertools 0.10.5", "lighthouse_metrics", @@ -6594,7 +6608,7 @@ dependencies = [ name = "proto_array" version = "0.2.0" dependencies = [ - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethereum_ssz_derive", "safe_arith", "serde", @@ -7842,7 +7856,7 @@ dependencies = [ "bincode", "byteorder", "derivative", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethereum_ssz_derive", "filesystem", "flate2", @@ -8106,7 +8120,7 @@ dependencies = [ "arbitrary", "derivative", "ethereum_serde_utils", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "itertools 0.13.0", "serde", "serde_derive", @@ -8131,7 +8145,7 @@ dependencies = [ "derivative", "env_logger 0.9.3", "ethereum_hashing 0.6.0", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethereum_ssz_derive", "int_to_bytes", "integer-sqrt", @@ -8154,7 +8168,7 @@ name = "state_transition_vectors" version = "0.1.0" dependencies = [ "beacon_chain", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "state_processing", "tokio", "types", @@ -8173,7 +8187,7 @@ dependencies = [ "beacon_chain", "db-key", "directory", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethereum_ssz_derive", "itertools 0.10.5", "leveldb", @@ -8992,7 +9006,7 @@ dependencies = [ "eth2_interop_keypairs", "ethereum_hashing 0.6.0", "ethereum_serde_utils", - "ethereum_ssz", + "ethereum_ssz 0.6.0", "ethereum_ssz_derive", "hex", "int_to_bytes", @@ -9040,6 +9054,7 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ + "arbitrary", "byteorder", "crunchy", "hex", diff --git a/Cargo.toml b/Cargo.toml index eff2632ffe8..ca857574bf2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -247,5 +247,4 @@ codegen-units = 1 incremental = false [patch.crates-io] -quick-protobuf = { git = "https://github.com/sigp/quick-protobuf.git", rev = "681f413312404ab6e51f0b46f39b0075c6f4ebfd" } -alloy-primitives = { git = "https://github.com/eserilev/core", branch = "remove-ethereum-ssz-dep" } \ No newline at end of file +quick-protobuf = { git = "https://github.com/sigp/quick-protobuf.git", rev = "681f413312404ab6e51f0b46f39b0075c6f4ebfd" } \ No newline at end of file From 074681bf36638432e3984bd5aa6d0f7e5e6eb5b2 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Tue, 20 Aug 2024 13:47:19 -0700 Subject: [PATCH 41/62] fmt --- beacon_node/beacon_chain/src/eth1_chain.rs | 2 +- beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs | 6 +++--- beacon_node/network/src/service.rs | 2 +- consensus/types/src/lib.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/beacon_node/beacon_chain/src/eth1_chain.rs b/beacon_node/beacon_chain/src/eth1_chain.rs index 3671fedad5d..9e1bcbe6fa8 100644 --- a/beacon_node/beacon_chain/src/eth1_chain.rs +++ b/beacon_node/beacon_chain/src/eth1_chain.rs @@ -685,7 +685,7 @@ fn is_candidate_block(block: &Eth1Block, period_start: u64, spec: &ChainSpec) -> #[cfg(test)] mod test { use super::*; - use types::{DepositData, MinimalEthSpec, Signature, FixedBytesExtended}; + use types::{DepositData, FixedBytesExtended, MinimalEthSpec, Signature}; type E = MinimalEthSpec; diff --git a/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs b/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs index 48c3d804733..3b457fe3b64 100644 --- a/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs +++ b/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs @@ -812,9 +812,9 @@ mod tests { use crate::rpc::protocol::*; use crate::types::{EnrAttestationBitfield, EnrSyncCommitteeBitfield}; use types::{ - blob_sidecar::BlobIdentifier, BeaconBlock, BeaconBlockAltair, BeaconBlockBase, FixedBytesExtended, - BeaconBlockBellatrix, DataColumnIdentifier, EmptyBlock, Epoch, FullPayload, Signature, - Slot, + blob_sidecar::BlobIdentifier, BeaconBlock, BeaconBlockAltair, BeaconBlockBase, + BeaconBlockBellatrix, DataColumnIdentifier, EmptyBlock, Epoch, FixedBytesExtended, + FullPayload, Signature, Slot, }; type Spec = types::MainnetEthSpec; diff --git a/beacon_node/network/src/service.rs b/beacon_node/network/src/service.rs index e305b758101..0472a242e18 100644 --- a/beacon_node/network/src/service.rs +++ b/beacon_node/network/src/service.rs @@ -8,13 +8,13 @@ use crate::{ subnet_service::{AttestationService, SubnetServiceMessage}, NetworkConfig, }; +use alloy_primitives::U256; use beacon_chain::{BeaconChain, BeaconChainTypes}; use beacon_processor::{work_reprocessing_queue::ReprocessQueueMessage, BeaconProcessorSend}; use futures::channel::mpsc::Sender; use futures::future::OptionFuture; use futures::prelude::*; use futures::StreamExt; -use alloy_primitives::U256; use lighthouse_network::service::Network; use lighthouse_network::types::GossipKind; use lighthouse_network::Eth2Enr; diff --git a/consensus/types/src/lib.rs b/consensus/types/src/lib.rs index 13a5b07adef..5edd4e54565 100644 --- a/consensus/types/src/lib.rs +++ b/consensus/types/src/lib.rs @@ -275,4 +275,4 @@ pub use bls::{ pub use kzg::{KzgCommitment, KzgProof, VERSIONED_HASH_VERSION_KZG}; pub use milhouse::{self, List, Vector}; pub use ssz_types::{typenum, typenum::Unsigned, BitList, BitVector, FixedVector, VariableList}; -pub use superstruct::superstruct; \ No newline at end of file +pub use superstruct::superstruct; From 8cd7f8b1b2754f955b10530560c8defef02e2ffd Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Tue, 20 Aug 2024 14:03:52 -0700 Subject: [PATCH 42/62] remove file --- output.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 output.txt diff --git a/output.txt b/output.txt deleted file mode 100644 index e69de29bb2d..00000000000 From 98286249d47965a87a266c1de41c9356ecda5b8f Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Fri, 23 Aug 2024 13:47:13 -0700 Subject: [PATCH 43/62] sneaking in a smol change --- Cargo.lock | 20 ++++++++++---------- consensus/types/src/attestation.rs | 8 +------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 685fa8bd94a..bc8818be558 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1218,9 +1218,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.13" +version = "1.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +checksum = "50d2eb3cd3d1bf4529e31c215ee6f93ec5a3d536d9f578f93d9d33ee19562932" dependencies = [ "jobserver", "libc", @@ -2044,9 +2044,9 @@ dependencies = [ [[package]] name = "diesel" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf97ee7261bb708fa3402fa9c17a54b70e90e3cb98afb3dc8999d5512cb03f94" +checksum = "65e13bab2796f412722112327f3e575601a3e9cdcbe426f0d30dbf43f3f5dc71" dependencies = [ "bitflags 2.6.0", "byteorder", @@ -2058,9 +2058,9 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ff2be1e7312c858b2ef974f5c7089833ae57b5311b334b30923af58e5718d8" +checksum = "e7f2c3de51e2ba6bf2a648285696137aaf0f5f487bcbea93972fe8a364e131a4" dependencies = [ "diesel_table_macro_syntax", "dsl_auto_type", @@ -6747,9 +6747,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -7598,9 +7598,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "b3b863381a05ffefbc82571a2d893edf47b27fb0ebedbf582c39640e51abebef" dependencies = [ "itoa", "memchr", diff --git a/consensus/types/src/attestation.rs b/consensus/types/src/attestation.rs index b8aa2560329..3801a2b5d2b 100644 --- a/consensus/types/src/attestation.rs +++ b/consensus/types/src/attestation.rs @@ -412,13 +412,7 @@ impl AttestationBase { pub fn extend_aggregation_bits( &self, ) -> Result, ssz_types::Error> { - let mut extended_aggregation_bits: BitList = - BitList::with_capacity(self.aggregation_bits.len())?; - - for (i, bit) in self.aggregation_bits.iter().enumerate() { - extended_aggregation_bits.set(i, bit)?; - } - Ok(extended_aggregation_bits) + self.aggregation_bits.resize::() } } From 11d8a267da11a1d4949221c34215bdd3c10981a8 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Sun, 25 Aug 2024 17:41:47 -0700 Subject: [PATCH 44/62] bump versions --- Cargo.lock | 254 +++++++++--------- Cargo.toml | 17 +- .../execution_layer/src/versioned_hashes.rs | 28 +- 3 files changed, 154 insertions(+), 145 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bc8818be558..5ade41ffd32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -189,7 +189,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04c309895995eaa4bfcc345f5515a39c7df9447798645cc8bf462b6c5bf1dc96" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "c-kzg", ] @@ -200,7 +200,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9431c99a3b3fe606ede4b3d4043bdfbcb780c45b8d8d226c3804e2b75cfbe68" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "c-kzg", "once_cell", @@ -213,6 +213,28 @@ name = "alloy-primitives" version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "hex-literal", + "itoa", + "k256 0.13.3", + "keccak-asm", + "proptest", + "rand", + "ruint", + "serde", + "tiny-keccak", +] + +[[package]] +name = "alloy-primitives" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a767e59c86900dd7c3ce3ecef04f3ace5ac9631ee150beb8b7d22f7fa3bbb2d7" dependencies = [ "alloy-rlp", "arbitrary", @@ -221,7 +243,6 @@ dependencies = [ "const-hex", "derive_arbitrary", "derive_more", - "ethereum_ssz 0.5.4", "getrandom", "hex-literal", "itoa", @@ -254,7 +275,7 @@ checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -523,7 +544,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "synstructure", ] @@ -535,7 +556,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -593,7 +614,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -663,7 +684,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -788,7 +809,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" name = "beacon_chain" version = "0.2.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "bitvec 1.0.1", "bls", "derivative", @@ -797,7 +818,7 @@ dependencies = [ "eth2_network_config", "ethereum_hashing 0.6.0", "ethereum_serde_utils", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethereum_ssz_derive", "execution_layer", "fork_choice", @@ -924,7 +945,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -1016,12 +1037,12 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" name = "bls" version = "0.2.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "arbitrary", "blst", "ethereum_hashing 0.6.0", "ethereum_serde_utils", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "hex", "rand", "safe_arith", @@ -1076,7 +1097,7 @@ dependencies = [ "clap", "clap_utils", "eth2_network_config", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "hex", "lighthouse_network", "log", @@ -1374,7 +1395,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -1387,11 +1408,11 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" name = "clap_utils" version = "0.1.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "clap", "dirs", "eth2_network_config", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "hex", "serde", "serde_json", @@ -1412,7 +1433,7 @@ dependencies = [ "eth1", "eth2", "eth2_config", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "execution_layer", "futures", "genesis", @@ -1791,7 +1812,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -1839,7 +1860,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -1861,7 +1882,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -1954,7 +1975,7 @@ name = "deposit_contract" version = "0.2.0" dependencies = [ "ethabi 16.0.0", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "hex", "reqwest", "serde_json", @@ -2026,7 +2047,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2039,7 +2060,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2066,7 +2087,7 @@ dependencies = [ "dsl_auto_type", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2086,7 +2107,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" dependencies = [ - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2199,7 +2220,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2213,7 +2234,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2283,14 +2304,14 @@ dependencies = [ name = "ef_tests" version = "0.2.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "beacon_chain", "bls", "compare_fields", "compare_fields_derive", "derivative", "eth2_network_config", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethereum_ssz_derive", "execution_layer", "fork_choice", @@ -2393,7 +2414,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2482,7 +2503,7 @@ dependencies = [ "environment", "eth1_test_rig", "eth2", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethereum_ssz_derive", "execution_layer", "futures", @@ -2526,7 +2547,7 @@ dependencies = [ "bytes", "eth2_keystore", "ethereum_serde_utils", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethereum_ssz_derive", "futures", "futures-util", @@ -2611,7 +2632,7 @@ dependencies = [ "bytes", "discv5", "eth2_config", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "logging", "pretty_reqwest_error", "reqwest", @@ -2766,11 +2787,11 @@ dependencies = [ [[package]] name = "ethereum_serde_utils" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c228a90f44b159ccc0c16da6c56da42d0a521b0388cca87e89919d1af1889b2" +checksum = "70cbccfccf81d67bff0ab36e591fa536c8a935b078a7b0e58c1d00d418332fc9" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "hex", "serde", "serde_derive", @@ -2779,36 +2800,25 @@ dependencies = [ [[package]] name = "ethereum_ssz" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3627f83d8b87b432a5fad9934b4565260722a141a2c40f371f8080adec9425" -dependencies = [ - "ethereum-types 0.14.1", - "itertools 0.10.5", - "smallvec", -] - -[[package]] -name = "ethereum_ssz" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654bbebe60af1f6554e0e1216b8e336bc1a5ec483b7774d904e25e6e65a655c6" +checksum = "1e999563461faea0ab9bc0024e5e66adcee35881f3d5062f52f31a4070fe1522" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "itertools 0.13.0", "smallvec", ] [[package]] name = "ethereum_ssz_derive" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c21b5706b8763f5cbae4fbc407dacb8ce574ff619b98ff9d9c15adda2384681b" +checksum = "f3deae99c8e74829a00ba7a92d49055732b3c1f093f2ccfa3cbc621679b6fa91" dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2989,7 +2999,7 @@ name = "execution_layer" version = "0.1.0" dependencies = [ "alloy-consensus", - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "arc-swap", "builder_client", @@ -2997,7 +3007,7 @@ dependencies = [ "eth2", "eth2_network_config", "ethereum_serde_utils", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethers-core", "fork_choice", "hash-db", @@ -3059,9 +3069,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fastrlp" @@ -3153,7 +3163,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ - "arbitrary", "byteorder", "rand", "rustc-hex", @@ -3162,9 +3171,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c0596c1eac1f9e04ed902702e9878208b336edc9d6fddc8a48387349bab3666" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", "libz-sys", @@ -3197,7 +3206,7 @@ name = "fork_choice" version = "0.1.0" dependencies = [ "beacon_chain", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethereum_ssz_derive", "lighthouse_metrics", "proto_array", @@ -3316,7 +3325,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3405,7 +3414,7 @@ dependencies = [ "eth1", "eth1_test_rig", "ethereum_hashing 0.6.0", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "futures", "int_to_bytes", "merkle_proof", @@ -3474,7 +3483,7 @@ checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3877,7 +3886,7 @@ dependencies = [ "eth1", "eth2", "ethereum_serde_utils", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "execution_layer", "futures", "genesis", @@ -4462,7 +4471,7 @@ dependencies = [ "eth2_network_config", "ethereum_hashing 0.6.0", "ethereum_serde_utils", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethereum_ssz_derive", "hex", "rust_eth_kzg", @@ -4502,7 +4511,7 @@ dependencies = [ "eth2_network_config", "eth2_wallet", "ethereum_hashing 0.6.0", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "execution_layer", "hex", "lighthouse_network", @@ -4908,7 +4917,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -5049,9 +5058,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.19" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc53a7799a7496ebc9fd29f31f7df80e83c9bda5299768af5f9e59eeea74647" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", "pkg-config", @@ -5110,7 +5119,7 @@ dependencies = [ name = "lighthouse_network" version = "0.2.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "async-channel", "bytes", "delay_map", @@ -5119,7 +5128,7 @@ dependencies = [ "discv5", "either", "error-chain", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethereum_ssz_derive", "fnv", "futures", @@ -5379,7 +5388,7 @@ dependencies = [ name = "merkle_proof" version = "0.2.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "ethereum_hashing 0.6.0", "quickcheck", "quickcheck_macros", @@ -5432,15 +5441,15 @@ dependencies = [ [[package]] name = "milhouse" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06165374fe4b2c85c910450877c57b690d508e855d3c18e4c82629fd681d211" +checksum = "f68e33f98199224d1073f7c1468ea6abfea30736306fb79c7181a881e97ea32f" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "arbitrary", "derivative", "ethereum_hashing 0.7.0", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethereum_ssz_derive", "itertools 0.13.0", "parking_lot 0.12.3", @@ -5676,7 +5685,7 @@ dependencies = [ name = "network" version = "0.2.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "anyhow", "async-channel", "beacon_chain", @@ -5685,7 +5694,7 @@ dependencies = [ "derivative", "error-chain", "eth2", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "execution_layer", "fnv", "futures", @@ -5957,7 +5966,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -5995,7 +6004,7 @@ dependencies = [ "beacon_chain", "bitvec 1.0.1", "derivative", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethereum_ssz_derive", "itertools 0.10.5", "lighthouse_metrics", @@ -6262,7 +6271,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -6562,7 +6571,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -6587,20 +6596,20 @@ dependencies = [ [[package]] name = "proptest-derive" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf16337405ca084e9c78985114633b6827711d22b9e6ef6c6c0d665eb3f0b6e" +checksum = "6ff7ff745a347b87471d859a377a9a404361e7efc2a971d73424a6d183c0fc77" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.76", ] [[package]] name = "proto_array" version = "0.2.0" dependencies = [ - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethereum_ssz_derive", "safe_arith", "serde", @@ -7568,9 +7577,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] @@ -7587,20 +7596,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] name = "serde_json" -version = "1.0.126" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b863381a05ffefbc82571a2d893edf47b27fb0ebedbf582c39640e51abebef" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", "memchr", @@ -7626,7 +7635,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -7848,7 +7857,7 @@ dependencies = [ "bincode", "byteorder", "derivative", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethereum_ssz_derive", "filesystem", "flate2", @@ -8105,14 +8114,14 @@ dependencies = [ [[package]] name = "ssz_types" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e202ef3c07d9abc7b110a81206064e462758074242e8d176e3cb07415f01a3ad" +checksum = "35e0719d2b86ac738a55ae71a8429f52aa2741da988f1fd0975b4cc610fd1e08" dependencies = [ "arbitrary", "derivative", "ethereum_serde_utils", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "itertools 0.13.0", "serde", "serde_derive", @@ -8137,7 +8146,7 @@ dependencies = [ "derivative", "env_logger 0.9.3", "ethereum_hashing 0.6.0", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethereum_ssz_derive", "int_to_bytes", "integer-sqrt", @@ -8160,7 +8169,7 @@ name = "state_transition_vectors" version = "0.1.0" dependencies = [ "beacon_chain", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "state_processing", "tokio", "types", @@ -8179,7 +8188,7 @@ dependencies = [ "beacon_chain", "db-key", "directory", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethereum_ssz_derive", "itertools 0.10.5", "leveldb", @@ -8264,7 +8273,7 @@ dependencies = [ name = "swap_or_not_shuffle" version = "0.2.0" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "criterion", "ethereum_hashing 0.6.0", ] @@ -8282,9 +8291,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.75" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", @@ -8311,7 +8320,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -8492,7 +8501,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -8644,7 +8653,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -8856,7 +8865,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -8929,25 +8938,25 @@ dependencies = [ [[package]] name = "tree_hash" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f113108f55d589941862727b5a74f75276a54c157060983611d99f7f7fa6368" +checksum = "373495c23db675a5192de8b610395e1bec324d596f9e6111192ce903dc11403a" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "ethereum_hashing 0.7.0", "smallvec", ] [[package]] name = "tree_hash_derive" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b623b16740c2ff75b04a705e726f436abab04eecb60a27b39eea55ec5e81e543" +checksum = "b0857056ca4eb5de8c417309be42bcff6017b47e86fbaddde609b4633f66061e" dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -8986,7 +8995,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" name = "types" version = "0.2.1" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.8.0", "alloy-rlp", "arbitrary", "beacon_chain", @@ -8998,7 +9007,7 @@ dependencies = [ "eth2_interop_keypairs", "ethereum_hashing 0.6.0", "ethereum_serde_utils", - "ethereum_ssz 0.6.0", + "ethereum_ssz", "ethereum_ssz_derive", "hex", "int_to_bytes", @@ -9046,7 +9055,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ - "arbitrary", "byteorder", "crunchy", "hex", @@ -9436,7 +9444,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "wasm-bindgen-shared", ] @@ -9470,7 +9478,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -10078,7 +10086,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -10098,7 +10106,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index ca857574bf2..6613f24846d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ resolver = "2" edition = "2021" [workspace.dependencies] -alloy-primitives = "0.7.7" +alloy-primitives = "0.8" alloy-rlp = "0.3.4" alloy-consensus = "0.2.0" anyhow = "1" @@ -119,9 +119,9 @@ discv5 = { version = "0.4.1", features = ["libp2p"] } env_logger = "0.9" error-chain = "0.12" ethereum_hashing = "0.6.0" -ethereum_serde_utils = "0.6" -ethereum_ssz = "0.6" -ethereum_ssz_derive = "0.6" +ethereum_serde_utils = "0.7" +ethereum_ssz = "0.7" +ethereum_ssz_derive = "0.7" ethers-core = "1" ethers-providers = { version = "1", default-features = false } exit-future = "0.2" @@ -136,7 +136,7 @@ libsecp256k1 = "0.7" log = "0.4" lru = "0.12" maplit = "1" -milhouse = "0.2" +milhouse = "0.3" num_cpus = "1" parking_lot = "0.12" paste = "1" @@ -162,7 +162,7 @@ slog-term = "2" sloggers = { version = "2", features = ["json"] } smallvec = { version = "1.11.2", features = ["arbitrary"] } snap = "1" -ssz_types = "0.7" +ssz_types = "0.8" strum = { version = "0.24", features = ["derive"] } superstruct = "0.8" syn = "1" @@ -176,14 +176,13 @@ tracing-appender = "0.2" tracing-core = "0.1" tracing-log = "0.2" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -tree_hash = "0.7" -tree_hash_derive = "0.7" +tree_hash = "0.8" +tree_hash_derive = "0.8" url = "2" uuid = { version = "0.8", features = ["serde", "v4"] } warp = { version = "0.3.7", default-features = false, features = ["tls"] } zeroize = { version = "1", features = ["zeroize_derive"] } zip = "0.6" -ethereum-types = "0.14" # Local crates. account_utils = { path = "common/account_utils" } diff --git a/beacon_node/execution_layer/src/versioned_hashes.rs b/beacon_node/execution_layer/src/versioned_hashes.rs index 97c3100de99..8cc7d179c7e 100644 --- a/beacon_node/execution_layer/src/versioned_hashes.rs +++ b/beacon_node/execution_layer/src/versioned_hashes.rs @@ -71,8 +71,9 @@ pub fn beacon_tx_to_tx_envelope( mod test { use super::*; use crate::test_utils::static_valid_tx; - use alloy_consensus::TxLegacy; - use alloy_primitives::TxKind; + // TODO(alloy) uncomment once https://github.com/alloy-rs/alloy/pull/1167 is merged + // use alloy_consensus::TxLegacy; + // use alloy_primitives::TxKind; type E = types::MainnetEthSpec; @@ -80,20 +81,21 @@ mod test { fn test_decode_static_transaction() { let valid_tx = static_valid_tx::().expect("should give me known valid transaction"); let tx_envelope = beacon_tx_to_tx_envelope(&valid_tx).expect("should decode tx"); - let TxEnvelope::Legacy(signed_tx) = tx_envelope else { + let TxEnvelope::Legacy(_) = tx_envelope else { panic!("should decode to legacy transaction"); }; - assert!(matches!( - signed_tx.tx(), - TxLegacy { - chain_id: Some(0x01), - nonce: 0x15, - gas_price: 0x4a817c800, - to: TxKind::Call(..), - .. - } - )); + // TODO(alloy) uncomment once https://github.com/alloy-rs/alloy/pull/1167 is merged + // assert!(matches!( + // signed_tx.tx(), + // TxLegacy { + // chain_id: Some(0x01), + // nonce: 0x15, + // gas_price: 0x4a817c800, + // to: TxKind::Call(..), + // .. + // } + // )); } #[test] From 7342d975d6e2fdf6f28a6110569ad31428b2e9b7 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Tue, 27 Aug 2024 16:12:18 +1000 Subject: [PATCH 45/62] Updates for peerDAS --- beacon_node/lighthouse_network/src/peer_manager/peerdb.rs | 3 ++- beacon_node/lighthouse_network/src/types/globals.rs | 5 +++-- beacon_node/network/src/sync/block_lookups/tests.rs | 2 +- testing/ef_tests/src/cases/get_custody_columns.rs | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs b/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs index fdde57b4a57..63abe4a9db6 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs @@ -3,6 +3,7 @@ use crate::discovery::CombinedKey; use crate::{ metrics, multiaddr::Multiaddr, types::Subnet, Enr, EnrExt, Eth2Enr, Gossipsub, PeerId, }; +use alloy_primitives::U256; use peer_info::{ConnectionDirection, PeerConnectionStatus, PeerInfo}; use rand::seq::SliceRandom; use score::{PeerAction, ReportSource, Score, ScoreState}; @@ -796,7 +797,7 @@ impl PeerDB { ) => { // Update the ENR if one exists, and compute the custody subnets if let Some(enr) = enr { - let node_id = enr.node_id().raw().into(); + let node_id = U256::from_be_bytes(enr.node_id().raw()); let custody_subnet_count = enr.custody_subnet_count::(&self.spec); let custody_subnets = DataColumnSubnetId::compute_custody_subnets::( node_id, diff --git a/beacon_node/lighthouse_network/src/types/globals.rs b/beacon_node/lighthouse_network/src/types/globals.rs index 412a70902df..1ca4878e3f3 100644 --- a/beacon_node/lighthouse_network/src/types/globals.rs +++ b/beacon_node/lighthouse_network/src/types/globals.rs @@ -5,6 +5,7 @@ use crate::types::{BackFillState, SyncState}; use crate::EnrExt; use crate::{Client, Eth2Enr}; use crate::{Enr, GossipTopic, Multiaddr, PeerId}; +use alloy_primitives::U256; use parking_lot::RwLock; use std::collections::HashSet; use types::{ChainSpec, ColumnIndex, DataColumnSubnetId, EthSpec}; @@ -121,7 +122,7 @@ impl NetworkGlobals { /// Compute custody data columns the node is assigned to custody. pub fn custody_columns(&self) -> Vec { let enr = self.local_enr(); - let node_id = enr.node_id().raw().into(); + let node_id = U256::from_be_bytes(enr.node_id().raw()); let custody_subnet_count = enr.custody_subnet_count::(&self.spec); DataColumnSubnetId::compute_custody_columns::(node_id, custody_subnet_count, &self.spec) .collect() @@ -130,7 +131,7 @@ impl NetworkGlobals { /// Compute custody data column subnets the node is assigned to custody. pub fn custody_subnets(&self) -> impl Iterator { let enr = self.local_enr(); - let node_id = enr.node_id().raw().into(); + let node_id = U256::from_be_bytes(enr.node_id().raw()); let custody_subnet_count = enr.custody_subnet_count::(&self.spec); DataColumnSubnetId::compute_custody_subnets::(node_id, custody_subnet_count, &self.spec) } diff --git a/beacon_node/network/src/sync/block_lookups/tests.rs b/beacon_node/network/src/sync/block_lookups/tests.rs index 9572bf7f444..0ab3076cc3f 100644 --- a/beacon_node/network/src/sync/block_lookups/tests.rs +++ b/beacon_node/network/src/sync/block_lookups/tests.rs @@ -300,7 +300,7 @@ impl TestRig { fn expect_no_active_sampling(&mut self) { assert_eq!( self.sync_manager.active_sampling_requests(), - vec![], + Vec::::new(), "expected no active sampling" ); } diff --git a/testing/ef_tests/src/cases/get_custody_columns.rs b/testing/ef_tests/src/cases/get_custody_columns.rs index efe5b147e44..d96a22951ef 100644 --- a/testing/ef_tests/src/cases/get_custody_columns.rs +++ b/testing/ef_tests/src/cases/get_custody_columns.rs @@ -1,5 +1,5 @@ use super::*; -use ethereum_types::U256; +use alloy_primitives::U256; use serde::Deserialize; use std::marker::PhantomData; use types::DataColumnSubnetId; @@ -23,7 +23,7 @@ impl LoadCase for GetCustodyColumns { impl Case for GetCustodyColumns { fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> { let spec = E::default_spec(); - let node_id = U256::from_dec_str(&self.node_id) + let node_id = U256::from_str_radix(&self.node_id, 10) .map_err(|e| Error::FailedToParseTest(format!("{e:?}")))?; let computed = DataColumnSubnetId::compute_custody_columns::( node_id, From be405d67a0a5cafb192fbb1e821bdb78b4923162 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Tue, 27 Aug 2024 16:19:02 +1000 Subject: [PATCH 46/62] Update ethereum_hashing to prevent dupe --- Cargo.lock | 38 +++++++++++++------------------------- Cargo.toml | 4 ++-- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f36828009db..1739ac67bd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -817,7 +817,7 @@ dependencies = [ "eth1", "eth2", "eth2_network_config", - "ethereum_hashing 0.6.0", + "ethereum_hashing", "ethereum_serde_utils", "ethereum_ssz", "ethereum_ssz_derive", @@ -1041,7 +1041,7 @@ dependencies = [ "alloy-primitives 0.8.0", "arbitrary", "blst", - "ethereum_hashing 0.6.0", + "ethereum_hashing", "ethereum_serde_utils", "ethereum_ssz", "hex", @@ -2585,7 +2585,7 @@ version = "0.2.0" dependencies = [ "base64 0.13.1", "bls", - "ethereum_hashing 0.6.0", + "ethereum_hashing", "hex", "num-bigint", "serde", @@ -2763,18 +2763,6 @@ dependencies = [ "uint", ] -[[package]] -name = "ethereum_hashing" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea7b408432c13f71af01197b1d3d0069c48a27bfcfbe72a81fc346e47f6defb" -dependencies = [ - "cpufeatures", - "lazy_static", - "ring 0.17.8", - "sha2 0.10.8", -] - [[package]] name = "ethereum_hashing" version = "0.7.0" @@ -3414,7 +3402,7 @@ dependencies = [ "environment", "eth1", "eth1_test_rig", - "ethereum_hashing 0.6.0", + "ethereum_hashing", "ethereum_ssz", "futures", "int_to_bytes", @@ -4471,7 +4459,7 @@ dependencies = [ "criterion", "derivative", "eth2_network_config", - "ethereum_hashing 0.6.0", + "ethereum_hashing", "ethereum_serde_utils", "ethereum_ssz", "ethereum_ssz_derive", @@ -4512,7 +4500,7 @@ dependencies = [ "eth2", "eth2_network_config", "eth2_wallet", - "ethereum_hashing 0.6.0", + "ethereum_hashing", "ethereum_ssz", "execution_layer", "hex", @@ -5087,7 +5075,7 @@ dependencies = [ "eth1", "eth2", "eth2_network_config", - "ethereum_hashing 0.6.0", + "ethereum_hashing", "futures", "lighthouse_metrics", "lighthouse_network", @@ -5391,7 +5379,7 @@ name = "merkle_proof" version = "0.2.0" dependencies = [ "alloy-primitives 0.8.0", - "ethereum_hashing 0.6.0", + "ethereum_hashing", "quickcheck", "quickcheck_macros", "safe_arith", @@ -5450,7 +5438,7 @@ dependencies = [ "alloy-primitives 0.8.0", "arbitrary", "derivative", - "ethereum_hashing 0.7.0", + "ethereum_hashing", "ethereum_ssz", "ethereum_ssz_derive", "itertools 0.13.0", @@ -8147,7 +8135,7 @@ dependencies = [ "bls", "derivative", "env_logger 0.9.3", - "ethereum_hashing 0.6.0", + "ethereum_hashing", "ethereum_ssz", "ethereum_ssz_derive", "int_to_bytes", @@ -8277,7 +8265,7 @@ version = "0.2.0" dependencies = [ "alloy-primitives 0.8.0", "criterion", - "ethereum_hashing 0.6.0", + "ethereum_hashing", ] [[package]] @@ -8945,7 +8933,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "373495c23db675a5192de8b610395e1bec324d596f9e6111192ce903dc11403a" dependencies = [ "alloy-primitives 0.8.0", - "ethereum_hashing 0.7.0", + "ethereum_hashing", "smallvec", ] @@ -9007,7 +8995,7 @@ dependencies = [ "criterion", "derivative", "eth2_interop_keypairs", - "ethereum_hashing 0.6.0", + "ethereum_hashing", "ethereum_serde_utils", "ethereum_ssz", "ethereum_ssz_derive", diff --git a/Cargo.toml b/Cargo.toml index 6613f24846d..97582e688e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,7 +118,7 @@ rust_eth_kzg = "0.3.4" discv5 = { version = "0.4.1", features = ["libp2p"] } env_logger = "0.9" error-chain = "0.12" -ethereum_hashing = "0.6.0" +ethereum_hashing = "0.7.0" ethereum_serde_utils = "0.7" ethereum_ssz = "0.7" ethereum_ssz_derive = "0.7" @@ -246,4 +246,4 @@ codegen-units = 1 incremental = false [patch.crates-io] -quick-protobuf = { git = "https://github.com/sigp/quick-protobuf.git", rev = "681f413312404ab6e51f0b46f39b0075c6f4ebfd" } \ No newline at end of file +quick-protobuf = { git = "https://github.com/sigp/quick-protobuf.git", rev = "681f413312404ab6e51f0b46f39b0075c6f4ebfd" } From cd8cb3c4dd8d5bfff504fe47d7dce07296bbdaec Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Wed, 28 Aug 2024 14:55:53 -0700 Subject: [PATCH 47/62] updated alloy-consensus, removed TODOs --- Cargo.lock | 80 +++++++++---------- Cargo.toml | 2 +- .../execution_layer/src/versioned_hashes.rs | 28 +++---- 3 files changed, 54 insertions(+), 56 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1739ac67bd9..d824a4594ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -184,50 +184,50 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy-consensus" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c309895995eaa4bfcc345f5515a39c7df9447798645cc8bf462b6c5bf1dc96" +checksum = "7198a527b4c4762cb88d54bcaeb0428f4298b72552c9c8ec4af614b4a4990c59" dependencies = [ "alloy-eips", - "alloy-primitives 0.7.7", + "alloy-primitives", "alloy-rlp", "c-kzg", ] [[package]] -name = "alloy-eips" -version = "0.2.1" +name = "alloy-eip2930" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9431c99a3b3fe606ede4b3d4043bdfbcb780c45b8d8d226c3804e2b75cfbe68" +checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" dependencies = [ - "alloy-primitives 0.7.7", + "alloy-primitives", "alloy-rlp", - "c-kzg", - "once_cell", - "serde", - "sha2 0.10.8", ] [[package]] -name = "alloy-primitives" -version = "0.7.7" +name = "alloy-eip7702" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" +checksum = "37d319bb544ca6caeab58c39cea8921c55d924d4f68f2c60f24f914673f9a74a" dependencies = [ + "alloy-primitives", "alloy-rlp", - "bytes", - "cfg-if", - "const-hex", - "derive_more", - "hex-literal", - "itoa", - "k256 0.13.3", - "keccak-asm", - "proptest", - "rand", - "ruint", +] + +[[package]] +name = "alloy-eips" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "159eab0e4e15b88571f55673af37314f4b8f17630dc1b393c3d70f2128a1d494" +dependencies = [ + "alloy-eip2930", + "alloy-eip7702", + "alloy-primitives", + "alloy-rlp", + "c-kzg", + "once_cell", "serde", - "tiny-keccak", + "sha2 0.10.8", ] [[package]] @@ -809,7 +809,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" name = "beacon_chain" version = "0.2.0" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "bitvec 1.0.1", "bls", "criterion", @@ -1038,7 +1038,7 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" name = "bls" version = "0.2.0" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "arbitrary", "blst", "ethereum_hashing", @@ -1409,7 +1409,7 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" name = "clap_utils" version = "0.1.0" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "clap", "dirs", "eth2_network_config", @@ -2305,7 +2305,7 @@ dependencies = [ name = "ef_tests" version = "0.2.0" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "beacon_chain", "bls", "compare_fields", @@ -2780,7 +2780,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70cbccfccf81d67bff0ab36e591fa536c8a935b078a7b0e58c1d00d418332fc9" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "hex", "serde", "serde_derive", @@ -2793,7 +2793,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e999563461faea0ab9bc0024e5e66adcee35881f3d5062f52f31a4070fe1522" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "itertools 0.13.0", "smallvec", ] @@ -2988,7 +2988,7 @@ name = "execution_layer" version = "0.1.0" dependencies = [ "alloy-consensus", - "alloy-primitives 0.8.0", + "alloy-primitives", "alloy-rlp", "arc-swap", "builder_client", @@ -5109,7 +5109,7 @@ dependencies = [ name = "lighthouse_network" version = "0.2.0" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "async-channel", "bytes", "delay_map", @@ -5378,7 +5378,7 @@ dependencies = [ name = "merkle_proof" version = "0.2.0" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "ethereum_hashing", "quickcheck", "quickcheck_macros", @@ -5435,7 +5435,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f68e33f98199224d1073f7c1468ea6abfea30736306fb79c7181a881e97ea32f" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "arbitrary", "derivative", "ethereum_hashing", @@ -5675,7 +5675,7 @@ dependencies = [ name = "network" version = "0.2.0" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "anyhow", "async-channel", "beacon_chain", @@ -8263,7 +8263,7 @@ dependencies = [ name = "swap_or_not_shuffle" version = "0.2.0" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "criterion", "ethereum_hashing", ] @@ -8932,7 +8932,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "373495c23db675a5192de8b610395e1bec324d596f9e6111192ce903dc11403a" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "ethereum_hashing", "smallvec", ] @@ -8985,7 +8985,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" name = "types" version = "0.2.1" dependencies = [ - "alloy-primitives 0.8.0", + "alloy-primitives", "alloy-rlp", "arbitrary", "beacon_chain", diff --git a/Cargo.toml b/Cargo.toml index 97582e688e8..a362263f7cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -96,7 +96,7 @@ edition = "2021" [workspace.dependencies] alloy-primitives = "0.8" alloy-rlp = "0.3.4" -alloy-consensus = "0.2.0" +alloy-consensus = "0.3.0" anyhow = "1" arbitrary = { version = "1", features = ["derive"] } async-channel = "1.9.0" diff --git a/beacon_node/execution_layer/src/versioned_hashes.rs b/beacon_node/execution_layer/src/versioned_hashes.rs index 8cc7d179c7e..97c3100de99 100644 --- a/beacon_node/execution_layer/src/versioned_hashes.rs +++ b/beacon_node/execution_layer/src/versioned_hashes.rs @@ -71,9 +71,8 @@ pub fn beacon_tx_to_tx_envelope( mod test { use super::*; use crate::test_utils::static_valid_tx; - // TODO(alloy) uncomment once https://github.com/alloy-rs/alloy/pull/1167 is merged - // use alloy_consensus::TxLegacy; - // use alloy_primitives::TxKind; + use alloy_consensus::TxLegacy; + use alloy_primitives::TxKind; type E = types::MainnetEthSpec; @@ -81,21 +80,20 @@ mod test { fn test_decode_static_transaction() { let valid_tx = static_valid_tx::().expect("should give me known valid transaction"); let tx_envelope = beacon_tx_to_tx_envelope(&valid_tx).expect("should decode tx"); - let TxEnvelope::Legacy(_) = tx_envelope else { + let TxEnvelope::Legacy(signed_tx) = tx_envelope else { panic!("should decode to legacy transaction"); }; - // TODO(alloy) uncomment once https://github.com/alloy-rs/alloy/pull/1167 is merged - // assert!(matches!( - // signed_tx.tx(), - // TxLegacy { - // chain_id: Some(0x01), - // nonce: 0x15, - // gas_price: 0x4a817c800, - // to: TxKind::Call(..), - // .. - // } - // )); + assert!(matches!( + signed_tx.tx(), + TxLegacy { + chain_id: Some(0x01), + nonce: 0x15, + gas_price: 0x4a817c800, + to: TxKind::Call(..), + .. + } + )); } #[test] From 8281cda21d937d366df1a63266127a89db3936e9 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Wed, 28 Aug 2024 16:26:55 -0700 Subject: [PATCH 48/62] cargo update --- Cargo.lock | 78 ++++++++++++++++++++++++------------------------------ 1 file changed, 34 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d824a4594ad..b61fdb1c4cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -412,7 +412,7 @@ dependencies = [ "num-bigint", "num-traits", "paste", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "zeroize", ] @@ -589,7 +589,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix 0.38.34", + "rustix 0.38.35", "slab", "tracing", "windows-sys 0.59.0", @@ -625,7 +625,7 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -1188,15 +1188,16 @@ dependencies = [ [[package]] name = "c-kzg" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf100c4cea8f207e883ff91ca886d621d8a166cb04971dfaa9bb8fd99ed95df" +checksum = "f0307f72feab3300336fb803a57134159f6e20139af1357f36c54cb90d8e8928" dependencies = [ "blst", "cc", "glob", "hex", "libc", + "once_cell", "serde", ] @@ -1240,9 +1241,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.14" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d2eb3cd3d1bf4529e31c215ee6f93ec5a3d536d9f578f93d9d33ee19562932" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" dependencies = [ "jobserver", "libc", @@ -1800,7 +1801,7 @@ dependencies = [ "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "subtle", "zeroize", ] @@ -2060,7 +2061,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "syn 2.0.76", ] @@ -3123,7 +3124,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ "memoffset", - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -5876,9 +5877,9 @@ dependencies = [ [[package]] name = "oid-registry" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" +checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9" dependencies = [ "asn1-rs", ] @@ -6082,7 +6083,7 @@ version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", @@ -6223,7 +6224,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" dependencies = [ "futures", - "rustc_version 0.4.0", + "rustc_version 0.4.1", ] [[package]] @@ -6346,7 +6347,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.34", + "rustix 0.38.35", "tracing", "windows-sys 0.59.0", ] @@ -6495,11 +6496,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.22.20", ] [[package]] @@ -6859,9 +6860,9 @@ dependencies = [ [[package]] name = "redb" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6dd20d3cdeb9c7d2366a0b16b93b35b75aec15309fbeb7ce477138c9f68c8c0" +checksum = "58323dc32ea52a8ae105ff94bc0460c5d906307533ba3401aa63db3cbe491fe5" dependencies = [ "libc", ] @@ -7211,9 +7212,9 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver 1.0.23", ] @@ -7243,9 +7244,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ "bitflags 2.6.0", "errno", @@ -7275,7 +7276,7 @@ dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] @@ -7289,7 +7290,7 @@ dependencies = [ "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] @@ -7331,9 +7332,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -7415,7 +7416,7 @@ version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", @@ -8045,7 +8046,7 @@ dependencies = [ "curve25519-dalek", "rand_core", "ring 0.17.8", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "sha2 0.10.8", "subtle", ] @@ -8407,7 +8408,7 @@ dependencies = [ "cfg-if", "fastrand", "once_cell", - "rustix 0.38.34", + "rustix 0.38.35", "windows-sys 0.59.0", ] @@ -8437,7 +8438,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.38.34", + "rustix 0.38.35", "windows-sys 0.48.0", ] @@ -8771,17 +8772,6 @@ dependencies = [ "winnow 0.5.40", ] -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.4.0", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.22.20" @@ -9940,7 +9930,7 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "send_wrapper", "thiserror", "wasm-bindgen", From 4f1973ecdd5aca3a87309f71e1c6b4ea140cf9d1 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Wed, 28 Aug 2024 16:32:01 -0700 Subject: [PATCH 49/62] endianess fix --- .../network/src/subnet_service/attestation_subnets.rs | 2 +- consensus/types/src/subnet_id.rs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/beacon_node/network/src/subnet_service/attestation_subnets.rs b/beacon_node/network/src/subnet_service/attestation_subnets.rs index c10d2672097..f6b9eabf034 100644 --- a/beacon_node/network/src/subnet_service/attestation_subnets.rs +++ b/beacon_node/network/src/subnet_service/attestation_subnets.rs @@ -315,7 +315,7 @@ impl AttestationService { })?; let (subnets, next_subscription_epoch) = SubnetId::compute_subnets_for_epoch::( - Uint256::from_le_slice(self.node_id.raw().as_slice()), + Uint256::from_be_slice(self.node_id.raw().as_slice()), current_epoch, &self.beacon_chain.spec, ) diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index 7288d6fb3db..cf99e41194b 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -88,10 +88,11 @@ impl SubnetId { let shuffling_prefix_bits = spec.attestation_subnet_shuffling_prefix_bits as u64; // calculate the prefixes used to compute the subnet and shuffling - let node_id_prefix = (node_id >> (256 - prefix_bits)).as_le_slice().get_u64_le(); + let node_id_prefix = (node_id >> (256 - prefix_bits)).to_be_bytes::<32>().as_ref().get_u64(); let shuffling_prefix = (node_id >> (256 - (prefix_bits + shuffling_prefix_bits))) - .as_le_slice() - .get_u64_le(); + .to_be_bytes::<32>() + .as_ref() + .get_u64(); // number of groups the shuffling creates let shuffling_groups = 1 << shuffling_prefix_bits; From b45cc6663e8d7ffdaf70cc57b87c382caee40fc6 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Wed, 28 Aug 2024 16:35:02 -0700 Subject: [PATCH 50/62] fmt --- consensus/types/src/subnet_id.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index cf99e41194b..35ebac05b4e 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -88,7 +88,10 @@ impl SubnetId { let shuffling_prefix_bits = spec.attestation_subnet_shuffling_prefix_bits as u64; // calculate the prefixes used to compute the subnet and shuffling - let node_id_prefix = (node_id >> (256 - prefix_bits)).to_be_bytes::<32>().as_ref().get_u64(); + let node_id_prefix = (node_id >> (256 - prefix_bits)) + .to_be_bytes::<32>() + .as_ref() + .get_u64(); let shuffling_prefix = (node_id >> (256 - (prefix_bits + shuffling_prefix_bits))) .to_be_bytes::<32>() .as_ref() From c3c80610d6f76d5d1f6b3d14f50319fa8f2ce685 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Wed, 28 Aug 2024 16:39:59 -0700 Subject: [PATCH 51/62] fix merge --- .../lighthouse_network/src/peer_manager/peerdb/peer_info.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs b/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs index 5ff8f74dd46..d2d9812249f 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs @@ -3,6 +3,7 @@ use super::score::{PeerAction, Score, ScoreState}; use super::sync_status::SyncStatus; use crate::discovery::Eth2Enr; use crate::{rpc::MetaData, types::Subnet}; +use alloy_primitives::U256; use discv5::enr::NodeId; use discv5::Enr; use libp2p::core::multiaddr::{Multiaddr, Protocol}; @@ -374,7 +375,7 @@ impl PeerInfo { if self.custody_subnets.is_empty() { if let Ok(custody_subnet_count) = meta_data.custody_subnet_count() { let custody_subnets = DataColumnSubnetId::compute_custody_subnets::( - node_id.raw().into(), + U256::from_be_slice(&node_id.raw()), std::cmp::min(*custody_subnet_count, spec.data_column_sidecar_subnet_count), spec, ) From 4cd0268b9f6996ea479ab370f80b43ed199dbc55 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Wed, 28 Aug 2024 18:39:50 -0700 Subject: [PATCH 52/62] fix test --- .../src/peer_manager/peerdb/peer_info.rs | 2 +- .../network/src/subnet_service/attestation_subnets.rs | 2 +- consensus/types/src/subnet_id.rs | 10 +++------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs b/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs index d2d9812249f..c3d92373308 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs @@ -375,7 +375,7 @@ impl PeerInfo { if self.custody_subnets.is_empty() { if let Ok(custody_subnet_count) = meta_data.custody_subnet_count() { let custody_subnets = DataColumnSubnetId::compute_custody_subnets::( - U256::from_be_slice(&node_id.raw()), + U256::from_le_slice(&node_id.raw()), std::cmp::min(*custody_subnet_count, spec.data_column_sidecar_subnet_count), spec, ) diff --git a/beacon_node/network/src/subnet_service/attestation_subnets.rs b/beacon_node/network/src/subnet_service/attestation_subnets.rs index f6b9eabf034..c10d2672097 100644 --- a/beacon_node/network/src/subnet_service/attestation_subnets.rs +++ b/beacon_node/network/src/subnet_service/attestation_subnets.rs @@ -315,7 +315,7 @@ impl AttestationService { })?; let (subnets, next_subscription_epoch) = SubnetId::compute_subnets_for_epoch::( - Uint256::from_be_slice(self.node_id.raw().as_slice()), + Uint256::from_le_slice(self.node_id.raw().as_slice()), current_epoch, &self.beacon_chain.spec, ) diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index 35ebac05b4e..7288d6fb3db 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -88,14 +88,10 @@ impl SubnetId { let shuffling_prefix_bits = spec.attestation_subnet_shuffling_prefix_bits as u64; // calculate the prefixes used to compute the subnet and shuffling - let node_id_prefix = (node_id >> (256 - prefix_bits)) - .to_be_bytes::<32>() - .as_ref() - .get_u64(); + let node_id_prefix = (node_id >> (256 - prefix_bits)).as_le_slice().get_u64_le(); let shuffling_prefix = (node_id >> (256 - (prefix_bits + shuffling_prefix_bits))) - .to_be_bytes::<32>() - .as_ref() - .get_u64(); + .as_le_slice() + .get_u64_le(); // number of groups the shuffling creates let shuffling_groups = 1 << shuffling_prefix_bits; From 5162316d8927b69451837468c211c69576a1fbf3 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Sat, 31 Aug 2024 22:05:55 -0700 Subject: [PATCH 53/62] fixed_bytes crate --- Cargo.lock | 12 ++++ Cargo.toml | 1 + consensus/fixed_bytes/Cargo.toml | 11 ++++ .../fixed_bytes.rs => fixed_bytes/src/lib.rs} | 13 +++-- consensus/merkle_proof/Cargo.toml | 1 + consensus/merkle_proof/src/lib.rs | 57 +------------------ consensus/swap_or_not_shuffle/Cargo.toml | 1 + consensus/swap_or_not_shuffle/src/lib.rs | 2 +- consensus/types/Cargo.toml | 1 + consensus/types/src/beacon_state.rs | 2 +- consensus/types/src/lib.rs | 9 ++- crypto/bls/Cargo.toml | 1 + crypto/bls/src/lib.rs | 55 +----------------- 13 files changed, 48 insertions(+), 118 deletions(-) create mode 100644 consensus/fixed_bytes/Cargo.toml rename consensus/{types/src/fixed_bytes.rs => fixed_bytes/src/lib.rs} (83%) diff --git a/Cargo.lock b/Cargo.lock index 6601fe29f78..0e9aca16e48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1044,6 +1044,7 @@ dependencies = [ "ethereum_hashing", "ethereum_serde_utils", "ethereum_ssz", + "fixed_bytes", "hex", "rand", "safe_arith", @@ -3165,6 +3166,14 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fixed_bytes" +version = "0.1.0" +dependencies = [ + "alloy-primitives", + "safe_arith", +] + [[package]] name = "flate2" version = "1.0.33" @@ -5387,6 +5396,7 @@ version = "0.2.0" dependencies = [ "alloy-primitives", "ethereum_hashing", + "fixed_bytes", "quickcheck", "quickcheck_macros", "safe_arith", @@ -8272,6 +8282,7 @@ dependencies = [ "alloy-primitives", "criterion", "ethereum_hashing", + "fixed_bytes", ] [[package]] @@ -8994,6 +9005,7 @@ dependencies = [ "ethereum_serde_utils", "ethereum_ssz", "ethereum_ssz_derive", + "fixed_bytes", "hex", "int_to_bytes", "itertools 0.10.5", diff --git a/Cargo.toml b/Cargo.toml index 4a177412d3d..777470c102d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -204,6 +204,7 @@ eth2_keystore = { path = "crypto/eth2_keystore" } eth2_network_config = { path = "common/eth2_network_config" } eth2_wallet = { path = "crypto/eth2_wallet" } execution_layer = { path = "beacon_node/execution_layer" } +fixed_bytes = { path = "consensus/fixed_bytes" } filesystem = { path = "common/filesystem" } fork_choice = { path = "consensus/fork_choice" } genesis = { path = "beacon_node/genesis" } diff --git a/consensus/fixed_bytes/Cargo.toml b/consensus/fixed_bytes/Cargo.toml new file mode 100644 index 00000000000..e5201a04551 --- /dev/null +++ b/consensus/fixed_bytes/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "fixed_bytes" +version = "0.1.0" +authors = ["Eitan Seri-Levi "] +edition = { workspace = true } + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +alloy-primitives = { workspace = true } +safe_arith = { workspace = true } diff --git a/consensus/types/src/fixed_bytes.rs b/consensus/fixed_bytes/src/lib.rs similarity index 83% rename from consensus/types/src/fixed_bytes.rs rename to consensus/fixed_bytes/src/lib.rs index 6f9b867e751..4e32dc88eeb 100644 --- a/consensus/types/src/fixed_bytes.rs +++ b/consensus/fixed_bytes/src/lib.rs @@ -1,6 +1,11 @@ -use alloy_primitives::{Address, FixedBytes}; +use alloy_primitives::FixedBytes; use safe_arith::SafeArith; +pub type Hash64 = alloy_primitives::B64; +pub type Hash256 = alloy_primitives::B256; +pub type Uint256 = alloy_primitives::U256; +pub type Address = alloy_primitives::Address; + pub trait FixedBytesExtended { fn from_low_u64_be(value: u64) -> Self; fn from_low_u64_le(value: u64) -> Self; @@ -16,7 +21,7 @@ impl FixedBytesExtended for FixedBytes { let start_index = buffer .len() .safe_sub(bytes_to_copy) - .expect("byte_to_copy <= buffer.len()"); + .expect("bytes_to_copy <= buffer.len()"); // Panic-free because start_index <= buffer.len() // and bytes_to_copy <= value_bytes.len() buffer @@ -34,7 +39,7 @@ impl FixedBytesExtended for FixedBytes { let value_bytes = value.to_le_bytes(); let mut buffer = [0x0; N]; let bytes_to_copy = value_bytes.len().min(buffer.len()); - // Panic-free because bytes_to_copy <= buffer.len() + // Panic-free because bytes_to_copy <= buffer.len(), // and bytes_to_copy <= value_bytes.len() buffer .get_mut(..bytes_to_copy) @@ -52,7 +57,7 @@ impl FixedBytesExtended for FixedBytes { } } -impl FixedBytesExtended for Address { +impl FixedBytesExtended for alloy_primitives::Address { fn from_low_u64_be(value: u64) -> Self { FixedBytes::<20>::from_low_u64_be(value).into() } diff --git a/consensus/merkle_proof/Cargo.toml b/consensus/merkle_proof/Cargo.toml index b2c190532b9..c2c6bf270a6 100644 --- a/consensus/merkle_proof/Cargo.toml +++ b/consensus/merkle_proof/Cargo.toml @@ -8,6 +8,7 @@ edition = { workspace = true } alloy-primitives = { workspace = true } ethereum_hashing = { workspace = true } safe_arith = { workspace = true } +fixed_bytes = { workspace = true } [dev-dependencies] quickcheck = { workspace = true } diff --git a/consensus/merkle_proof/src/lib.rs b/consensus/merkle_proof/src/lib.rs index 015afb55569..b01f3f4429f 100644 --- a/consensus/merkle_proof/src/lib.rs +++ b/consensus/merkle_proof/src/lib.rs @@ -1,60 +1,9 @@ -use alloy_primitives::FixedBytes; use ethereum_hashing::{hash, hash32_concat, ZERO_HASHES}; -use safe_arith::{ArithError, SafeArith}; +use safe_arith::ArithError; use std::sync::LazyLock; -type H256 = alloy_primitives::B256; - -pub trait FixedBytesExtended { - fn from_low_u64_be(value: u64) -> Self; - fn from_low_u64_le(value: u64) -> Self; - fn zero() -> Self; -} - -impl FixedBytesExtended for FixedBytes { - fn from_low_u64_be(value: u64) -> Self { - let value_bytes = value.to_be_bytes(); - let mut buffer = [0x0; N]; - let bytes_to_copy = value_bytes.len().min(buffer.len()); - // Panic-free because bytes_to_copy <= buffer.len() - let start_index = buffer - .len() - .safe_sub(bytes_to_copy) - .expect("bytes_to_copy <= buffer.len()"); - // Panic-free because start_index <= buffer.len() - // and bytes_to_copy <= value_bytes.len() - buffer - .get_mut(start_index..) - .expect("start_index <= buffer.len()") - .copy_from_slice( - value_bytes - .get(..bytes_to_copy) - .expect("bytes_to_copy <= value_byte.len()"), - ); - Self::from(buffer) - } - - fn from_low_u64_le(value: u64) -> Self { - let value_bytes = value.to_le_bytes(); - let mut buffer = [0x0; N]; - let bytes_to_copy = value_bytes.len().min(buffer.len()); - // Panic-free because bytes_to_copy <= buffer.len() - // and bytes_to_copy <= value_bytes.len() - buffer - .get_mut(..bytes_to_copy) - .expect("bytes_to_copy <= buffer.len()") - .copy_from_slice( - value_bytes - .get(..bytes_to_copy) - .expect("bytes_to_copy <= value_byte.len()"), - ); - Self::from(buffer) - } - - fn zero() -> Self { - Self::ZERO - } -} +type H256 = fixed_bytes::Hash256; +pub use fixed_bytes::FixedBytesExtended; const MAX_TREE_DEPTH: usize = 32; const EMPTY_SLICE: &[H256] = &[]; diff --git a/consensus/swap_or_not_shuffle/Cargo.toml b/consensus/swap_or_not_shuffle/Cargo.toml index bebf8f1d04d..aff0225edd4 100644 --- a/consensus/swap_or_not_shuffle/Cargo.toml +++ b/consensus/swap_or_not_shuffle/Cargo.toml @@ -14,6 +14,7 @@ criterion = { workspace = true } [dependencies] alloy-primitives = { workspace = true } ethereum_hashing = { workspace = true } +fixed_bytes = { workspace = true } [features] arbitrary = ["alloy-primitives/arbitrary"] diff --git a/consensus/swap_or_not_shuffle/src/lib.rs b/consensus/swap_or_not_shuffle/src/lib.rs index f6e6ac051af..c6af6b77516 100644 --- a/consensus/swap_or_not_shuffle/src/lib.rs +++ b/consensus/swap_or_not_shuffle/src/lib.rs @@ -20,4 +20,4 @@ mod shuffle_list; pub use compute_shuffled_index::compute_shuffled_index; pub use shuffle_list::shuffle_list; -type Hash256 = alloy_primitives::B256; +type Hash256 = fixed_bytes::Hash256; diff --git a/consensus/types/Cargo.toml b/consensus/types/Cargo.toml index 80eeec53334..c1559a407cf 100644 --- a/consensus/types/Cargo.toml +++ b/consensus/types/Cargo.toml @@ -52,6 +52,7 @@ maplit = { workspace = true } alloy-rlp = { version = "0.3.4", features = ["derive"] } milhouse = { workspace = true } rpds = { workspace = true } +fixed_bytes = { workspace = true } [dev-dependencies] criterion = { workspace = true } diff --git a/consensus/types/src/beacon_state.rs b/consensus/types/src/beacon_state.rs index 8f42e8ab47c..a08f6d720c7 100644 --- a/consensus/types/src/beacon_state.rs +++ b/consensus/types/src/beacon_state.rs @@ -1,7 +1,7 @@ use self::committee_cache::get_active_validator_indices; -use crate::fixed_bytes::FixedBytesExtended; use crate::historical_summary::HistoricalSummary; use crate::test_utils::TestRandom; +use crate::FixedBytesExtended; use crate::*; use compare_fields::CompareFields; use compare_fields_derive::CompareFields; diff --git a/consensus/types/src/lib.rs b/consensus/types/src/lib.rs index 042487ffb4a..afc64e86a82 100644 --- a/consensus/types/src/lib.rs +++ b/consensus/types/src/lib.rs @@ -41,7 +41,6 @@ pub mod eth_spec; pub mod execution_block_hash; pub mod execution_payload; pub mod execution_payload_header; -pub mod fixed_bytes; pub mod fork; pub mod fork_data; pub mod fork_name; @@ -170,7 +169,6 @@ pub use crate::execution_payload_header::{ ExecutionPayloadHeaderDeneb, ExecutionPayloadHeaderElectra, ExecutionPayloadHeaderRef, ExecutionPayloadHeaderRefMut, }; -pub use crate::fixed_bytes::FixedBytesExtended; pub use crate::fork::Fork; pub use crate::fork_context::ForkContext; pub use crate::fork_data::ForkData; @@ -254,11 +252,12 @@ pub use crate::voluntary_exit::VoluntaryExit; pub use crate::withdrawal::Withdrawal; pub use crate::withdrawal_credentials::WithdrawalCredentials; pub use crate::withdrawal_request::WithdrawalRequest; +pub use fixed_bytes::FixedBytesExtended; pub type CommitteeIndex = u64; -pub type Hash256 = alloy_primitives::B256; -pub type Uint256 = alloy_primitives::U256; -pub type Address = alloy_primitives::Address; +pub type Hash256 = fixed_bytes::Hash256; +pub type Uint256 = fixed_bytes::Uint256; +pub type Address = fixed_bytes::Address; pub type ForkVersion = [u8; 4]; pub type BLSFieldElement = Uint256; pub type Blob = FixedVector::BytesPerBlob>; diff --git a/crypto/bls/Cargo.toml b/crypto/bls/Cargo.toml index a9bb9626e74..b65b51230c3 100644 --- a/crypto/bls/Cargo.toml +++ b/crypto/bls/Cargo.toml @@ -17,6 +17,7 @@ arbitrary = { workspace = true } zeroize = { workspace = true } blst = { version = "0.3.3", optional = true } safe_arith = { workspace = true } +fixed_bytes = { workspace = true } [features] arbitrary = [] diff --git a/crypto/bls/src/lib.rs b/crypto/bls/src/lib.rs index 5ae068f865a..6ea85548c0d 100644 --- a/crypto/bls/src/lib.rs +++ b/crypto/bls/src/lib.rs @@ -33,70 +33,19 @@ mod zeroize_hash; pub mod impls; -use alloy_primitives::FixedBytes; pub use generic_public_key::{ INFINITY_PUBLIC_KEY, PUBLIC_KEY_BYTES_LEN, PUBLIC_KEY_UNCOMPRESSED_BYTES_LEN, }; pub use generic_secret_key::SECRET_KEY_BYTES_LEN; pub use generic_signature::{INFINITY_SIGNATURE, SIGNATURE_BYTES_LEN}; pub use get_withdrawal_credentials::get_withdrawal_credentials; -use safe_arith::SafeArith; pub use zeroize_hash::ZeroizeHash; #[cfg(feature = "supranational")] use blst::BLST_ERROR as BlstError; -pub type Hash256 = alloy_primitives::B256; -pub trait FixedBytesExtended { - fn from_low_u64_be(value: u64) -> Self; - fn from_low_u64_le(value: u64) -> Self; - fn zero() -> Self; -} - -impl FixedBytesExtended for FixedBytes { - fn from_low_u64_be(value: u64) -> Self { - let value_bytes = value.to_be_bytes(); - let mut buffer = [0x0; N]; - let bytes_to_copy = value_bytes.len().min(buffer.len()); - // Panic-free because bytes_to_copy <= buffer.len() - let start_index = buffer - .len() - .safe_sub(bytes_to_copy) - .expect("bytes_to_copy <= buffer.len()"); - // Panic-free because start_index <= buffer.len() - // and bytes_to_copy <= value_bytes.len() - buffer - .get_mut(start_index..) - .expect("start_index <= buffer.len()") - .copy_from_slice( - value_bytes - .get(..bytes_to_copy) - .expect("bytes_to_copy <= value_byte.len()"), - ); - Self::from(buffer) - } - - fn from_low_u64_le(value: u64) -> Self { - let value_bytes = value.to_le_bytes(); - let mut buffer = [0x0; N]; - let bytes_to_copy = value_bytes.len().min(buffer.len()); - // Panic-free because bytes_to_copy <= buffer.len(), - // and bytes_to_copy <= value_bytes.len() - buffer - .get_mut(..bytes_to_copy) - .expect("bytes_to_copy <= buffer.len()") - .copy_from_slice( - value_bytes - .get(..bytes_to_copy) - .expect("bytes_to_copy <= value_byte.len()"), - ); - Self::from(buffer) - } - - fn zero() -> Self { - Self::ZERO - } -} +pub type Hash256 = fixed_bytes::Hash256; +pub use fixed_bytes::FixedBytesExtended; #[derive(Clone, Debug, PartialEq)] pub enum Error { From 88c75bd47c88a4ff9cbdcafbd7ca4a206a4e922e Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Sat, 31 Aug 2024 22:10:11 -0700 Subject: [PATCH 54/62] minor fixes --- consensus/types/src/execution_transaction.rs | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 consensus/types/src/execution_transaction.rs diff --git a/consensus/types/src/execution_transaction.rs b/consensus/types/src/execution_transaction.rs deleted file mode 100644 index e69de29bb2d..00000000000 From e555728d25bb960595f4eef6f64ea074317921ad Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Sun, 1 Sep 2024 08:33:53 -0700 Subject: [PATCH 55/62] convert u256 to i64 --- Cargo.lock | 1 + beacon_node/execution_layer/Cargo.toml | 1 + beacon_node/execution_layer/src/lib.rs | 5 ++--- consensus/fixed_bytes/src/lib.rs | 17 ++++++++++++++++- testing/ef_tests/src/cases/epoch_processing.rs | 1 - testing/ef_tests/src/cases/fork_choice.rs | 1 - 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e9aca16e48..0ccf7865894 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3006,6 +3006,7 @@ dependencies = [ "ethereum_serde_utils", "ethereum_ssz", "ethers-core", + "fixed_bytes", "fork_choice", "hash-db", "hash256-std-hasher", diff --git a/beacon_node/execution_layer/Cargo.toml b/beacon_node/execution_layer/Cargo.toml index e93d1480d80..93d8086149d 100644 --- a/beacon_node/execution_layer/Cargo.toml +++ b/beacon_node/execution_layer/Cargo.toml @@ -51,3 +51,4 @@ eth2_network_config = { workspace = true } alloy-rlp = { workspace = true } alloy-consensus = { workspace = true } lighthouse_version = { workspace = true } +fixed_bytes = { workspace = true } diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index ce11211e98b..a42b555cd0a 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -19,6 +19,7 @@ pub use engines::{EngineState, ForkchoiceState}; use eth2::types::FullPayloadContents; use eth2::types::{builder_bid::SignedBuilderBid, BlobsBundle, ForkVersionedResponse}; use ethers_core::types::Transaction as EthersTransaction; +use fixed_bytes::UintExtended; use fork_choice::ForkchoiceUpdateParameters; use lru::LruCache; use payload_status::process_payload_status; @@ -2196,12 +2197,10 @@ fn verify_builder_bid( let is_signature_valid = bid.data.verify_signature(spec); let header = &bid.data.message.header(); - // Avoid logging values that we can't represent with our Prometheus library. - let payload_value_gwei = bid.data.message.value() / Uint256::from(1_000_000_000); metrics::set_gauge_vec( &metrics::EXECUTION_LAYER_PAYLOAD_BIDS, &[metrics::BUILDER], - payload_value_gwei.as_le_slice().get_i64(), + bid.data.message.value().to_i64(), ); let expected_withdrawals_root = payload_attributes diff --git a/consensus/fixed_bytes/src/lib.rs b/consensus/fixed_bytes/src/lib.rs index 4e32dc88eeb..5cd60321d3e 100644 --- a/consensus/fixed_bytes/src/lib.rs +++ b/consensus/fixed_bytes/src/lib.rs @@ -1,4 +1,4 @@ -use alloy_primitives::FixedBytes; +use alloy_primitives::{FixedBytes, Uint}; use safe_arith::SafeArith; pub type Hash64 = alloy_primitives::B64; @@ -6,6 +6,10 @@ pub type Hash256 = alloy_primitives::B256; pub type Uint256 = alloy_primitives::U256; pub type Address = alloy_primitives::Address; +pub trait UintExtended { + fn to_i64(self) -> i64; +} + pub trait FixedBytesExtended { fn from_low_u64_be(value: u64) -> Self; fn from_low_u64_le(value: u64) -> Self; @@ -70,3 +74,14 @@ impl FixedBytesExtended for alloy_primitives::Address { FixedBytes::<20>::zero().into() } } + +impl UintExtended for Uint256 { + /// Trims the Uint256 to 8 bytes and converts it to i64 + fn to_i64(self) -> i64 { + let mut result = [0u8; 8]; + let bytes = self.to_le_bytes::<32>(); + // Panic-free because result.len() == bytes[0..8].len() + result.copy_from_slice(&bytes[0..8]); + i64::from_le_bytes(result) + } +} diff --git a/testing/ef_tests/src/cases/epoch_processing.rs b/testing/ef_tests/src/cases/epoch_processing.rs index 7a292af6401..dfd782a22b3 100644 --- a/testing/ef_tests/src/cases/epoch_processing.rs +++ b/testing/ef_tests/src/cases/epoch_processing.rs @@ -201,7 +201,6 @@ impl EpochTransition for PendingBalanceDeposits { } } -// TODO(alloy) test fails here impl EpochTransition for PendingConsolidations { fn run(state: &mut BeaconState, spec: &ChainSpec) -> Result<(), EpochProcessingError> { initialize_epoch_cache(state, spec)?; diff --git a/testing/ef_tests/src/cases/fork_choice.rs b/testing/ef_tests/src/cases/fork_choice.rs index cd920969f86..2a2cc067e58 100644 --- a/testing/ef_tests/src/cases/fork_choice.rs +++ b/testing/ef_tests/src/cases/fork_choice.rs @@ -33,7 +33,6 @@ use types::{ #[serde(deny_unknown_fields)] pub struct PowBlock { pub block_hash: ExecutionBlockHash, - pub parent_hash: ExecutionBlockHash, pub total_difficulty: Uint256, } From 4cf9de815d4d24e802d07677318c388f72adc0a2 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Sun, 1 Sep 2024 08:47:19 -0700 Subject: [PATCH 56/62] panic free mixin to_low_u64_le --- beacon_node/beacon_chain/src/metrics.rs | 4 ++-- consensus/fixed_bytes/src/lib.rs | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/beacon_node/beacon_chain/src/metrics.rs b/beacon_node/beacon_chain/src/metrics.rs index d8a6d975aaa..3da2bea36c8 100644 --- a/beacon_node/beacon_chain/src/metrics.rs +++ b/beacon_node/beacon_chain/src/metrics.rs @@ -1,7 +1,7 @@ use crate::observed_attesters::SlotSubcommitteeIndex; use crate::types::consts::altair::SYNC_COMMITTEE_SUBNET_COUNT; use crate::{BeaconChain, BeaconChainError, BeaconChainTypes}; -use alloy_primitives::bytes::Buf; +use bls::FixedBytesExtended; pub use lighthouse_metrics::*; use slot_clock::SlotClock; use std::sync::LazyLock; @@ -2134,7 +2134,7 @@ fn set_gauge_by_epoch(gauge: &Result, value: Epoch) { } fn set_gauge_by_hash(gauge: &Result, value: Hash256) { - set_gauge(gauge, value.as_slice().get_i64()); + set_gauge(gauge, value.to_low_u64_le() as i64); } fn set_gauge_by_usize(gauge: &Result, value: usize) { diff --git a/consensus/fixed_bytes/src/lib.rs b/consensus/fixed_bytes/src/lib.rs index 5cd60321d3e..6fca031956a 100644 --- a/consensus/fixed_bytes/src/lib.rs +++ b/consensus/fixed_bytes/src/lib.rs @@ -13,6 +13,7 @@ pub trait UintExtended { pub trait FixedBytesExtended { fn from_low_u64_be(value: u64) -> Self; fn from_low_u64_le(value: u64) -> Self; + fn to_low_u64_le(&self) -> u64; fn zero() -> Self; } @@ -59,6 +60,15 @@ impl FixedBytesExtended for FixedBytes { fn zero() -> Self { Self::ZERO } + + /// Trims FixedBytes to its first 8 bytes and converts to u64 + fn to_low_u64_le(&self) -> u64 { + let mut result = [0u8; 8]; + let bytes = self.as_slice(); + // Panic-free because result.len() == bytes[0..8].len() + result.copy_from_slice(&bytes[0..8]); + u64::from_le_bytes(result) + } } impl FixedBytesExtended for alloy_primitives::Address { @@ -73,10 +83,14 @@ impl FixedBytesExtended for alloy_primitives::Address { fn zero() -> Self { FixedBytes::<20>::zero().into() } + + fn to_low_u64_le(&self) -> u64 { + FixedBytes::<20>::to_low_u64_le(&self) + } } impl UintExtended for Uint256 { - /// Trims the Uint256 to 8 bytes and converts it to i64 + /// Trims the Uint256 to its first 8 bytes and converts to i64 fn to_i64(self) -> i64 { let mut result = [0u8; 8]; let bytes = self.to_le_bytes::<32>(); From a7876e7c74a2641dcf644900f7a3262849cc4019 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Sun, 1 Sep 2024 08:49:47 -0700 Subject: [PATCH 57/62] from_str_radix --- common/eth2/src/types.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/eth2/src/types.rs b/common/eth2/src/types.rs index 72294aefaf7..3925d2deda8 100644 --- a/common/eth2/src/types.rs +++ b/common/eth2/src/types.rs @@ -1793,12 +1793,12 @@ impl TryFrom<&HeaderMap> for ProduceBlockV3Metadata { })?; let execution_payload_value = parse_required_header(headers, EXECUTION_PAYLOAD_VALUE_HEADER, |s| { - Uint256::from_str(s) + Uint256::from_str_radix(s, 10) .map_err(|e| format!("invalid {EXECUTION_PAYLOAD_VALUE_HEADER}: {e:?}")) })?; let consensus_block_value = parse_required_header(headers, CONSENSUS_BLOCK_VALUE_HEADER, |s| { - Uint256::from_str(s) + Uint256::from_str_radix(s, 10) .map_err(|e| format!("invalid {CONSENSUS_BLOCK_VALUE_HEADER}: {e:?}")) })?; From bbeb7deef650bac4e0ed671f8effd9e0d4747db3 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Sun, 1 Sep 2024 10:37:17 -0700 Subject: [PATCH 58/62] computbe_subnet api and ensuring we use big-endian --- beacon_node/execution_layer/src/lib.rs | 1 - .../src/discovery/subnet_predicate.rs | 3 +-- .../src/peer_manager/peerdb.rs | 4 +--- .../src/peer_manager/peerdb/peer_info.rs | 3 +-- .../lighthouse_network/src/types/globals.rs | 17 +++++++++++------ beacon_node/network/src/service.rs | 3 +-- beacon_node/network/src/service/tests.rs | 2 +- .../src/subnet_service/attestation_subnets.rs | 4 ++-- consensus/fixed_bytes/src/lib.rs | 4 ++-- consensus/types/src/data_column_subnet_id.rs | 18 +++++++++++------- consensus/types/src/subnet_id.rs | 14 +++++++++++--- .../ef_tests/src/cases/get_custody_columns.rs | 4 +++- 12 files changed, 45 insertions(+), 32 deletions(-) diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index a42b555cd0a..6e3aca39594 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -9,7 +9,6 @@ use arc_swap::ArcSwapOption; use auth::{strip_prefix, Auth, JwtKey}; pub use block_hash::calculate_execution_block_hash; use builder_client::BuilderHttpClient; -use bytes::Buf; pub use engine_api::EngineCapabilities; use engine_api::Error as ApiError; pub use engine_api::*; diff --git a/beacon_node/lighthouse_network/src/discovery/subnet_predicate.rs b/beacon_node/lighthouse_network/src/discovery/subnet_predicate.rs index 89119eec316..e198b3ee17f 100644 --- a/beacon_node/lighthouse_network/src/discovery/subnet_predicate.rs +++ b/beacon_node/lighthouse_network/src/discovery/subnet_predicate.rs @@ -1,7 +1,6 @@ //! The subnet predicate used for searching for a particular subnet. use super::*; use crate::types::{EnrAttestationBitfield, EnrSyncCommitteeBitfield}; -use alloy_primitives::U256; use itertools::Itertools; use slog::trace; use std::ops::Deref; @@ -42,7 +41,7 @@ where .map_or(false, |b| b.get(*s.deref() as usize).unwrap_or(false)), Subnet::DataColumn(s) => { let mut subnets = DataColumnSubnetId::compute_custody_subnets::( - U256::from_le_slice(enr.node_id().raw().as_slice()), + enr.node_id().raw(), custody_subnet_count, &spec, ); diff --git a/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs b/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs index 6357fa52121..6e76fd4bb00 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs @@ -3,7 +3,6 @@ use crate::discovery::CombinedKey; use crate::{ metrics, multiaddr::Multiaddr, types::Subnet, Enr, EnrExt, Eth2Enr, Gossipsub, PeerId, }; -use alloy_primitives::U256; use peer_info::{ConnectionDirection, PeerConnectionStatus, PeerInfo}; use rand::seq::SliceRandom; use score::{PeerAction, ReportSource, Score, ScoreState}; @@ -792,10 +791,9 @@ impl PeerDB { ) => { // Update the ENR if one exists, and compute the custody subnets if let Some(enr) = enr { - let node_id = U256::from_be_bytes(enr.node_id().raw()); let custody_subnet_count = enr.custody_subnet_count::(&self.spec); let custody_subnets = DataColumnSubnetId::compute_custody_subnets::( - node_id, + enr.node_id().raw(), custody_subnet_count, &self.spec, ) diff --git a/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs b/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs index c3d92373308..1ea3f8ed5fc 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs @@ -3,7 +3,6 @@ use super::score::{PeerAction, Score, ScoreState}; use super::sync_status::SyncStatus; use crate::discovery::Eth2Enr; use crate::{rpc::MetaData, types::Subnet}; -use alloy_primitives::U256; use discv5::enr::NodeId; use discv5::Enr; use libp2p::core::multiaddr::{Multiaddr, Protocol}; @@ -375,7 +374,7 @@ impl PeerInfo { if self.custody_subnets.is_empty() { if let Ok(custody_subnet_count) = meta_data.custody_subnet_count() { let custody_subnets = DataColumnSubnetId::compute_custody_subnets::( - U256::from_le_slice(&node_id.raw()), + node_id.raw(), std::cmp::min(*custody_subnet_count, spec.data_column_sidecar_subnet_count), spec, ) diff --git a/beacon_node/lighthouse_network/src/types/globals.rs b/beacon_node/lighthouse_network/src/types/globals.rs index c5e3955ce95..c76e0a18577 100644 --- a/beacon_node/lighthouse_network/src/types/globals.rs +++ b/beacon_node/lighthouse_network/src/types/globals.rs @@ -5,7 +5,6 @@ use crate::types::{BackFillState, SyncState}; use crate::EnrExt; use crate::{Client, Eth2Enr}; use crate::{Enr, GossipTopic, Multiaddr, PeerId}; -use alloy_primitives::U256; use parking_lot::RwLock; use std::collections::HashSet; use types::{ChainSpec, ColumnIndex, DataColumnSubnetId, EthSpec}; @@ -122,18 +121,24 @@ impl NetworkGlobals { /// Compute custody data columns the node is assigned to custody. pub fn custody_columns(&self) -> Vec { let enr = self.local_enr(); - let node_id = U256::from_be_bytes(enr.node_id().raw()); let custody_subnet_count = enr.custody_subnet_count::(&self.spec); - DataColumnSubnetId::compute_custody_columns::(node_id, custody_subnet_count, &self.spec) - .collect() + DataColumnSubnetId::compute_custody_columns::( + enr.node_id().raw(), + custody_subnet_count, + &self.spec, + ) + .collect() } /// Compute custody data column subnets the node is assigned to custody. pub fn custody_subnets(&self) -> impl Iterator { let enr = self.local_enr(); - let node_id = U256::from_be_bytes(enr.node_id().raw()); let custody_subnet_count = enr.custody_subnet_count::(&self.spec); - DataColumnSubnetId::compute_custody_subnets::(node_id, custody_subnet_count, &self.spec) + DataColumnSubnetId::compute_custody_subnets::( + enr.node_id().raw(), + custody_subnet_count, + &self.spec, + ) } /// Returns a connected peer that: diff --git a/beacon_node/network/src/service.rs b/beacon_node/network/src/service.rs index 0472a242e18..5b9a3125ea5 100644 --- a/beacon_node/network/src/service.rs +++ b/beacon_node/network/src/service.rs @@ -8,7 +8,6 @@ use crate::{ subnet_service::{AttestationService, SubnetServiceMessage}, NetworkConfig, }; -use alloy_primitives::U256; use beacon_chain::{BeaconChain, BeaconChainTypes}; use beacon_processor::{work_reprocessing_queue::ReprocessQueueMessage, BeaconProcessorSend}; use futures::channel::mpsc::Sender; @@ -810,7 +809,7 @@ impl NetworkService { } } else { for column_subnet in DataColumnSubnetId::compute_custody_subnets::( - U256::from_le_slice(self.network_globals.local_enr().node_id().raw().as_slice()), + self.network_globals.local_enr().node_id().raw(), self.network_globals .local_enr() .custody_subnet_count::<::EthSpec>( diff --git a/beacon_node/network/src/service/tests.rs b/beacon_node/network/src/service/tests.rs index 392c0bfb0ad..c16de352ff5 100644 --- a/beacon_node/network/src/service/tests.rs +++ b/beacon_node/network/src/service/tests.rs @@ -176,7 +176,7 @@ mod tests { // Make sure the service is subscribed to the topics. let (old_topic1, old_topic2) = { let mut subnets = SubnetId::compute_subnets_for_epoch::( - Uint256::from_le_slice(&network_globals.local_enr().node_id().raw()), + &network_globals.local_enr().node_id().raw(), beacon_chain.epoch().unwrap(), &spec, ) diff --git a/beacon_node/network/src/subnet_service/attestation_subnets.rs b/beacon_node/network/src/subnet_service/attestation_subnets.rs index c10d2672097..432a2b7fb7c 100644 --- a/beacon_node/network/src/subnet_service/attestation_subnets.rs +++ b/beacon_node/network/src/subnet_service/attestation_subnets.rs @@ -16,7 +16,7 @@ use futures::prelude::*; use lighthouse_network::{discv5::enr::NodeId, NetworkConfig, Subnet, SubnetDiscovery}; use slog::{debug, error, info, o, trace, warn}; use slot_clock::SlotClock; -use types::{Attestation, EthSpec, Slot, SubnetId, Uint256, ValidatorSubscription}; +use types::{Attestation, EthSpec, Slot, SubnetId, ValidatorSubscription}; use crate::metrics; @@ -315,7 +315,7 @@ impl AttestationService { })?; let (subnets, next_subscription_epoch) = SubnetId::compute_subnets_for_epoch::( - Uint256::from_le_slice(self.node_id.raw().as_slice()), + self.node_id.raw(), current_epoch, &self.beacon_chain.spec, ) diff --git a/consensus/fixed_bytes/src/lib.rs b/consensus/fixed_bytes/src/lib.rs index 6fca031956a..6f43c2152ac 100644 --- a/consensus/fixed_bytes/src/lib.rs +++ b/consensus/fixed_bytes/src/lib.rs @@ -1,4 +1,4 @@ -use alloy_primitives::{FixedBytes, Uint}; +use alloy_primitives::FixedBytes; use safe_arith::SafeArith; pub type Hash64 = alloy_primitives::B64; @@ -85,7 +85,7 @@ impl FixedBytesExtended for alloy_primitives::Address { } fn to_low_u64_le(&self) -> u64 { - FixedBytes::<20>::to_low_u64_le(&self) + FixedBytes::<20>::to_low_u64_le(self) } } diff --git a/consensus/types/src/data_column_subnet_id.rs b/consensus/types/src/data_column_subnet_id.rs index 915f9180066..f650dafa795 100644 --- a/consensus/types/src/data_column_subnet_id.rs +++ b/consensus/types/src/data_column_subnet_id.rs @@ -38,7 +38,7 @@ impl DataColumnSubnetId { /// Compute required subnets to subscribe to given the node id. #[allow(clippy::arithmetic_side_effects)] pub fn compute_custody_subnets( - node_id: U256, + raw_node_id: [u8; 32], custody_subnet_count: u64, spec: &ChainSpec, ) -> impl Iterator { @@ -46,7 +46,7 @@ impl DataColumnSubnetId { // value, but here we assume it is valid. let mut subnets: HashSet = HashSet::new(); - let mut current_id = node_id; + let mut current_id = U256::from_be_slice(&raw_node_id); while (subnets.len() as u64) < custody_subnet_count { let mut node_id_bytes = [0u8; 32]; node_id_bytes.copy_from_slice(current_id.as_le_slice()); @@ -70,11 +70,11 @@ impl DataColumnSubnetId { } pub fn compute_custody_columns( - node_id: U256, + raw_node_id: [u8; 32], custody_subnet_count: u64, spec: &ChainSpec, ) -> impl Iterator { - Self::compute_custody_subnets::(node_id, custody_subnet_count, spec) + Self::compute_custody_subnets::(raw_node_id, custody_subnet_count, spec) .flat_map(|subnet| subnet.columns::(spec)) .sorted() } @@ -131,11 +131,10 @@ impl From for Error { #[cfg(test)] mod test { - use alloy_primitives::U256; - use crate::data_column_subnet_id::DataColumnSubnetId; use crate::EthSpec; use crate::MainnetEthSpec; + use crate::Uint256; type E = MainnetEthSpec; @@ -155,7 +154,12 @@ mod test { "103822458477361691467064888613019442068586830412598673713899771287914656699997", ] .into_iter() - .map(|v| U256::from_str_radix(v, 10).unwrap()) + .map(|v| { + let bytes = Uint256::from_str_radix(v, 10).unwrap().to_be_bytes::<32>(); + let mut result = [0u8; 32]; + result.copy_from_slice(&bytes); + result + }) .collect::>(); let custody_requirement = 4; diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index 7288d6fb3db..61527ca8687 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -78,7 +78,7 @@ impl SubnetId { /// along with the first epoch in which these subscriptions are no longer valid. #[allow(clippy::arithmetic_side_effects)] pub fn compute_subnets_for_epoch( - node_id: U256, + raw_node_id: [u8; 32], epoch: Epoch, spec: &ChainSpec, ) -> Result<(impl Iterator, Epoch), &'static str> { @@ -86,6 +86,7 @@ impl SubnetId { let subscription_duration = spec.epochs_per_subnet_subscription; let prefix_bits = spec.attestation_subnet_prefix_bits as u64; let shuffling_prefix_bits = spec.attestation_subnet_shuffling_prefix_bits as u64; + let node_id = U256::from_be_slice(&raw_node_id); // calculate the prefixes used to compute the subnet and shuffling let node_id_prefix = (node_id >> (256 - prefix_bits)).as_le_slice().get_u64_le(); @@ -173,6 +174,8 @@ impl AsRef for SubnetId { #[cfg(test)] mod tests { + use crate::Uint256; + use super::*; /// A set of tests compared to the python specification @@ -191,7 +194,12 @@ mod tests { "60930578857433095740782970114409273483106482059893286066493409689627770333527", "103822458477361691467064888613019442068586830412598673713899771287914656699997", ] - .map(|v| v.parse::().unwrap()); + .map(|v| { + let bytes = Uint256::from_str_radix(v, 10).unwrap().to_be_bytes::<32>(); + let mut result = [0u8; 32]; + result.copy_from_slice(&bytes); + result + }); let epochs = [ 54321u64, 1017090249, 1827566880, 846255942, 766597383, 1204990115, 1616209495, @@ -225,7 +233,7 @@ mod tests { for x in 0..node_ids.len() { println!("Test: {}", x); println!( - "NodeId: {}\n Epoch: {}\n, expected_update_time: {}\n, expected_subnets: {:?}", + "NodeId: {:?}\n Epoch: {}\n, expected_update_time: {}\n, expected_subnets: {:?}", node_ids[x], epochs[x], expected_valid_time[x], expected_subnets[x] ); diff --git a/testing/ef_tests/src/cases/get_custody_columns.rs b/testing/ef_tests/src/cases/get_custody_columns.rs index d96a22951ef..6b3e95dbb84 100644 --- a/testing/ef_tests/src/cases/get_custody_columns.rs +++ b/testing/ef_tests/src/cases/get_custody_columns.rs @@ -25,8 +25,10 @@ impl Case for GetCustodyColumns { let spec = E::default_spec(); let node_id = U256::from_str_radix(&self.node_id, 10) .map_err(|e| Error::FailedToParseTest(format!("{e:?}")))?; + let mut raw_node_id = [0u8; 32]; + raw_node_id.copy_from_slice(&node_id.to_be_bytes::<32>()); let computed = DataColumnSubnetId::compute_custody_columns::( - node_id, + raw_node_id, self.custody_subnet_count, &spec, ) From c36aee489cbd1e4149574e7b7402311e43557c0f Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Sun, 1 Sep 2024 10:51:40 -0700 Subject: [PATCH 59/62] fix test --- beacon_node/network/src/service/tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beacon_node/network/src/service/tests.rs b/beacon_node/network/src/service/tests.rs index c16de352ff5..fec5f3f83f7 100644 --- a/beacon_node/network/src/service/tests.rs +++ b/beacon_node/network/src/service/tests.rs @@ -14,7 +14,7 @@ mod tests { use std::str::FromStr; use std::sync::Arc; use tokio::runtime::Runtime; - use types::{Epoch, EthSpec, ForkName, MinimalEthSpec, SubnetId, Uint256}; + use types::{Epoch, EthSpec, ForkName, MinimalEthSpec, SubnetId}; impl NetworkService { fn get_topic_params(&self, topic: GossipTopic) -> Option<&gossipsub::TopicScoreParams> { @@ -176,7 +176,7 @@ mod tests { // Make sure the service is subscribed to the topics. let (old_topic1, old_topic2) = { let mut subnets = SubnetId::compute_subnets_for_epoch::( - &network_globals.local_enr().node_id().raw(), + network_globals.local_enr().node_id().raw(), beacon_chain.epoch().unwrap(), &spec, ) From 4967294069b5beaecc05ece765050a2abd3b673a Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Mon, 2 Sep 2024 10:54:41 +1000 Subject: [PATCH 60/62] Simplify subnet_id test --- consensus/types/src/subnet_id.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index 61527ca8687..9bfe6fb261c 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -194,12 +194,7 @@ mod tests { "60930578857433095740782970114409273483106482059893286066493409689627770333527", "103822458477361691467064888613019442068586830412598673713899771287914656699997", ] - .map(|v| { - let bytes = Uint256::from_str_radix(v, 10).unwrap().to_be_bytes::<32>(); - let mut result = [0u8; 32]; - result.copy_from_slice(&bytes); - result - }); + .map(|v| Uint256::from_str_radix(v, 10).unwrap().to_be_bytes::<32>()); let epochs = [ 54321u64, 1017090249, 1827566880, 846255942, 766597383, 1204990115, 1616209495, From 4bf44c5e0ab6965d5172ada0aae1b7a33f8d93fc Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Mon, 2 Sep 2024 11:02:24 +1000 Subject: [PATCH 61/62] Simplify some more tests --- consensus/types/src/data_column_subnet_id.rs | 7 +------ testing/ef_tests/src/cases/get_custody_columns.rs | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/consensus/types/src/data_column_subnet_id.rs b/consensus/types/src/data_column_subnet_id.rs index f650dafa795..df964cf8de7 100644 --- a/consensus/types/src/data_column_subnet_id.rs +++ b/consensus/types/src/data_column_subnet_id.rs @@ -154,12 +154,7 @@ mod test { "103822458477361691467064888613019442068586830412598673713899771287914656699997", ] .into_iter() - .map(|v| { - let bytes = Uint256::from_str_radix(v, 10).unwrap().to_be_bytes::<32>(); - let mut result = [0u8; 32]; - result.copy_from_slice(&bytes); - result - }) + .map(|v| Uint256::from_str_radix(v, 10).unwrap().to_be_bytes::<32>()) .collect::>(); let custody_requirement = 4; diff --git a/testing/ef_tests/src/cases/get_custody_columns.rs b/testing/ef_tests/src/cases/get_custody_columns.rs index 6b3e95dbb84..d31e72a473d 100644 --- a/testing/ef_tests/src/cases/get_custody_columns.rs +++ b/testing/ef_tests/src/cases/get_custody_columns.rs @@ -25,8 +25,7 @@ impl Case for GetCustodyColumns { let spec = E::default_spec(); let node_id = U256::from_str_radix(&self.node_id, 10) .map_err(|e| Error::FailedToParseTest(format!("{e:?}")))?; - let mut raw_node_id = [0u8; 32]; - raw_node_id.copy_from_slice(&node_id.to_be_bytes::<32>()); + let raw_node_id = node_id.to_be_bytes::<32>(); let computed = DataColumnSubnetId::compute_custody_columns::( raw_node_id, self.custody_subnet_count, From 8c83b2c0330f9e38f7319a10f9e8dfc2198df6fa Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Mon, 2 Sep 2024 11:26:28 +1000 Subject: [PATCH 62/62] Add tests to fixed_bytes crate --- Cargo.toml | 1 + consensus/fixed_bytes/src/lib.rs | 59 ++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 777470c102d..8c6aa308c1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,6 +52,7 @@ members = [ "database_manager", "consensus/int_to_bytes", + "consensus/fixed_bytes", "consensus/fork_choice", "consensus/proto_array", "consensus/safe_arith", diff --git a/consensus/fixed_bytes/src/lib.rs b/consensus/fixed_bytes/src/lib.rs index 6f43c2152ac..efd3e593b93 100644 --- a/consensus/fixed_bytes/src/lib.rs +++ b/consensus/fixed_bytes/src/lib.rs @@ -99,3 +99,62 @@ impl UintExtended for Uint256 { i64::from_le_bytes(result) } } + +#[cfg(test)] +mod test { + use super::*; + use alloy_primitives::bytes::Buf; + + #[test] + fn from_low_u64_be() { + let values = [0, 1, 0xff, 1 << 16, u64::MAX, u64::MAX - 1]; + for value in values { + assert_eq!( + (&Hash256::from_low_u64_be(value).as_slice()[24..]).get_u64(), + value + ); + } + } + + #[test] + fn from_low_u64_le() { + let values = [0, 1, 0xff, 1 << 16, u64::MAX, u64::MAX - 1]; + for value in values { + assert_eq!( + u64::from_le_bytes( + Hash256::from_low_u64_le(value).as_slice()[0..8] + .try_into() + .unwrap() + ), + value + ); + } + } + + #[test] + fn to_low_u64_le() { + let values = [0, 1, 0xff, 1 << 16, u64::MAX, u64::MAX - 1]; + for value in values { + assert_eq!(Hash256::from_low_u64_le(value).to_low_u64_le(), value); + } + } + + #[test] + fn to_i64_in_range() { + let values = [0, 1, 0xff, 1 << 16, i64::MAX, i64::MAX - 1]; + for value in values { + assert_eq!(Uint256::from(value).to_i64(), value); + } + } + + #[test] + fn to_i64_out_of_range() { + let values = [u128::MAX, 1 << 70, 1 << 80, i64::MAX as u128 + 1]; + for value in values { + assert_eq!( + Uint256::from(value).to_i64(), + i64::from_le_bytes(value.to_le_bytes()[0..8].try_into().unwrap()) + ); + } + } +}