mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Add Gloas boilerplate (#7728)
Adds the required boilerplate code for the Gloas (Glamsterdam) hard fork. This allows PRs testing Gloas-candidate features to test fork transition. This also includes de-duplication of post-Bellatrix readiness notifiers from #6797 (credit to @dapplion)
This commit is contained in:
@@ -5,6 +5,7 @@ use crate::common::DepositDataTree;
|
||||
use crate::upgrade::electra::upgrade_state_to_electra;
|
||||
use crate::upgrade::{
|
||||
upgrade_to_altair, upgrade_to_bellatrix, upgrade_to_capella, upgrade_to_deneb, upgrade_to_fulu,
|
||||
upgrade_to_gloas,
|
||||
};
|
||||
use safe_arith::{ArithError, SafeArith};
|
||||
use std::sync::Arc;
|
||||
@@ -150,11 +151,27 @@ pub fn initialize_beacon_state_from_eth1<E: EthSpec>(
|
||||
state.fork_mut().previous_version = spec.fulu_fork_version;
|
||||
|
||||
// Override latest execution payload header.
|
||||
if let Some(ExecutionPayloadHeader::Fulu(header)) = execution_payload_header {
|
||||
if let Some(ExecutionPayloadHeader::Fulu(ref header)) = execution_payload_header {
|
||||
*state.latest_execution_payload_header_fulu_mut()? = header.clone();
|
||||
}
|
||||
}
|
||||
|
||||
// Upgrade to gloas if configured from genesis.
|
||||
if spec
|
||||
.gloas_fork_epoch
|
||||
.is_some_and(|fork_epoch| fork_epoch == E::genesis_epoch())
|
||||
{
|
||||
upgrade_to_gloas(&mut state, spec)?;
|
||||
|
||||
// Remove intermediate Fulu fork from `state.fork`.
|
||||
state.fork_mut().previous_version = spec.gloas_fork_version;
|
||||
|
||||
// Override latest execution payload header.
|
||||
if let Some(ExecutionPayloadHeader::Gloas(header)) = execution_payload_header {
|
||||
*state.latest_execution_payload_header_gloas_mut()? = header.clone();
|
||||
}
|
||||
}
|
||||
|
||||
// Now that we have our validators, initialize the caches (including the committees)
|
||||
state.build_caches(spec)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user