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

@@ -4,7 +4,7 @@ use crate::decode::{ssz_decode_state, yaml_decode_file};
use serde::Deserialize;
use state_processing::upgrade::{
upgrade_to_altair, upgrade_to_bellatrix, upgrade_to_capella, upgrade_to_deneb,
upgrade_to_electra, upgrade_to_fulu,
upgrade_to_electra, upgrade_to_fulu, upgrade_to_gloas,
};
use types::BeaconState;
@@ -72,6 +72,7 @@ impl<E: EthSpec> Case for ForkTest<E> {
ForkName::Deneb => upgrade_to_deneb(&mut result_state, spec).map(|_| result_state),
ForkName::Electra => upgrade_to_electra(&mut result_state, spec).map(|_| result_state),
ForkName::Fulu => upgrade_to_fulu(&mut result_state, spec).map(|_| result_state),
ForkName::Gloas => upgrade_to_gloas(&mut result_state, spec).map(|_| result_state),
};
compare_beacon_state_results_without_caches(&mut result, &mut expected)

View File

@@ -4,7 +4,8 @@ use serde::Deserialize;
use tree_hash::Hash256;
use types::{
BeaconBlockBody, BeaconBlockBodyCapella, BeaconBlockBodyDeneb, BeaconBlockBodyElectra,
BeaconBlockBodyFulu, BeaconState, FixedVector, FullPayload, Unsigned, light_client_update,
BeaconBlockBodyFulu, BeaconBlockBodyGloas, BeaconState, FixedVector, FullPayload, Unsigned,
light_client_update,
};
#[derive(Debug, Clone, Deserialize)]
@@ -172,6 +173,9 @@ impl<E: EthSpec> LoadCase for KzgInclusionMerkleProofValidity<E> {
ForkName::Fulu => {
ssz_decode_file::<BeaconBlockBodyFulu<E>>(&path.join("object.ssz_snappy"))?.into()
}
ForkName::Gloas => {
ssz_decode_file::<BeaconBlockBodyGloas<E>>(&path.join("object.ssz_snappy"))?.into()
}
};
let merkle_proof = yaml_decode_file(&path.join("proof.yaml"))?;
// Metadata does not exist in these tests but it is left like this just in case.
@@ -290,6 +294,9 @@ impl<E: EthSpec> LoadCase for BeaconBlockBodyMerkleProofValidity<E> {
ForkName::Fulu => {
ssz_decode_file::<BeaconBlockBodyFulu<E>>(&path.join("object.ssz_snappy"))?.into()
}
ForkName::Gloas => {
ssz_decode_file::<BeaconBlockBodyGloas<E>>(&path.join("object.ssz_snappy"))?.into()
}
};
let merkle_proof = yaml_decode_file(&path.join("proof.yaml"))?;
// Metadata does not exist in these tests but it is left like this just in case.

View File

@@ -68,6 +68,15 @@ impl<E: EthSpec> LoadCase for TransitionTest<E> {
spec.electra_fork_epoch = Some(Epoch::new(0));
spec.fulu_fork_epoch = Some(metadata.fork_epoch);
}
ForkName::Gloas => {
spec.altair_fork_epoch = Some(Epoch::new(0));
spec.bellatrix_fork_epoch = Some(Epoch::new(0));
spec.capella_fork_epoch = Some(Epoch::new(0));
spec.deneb_fork_epoch = Some(Epoch::new(0));
spec.electra_fork_epoch = Some(Epoch::new(0));
spec.fulu_fork_epoch = Some(Epoch::new(0));
spec.gloas_fork_epoch = Some(metadata.fork_epoch);
}
}
// Load blocks

View File

@@ -22,7 +22,7 @@ pub trait Handler {
// Add forks here to exclude them from EF spec testing. Helpful for adding future or
// unspecified forks.
fn disabled_forks(&self) -> Vec<ForkName> {
vec![]
vec![ForkName::Gloas]
}
fn is_enabled_for_fork(&self, fork_name: ForkName) -> bool {