mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
Rename eip4844 to deneb (#4129)
* rename 4844 to deneb * rename 4844 to deneb * move excess data gas field * get EF tests working * fix ef tests lint * fix the blob identifier ef test * fix accessed files ef test script * get beacon chain tests passing
This commit is contained in:
@@ -39,7 +39,7 @@ use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use types::blob_sidecar::BlobSidecarList;
|
||||
use types::consts::eip4844::MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS;
|
||||
use types::consts::deneb::MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS;
|
||||
use types::*;
|
||||
|
||||
/// On-disk database that stores finalized states efficiently.
|
||||
@@ -1854,10 +1854,10 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
|
||||
/// Try to prune blobs, approximating the current epoch from lower epoch numbers end (older
|
||||
/// end) and is useful when the data availability boundary is not at hand.
|
||||
pub fn try_prune_most_blobs(&self, force: bool) -> Result<(), Error> {
|
||||
let eip4844_fork = match self.spec.eip4844_fork_epoch {
|
||||
let deneb_fork = match self.spec.deneb_fork_epoch {
|
||||
Some(epoch) => epoch,
|
||||
None => {
|
||||
debug!(self.log, "Eip4844 fork is disabled");
|
||||
debug!(self.log, "Deneb fork is disabled");
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
@@ -1865,7 +1865,7 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
|
||||
// `split.slot` is not updated and current_epoch > split_epoch + 2.
|
||||
let min_current_epoch = self.get_split_slot().epoch(E::slots_per_epoch()) + Epoch::new(2);
|
||||
let min_data_availability_boundary = std::cmp::max(
|
||||
eip4844_fork,
|
||||
deneb_fork,
|
||||
min_current_epoch.saturating_sub(*MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS),
|
||||
);
|
||||
|
||||
@@ -1878,11 +1878,11 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
|
||||
force: bool,
|
||||
data_availability_boundary: Option<Epoch>,
|
||||
) -> Result<(), Error> {
|
||||
let (data_availability_boundary, eip4844_fork) =
|
||||
match (data_availability_boundary, self.spec.eip4844_fork_epoch) {
|
||||
let (data_availability_boundary, deneb_fork) =
|
||||
match (data_availability_boundary, self.spec.deneb_fork_epoch) {
|
||||
(Some(boundary_epoch), Some(fork_epoch)) => (boundary_epoch, fork_epoch),
|
||||
_ => {
|
||||
debug!(self.log, "Eip4844 fork is disabled");
|
||||
debug!(self.log, "Deneb fork is disabled");
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
@@ -1900,7 +1900,7 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
|
||||
let blob_info = self.get_blob_info();
|
||||
let oldest_blob_slot = blob_info
|
||||
.oldest_blob_slot
|
||||
.unwrap_or_else(|| eip4844_fork.start_slot(E::slots_per_epoch()));
|
||||
.unwrap_or_else(|| deneb_fork.start_slot(E::slots_per_epoch()));
|
||||
|
||||
// The last entirely pruned epoch, blobs sidecar pruning may have stopped early in the
|
||||
// middle of an epoch otherwise the oldest blob slot is a start slot.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::{DBColumn, Error, StoreItem};
|
||||
use ssz::{Decode, Encode};
|
||||
use types::{
|
||||
BlobSidecarList, EthSpec, ExecutionPayload, ExecutionPayloadCapella, ExecutionPayloadEip4844,
|
||||
BlobSidecarList, EthSpec, ExecutionPayload, ExecutionPayloadCapella, ExecutionPayloadDeneb,
|
||||
ExecutionPayloadMerge,
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@ macro_rules! impl_store_item {
|
||||
}
|
||||
impl_store_item!(ExecutionPayloadMerge);
|
||||
impl_store_item!(ExecutionPayloadCapella);
|
||||
impl_store_item!(ExecutionPayloadEip4844);
|
||||
impl_store_item!(ExecutionPayloadDeneb);
|
||||
impl_store_item!(BlobSidecarList);
|
||||
|
||||
/// This fork-agnostic implementation should be only used for writing.
|
||||
@@ -41,8 +41,8 @@ impl<E: EthSpec> StoreItem for ExecutionPayload<E> {
|
||||
}
|
||||
|
||||
fn from_store_bytes(bytes: &[u8]) -> Result<Self, Error> {
|
||||
ExecutionPayloadEip4844::from_ssz_bytes(bytes)
|
||||
.map(Self::Eip4844)
|
||||
ExecutionPayloadDeneb::from_ssz_bytes(bytes)
|
||||
.map(Self::Deneb)
|
||||
.or_else(|_| {
|
||||
ExecutionPayloadCapella::from_ssz_bytes(bytes)
|
||||
.map(Self::Capella)
|
||||
|
||||
@@ -15,7 +15,7 @@ use types::*;
|
||||
///
|
||||
/// Utilises lazy-loading from separate storage for its vector fields.
|
||||
#[superstruct(
|
||||
variants(Base, Altair, Merge, Capella, Eip4844),
|
||||
variants(Base, Altair, Merge, Capella, Deneb),
|
||||
variant_attributes(derive(Debug, PartialEq, Clone, Encode, Decode))
|
||||
)]
|
||||
#[derive(Debug, PartialEq, Clone, Encode)]
|
||||
@@ -67,9 +67,9 @@ where
|
||||
pub current_epoch_attestations: VariableList<PendingAttestation<T>, T::MaxPendingAttestations>,
|
||||
|
||||
// Participation (Altair and later)
|
||||
#[superstruct(only(Altair, Merge, Capella, Eip4844))]
|
||||
#[superstruct(only(Altair, Merge, Capella, Deneb))]
|
||||
pub previous_epoch_participation: VariableList<ParticipationFlags, T::ValidatorRegistryLimit>,
|
||||
#[superstruct(only(Altair, Merge, Capella, Eip4844))]
|
||||
#[superstruct(only(Altair, Merge, Capella, Deneb))]
|
||||
pub current_epoch_participation: VariableList<ParticipationFlags, T::ValidatorRegistryLimit>,
|
||||
|
||||
// Finality
|
||||
@@ -79,13 +79,13 @@ where
|
||||
pub finalized_checkpoint: Checkpoint,
|
||||
|
||||
// Inactivity
|
||||
#[superstruct(only(Altair, Merge, Capella, Eip4844))]
|
||||
#[superstruct(only(Altair, Merge, Capella, Deneb))]
|
||||
pub inactivity_scores: VariableList<u64, T::ValidatorRegistryLimit>,
|
||||
|
||||
// Light-client sync committees
|
||||
#[superstruct(only(Altair, Merge, Capella, Eip4844))]
|
||||
#[superstruct(only(Altair, Merge, Capella, Deneb))]
|
||||
pub current_sync_committee: Arc<SyncCommittee<T>>,
|
||||
#[superstruct(only(Altair, Merge, Capella, Eip4844))]
|
||||
#[superstruct(only(Altair, Merge, Capella, Deneb))]
|
||||
pub next_sync_committee: Arc<SyncCommittee<T>>,
|
||||
|
||||
// Execution
|
||||
@@ -100,19 +100,19 @@ where
|
||||
)]
|
||||
pub latest_execution_payload_header: ExecutionPayloadHeaderCapella<T>,
|
||||
#[superstruct(
|
||||
only(Eip4844),
|
||||
partial_getter(rename = "latest_execution_payload_header_eip4844")
|
||||
only(Deneb),
|
||||
partial_getter(rename = "latest_execution_payload_header_deneb")
|
||||
)]
|
||||
pub latest_execution_payload_header: ExecutionPayloadHeaderEip4844<T>,
|
||||
pub latest_execution_payload_header: ExecutionPayloadHeaderDeneb<T>,
|
||||
|
||||
// Capella
|
||||
#[superstruct(only(Capella, Eip4844))]
|
||||
#[superstruct(only(Capella, Deneb))]
|
||||
pub next_withdrawal_index: u64,
|
||||
#[superstruct(only(Capella, Eip4844))]
|
||||
#[superstruct(only(Capella, Deneb))]
|
||||
pub next_withdrawal_validator_index: u64,
|
||||
|
||||
#[ssz(skip_serializing, skip_deserializing)]
|
||||
#[superstruct(only(Capella, Eip4844))]
|
||||
#[superstruct(only(Capella, Deneb))]
|
||||
pub historical_summaries: Option<VariableList<HistoricalSummary, T::HistoricalRootsLimit>>,
|
||||
}
|
||||
|
||||
@@ -227,11 +227,11 @@ impl<T: EthSpec> PartialBeaconState<T> {
|
||||
],
|
||||
[historical_summaries]
|
||||
),
|
||||
BeaconState::Eip4844(s) => impl_from_state_forgetful!(
|
||||
BeaconState::Deneb(s) => impl_from_state_forgetful!(
|
||||
s,
|
||||
outer,
|
||||
Eip4844,
|
||||
PartialBeaconStateEip4844,
|
||||
Deneb,
|
||||
PartialBeaconStateDeneb,
|
||||
[
|
||||
previous_epoch_participation,
|
||||
current_epoch_participation,
|
||||
@@ -472,10 +472,10 @@ impl<E: EthSpec> TryInto<BeaconState<E>> for PartialBeaconState<E> {
|
||||
],
|
||||
[historical_summaries]
|
||||
),
|
||||
PartialBeaconState::Eip4844(inner) => impl_try_into_beacon_state!(
|
||||
PartialBeaconState::Deneb(inner) => impl_try_into_beacon_state!(
|
||||
inner,
|
||||
Eip4844,
|
||||
BeaconStateEip4844,
|
||||
Deneb,
|
||||
BeaconStateDeneb,
|
||||
[
|
||||
previous_epoch_participation,
|
||||
current_epoch_participation,
|
||||
|
||||
Reference in New Issue
Block a user