mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-12 02:14:10 +00:00
Initial merge changes
Added Execution Payload from Rayonism Fork Updated new Containers to match Merge Spec Updated BeaconBlockBody for Merge Spec Completed updating BeaconState and BeaconBlockBody Modified ExecutionPayload<T> to use Transaction<T> Mostly Finished Changes for beacon-chain.md Added some things for fork-choice.md Update to match new fork-choice.md/fork.md changes ran cargo fmt Added Missing Pieces in eth2_libp2p for Merge fix ef test Various Changes to Conform Closer to Merge Spec
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::upgrade::upgrade_to_altair;
|
||||
use crate::upgrade::{upgrade_to_altair, upgrade_to_merge};
|
||||
use crate::{per_epoch_processing::EpochProcessingSummary, *};
|
||||
use safe_arith::{ArithError, SafeArith};
|
||||
use types::*;
|
||||
@@ -44,11 +44,17 @@ pub fn per_slot_processing<T: EthSpec>(
|
||||
|
||||
state.slot_mut().safe_add_assign(1)?;
|
||||
|
||||
// If the Altair fork epoch is reached, perform an irregular state upgrade.
|
||||
if state.slot().safe_rem(T::slots_per_epoch())? == 0
|
||||
&& spec.altair_fork_epoch == Some(state.current_epoch())
|
||||
{
|
||||
upgrade_to_altair(state, spec)?;
|
||||
// Process fork upgrades here. Note that multiple upgrades can potentially run
|
||||
// in sequence if they are scheduled in the same Epoch (common in testnets)
|
||||
if state.slot().safe_rem(T::slots_per_epoch())? == 0 {
|
||||
// If the Altair fork epoch is reached, perform an irregular state upgrade.
|
||||
if spec.altair_fork_epoch == Some(state.current_epoch()) {
|
||||
upgrade_to_altair(state, spec)?;
|
||||
}
|
||||
// If the Merge fork epoch is reached, perform an irregular state upgrade.
|
||||
if spec.merge_fork_epoch == Some(state.current_epoch()) {
|
||||
upgrade_to_merge(state, spec)?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(summary)
|
||||
|
||||
Reference in New Issue
Block a user