Spec v1.7.0-alpha.6 and Gloas genesis (#9190)

Co-Authored-By: Josh King <josh@sigmaprime.io>

Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
jking-aus
2026-04-29 10:23:24 +02:00
committed by GitHub
parent e8c865dcc6
commit 16132a3694
35 changed files with 349 additions and 117 deletions

View File

@@ -58,6 +58,8 @@ pub struct Eth1DataReset;
#[derive(Debug)]
pub struct PendingBalanceDeposits;
#[derive(Debug)]
pub struct PendingDepositsChurn;
#[derive(Debug)]
pub struct PendingConsolidations;
#[derive(Debug)]
pub struct EffectiveBalanceUpdates;
@@ -93,6 +95,7 @@ type_name!(RegistryUpdates, "registry_updates");
type_name!(Slashings, "slashings");
type_name!(Eth1DataReset, "eth1_data_reset");
type_name!(PendingBalanceDeposits, "pending_deposits");
type_name!(PendingDepositsChurn, "pending_deposits_churn");
type_name!(PendingConsolidations, "pending_consolidations");
type_name!(EffectiveBalanceUpdates, "effective_balance_updates");
type_name!(SlashingsReset, "slashings_reset");
@@ -191,6 +194,20 @@ impl<E: EthSpec> EpochTransition<E> for PendingBalanceDeposits {
}
}
impl<E: EthSpec> EpochTransition<E> for PendingDepositsChurn {
fn run(state: &mut BeaconState<E>, spec: &ChainSpec) -> Result<(), EpochProcessingError> {
process_epoch_single_pass(
state,
spec,
SinglePassConfig {
pending_deposits: true,
..SinglePassConfig::disable_all()
},
)
.map(|_| ())
}
}
impl<E: EthSpec> EpochTransition<E> for PendingConsolidations {
fn run(state: &mut BeaconState<E>, spec: &ChainSpec) -> Result<(), EpochProcessingError> {
initialize_epoch_cache(state, spec)?;
@@ -387,7 +404,9 @@ impl<E: EthSpec, T: EpochTransition<E>> Case for EpochProcessing<E, T> {
}
if !fork_name.gloas_enabled()
&& (T::name() == "builder_pending_payments" || T::name() == "ptc_window")
&& (T::name() == "builder_pending_payments"
|| T::name() == "ptc_window"
|| T::name() == "pending_deposits_churn")
{
return false;
}

View File

@@ -53,6 +53,15 @@ pub struct WithdrawalsPayload<E: EthSpec> {
payload: Option<ExecutionPayload<E>>,
}
/// Newtype for testing voluntary exit churn (Gloas+).
///
/// The test case applies the same `process_voluntary_exit` operation as the regular
/// `voluntary_exit` test, but under the `voluntary_exit_churn` handler directory.
#[derive(Debug, Clone)]
pub struct VoluntaryExitChurn {
exit: SignedVoluntaryExit,
}
/// Newtype for testing execution payload bids.
#[derive(Debug, Clone, Deserialize)]
pub struct ExecutionPayloadBidBlock<E: EthSpec> {
@@ -265,6 +274,40 @@ impl<E: EthSpec> Operation<E> for SignedVoluntaryExit {
}
}
impl<E: EthSpec> Operation<E> for VoluntaryExitChurn {
type Error = BlockProcessingError;
fn handler_name() -> String {
"voluntary_exit_churn".into()
}
fn filename() -> String {
"voluntary_exit.ssz_snappy".into()
}
fn is_enabled_for_fork(fork_name: ForkName) -> bool {
fork_name.gloas_enabled()
}
fn decode(path: &Path, _fork_name: ForkName, _spec: &ChainSpec) -> Result<Self, Error> {
ssz_decode_file(path).map(|exit| VoluntaryExitChurn { exit })
}
fn apply_to(
&self,
state: &mut BeaconState<E>,
spec: &ChainSpec,
_: &Operations<E, Self>,
) -> Result<(), BlockProcessingError> {
process_exits(
state,
std::slice::from_ref(&self.exit),
VerifySignatures::True,
spec,
)
}
}
impl<E: EthSpec> Operation<E> for BeaconBlock<E> {
type Error = BlockProcessingError;