add light client fulu spec tests (#15697)

This commit is contained in:
Bastin
2025-09-16 16:21:54 +02:00
committed by GitHub
parent db074cbf12
commit 41884d8d9d
7 changed files with 35 additions and 3 deletions

View File

@@ -0,0 +1,3 @@
### Ignored
- Fulu spec tests coverage for light client tests.

View File

@@ -9,8 +9,6 @@ tests/minimal/bellatrix/light_client/data_collection
tests/minimal/capella/light_client/data_collection tests/minimal/capella/light_client/data_collection
tests/minimal/deneb/light_client/data_collection tests/minimal/deneb/light_client/data_collection
tests/minimal/electra/light_client/data_collection tests/minimal/electra/light_client/data_collection
tests/minimal/fulu/light_client/single_merkle_proof
tests/mainnet/fulu/light_client/single_merkle_proof
# SSZ Generic # SSZ Generic
tests/general/phase0/ssz_generic/basic_vector tests/general/phase0/ssz_generic/basic_vector

View File

@@ -179,6 +179,7 @@ go_test(
"fulu__fork__upgrade_to_fulu_test.go", "fulu__fork__upgrade_to_fulu_test.go",
"fulu__fork_transition__transition_test.go", "fulu__fork_transition__transition_test.go",
"fulu__forkchoice__forkchoice_test.go", "fulu__forkchoice__forkchoice_test.go",
"fulu__light_client__single_merkle_proof_test.go",
"fulu__merkle_proof__merkle_proof_test.go", "fulu__merkle_proof__merkle_proof_test.go",
"fulu__networking__custody_groups_test.go", "fulu__networking__custody_groups_test.go",
"fulu__operations__attestation_test.go", "fulu__operations__attestation_test.go",

View File

@@ -0,0 +1,12 @@
package mainnet
import (
"testing"
"github.com/OffchainLabs/prysm/v6/runtime/version"
"github.com/OffchainLabs/prysm/v6/testing/spectest/shared/common/light_client"
)
func TestMainnet_Fulu_LightClient_SingleMerkleProof(t *testing.T) {
light_client.RunLightClientSingleMerkleProofTests(t, "mainnet", version.Fulu)
}

View File

@@ -185,6 +185,7 @@ go_test(
"fulu__fork__upgrade_to_fulu_test.go", "fulu__fork__upgrade_to_fulu_test.go",
"fulu__fork_transition__transition_test.go", "fulu__fork_transition__transition_test.go",
"fulu__forkchoice__forkchoice_test.go", "fulu__forkchoice__forkchoice_test.go",
"fulu__light_client__single_merkle_proof_test.go",
"fulu__merkle_proof__merkle_proof_test.go", "fulu__merkle_proof__merkle_proof_test.go",
"fulu__networking__custody_columns_test.go", "fulu__networking__custody_columns_test.go",
"fulu__operations__attestation_test.go", "fulu__operations__attestation_test.go",

View File

@@ -0,0 +1,12 @@
package minimal
import (
"testing"
"github.com/OffchainLabs/prysm/v6/runtime/version"
"github.com/OffchainLabs/prysm/v6/testing/spectest/shared/common/light_client"
)
func TestMinimal_Fulu_LightClient_SingleMerkleProof(t *testing.T) {
light_client.RunLightClientSingleMerkleProofTests(t, "minimal", version.Fulu)
}

View File

@@ -85,6 +85,11 @@ func runLightClientSingleMerkleProofTestBeaconState(t *testing.T, testFolderPath
require.NoError(t, beaconStateBase.UnmarshalSSZ(beaconStateSSZ), "Failed to unmarshal") require.NoError(t, beaconStateBase.UnmarshalSSZ(beaconStateSSZ), "Failed to unmarshal")
beaconState, err = state_native.InitializeFromProtoElectra(beaconStateBase) beaconState, err = state_native.InitializeFromProtoElectra(beaconStateBase)
require.NoError(t, err) require.NoError(t, err)
case version.Fulu:
beaconStateBase := &ethpb.BeaconStateFulu{}
require.NoError(t, beaconStateBase.UnmarshalSSZ(beaconStateSSZ), "Failed to unmarshal")
beaconState, err = state_native.InitializeFromProtoFulu(beaconStateBase)
require.NoError(t, err)
default: default:
t.Fatalf("Unsupported version: %d", v) t.Fatalf("Unsupported version: %d", v)
} }
@@ -157,7 +162,7 @@ func runLightClientSingleMerkleProofTestBeaconBlockBody(t *testing.T, testFolder
require.NoError(t, err) require.NoError(t, err)
executionPayloadRoot, err = beaconBlockBody.ExecutionPayload.HashTreeRoot() executionPayloadRoot, err = beaconBlockBody.ExecutionPayload.HashTreeRoot()
require.NoError(t, err) require.NoError(t, err)
case version.Electra: case version.Electra, version.Fulu:
beaconBlockBody := &ethpb.BeaconBlockBodyElectra{} beaconBlockBody := &ethpb.BeaconBlockBodyElectra{}
require.NoError(t, beaconBlockBody.UnmarshalSSZ(beaconBlockBodySSZ), "Failed to unmarshal") require.NoError(t, beaconBlockBody.UnmarshalSSZ(beaconBlockBodySSZ), "Failed to unmarshal")
beaconBlockBodyRoot, err = beaconBlockBody.HashTreeRoot() beaconBlockBodyRoot, err = beaconBlockBody.HashTreeRoot()