mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 23:48:06 -05:00
add light client fulu spec tests (#15697)
This commit is contained in:
3
changelog/bastin_lc-fulu-spectest.md
Normal file
3
changelog/bastin_lc-fulu-spectest.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
### Ignored
|
||||||
|
|
||||||
|
- Fulu spec tests coverage for light client tests.
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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)
|
||||||
|
}
|
||||||
@@ -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",
|
||||||
|
|||||||
@@ -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)
|
||||||
|
}
|
||||||
@@ -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 := ðpb.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 := ðpb.BeaconBlockBodyElectra{}
|
beaconBlockBody := ðpb.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()
|
||||||
|
|||||||
Reference in New Issue
Block a user