From ceb5ecf3494ea61ab3f9370ac3b3c1c92aa6d280 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Mon, 10 Feb 2025 12:58:08 +1100 Subject: [PATCH] Update EF tests to spec v1.5.0-beta.2 (#6958) Update spec tests for recent v1.5.0-beta.2 release. There are no substantial changes for Electra and earlier, and the Fulu test updates to be made are tracked here: - https://github.com/sigp/lighthouse/issues/6957 - Add `SingleAttestation` SSZ tests - Add new `deposit_with_reorg` fork choice tests - Update tag to v1.5.0-beta.2 - Ignore Fulu tests --- testing/ef_tests/Makefile | 2 +- testing/ef_tests/check_all_files_accessed.py | 5 ++--- testing/ef_tests/src/handler.rs | 5 +++++ testing/ef_tests/src/type_name.rs | 1 + testing/ef_tests/tests/tests.rs | 12 ++++++++++++ 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/testing/ef_tests/Makefile b/testing/ef_tests/Makefile index 7b507f8c503..c32a670e9a8 100644 --- a/testing/ef_tests/Makefile +++ b/testing/ef_tests/Makefile @@ -1,4 +1,4 @@ -TESTS_TAG := v1.5.0-beta.1 +TESTS_TAG := v1.5.0-beta.2 TESTS = general minimal mainnet TARBALLS = $(patsubst %,%-$(TESTS_TAG).tar.gz,$(TESTS)) diff --git a/testing/ef_tests/check_all_files_accessed.py b/testing/ef_tests/check_all_files_accessed.py index 02a01555b4e..8a662b72e35 100755 --- a/testing/ef_tests/check_all_files_accessed.py +++ b/testing/ef_tests/check_all_files_accessed.py @@ -49,9 +49,8 @@ "bls12-381-tests/hash_to_G2", "tests/.*/eip6110", "tests/.*/whisk", - # TODO(electra): SingleAttestation tests are waiting on Eitan's PR - "tests/.*/electra/ssz_static/SingleAttestation", - "tests/.*/fulu/ssz_static/SingleAttestation", + # TODO(das): Fulu tests are ignored for now + "tests/.*/fulu", "tests/.*/fulu/ssz_static/MatrixEntry", ] diff --git a/testing/ef_tests/src/handler.rs b/testing/ef_tests/src/handler.rs index d1ddd6a48ff..481c9b2169f 100644 --- a/testing/ef_tests/src/handler.rs +++ b/testing/ef_tests/src/handler.rs @@ -680,6 +680,11 @@ impl Handler for ForkChoiceHandler { return false; } + // Deposit tests exist only after Electra. + if self.handler_name == "deposit_with_reorg" && !fork_name.electra_enabled() { + return false; + } + // These tests check block validity (which may include signatures) and there is no need to // run them with fake crypto. cfg!(not(feature = "fake_crypto")) diff --git a/testing/ef_tests/src/type_name.rs b/testing/ef_tests/src/type_name.rs index 285ac951a6e..dfee3859580 100644 --- a/testing/ef_tests/src/type_name.rs +++ b/testing/ef_tests/src/type_name.rs @@ -155,6 +155,7 @@ type_name!(SignedBeaconBlockHeader); type_name_generic!(SignedContributionAndProof); type_name!(SignedVoluntaryExit); type_name!(SigningData); +type_name!(SingleAttestation); type_name_generic!(SyncCommitteeContribution); type_name!(SyncCommitteeMessage); type_name!(SyncAggregatorSelectionData); diff --git a/testing/ef_tests/tests/tests.rs b/testing/ef_tests/tests/tests.rs index bba7efde495..1f5a7dd9974 100644 --- a/testing/ef_tests/tests/tests.rs +++ b/testing/ef_tests/tests/tests.rs @@ -282,6 +282,12 @@ mod ssz_static { .run(); } + #[test] + fn single_attestation() { + SszStaticHandler::::electra_and_later().run(); + SszStaticHandler::::electra_and_later().run(); + } + #[test] fn attester_slashing() { SszStaticHandler::, MinimalEthSpec>::pre_electra() @@ -880,6 +886,12 @@ fn fork_choice_get_proposer_head() { ForkChoiceHandler::::new("get_proposer_head").run(); } +#[test] +fn fork_choice_deposit_with_reorg() { + ForkChoiceHandler::::new("deposit_with_reorg").run(); + // There is no mainnet variant for this test. +} + #[test] fn optimistic_sync() { OptimisticSyncHandler::::default().run();