Fork boilerplate

This commit is contained in:
Eitan Seri-Levi
2025-04-29 23:42:37 -07:00
parent 7bd50a6fe8
commit c464a54ba2
63 changed files with 1654 additions and 217 deletions

View File

@@ -26,13 +26,15 @@ pub fn fork_context(fork_name: ForkName) -> ForkContext {
let capella_fork_epoch = Epoch::new(3);
let deneb_fork_epoch = Epoch::new(4);
let electra_fork_epoch = Epoch::new(5);
let fulu_fork_epoch = Epoch::new(6);
let eip7805_fork_epoch = Epoch::new(6);
let fulu_fork_epoch = Epoch::new(7);
chain_spec.altair_fork_epoch = Some(altair_fork_epoch);
chain_spec.bellatrix_fork_epoch = Some(bellatrix_fork_epoch);
chain_spec.capella_fork_epoch = Some(capella_fork_epoch);
chain_spec.deneb_fork_epoch = Some(deneb_fork_epoch);
chain_spec.electra_fork_epoch = Some(electra_fork_epoch);
chain_spec.eip7805_fork_epoch = Some(eip7805_fork_epoch);
chain_spec.fulu_fork_epoch = Some(fulu_fork_epoch);
let current_slot = match fork_name {
@@ -42,6 +44,7 @@ pub fn fork_context(fork_name: ForkName) -> ForkContext {
ForkName::Capella => capella_fork_epoch.start_slot(E::slots_per_epoch()),
ForkName::Deneb => deneb_fork_epoch.start_slot(E::slots_per_epoch()),
ForkName::Electra => electra_fork_epoch.start_slot(E::slots_per_epoch()),
ForkName::Eip7805 => eip7805_fork_epoch.start_slot(E::slots_per_epoch()),
ForkName::Fulu => fulu_fork_epoch.start_slot(E::slots_per_epoch()),
};
ForkContext::new::<E>(current_slot, Hash256::zero(), &chain_spec)