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:
Jimmy Chen
2025-01-30 18:01:34 +11:00
committed by GitHub
parent 7d54a43243
commit 70194dfc6a
54 changed files with 1126 additions and 640 deletions

View File

@@ -49,11 +49,10 @@ excluded_paths = [
"bls12-381-tests/hash_to_G2",
"tests/.*/eip6110",
"tests/.*/whisk",
"tests/.*/eip7594",
# Fulu tests are not yet being run
"tests/.*/fulu",
# TODO(electra): SingleAttestation tests are waiting on Eitan's PR
"tests/.*/electra/ssz_static/SingleAttestation"
"tests/.*/electra/ssz_static/SingleAttestation",
"tests/.*/fulu/ssz_static/SingleAttestation",
"tests/.*/fulu/ssz_static/MatrixEntry",
]

View File

@@ -91,6 +91,9 @@ pub use transition::TransitionTest;
/// to return `true` for the feature in order for the feature test vector to be tested.
#[derive(Debug, PartialEq, Clone, Copy)]
pub enum FeatureName {
// TODO(fulu): to be removed once we start using Fulu types for test vectors.
// Existing SSZ types for PeerDAS (Fulu) are the same as Electra, so the test vectors get
// loaded as Electra types (default serde behaviour for untagged enums).
Fulu,
}

View File

