This commit is contained in:
realbigsean
2022-10-03 10:06:04 -04:00
64 changed files with 1349 additions and 321 deletions

View File

@@ -78,6 +78,6 @@ pub fn previous_fork(fork_name: ForkName) -> ForkName {
ForkName::Base => ForkName::Base,
ForkName::Altair => ForkName::Base,
ForkName::Merge => ForkName::Altair, // TODO: Check this when tests are released..
ForkName::Capella => ForkName::Merge, // TODO: Check this when tests are released..
ForkName::Eip4844 => ForkName::Merge, // TODO: Check this when tests are released..
}
}

View File

@@ -97,7 +97,7 @@ impl<E: EthSpec> EpochTransition<E> for JustificationAndFinalization {
justification_and_finalization_state.apply_changes_to_state(state);
Ok(())
}
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Eip4844(_) => {
let justification_and_finalization_state =
altair::process_justification_and_finalization(
state,
@@ -118,7 +118,7 @@ impl<E: EthSpec> EpochTransition<E> for RewardsAndPenalties {
validator_statuses.process_attestations(state)?;
base::process_rewards_and_penalties(state, &mut validator_statuses, spec)
}
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Eip4844(_) => {
altair::process_rewards_and_penalties(
state,
&altair::ParticipationCache::new(state, spec).unwrap(),
@@ -147,7 +147,7 @@ impl<E: EthSpec> EpochTransition<E> for Slashings {
spec,
)?;
}
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Eip4844(_) => {
process_slashings(
state,
altair::ParticipationCache::new(state, spec)
@@ -205,7 +205,7 @@ impl<E: EthSpec> EpochTransition<E> for SyncCommitteeUpdates {
fn run(state: &mut BeaconState<E>, spec: &ChainSpec) -> Result<(), EpochProcessingError> {
match state {
BeaconState::Base(_) => Ok(()),
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Eip4844(_) => {
altair::process_sync_committee_updates(state, spec)
}
}
@@ -216,7 +216,7 @@ impl<E: EthSpec> EpochTransition<E> for InactivityUpdates {
fn run(state: &mut BeaconState<E>, spec: &ChainSpec) -> Result<(), EpochProcessingError> {
match state {
BeaconState::Base(_) => Ok(()),
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Eip4844(_) => {
altair::process_inactivity_updates(
state,
&altair::ParticipationCache::new(state, spec).unwrap(),
@@ -231,7 +231,7 @@ impl<E: EthSpec> EpochTransition<E> for ParticipationFlagUpdates {
fn run(state: &mut BeaconState<E>, _: &ChainSpec) -> Result<(), EpochProcessingError> {
match state {
BeaconState::Base(_) => Ok(()),
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Eip4844(_) => {
altair::process_participation_flag_updates(state)
}
}
@@ -280,7 +280,7 @@ impl<E: EthSpec, T: EpochTransition<E>> Case for EpochProcessing<E, T> {
}
// No phase0 tests for Altair and later.
ForkName::Altair | ForkName::Merge => T::name() != "participation_record_updates",
ForkName::Capella => false, // TODO: revisit when tests are out
ForkName::Eip4844 => false, // TODO: revisit when tests are out
}
}

View File

@@ -61,7 +61,7 @@ impl<E: EthSpec> Case for ForkTest<E> {
ForkName::Base => panic!("phase0 not supported"),
ForkName::Altair => upgrade_to_altair(&mut result_state, spec).map(|_| result_state),
ForkName::Merge => upgrade_to_bellatrix(&mut result_state, spec).map(|_| result_state),
ForkName::Capella => panic!("capella not supported"),
ForkName::Eip4844 => panic!("eip4844 not supported"),
};
compare_beacon_state_results_without_caches(&mut result, &mut expected)

View File

@@ -81,7 +81,7 @@ impl<E: EthSpec> Operation<E> for Attestation<E> {
BeaconState::Base(_) => {
base::process_attestations(state, &[self.clone()], VerifySignatures::True, spec)
}
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Eip4844(_) => {
altair::process_attestation(
state,
self,

View File

@@ -42,9 +42,9 @@ impl<E: EthSpec> LoadCase for TransitionTest<E> {
spec.altair_fork_epoch = Some(Epoch::new(0));
spec.bellatrix_fork_epoch = Some(metadata.fork_epoch);
}
ForkName::Capella => {
ForkName::Eip4844 => {
spec.bellatrix_fork_epoch = Some(Epoch::new(0));
spec.capella_fork_epoch = Some(metadata.fork_epoch);
spec.eip4844_fork_epoch = Some(metadata.fork_epoch);
}
}