From ffbd25e2be041584e823123b051cf96775dd9e6c Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Tue, 24 Dec 2024 14:40:38 +1100 Subject: [PATCH] Fix `SszStatic` tests for PeerDAS: exclude eip7594 test vectors when testing Electra types. --- testing/ef_tests/src/handler.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/testing/ef_tests/src/handler.rs b/testing/ef_tests/src/handler.rs index e3365e8c40..53ab2e6322 100644 --- a/testing/ef_tests/src/handler.rs +++ b/testing/ef_tests/src/handler.rs @@ -343,7 +343,19 @@ where } fn is_enabled_for_feature(&self, feature_name: FeatureName) -> bool { + // This ensures we only run the tests **once** for `Eip7594`, using the types matching the + // correct fork, e.g. `Eip7594` uses SSZ types from `Deneb` as of spec test version + // `v1.5.0-alpha.8`, therefore the `Eip7594` tests should get included when testing Deneb types. + // + // e.g. Eip7594 test vectors are executed in the first line below, but excluded in the 2nd + // line when testing the type `AttestationElectra`: + // + // ``` + // SszStaticHandler::, MainnetEthSpec>::pre_electra().run(); + // SszStaticHandler::, MainnetEthSpec>::electra_only().run(); + // ``` feature_name == FeatureName::Eip7594 + && self.supported_forks.contains(&feature_name.fork_name()) } }