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:
Mac L
2025-08-26 12:49:48 +10:00
committed by GitHub
parent daf1c7c3af
commit e438691683
75 changed files with 1801 additions and 917 deletions

View File

@@ -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)?;