mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +00:00
Clean capella (#4019)
## Issue Addressed Cleans up all the remnants of 4844 in capella. This makes sure when 4844 is reviewed there is nothing we are missing because it got included here ## Proposed Changes drop a bomb on every 4844 thing ## Additional Info Merge process I did (locally) is as follows: - squash merge to produce one commit - in new branch off unstable with the squashed commit create a `git revert HEAD` commit - merge that new branch onto 4844 with `--strategy ours` - compare local 4844 to remote 4844 and make sure the diff is empty - enjoy Co-authored-by: Paul Hauner <paul@paulhauner.com>
This commit is contained in:
@@ -66,7 +66,6 @@ pub fn previous_fork(fork_name: ForkName) -> ForkName {
|
||||
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::Capella, // TODO: Check this when tests are released..
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,10 +101,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::Eip4844(_) => {
|
||||
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
|
||||
let justification_and_finalization_state =
|
||||
altair::process_justification_and_finalization(
|
||||
state,
|
||||
@@ -125,14 +122,13 @@ 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::Eip4844(_) => altair::process_rewards_and_penalties(
|
||||
state,
|
||||
&altair::ParticipationCache::new(state, spec).unwrap(),
|
||||
spec,
|
||||
),
|
||||
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
|
||||
altair::process_rewards_and_penalties(
|
||||
state,
|
||||
&altair::ParticipationCache::new(state, spec).unwrap(),
|
||||
spec,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -155,10 +151,7 @@ impl<E: EthSpec> EpochTransition<E> for Slashings {
|
||||
spec,
|
||||
)?;
|
||||
}
|
||||
BeaconState::Altair(_)
|
||||
| BeaconState::Merge(_)
|
||||
| BeaconState::Capella(_)
|
||||
| BeaconState::Eip4844(_) => {
|
||||
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
|
||||
process_slashings(
|
||||
state,
|
||||
altair::ParticipationCache::new(state, spec)
|
||||
@@ -210,9 +203,7 @@ impl<E: EthSpec> EpochTransition<E> for HistoricalRootsUpdate {
|
||||
impl<E: EthSpec> EpochTransition<E> for HistoricalSummariesUpdate {
|
||||
fn run(state: &mut BeaconState<E>, _spec: &ChainSpec) -> Result<(), EpochProcessingError> {
|
||||
match state {
|
||||
BeaconState::Capella(_) | BeaconState::Eip4844(_) => {
|
||||
process_historical_summaries_update(state)
|
||||
}
|
||||
BeaconState::Capella(_) => process_historical_summaries_update(state),
|
||||
_ => Ok(()),
|
||||
}
|
||||
}
|
||||
@@ -232,10 +223,9 @@ 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::Eip4844(_) => altair::process_sync_committee_updates(state, spec),
|
||||
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
|
||||
altair::process_sync_committee_updates(state, spec)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,14 +234,13 @@ 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::Eip4844(_) => altair::process_inactivity_updates(
|
||||
state,
|
||||
&altair::ParticipationCache::new(state, spec).unwrap(),
|
||||
spec,
|
||||
),
|
||||
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
|
||||
altair::process_inactivity_updates(
|
||||
state,
|
||||
&altair::ParticipationCache::new(state, spec).unwrap(),
|
||||
spec,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -260,10 +249,9 @@ 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::Eip4844(_) => altair::process_participation_flag_updates(state),
|
||||
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
|
||||
altair::process_participation_flag_updates(state)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -318,7 +306,6 @@ impl<E: EthSpec, T: EpochTransition<E>> Case for EpochProcessing<E, T> {
|
||||
T::name() != "participation_record_updates"
|
||||
&& T::name() != "historical_roots_update"
|
||||
}
|
||||
ForkName::Eip4844 => false, // TODO: revisit when tests are out
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@ impl<E: EthSpec> Case for ForkTest<E> {
|
||||
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 => upgrade_to_capella(&mut result_state, spec).map(|_| result_state),
|
||||
ForkName::Eip4844 => panic!("eip4844 not supported"),
|
||||
};
|
||||
|
||||
compare_beacon_state_results_without_caches(&mut result, &mut expected)
|
||||
|
||||
@@ -95,10 +95,7 @@ impl<E: EthSpec> Operation<E> for Attestation<E> {
|
||||
&mut ctxt,
|
||||
spec,
|
||||
),
|
||||
BeaconState::Altair(_)
|
||||
| BeaconState::Merge(_)
|
||||
| BeaconState::Capella(_)
|
||||
| BeaconState::Eip4844(_) => {
|
||||
BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
|
||||
altair::process_attestation(state, self, 0, &mut ctxt, VerifySignatures::True, spec)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,12 +47,6 @@ impl<E: EthSpec> LoadCase for TransitionTest<E> {
|
||||
spec.bellatrix_fork_epoch = Some(Epoch::new(0));
|
||||
spec.capella_fork_epoch = Some(metadata.fork_epoch);
|
||||
}
|
||||
ForkName::Eip4844 => {
|
||||
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.eip4844_fork_epoch = Some(metadata.fork_epoch);
|
||||
}
|
||||
}
|
||||
|
||||
// Load blocks
|
||||
|
||||
@@ -24,11 +24,6 @@ pub trait Handler {
|
||||
|
||||
fn run(&self) {
|
||||
for fork_name in ForkName::list_all() {
|
||||
// FIXME(eip4844): enable eip4844
|
||||
if fork_name == ForkName::Eip4844 {
|
||||
continue;
|
||||
}
|
||||
|
||||
if self.is_enabled_for_fork(fork_name) {
|
||||
self.run_for_fork(fork_name)
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ type_name_generic!(BeaconBlockBodyBase, "BeaconBlockBody");
|
||||
type_name_generic!(BeaconBlockBodyAltair, "BeaconBlockBody");
|
||||
type_name_generic!(BeaconBlockBodyMerge, "BeaconBlockBody");
|
||||
type_name_generic!(BeaconBlockBodyCapella, "BeaconBlockBody");
|
||||
type_name_generic!(BeaconBlockBodyEip4844, "BeaconBlockBody");
|
||||
type_name!(BeaconBlockHeader);
|
||||
type_name_generic!(BeaconState);
|
||||
type_name!(Checkpoint);
|
||||
@@ -59,12 +58,10 @@ type_name!(Eth1Data);
|
||||
type_name_generic!(ExecutionPayload);
|
||||
type_name_generic!(ExecutionPayloadMerge, "ExecutionPayload");
|
||||
type_name_generic!(ExecutionPayloadCapella, "ExecutionPayload");
|
||||
type_name_generic!(ExecutionPayloadEip4844, "ExecutionPayload");
|
||||
type_name_generic!(FullPayload, "ExecutionPayload");
|
||||
type_name_generic!(ExecutionPayloadHeader);
|
||||
type_name_generic!(ExecutionPayloadHeaderMerge, "ExecutionPayloadHeader");
|
||||
type_name_generic!(ExecutionPayloadHeaderCapella, "ExecutionPayloadHeader");
|
||||
type_name_generic!(ExecutionPayloadHeaderEip4844, "ExecutionPayloadHeader");
|
||||
type_name_generic!(BlindedPayload, "ExecutionPayloadHeader");
|
||||
type_name!(Fork);
|
||||
type_name!(ForkData);
|
||||
|
||||
Reference in New Issue
Block a user