diff --git a/beacon_node/network/src/status.rs b/beacon_node/network/src/status.rs index 27689a741..865f8ee93 100644 --- a/beacon_node/network/src/status.rs +++ b/beacon_node/network/src/status.rs @@ -18,7 +18,7 @@ impl ToStatusMessage for BeaconChain { /// Build a `StatusMessage` representing the state of the given `beacon_chain`. pub(crate) fn status_message(beacon_chain: &BeaconChain) -> StatusMessage { - let fork_digest = [0x9c, 0x67, 0x11, 0x28]; + let fork_digest = beacon_chain.enr_fork_id().fork_digest; let cached_head = beacon_chain.canonical_head.cached_head(); let mut finalized_checkpoint = cached_head.finalized_checkpoint(); diff --git a/consensus/types/src/chain_spec.rs b/consensus/types/src/chain_spec.rs index 9e3d40c99..e07d53bf8 100644 --- a/consensus/types/src/chain_spec.rs +++ b/consensus/types/src/chain_spec.rs @@ -236,13 +236,17 @@ impl ChainSpec { /// Returns the name of the fork which is active at `epoch`. pub fn fork_name_at_epoch(&self, epoch: Epoch) -> ForkName { - match self.bellatrix_fork_epoch { - Some(fork_epoch) if epoch >= fork_epoch => ForkName::Merge, - _ => match self.altair_fork_epoch { - Some(fork_epoch) if epoch >= fork_epoch => ForkName::Altair, - _ => ForkName::Base, - }, + match self.eip4844_fork_epoch { + Some(fork_epoch) if epoch >= fork_epoch => ForkName::Eip4844, + _ => match self.bellatrix_fork_epoch { + Some(fork_epoch) if epoch >= fork_epoch => ForkName::Merge, + _ => match self.altair_fork_epoch { + Some(fork_epoch) if epoch >= fork_epoch => ForkName::Altair, + _ => ForkName::Base, + }, + } } + } /// Returns the fork version for a named fork. @@ -582,7 +586,7 @@ impl ChainSpec { /* * Eip4844 hard fork params */ - eip4844_fork_epoch: None, + eip4844_fork_epoch: Some(Epoch::new(3)), eip4844_fork_version: [0x83, 0x00, 0x0f, 0xfd], /* diff --git a/consensus/types/src/fork_name.rs b/consensus/types/src/fork_name.rs index 7afe0d753..5e6ee3e5e 100644 --- a/consensus/types/src/fork_name.rs +++ b/consensus/types/src/fork_name.rs @@ -42,7 +42,7 @@ impl ForkName { ForkName::Eip4844 => { spec.altair_fork_epoch = Some(Epoch::new(0)); spec.bellatrix_fork_epoch = Some(Epoch::new(0)); - spec.eip4844_fork_epoch = Some(Epoch::new(0)); + spec.eip4844_fork_epoch = Some(Epoch::new(3)); spec } } @@ -126,6 +126,7 @@ impl FromStr for ForkName { "phase0" | "base" => ForkName::Base, "altair" => ForkName::Altair, "bellatrix" | "merge" => ForkName::Merge, + "eip4844" => ForkName::Eip4844, _ => return Err(format!("unknown fork name: {}", fork_name)), }) }