Skip to content

Commit

Permalink
Apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
macladson committed Mar 18, 2024
1 parent 1089cb5 commit ef724dc
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 21 deletions.
1 change: 1 addition & 0 deletions beacon_node/beacon_chain/src/electra_readiness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
}
}
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ---------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ---------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/local_testnet/vars.env
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 12 additions & 5 deletions testing/ef_tests/src/cases/merkle_proof_validity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -93,15 +96,19 @@ pub struct KzgInclusionMerkleProofValidity<E: EthSpec> {

impl<E: EthSpec> LoadCase for KzgInclusionMerkleProofValidity<E> {
fn load_from_dir(path: &Path, fork_name: ForkName) -> Result<Self, Error> {
let block = match fork_name {
let block: BeaconBlockBody<E, FullPayload<E>> = 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::<BeaconBlockBodyDeneb<E>>(&path.join("object.ssz_snappy"))?
ForkName::Deneb => {
ssz_decode_file::<BeaconBlockBodyDeneb<E>>(&path.join("object.ssz_snappy"))?.into()
}
ForkName::Electra => {
ssz_decode_file::<BeaconBlockBodyElectra<E>>(&path.join("object.ssz_snappy"))?
.into()
}
};
let merkle_proof = yaml_decode_file(&path.join("proof.yaml"))?;
Expand All @@ -115,7 +122,7 @@ impl<E: EthSpec> LoadCase for KzgInclusionMerkleProofValidity<E> {

Ok(Self {
metadata,
block: block.into(),
block,
merkle_proof,
})
}
Expand Down

0 comments on commit ef724dc

Please sign in to comment.