@@ -21,12 +21,8 @@ impl<E: EthSpec> LoadCase for ComputeColumnsForCustodyGroups<E> {
}
impl<E: EthSpec> Case for ComputeColumnsForCustodyGroups<E> {
fn is_enabled_for_fork(_fork_name: ForkName) -> bool {
false
}
fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name == FeatureName::Fulu
fn is_enabled_for_fork(fork_name: ForkName) -> bool {
fork_name.fulu_enabled()
}
fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {

View File

@@ -24,12 +24,8 @@ impl<E: EthSpec> LoadCase for GetCustodyGroups<E> {
}
impl<E: EthSpec> Case for GetCustodyGroups<E> {
fn is_enabled_for_fork(_fork_name: ForkName) -> bool {
false
}
fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name == FeatureName::Fulu
fn is_enabled_for_fork(fork_name: ForkName) -> bool {
fork_name.fulu_enabled()
}
fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {

View File

@@ -26,12 +26,8 @@ impl<E: EthSpec> LoadCase for KZGComputeCellsAndKZGProofs<E> {
}
impl<E: EthSpec> Case for KZGComputeCellsAndKZGProofs<E> {
fn is_enabled_for_fork(_fork_name: ForkName) -> bool {
false
}
fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name == FeatureName::Fulu
fn is_enabled_for_fork(fork_name: ForkName) -> bool {
fork_name.fulu_enabled()
}
fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {

View File

@@ -27,12 +27,8 @@ impl<E: EthSpec> LoadCase for KZGRecoverCellsAndKZGProofs<E> {
}
impl<E: EthSpec> Case for KZGRecoverCellsAndKZGProofs<E> {
fn is_enabled_for_fork(_fork_name: ForkName) -> bool {
false
}
fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name == FeatureName::Fulu
fn is_enabled_for_fork(fork_name: ForkName) -> bool {
fork_name.fulu_enabled()
}
fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {

View File

@@ -29,12 +29,8 @@ impl<E: EthSpec> LoadCase for KZGVerifyCellKZGProofBatch<E> {
}
impl<E: EthSpec> Case for KZGVerifyCellKZGProofBatch<E> {
fn is_enabled_for_fork(_fork_name: ForkName) -> bool {
false
}
fn is_enabled_for_feature(feature_name: FeatureName) -> bool {
feature_name == FeatureName::Fulu
fn is_enabled_for_fork(fork_name: ForkName) -> bool {
fork_name.fulu_enabled()
}
fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> {

View File

@@ -355,11 +355,14 @@ where
}
fn is_enabled_for_feature(&self, feature_name: FeatureName) -> bool {
// This ensures we only run the tests **once** for the feature, using the types matching the
// correct fork, e.g. `Fulu` uses SSZ types from `Electra` fork as of spec test version
// `v1.5.0-beta.0`, therefore the `Fulu` tests should get included when testing Electra types.
// TODO(fulu): to be removed once Fulu types start differing from Electra. We currently run Fulu tests as a
// "feature" - this means we use Electra types for Fulu SSZ tests (except for PeerDAS types, e.g. `DataColumnSidecar`).
//
// e.g. Fulu test vectors are executed in the first line below, but excluded in the 2nd
// This ensures we only run the tests **once** for `Fulu`, using the types matching the
// correct fork, e.g. `Fulu` uses SSZ types from `Electra` as of spec test version
// `v1.5.0-beta.0`, therefore the `Fulu` tests should get included when testing Deneb types.
//
// e.g. Fulu test vectors are executed in the 2nd line below, but excluded in the 1st
// line when testing the type `AttestationElectra`:
//
// ```
@@ -890,6 +893,10 @@ impl<E: EthSpec + TypeName> Handler for GetCustodyGroupsHandler<E> {
fn handler_name(&self) -> String {
"get_custody_groups".into()
}
fn is_enabled_for_feature(&self, feature_name: FeatureName) -> bool {
feature_name == FeatureName::Fulu
}
}
#[derive(Derivative)]
@@ -910,6 +917,10 @@ impl<E: EthSpec + TypeName> Handler for ComputeColumnsForCustodyGroupHandler<E>
fn handler_name(&self) -> String {
"compute_columns_for_custody_group".into()
}
fn is_enabled_for_feature(&self, feature_name: FeatureName) -> bool {
feature_name == FeatureName::Fulu
}
}
#[derive(Derivative)]
@@ -930,6 +941,10 @@ impl<E: EthSpec> Handler for KZGComputeCellsAndKZGProofHandler<E> {
fn handler_name(&self) -> String {
"compute_cells_and_kzg_proofs".into()
}
fn is_enabled_for_feature(&self, feature_name: FeatureName) -> bool {
feature_name == FeatureName::Fulu
}
}
#[derive(Derivative)]
@@ -950,6 +965,10 @@ impl<E: EthSpec> Handler for KZGVerifyCellKZGProofBatchHandler<E> {
fn handler_name(&self) -> String {
"verify_cell_kzg_proof_batch".into()
}
fn is_enabled_for_feature(&self, feature_name: FeatureName) -> bool {
feature_name == FeatureName::Fulu
}
}
#[derive(Derivative)]
@@ -970,6 +989,10 @@ impl<E: EthSpec> Handler for KZGRecoverCellsAndKZGProofHandler<E> {
fn handler_name(&self) -> String {
"recover_cells_and_kzg_proofs".into()
}
fn is_enabled_for_feature(&self, feature_name: FeatureName) -> bool {
feature_name == FeatureName::Fulu
}
}
#[derive(Derivative)]

View File

@@ -54,6 +54,7 @@ type_name_generic!(BeaconBlockBodyBellatrix, "BeaconBlockBody");
type_name_generic!(BeaconBlockBodyCapella, "BeaconBlockBody");
type_name_generic!(BeaconBlockBodyDeneb, "BeaconBlockBody");
type_name_generic!(BeaconBlockBodyElectra, "BeaconBlockBody");
type_name_generic!(BeaconBlockBodyFulu, "BeaconBlockBody");
type_name!(BeaconBlockHeader);
type_name_generic!(BeaconState);
type_name!(BlobIdentifier);
@@ -74,12 +75,14 @@ type_name_generic!(ExecutionPayloadBellatrix, "ExecutionPayload");
type_name_generic!(ExecutionPayloadCapella, "ExecutionPayload");
type_name_generic!(ExecutionPayloadDeneb, "ExecutionPayload");
type_name_generic!(ExecutionPayloadElectra, "ExecutionPayload");
type_name_generic!(ExecutionPayloadFulu, "ExecutionPayload");
type_name_generic!(FullPayload, "ExecutionPayload");
type_name_generic!(ExecutionPayloadHeader);
type_name_generic!(ExecutionPayloadHeaderBellatrix, "ExecutionPayloadHeader");
type_name_generic!(ExecutionPayloadHeaderCapella, "ExecutionPayloadHeader");
type_name_generic!(ExecutionPayloadHeaderDeneb, "ExecutionPayloadHeader");
type_name_generic!(ExecutionPayloadHeaderElectra, "ExecutionPayloadHeader");
type_name_generic!(ExecutionPayloadHeaderFulu, "ExecutionPayloadHeader");
type_name_generic!(ExecutionRequests);
type_name_generic!(BlindedPayload, "ExecutionPayloadHeader");
type_name!(Fork);
@@ -93,6 +96,7 @@ type_name_generic!(LightClientBootstrapAltair, "LightClientBootstrap");
type_name_generic!(LightClientBootstrapCapella, "LightClientBootstrap");
type_name_generic!(LightClientBootstrapDeneb, "LightClientBootstrap");
type_name_generic!(LightClientBootstrapElectra, "LightClientBootstrap");
type_name_generic!(LightClientBootstrapFulu, "LightClientBootstrap");
type_name_generic!(LightClientFinalityUpdate);
type_name_generic!(LightClientFinalityUpdateAltair, "LightClientFinalityUpdate");
type_name_generic!(
@@ -104,11 +108,13 @@ type_name_generic!(
LightClientFinalityUpdateElectra,
"LightClientFinalityUpdate"
);
type_name_generic!(LightClientFinalityUpdateFulu, "LightClientFinalityUpdate");
type_name_generic!(LightClientHeader);
type_name_generic!(LightClientHeaderAltair, "LightClientHeader");
type_name_generic!(LightClientHeaderCapella, "LightClientHeader");
type_name_generic!(LightClientHeaderDeneb, "LightClientHeader");
type_name_generic!(LightClientHeaderElectra, "LightClientHeader");
type_name_generic!(LightClientHeaderFulu, "LightClientHeader");
type_name_generic!(LightClientOptimisticUpdate);
type_name_generic!(
LightClientOptimisticUpdateAltair,
@@ -126,11 +132,16 @@ type_name_generic!(
LightClientOptimisticUpdateElectra,
"LightClientOptimisticUpdate"
);
type_name_generic!(
LightClientOptimisticUpdateFulu,
"LightClientOptimisticUpdate"
);
type_name_generic!(LightClientUpdate);
type_name_generic!(LightClientUpdateAltair, "LightClientUpdate");
type_name_generic!(LightClientUpdateCapella, "LightClientUpdate");
type_name_generic!(LightClientUpdateDeneb, "LightClientUpdate");
type_name_generic!(LightClientUpdateElectra, "LightClientUpdate");
type_name_generic!(LightClientUpdateFulu, "LightClientUpdate");
type_name_generic!(PendingAttestation);
type_name!(PendingConsolidation);
type_name!(PendingPartialWithdrawal);

View File

@@ -276,9 +276,9 @@ mod ssz_static {
fn attestation() {
SszStaticHandler::<AttestationBase<MinimalEthSpec>, MinimalEthSpec>::pre_electra().run();
SszStaticHandler::<AttestationBase<MainnetEthSpec>, MainnetEthSpec>::pre_electra().run();
SszStaticHandler::<AttestationElectra<MinimalEthSpec>, MinimalEthSpec>::electra_only()
SszStaticHandler::<AttestationElectra<MinimalEthSpec>, MinimalEthSpec>::electra_and_later()
.run();
SszStaticHandler::<AttestationElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only()
SszStaticHandler::<AttestationElectra<MainnetEthSpec>, MainnetEthSpec>::electra_and_later()
.run();
}
@@ -288,9 +288,9 @@ mod ssz_static {
.run();
SszStaticHandler::<AttesterSlashingBase<MainnetEthSpec>, MainnetEthSpec>::pre_electra()
.run();
SszStaticHandler::<AttesterSlashingElectra<MinimalEthSpec>, MinimalEthSpec>::electra_only()
SszStaticHandler::<AttesterSlashingElectra<MinimalEthSpec>, MinimalEthSpec>::electra_and_later()
.run();
SszStaticHandler::<AttesterSlashingElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only()
SszStaticHandler::<AttesterSlashingElectra<MainnetEthSpec>, MainnetEthSpec>::electra_and_later()
.run();
}
@@ -300,9 +300,9 @@ mod ssz_static {
.run();
SszStaticHandler::<IndexedAttestationBase<MainnetEthSpec>, MainnetEthSpec>::pre_electra()
.run();
SszStaticHandler::<IndexedAttestationElectra<MinimalEthSpec>, MinimalEthSpec>::electra_only()
SszStaticHandler::<IndexedAttestationElectra<MinimalEthSpec>, MinimalEthSpec>::electra_and_later()
.run();
SszStaticHandler::<IndexedAttestationElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only()
SszStaticHandler::<IndexedAttestationElectra<MainnetEthSpec>, MainnetEthSpec>::electra_and_later()
.run();
}
@@ -314,10 +314,10 @@ mod ssz_static {
SszStaticHandler::<SignedAggregateAndProofBase<MainnetEthSpec>, MainnetEthSpec>::pre_electra(
)
.run();
SszStaticHandler::<SignedAggregateAndProofElectra<MinimalEthSpec>, MinimalEthSpec>::electra_only(
SszStaticHandler::<SignedAggregateAndProofElectra<MinimalEthSpec>, MinimalEthSpec>::electra_and_later(
)
.run();
SszStaticHandler::<SignedAggregateAndProofElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only(
SszStaticHandler::<SignedAggregateAndProofElectra<MainnetEthSpec>, MainnetEthSpec>::electra_and_later(
)
.run();
}
@@ -328,10 +328,10 @@ mod ssz_static {
.run();
SszStaticHandler::<AggregateAndProofBase<MainnetEthSpec>, MainnetEthSpec>::pre_electra()
.run();
SszStaticHandler::<AggregateAndProofElectra<MinimalEthSpec>, MinimalEthSpec>::electra_only(
SszStaticHandler::<AggregateAndProofElectra<MinimalEthSpec>, MinimalEthSpec>::electra_and_later(
)
.run();
SszStaticHandler::<AggregateAndProofElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only(
SszStaticHandler::<AggregateAndProofElectra<MainnetEthSpec>, MainnetEthSpec>::electra_and_later(
)
.run();
}
@@ -361,6 +361,8 @@ mod ssz_static {
.run();
SszStaticHandler::<BeaconBlockBodyElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only()
.run();
SszStaticHandler::<BeaconBlockBodyFulu<MinimalEthSpec>, MinimalEthSpec>::fulu_only().run();
SszStaticHandler::<BeaconBlockBodyFulu<MainnetEthSpec>, MainnetEthSpec>::fulu_only().run();
}
// Altair and later
@@ -399,6 +401,10 @@ mod ssz_static {
.run();
SszStaticHandler::<LightClientBootstrapElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only()
.run();
SszStaticHandler::<LightClientBootstrapFulu<MinimalEthSpec>, MinimalEthSpec>::fulu_only()
.run();
SszStaticHandler::<LightClientBootstrapFulu<MainnetEthSpec>, MainnetEthSpec>::fulu_only()
.run();
}
// LightClientHeader has no internal indicator of which fork it is for, so we test it separately.
@@ -430,6 +436,10 @@ mod ssz_static {
SszStaticHandler::<LightClientHeaderElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only(
)
.run();
SszStaticHandler::<LightClientHeaderFulu<MinimalEthSpec>, MinimalEthSpec>::fulu_only()
.run();
SszStaticHandler::<LightClientHeaderFulu<MainnetEthSpec>, MainnetEthSpec>::fulu_only()
.run();
}
// LightClientOptimisticUpdate has no internal indicator of which fork it is for, so we test it separately.
@@ -445,6 +455,8 @@ mod ssz_static {
SszStaticHandler::<LightClientOptimisticUpdateDeneb<MainnetEthSpec>, MainnetEthSpec>::deneb_only().run();
SszStaticHandler::<LightClientOptimisticUpdateElectra<MinimalEthSpec>, MinimalEthSpec>::electra_only().run();
SszStaticHandler::<LightClientOptimisticUpdateElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only().run();
SszStaticHandler::<LightClientOptimisticUpdateFulu<MinimalEthSpec>, MinimalEthSpec>::fulu_only().run();
SszStaticHandler::<LightClientOptimisticUpdateFulu<MainnetEthSpec>, MainnetEthSpec>::fulu_only().run();
}
// LightClientFinalityUpdate has no internal indicator of which fork it is for, so we test it separately.
@@ -480,6 +492,12 @@ mod ssz_static {
SszStaticHandler::<LightClientFinalityUpdateElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only(
)
.run();
SszStaticHandler::<LightClientFinalityUpdateFulu<MinimalEthSpec>, MinimalEthSpec>::fulu_only(
)
.run();
SszStaticHandler::<LightClientFinalityUpdateFulu<MainnetEthSpec>, MainnetEthSpec>::fulu_only(
)
.run();
}
// LightClientUpdate has no internal indicator of which fork it is for, so we test it separately.
@@ -509,6 +527,10 @@ mod ssz_static {
SszStaticHandler::<LightClientUpdateElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only(
)
.run();
SszStaticHandler::<LightClientUpdateFulu<MinimalEthSpec>, MinimalEthSpec>::fulu_only()
.run();
SszStaticHandler::<LightClientUpdateFulu<MainnetEthSpec>, MainnetEthSpec>::fulu_only()
.run();
}
#[test]
@@ -566,6 +588,8 @@ mod ssz_static {
.run();
SszStaticHandler::<ExecutionPayloadElectra<MainnetEthSpec>, MainnetEthSpec>::electra_only()
.run();
SszStaticHandler::<ExecutionPayloadFulu<MinimalEthSpec>, MinimalEthSpec>::fulu_only().run();
SszStaticHandler::<ExecutionPayloadFulu<MainnetEthSpec>, MainnetEthSpec>::fulu_only().run();
}
#[test]
@@ -586,6 +610,10 @@ mod ssz_static {
::electra_only().run();
SszStaticHandler::<ExecutionPayloadHeaderElectra<MainnetEthSpec>, MainnetEthSpec>
::electra_only().run();
SszStaticHandler::<ExecutionPayloadHeaderFulu<MinimalEthSpec>, MinimalEthSpec>::fulu_only()
.run();
SszStaticHandler::<ExecutionPayloadHeaderFulu<MainnetEthSpec>, MainnetEthSpec>::fulu_only()
.run();
}
#[test]
@@ -626,17 +654,17 @@ mod ssz_static {
#[test]
fn data_column_sidecar() {
SszStaticHandler::<DataColumnSidecar<MinimalEthSpec>, MinimalEthSpec>::deneb_only()
SszStaticHandler::<DataColumnSidecar<MinimalEthSpec>, MinimalEthSpec>::default()
.run_for_feature(FeatureName::Fulu);
SszStaticHandler::<DataColumnSidecar<MainnetEthSpec>, MainnetEthSpec>::deneb_only()
SszStaticHandler::<DataColumnSidecar<MainnetEthSpec>, MainnetEthSpec>::default()
.run_for_feature(FeatureName::Fulu);
}
#[test]
fn data_column_identifier() {
SszStaticHandler::<DataColumnIdentifier, MinimalEthSpec>::deneb_only()
SszStaticHandler::<DataColumnIdentifier, MinimalEthSpec>::default()
.run_for_feature(FeatureName::Fulu);
SszStaticHandler::<DataColumnIdentifier, MainnetEthSpec>::deneb_only()
SszStaticHandler::<DataColumnIdentifier, MainnetEthSpec>::default()
.run_for_feature(FeatureName::Fulu);
}
@@ -901,20 +929,17 @@ fn kzg_verify_kzg_proof() {
#[test]
fn kzg_compute_cells_and_proofs() {
KZGComputeCellsAndKZGProofHandler::<MainnetEthSpec>::default()
.run_for_feature(FeatureName::Fulu);
KZGComputeCellsAndKZGProofHandler::<MainnetEthSpec>::default().run();
}
#[test]
fn kzg_verify_cell_proof_batch() {
KZGVerifyCellKZGProofBatchHandler::<MainnetEthSpec>::default()
.run_for_feature(FeatureName::Fulu);
KZGVerifyCellKZGProofBatchHandler::<MainnetEthSpec>::default().run();
}
#[test]
fn kzg_recover_cells_and_proofs() {
KZGRecoverCellsAndKZGProofHandler::<MainnetEthSpec>::default()
.run_for_feature(FeatureName::Fulu);
KZGRecoverCellsAndKZGProofHandler::<MainnetEthSpec>::default().run();
}
#[test]
@@ -949,14 +974,12 @@ fn rewards() {
#[test]
fn get_custody_groups() {
GetCustodyGroupsHandler::<MainnetEthSpec>::default().run_for_feature(FeatureName::Fulu);
GetCustodyGroupsHandler::<MinimalEthSpec>::default().run_for_feature(FeatureName::Fulu);
GetCustodyGroupsHandler::<MainnetEthSpec>::default().run();
GetCustodyGroupsHandler::<MinimalEthSpec>::default().run()
}
#[test]
fn compute_columns_for_custody_group() {
ComputeColumnsForCustodyGroupHandler::<MainnetEthSpec>::default()
.run_for_feature(FeatureName::Fulu);
ComputeColumnsForCustodyGroupHandler::<MinimalEthSpec>::default()
.run_for_feature(FeatureName::Fulu);
ComputeColumnsForCustodyGroupHandler::<MainnetEthSpec>::default().run();
ComputeColumnsForCustodyGroupHandler::<MinimalEthSpec>::default().run();
}