From 7df2972d41f52b2757dac5905a94ffc224673198 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Wed, 4 Feb 2026 20:15:38 +1100 Subject: [PATCH] Run all ssz_static tests for Gloas (#8755) - Ensure all ssz_static tests are running and passing for Gloas :tada: - Refine file ignores for Gloas EF tests Co-Authored-By: Michael Sproul Co-Authored-By: Jimmy Chen --- consensus/types/src/builder/builder.rs | 4 +- .../signed_execution_payload_envelope.rs | 6 +- testing/ef_tests/check_all_files_accessed.py | 34 +++++++- testing/ef_tests/src/handler.rs | 10 +++ testing/ef_tests/src/type_name.rs | 11 +++ testing/ef_tests/tests/tests.rs | 86 ++++++++++++++++++- 6 files changed, 141 insertions(+), 10 deletions(-) diff --git a/consensus/types/src/builder/builder.rs b/consensus/types/src/builder/builder.rs index 81ca45046c..2bd50f42cc 100644 --- a/consensus/types/src/builder/builder.rs +++ b/consensus/types/src/builder/builder.rs @@ -1,6 +1,7 @@ use crate::test_utils::TestRandom; -use crate::{Address, Epoch}; +use crate::{Address, Epoch, ForkName}; use bls::PublicKeyBytes; +use context_deserialize::context_deserialize; use serde::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; use test_random_derive::TestRandom; @@ -12,6 +13,7 @@ pub type BuilderIndex = u64; #[derive( Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Encode, Decode, TestRandom, TreeHash, )] +#[context_deserialize(ForkName)] pub struct Builder { pub pubkey: PublicKeyBytes, #[serde(with = "serde_utils::quoted_u8")] diff --git a/consensus/types/src/execution/signed_execution_payload_envelope.rs b/consensus/types/src/execution/signed_execution_payload_envelope.rs index cdcebc7b31..ca48a9ec9b 100644 --- a/consensus/types/src/execution/signed_execution_payload_envelope.rs +++ b/consensus/types/src/execution/signed_execution_payload_envelope.rs @@ -1,9 +1,10 @@ use crate::test_utils::TestRandom; use crate::{ - ChainSpec, Domain, Epoch, EthSpec, ExecutionBlockHash, ExecutionPayloadEnvelope, Fork, Hash256, - SignedRoot, Slot, + ChainSpec, Domain, Epoch, EthSpec, ExecutionBlockHash, ExecutionPayloadEnvelope, Fork, + ForkName, Hash256, SignedRoot, Slot, }; use bls::{PublicKey, Signature}; +use context_deserialize::context_deserialize; use educe::Educe; use serde::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; @@ -13,6 +14,7 @@ use tree_hash_derive::TreeHash; #[derive(Debug, Clone, Serialize, Encode, Decode, Deserialize, TestRandom, TreeHash, Educe)] #[educe(PartialEq, Hash(bound(E: EthSpec)))] #[serde(bound = "E: EthSpec")] +#[context_deserialize(ForkName)] pub struct SignedExecutionPayloadEnvelope { pub message: ExecutionPayloadEnvelope, pub signature: Signature, diff --git a/testing/ef_tests/check_all_files_accessed.py b/testing/ef_tests/check_all_files_accessed.py index 97c1c4f4f9..d270817267 100755 --- a/testing/ef_tests/check_all_files_accessed.py +++ b/testing/ef_tests/check_all_files_accessed.py @@ -47,8 +47,38 @@ excluded_paths = [ "bls12-381-tests/hash_to_G2", "tests/.*/eip7732", "tests/.*/eip7805", + # TODO(gloas): remove these ignores as more Gloas operations are implemented + "tests/.*/gloas/operations/attestation/.*", + "tests/.*/gloas/operations/attester_slashing/.*", + "tests/.*/gloas/operations/block_header/.*", + "tests/.*/gloas/operations/bls_to_execution_change/.*", + "tests/.*/gloas/operations/consolidation_request/.*", + "tests/.*/gloas/operations/deposit/.*", + "tests/.*/gloas/operations/deposit_request/.*", + "tests/.*/gloas/operations/execution_payload/.*", + "tests/.*/gloas/operations/execution_payload_bid/.*", + "tests/.*/gloas/operations/payload_attestation/.*", + "tests/.*/gloas/operations/proposer_slashing/.*", + "tests/.*/gloas/operations/sync_aggregate/.*", + "tests/.*/gloas/operations/voluntary_exit/.*", + "tests/.*/gloas/operations/withdrawal_request/.*", + # TODO(EIP-7732): remove these ignores as Gloas consensus is implemented + "tests/.*/gloas/epoch_processing/.*", + "tests/.*/gloas/finality/.*", + "tests/.*/gloas/fork/.*", + "tests/.*/gloas/fork_choice/.*", + "tests/.*/gloas/networking/.*", + "tests/.*/gloas/rewards/.*", + "tests/.*/gloas/sanity/.*", + "tests/.*/gloas/transition/.*", # Ignore MatrixEntry SSZ tests for now. - "tests/.*/fulu/ssz_static/MatrixEntry/.*", + "tests/.*/.*/ssz_static/MatrixEntry/.*", + # TODO(gloas): Ignore Gloas light client stuff for now + "tests/.*/gloas/ssz_static/LightClient.*/.*", + # Execution payload header is irrelevant after Gloas, this type will probably be deleted. + "tests/.*/gloas/ssz_static/ExecutionPayloadHeader/.*", + # ForkChoiceNode is internal to fork choice and probably doesn't need SSZ tests. + "tests/.*/gloas/ssz_static/ForkChoiceNode/.*", # EIP-7916 is still in draft and hasn't been implemented yet https://eips.ethereum.org/EIPS/eip-7916 "tests/general/phase0/ssz_generic/progressive_bitlist", "tests/general/phase0/ssz_generic/basic_progressive_list", @@ -61,8 +91,6 @@ excluded_paths = [ "tests/.*/.*/epoch_processing/.*/post_epoch.ssz_snappy", # Ignore inactivity_scores tests for now (should implement soon). "tests/.*/.*/rewards/inactivity_scores/.*", - # Ignore gloas tests for now - "tests/.*/gloas/.*", # Ignore KZG tests that target internal kzg library functions "tests/.*/compute_verify_cell_kzg_proof_batch_challenge/.*", "tests/.*/compute_challenge/.*", diff --git a/testing/ef_tests/src/handler.rs b/testing/ef_tests/src/handler.rs index b0fc90b169..5af2df33b4 100644 --- a/testing/ef_tests/src/handler.rs +++ b/testing/ef_tests/src/handler.rs @@ -422,6 +422,11 @@ where fn handler_name(&self) -> String { BeaconState::::name().into() } + + fn disabled_forks(&self) -> Vec { + // TODO(gloas): Can be removed once we enable Gloas on all tests + vec![] + } } impl Handler for SszStaticWithSpecHandler @@ -444,6 +449,11 @@ where T::name().into() } + fn disabled_forks(&self) -> Vec { + // TODO(gloas): Can be removed once we enable Gloas on all tests + vec![] + } + fn is_enabled_for_fork(&self, fork_name: ForkName) -> bool { self.supported_forks.contains(&fork_name) } diff --git a/testing/ef_tests/src/type_name.rs b/testing/ef_tests/src/type_name.rs index ae00727fc3..18666befaa 100644 --- a/testing/ef_tests/src/type_name.rs +++ b/testing/ef_tests/src/type_name.rs @@ -72,6 +72,9 @@ type_name!(DepositData); type_name!(DepositMessage); type_name!(DepositRequest); type_name!(Eth1Data); +type_name!(Builder); +type_name!(BuilderPendingPayment); +type_name!(BuilderPendingWithdrawal); type_name!(WithdrawalRequest); type_name_generic!(ExecutionPayload); type_name_generic!(ExecutionPayloadBellatrix, "ExecutionPayload"); @@ -90,6 +93,8 @@ type_name_generic!(ExecutionPayloadHeaderFulu, "ExecutionPayloadHeader"); type_name_generic!(ExecutionPayloadBid); type_name_generic!(SignedExecutionPayloadBid); type_name_generic!(ExecutionRequests); +type_name_generic!(ExecutionPayloadEnvelope); +type_name_generic!(SignedExecutionPayloadEnvelope); type_name_generic!(BlindedPayload, "ExecutionPayloadHeader"); type_name!(Fork); type_name!(ForkData); @@ -97,6 +102,7 @@ type_name_generic!(HistoricalBatch); type_name_generic!(IndexedAttestation); type_name_generic!(IndexedAttestationBase, "IndexedAttestation"); type_name_generic!(IndexedAttestationElectra, "IndexedAttestation"); +type_name_generic!(IndexedPayloadAttestation); type_name_generic!(LightClientBootstrap); type_name_generic!(LightClientBootstrapAltair, "LightClientBootstrap"); type_name_generic!(LightClientBootstrapCapella, "LightClientBootstrap"); @@ -149,10 +155,15 @@ type_name_generic!(LightClientUpdateDeneb, "LightClientUpdate"); type_name_generic!(LightClientUpdateElectra, "LightClientUpdate"); type_name_generic!(LightClientUpdateFulu, "LightClientUpdate"); type_name_generic!(PendingAttestation); +type_name_generic!(PayloadAttestation); +type_name!(PayloadAttestationData); +type_name!(PayloadAttestationMessage); type_name!(PendingConsolidation); type_name!(PendingPartialWithdrawal); type_name!(PendingDeposit); type_name!(ProposerSlashing); +type_name!(ProposerPreferences); +type_name!(SignedProposerPreferences); type_name_generic!(SignedAggregateAndProof); type_name_generic!(SignedAggregateAndProofBase, "SignedAggregateAndProof"); type_name_generic!(SignedAggregateAndProofElectra, "SignedAggregateAndProof"); diff --git a/testing/ef_tests/tests/tests.rs b/testing/ef_tests/tests/tests.rs index 505693c31d..b47d39a6fa 100644 --- a/testing/ef_tests/tests/tests.rs +++ b/testing/ef_tests/tests/tests.rs @@ -241,9 +241,12 @@ mod ssz_static { use ef_tests::{Handler, SszStaticHandler, SszStaticTHCHandler, SszStaticWithSpecHandler}; use types::state::HistoricalSummary; use types::{ - AttesterSlashingBase, AttesterSlashingElectra, ConsolidationRequest, DataColumnSidecarFulu, - DataColumnSidecarGloas, DepositRequest, LightClientBootstrapAltair, PendingDeposit, - PendingPartialWithdrawal, WithdrawalRequest, *, + AttesterSlashingBase, AttesterSlashingElectra, Builder, BuilderPendingPayment, + BuilderPendingWithdrawal, ConsolidationRequest, DepositRequest, ExecutionPayloadBid, + ExecutionPayloadEnvelope, IndexedPayloadAttestation, LightClientBootstrapAltair, + PayloadAttestation, PayloadAttestationData, PayloadAttestationMessage, PendingDeposit, + PendingPartialWithdrawal, SignedExecutionPayloadBid, SignedExecutionPayloadEnvelope, + WithdrawalRequest, *, }; ssz_static_test!(attestation_data, AttestationData); @@ -600,7 +603,7 @@ mod ssz_static { .run(); SszStaticHandler::, MinimalEthSpec>::fulu_only().run(); SszStaticHandler::, MainnetEthSpec>::fulu_only().run(); - SszStaticHandler::, MainnetEthSpec>::gloas_only() + SszStaticHandler::, MinimalEthSpec>::gloas_only() .run(); SszStaticHandler::, MainnetEthSpec>::gloas_only() .run(); @@ -749,6 +752,81 @@ mod ssz_static { SszStaticHandler::, MinimalEthSpec>::electra_and_later() .run(); } + + // Gloas and later + #[test] + fn builder() { + SszStaticHandler::::gloas_and_later().run(); + SszStaticHandler::::gloas_and_later().run(); + } + + #[test] + fn builder_pending_payment() { + SszStaticHandler::::gloas_and_later().run(); + SszStaticHandler::::gloas_and_later().run(); + } + + #[test] + fn builder_pending_withdrawal() { + SszStaticHandler::::gloas_and_later().run(); + SszStaticHandler::::gloas_and_later().run(); + } + + #[test] + fn payload_attestation_data() { + SszStaticHandler::::gloas_and_later().run(); + SszStaticHandler::::gloas_and_later().run(); + } + + #[test] + fn payload_attestation() { + SszStaticHandler::, MinimalEthSpec>::gloas_and_later() + .run(); + SszStaticHandler::, MainnetEthSpec>::gloas_and_later() + .run(); + } + + #[test] + fn payload_attestation_message() { + SszStaticHandler::::gloas_and_later().run(); + SszStaticHandler::::gloas_and_later().run(); + } + + #[test] + fn indexed_payload_attestation() { + SszStaticHandler::, MinimalEthSpec>::gloas_and_later() + .run(); + SszStaticHandler::, MainnetEthSpec>::gloas_and_later() + .run(); + } + + #[test] + fn execution_payload_envelope() { + SszStaticHandler::, MinimalEthSpec>::gloas_and_later() + .run(); + SszStaticHandler::, MainnetEthSpec>::gloas_and_later() + .run(); + } + + #[test] + fn signed_execution_payload_envelope() { + SszStaticHandler::, MinimalEthSpec>::gloas_and_later() + .run(); + SszStaticHandler::, MainnetEthSpec>::gloas_and_later() + .run(); + } + + #[test] + fn proposer_preferences() { + SszStaticHandler::::gloas_and_later().run(); + SszStaticHandler::::gloas_and_later().run(); + } + + #[test] + fn signed_proposer_preferences() { + SszStaticHandler::::gloas_and_later().run(); + SszStaticHandler::::gloas_and_later().run(); + } } #[test]