mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 06:14:38 +00:00
Implement PeerDAS Fulu fork activation (#6795)
Addresses #6706 This PR activates PeerDAS at the Fulu fork epoch instead of `EIP_7594_FORK_EPOCH`. This means we no longer support testing PeerDAS with Deneb / Electrs, as it's now part of a hard fork.
This commit is contained in:
@@ -198,12 +198,6 @@ pub struct ChainSpec {
|
||||
pub fulu_fork_version: [u8; 4],
|
||||
/// The Fulu fork epoch is optional, with `None` representing "Fulu never happens".
|
||||
pub fulu_fork_epoch: Option<Epoch>,
|
||||
pub fulu_placeholder: u64,
|
||||
|
||||
/*
|
||||
* DAS params
|
||||
*/
|
||||
pub eip7594_fork_epoch: Option<Epoch>,
|
||||
pub number_of_columns: u64,
|
||||
pub number_of_custody_groups: u64,
|
||||
pub data_column_sidecar_subnet_count: u64,
|
||||
@@ -440,16 +434,16 @@ impl ChainSpec {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if the given epoch is greater than or equal to the `EIP7594_FORK_EPOCH`.
|
||||
/// Returns true if the given epoch is greater than or equal to the `FULU_FORK_EPOCH`.
|
||||
pub fn is_peer_das_enabled_for_epoch(&self, block_epoch: Epoch) -> bool {
|
||||
self.eip7594_fork_epoch
|
||||
.is_some_and(|eip7594_fork_epoch| block_epoch >= eip7594_fork_epoch)
|
||||
self.fulu_fork_epoch
|
||||
.is_some_and(|fulu_fork_epoch| block_epoch >= fulu_fork_epoch)
|
||||
}
|
||||
|
||||
/// Returns true if `EIP7594_FORK_EPOCH` is set and is not set to `FAR_FUTURE_EPOCH`.
|
||||
/// Returns true if `FULU_FORK_EPOCH` is set and is not set to `FAR_FUTURE_EPOCH`.
|
||||
pub fn is_peer_das_scheduled(&self) -> bool {
|
||||
self.eip7594_fork_epoch
|
||||
.is_some_and(|eip7594_fork_epoch| eip7594_fork_epoch != self.far_future_epoch)
|
||||
self.fulu_fork_epoch
|
||||
.is_some_and(|fulu_fork_epoch| fulu_fork_epoch != self.far_future_epoch)
|
||||
}
|
||||
|
||||
/// Returns a full `Fork` struct for a given epoch.
|
||||
@@ -916,17 +910,11 @@ impl ChainSpec {
|
||||
*/
|
||||
fulu_fork_version: [0x06, 0x00, 0x00, 0x00],
|
||||
fulu_fork_epoch: None,
|
||||
fulu_placeholder: 0,
|
||||
|
||||
/*
|
||||
* DAS params
|
||||
*/
|
||||
eip7594_fork_epoch: None,
|
||||
number_of_columns: 128,
|
||||
custody_requirement: 4,
|
||||
number_of_custody_groups: 128,
|
||||
data_column_sidecar_subnet_count: 128,
|
||||
number_of_columns: 128,
|
||||
samples_per_slot: 8,
|
||||
custody_requirement: 4,
|
||||
|
||||
/*
|
||||
* Network specific
|
||||
@@ -1045,8 +1033,6 @@ impl ChainSpec {
|
||||
// Fulu
|
||||
fulu_fork_version: [0x06, 0x00, 0x00, 0x01],
|
||||
fulu_fork_epoch: None,
|
||||
// PeerDAS
|
||||
eip7594_fork_epoch: None,
|
||||
// Other
|
||||
network_id: 2, // lighthouse testnet network id
|
||||
deposit_chain_id: 5,
|
||||
@@ -1254,17 +1240,11 @@ impl ChainSpec {
|
||||
*/
|
||||
fulu_fork_version: [0x06, 0x00, 0x00, 0x64],
|
||||
fulu_fork_epoch: None,
|
||||
fulu_placeholder: 0,
|
||||
|
||||
/*
|
||||
* DAS params
|
||||
*/
|
||||
eip7594_fork_epoch: None,
|
||||
number_of_columns: 128,
|
||||
custody_requirement: 4,
|
||||
number_of_custody_groups: 128,
|
||||
data_column_sidecar_subnet_count: 128,
|
||||
number_of_columns: 128,
|
||||
samples_per_slot: 8,
|
||||
custody_requirement: 4,
|
||||
|
||||
/*
|
||||
* Network specific
|
||||
@@ -1408,11 +1388,6 @@ pub struct Config {
|
||||
#[serde(deserialize_with = "deserialize_fork_epoch")]
|
||||
pub fulu_fork_epoch: Option<MaybeQuoted<Epoch>>,
|
||||
|
||||
#[serde(default)]
|
||||
#[serde(serialize_with = "serialize_fork_epoch")]
|
||||
#[serde(deserialize_with = "deserialize_fork_epoch")]
|
||||
pub eip7594_fork_epoch: Option<MaybeQuoted<Epoch>>,
|
||||
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
seconds_per_slot: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
@@ -1855,10 +1830,6 @@ impl Config {
|
||||
.fulu_fork_epoch
|
||||
.map(|epoch| MaybeQuoted { value: epoch }),
|
||||
|
||||
eip7594_fork_epoch: spec
|
||||
.eip7594_fork_epoch
|
||||
.map(|epoch| MaybeQuoted { value: epoch }),
|
||||
|
||||
seconds_per_slot: spec.seconds_per_slot,
|
||||
seconds_per_eth1_block: spec.seconds_per_eth1_block,
|
||||
min_validator_withdrawability_delay: spec.min_validator_withdrawability_delay,
|
||||
@@ -1945,7 +1916,6 @@ impl Config {
|
||||
electra_fork_version,
|
||||
fulu_fork_epoch,
|
||||
fulu_fork_version,
|
||||
eip7594_fork_epoch,
|
||||
seconds_per_slot,
|
||||
seconds_per_eth1_block,
|
||||
min_validator_withdrawability_delay,
|
||||
@@ -2015,7 +1985,6 @@ impl Config {
|
||||
electra_fork_version,
|
||||
fulu_fork_epoch: fulu_fork_epoch.map(|q| q.value),
|
||||
fulu_fork_version,
|
||||
eip7594_fork_epoch: eip7594_fork_epoch.map(|q| q.value),
|
||||
seconds_per_slot,
|
||||
seconds_per_eth1_block,
|
||||
min_validator_withdrawability_delay,
|
||||
|
||||
@@ -133,20 +133,6 @@ impl<E: EthSpec> DataColumnSidecar<E> {
|
||||
.len()
|
||||
}
|
||||
|
||||
pub fn empty() -> Self {
|
||||
Self {
|
||||
index: 0,
|
||||
column: DataColumn::<E>::default(),
|
||||
kzg_commitments: VariableList::default(),
|
||||
kzg_proofs: VariableList::default(),
|
||||
signed_block_header: SignedBeaconBlockHeader {
|
||||
message: BeaconBlockHeader::empty(),
|
||||
signature: Signature::empty(),
|
||||
},
|
||||
kzg_commitments_inclusion_proof: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn id(&self) -> DataColumnIdentifier {
|
||||
DataColumnIdentifier {
|
||||
block_root: self.block_root(),
|
||||
|
||||
@@ -49,6 +49,13 @@ impl ForkName {
|
||||
*ForkName::list_all().last().unwrap()
|
||||
}
|
||||
|
||||
/// Returns the fork primarily used for testing purposes.
|
||||
/// This fork serves as the baseline for many tests, and the goal
|
||||
/// is to ensure features are passing on this fork.
|
||||
pub fn latest_stable() -> ForkName {
|
||||
ForkName::Electra
|
||||
}
|
||||
|
||||
/// Set the activation slots in the given `ChainSpec` so that the fork named by `self`
|
||||
/// is the only fork in effect from genesis.
|
||||
pub fn make_genesis_spec(&self, mut spec: ChainSpec) -> ChainSpec {
|
||||
|
||||
@@ -276,21 +276,6 @@ impl ElectraPreset {
|
||||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "UPPERCASE")]
|
||||
pub struct FuluPreset {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
pub fulu_placeholder: u64,
|
||||
}
|
||||
|
||||
impl FuluPreset {
|
||||
pub fn from_chain_spec<E: EthSpec>(spec: &ChainSpec) -> Self {
|
||||
Self {
|
||||
fulu_placeholder: spec.fulu_placeholder,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "UPPERCASE")]
|
||||
pub struct Eip7594Preset {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
pub field_elements_per_cell: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
@@ -299,7 +284,7 @@ pub struct Eip7594Preset {
|
||||
pub kzg_commitments_inclusion_proof_depth: u64,
|
||||
}
|
||||
|
||||
impl Eip7594Preset {
|
||||
impl FuluPreset {
|
||||
pub fn from_chain_spec<E: EthSpec>(_spec: &ChainSpec) -> Self {
|
||||
Self {
|
||||
field_elements_per_cell: E::field_elements_per_cell() as u64,
|
||||
@@ -357,9 +342,6 @@ mod test {
|
||||
|
||||
let fulu: FuluPreset = preset_from_file(&preset_name, "fulu.yaml");
|
||||
assert_eq!(fulu, FuluPreset::from_chain_spec::<E>(&spec));
|
||||
|
||||
let eip7594: Eip7594Preset = preset_from_file(&preset_name, "eip7594.yaml");
|
||||
assert_eq!(eip7594, Eip7594Preset::from_chain_spec::<E>(&spec));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user