From ef724dc9e0a63bb574b3a1bf47c78c629b8a973b Mon Sep 17 00:00:00 2001 From: Mac L Date: Mon, 18 Mar 2024 12:33:57 +1100 Subject: [PATCH] Apply suggestions --- .../beacon_chain/src/electra_readiness.rs | 1 + .../built_in_network_configs/chiado/config.yaml | 4 +++- .../built_in_network_configs/gnosis/config.yaml | 6 ------ .../holesky/config.yaml | 5 +++-- .../mainnet/config.yaml | 6 ------ scripts/local_testnet/vars.env | 2 +- .../ef_tests/src/cases/merkle_proof_validity.rs | 17 ++++++++++++----- 7 files changed, 20 insertions(+), 21 deletions(-) diff --git a/beacon_node/beacon_chain/src/electra_readiness.rs b/beacon_node/beacon_chain/src/electra_readiness.rs index 5e604b260f3..0e911bf37ec 100644 --- a/beacon_node/beacon_chain/src/electra_readiness.rs +++ b/beacon_node/beacon_chain/src/electra_readiness.rs @@ -88,6 +88,7 @@ impl BeaconChain { } } Ok(capabilities) => { + // TODO(electra): Update in the event we get V4s. let mut missing_methods = String::from("Required Methods Unsupported:"); let mut all_good = true; if !capabilities.get_payload_v3 { diff --git a/common/eth2_network_config/built_in_network_configs/chiado/config.yaml b/common/eth2_network_config/built_in_network_configs/chiado/config.yaml index 8064ea55563..c869d9cfc83 100644 --- a/common/eth2_network_config/built_in_network_configs/chiado/config.yaml +++ b/common/eth2_network_config/built_in_network_configs/chiado/config.yaml @@ -46,7 +46,9 @@ CAPELLA_FORK_EPOCH: 244224 # Wed May 24 2023 13:12:00 GMT+0000 # Deneb DENEB_FORK_VERSION: 0x0400006f DENEB_FORK_EPOCH: 516608 # Wed Jan 31 2024 18:15:40 GMT+0000 - +# Electra +ELECTRA_FORK_VERSION: 0x0500006f +ELECTRA_FORK_EPOCH: 18446744073709551615 # Time parameters # --------------------------------------------------------------- diff --git a/common/eth2_network_config/built_in_network_configs/gnosis/config.yaml b/common/eth2_network_config/built_in_network_configs/gnosis/config.yaml index 00d1a6a254d..7558b482506 100644 --- a/common/eth2_network_config/built_in_network_configs/gnosis/config.yaml +++ b/common/eth2_network_config/built_in_network_configs/gnosis/config.yaml @@ -45,12 +45,6 @@ DENEB_FORK_EPOCH: 889856 # 2024-03-11T18:30:20.000Z # Electra ELECTRA_FORK_VERSION: 0x05000064 ELECTRA_FORK_EPOCH: 18446744073709551615 -# Sharding -SHARDING_FORK_VERSION: 0x03000064 -SHARDING_FORK_EPOCH: 18446744073709551615 - -# TBD, 2**32 is a placeholder. Merge transition approach is in active R&D. -TRANSITION_TOTAL_DIFFICULTY: 4294967296 # Time parameters diff --git a/common/eth2_network_config/built_in_network_configs/holesky/config.yaml b/common/eth2_network_config/built_in_network_configs/holesky/config.yaml index 1104791ed5b..947924a7d16 100644 --- a/common/eth2_network_config/built_in_network_configs/holesky/config.yaml +++ b/common/eth2_network_config/built_in_network_configs/holesky/config.yaml @@ -28,14 +28,15 @@ BELLATRIX_FORK_EPOCH: 0 TERMINAL_TOTAL_DIFFICULTY: 0 TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000 TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615 - # Capella CAPELLA_FORK_VERSION: 0x04017000 CAPELLA_FORK_EPOCH: 256 - # Deneb DENEB_FORK_VERSION: 0x05017000 DENEB_FORK_EPOCH: 29696 +# Electra +ELECTRA_FORK_VERSION: 0x06017000 +ELECTRA_FORK_EPOCH: 18446744073709551615 # Time parameters # --------------------------------------------------------------- diff --git a/common/eth2_network_config/built_in_network_configs/mainnet/config.yaml b/common/eth2_network_config/built_in_network_configs/mainnet/config.yaml index 568e2d7629d..c8695123ab0 100644 --- a/common/eth2_network_config/built_in_network_configs/mainnet/config.yaml +++ b/common/eth2_network_config/built_in_network_configs/mainnet/config.yaml @@ -53,12 +53,6 @@ DENEB_FORK_EPOCH: 269568 # March 13, 2024, 01:55:35pm UTC # Electra ELECTRA_FORK_VERSION: 0x05000000 ELECTRA_FORK_EPOCH: 18446744073709551615 -# Sharding -SHARDING_FORK_VERSION: 0x03000000 -SHARDING_FORK_EPOCH: 18446744073709551615 - -# TBD, 2**32 is a placeholder. Merge transition approach is in active R&D. -TRANSITION_TOTAL_DIFFICULTY: 4294967296 # Time parameters diff --git a/scripts/local_testnet/vars.env b/scripts/local_testnet/vars.env index bd5268d1157..9bdec71ff78 100644 --- a/scripts/local_testnet/vars.env +++ b/scripts/local_testnet/vars.env @@ -46,7 +46,7 @@ ALTAIR_FORK_EPOCH=0 BELLATRIX_FORK_EPOCH=0 CAPELLA_FORK_EPOCH=0 DENEB_FORK_EPOCH=1 -ELECTRA_FORK_EPOCH=18446744073709551615 +ELECTRA_FORK_EPOCH=9999999 TTD=0 diff --git a/testing/ef_tests/src/cases/merkle_proof_validity.rs b/testing/ef_tests/src/cases/merkle_proof_validity.rs index 9367080c5f9..9e99d86505c 100644 --- a/testing/ef_tests/src/cases/merkle_proof_validity.rs +++ b/testing/ef_tests/src/cases/merkle_proof_validity.rs @@ -3,7 +3,10 @@ use crate::decode::{ssz_decode_file, ssz_decode_state, yaml_decode_file}; use serde::Deserialize; use std::path::Path; use tree_hash::Hash256; -use types::{BeaconBlockBody, BeaconBlockBodyDeneb, BeaconState, EthSpec, ForkName}; +use types::{ + BeaconBlockBody, BeaconBlockBodyDeneb, BeaconBlockBodyElectra, BeaconState, EthSpec, ForkName, + FullPayload, +}; #[derive(Debug, Clone, Deserialize)] pub struct Metadata { @@ -93,15 +96,19 @@ pub struct KzgInclusionMerkleProofValidity { impl LoadCase for KzgInclusionMerkleProofValidity { fn load_from_dir(path: &Path, fork_name: ForkName) -> Result { - let block = match fork_name { + let block: BeaconBlockBody> = match fork_name { ForkName::Base | ForkName::Altair | ForkName::Merge | ForkName::Capella => { return Err(Error::InternalError(format!( "KZG inclusion merkle proof validity test skipped for {:?}", fork_name ))) } - ForkName::Deneb | ForkName::Electra => { - ssz_decode_file::>(&path.join("object.ssz_snappy"))? + ForkName::Deneb => { + ssz_decode_file::>(&path.join("object.ssz_snappy"))?.into() + } + ForkName::Electra => { + ssz_decode_file::>(&path.join("object.ssz_snappy"))? + .into() } }; let merkle_proof = yaml_decode_file(&path.join("proof.yaml"))?; @@ -115,7 +122,7 @@ impl LoadCase for KzgInclusionMerkleProofValidity { Ok(Self { metadata, - block: block.into(), + block, merkle_proof, }) }