Fix LC versioning bug (#15400)

* fix versioning

* changelog

* fix blockchain tests

* fix linter issue

* fix spec tests

* fix default lc update version

* fix lc header version

* gzl

* clean up the code

* Update testing/spectest/shared/common/light_client/update_ranking.go

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>

* add fulu set up in update ranking

* pass att block to createDefaultLCUpdate

* address comments

* linter

* Update lightclient.go

* sort imports

---------

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
This commit is contained in:
Bastin
2025-07-01 23:40:18 +02:00
committed by GitHub
parent bc7664321b
commit bddcc158e4
18 changed files with 744 additions and 500 deletions

View File

@@ -7,6 +7,6 @@ import (
"github.com/OffchainLabs/prysm/v6/testing/spectest/shared/common/light_client"
)
func TestMainnet_Electra_LightClient_SingleMerkleProof(t *testing.T) {
func TestMinimal_Electra_LightClient_SingleMerkleProof(t *testing.T) {
light_client.RunLightClientSingleMerkleProofTests(t, "minimal", version.Electra)
}

View File

@@ -7,6 +7,6 @@ import (
"github.com/OffchainLabs/prysm/v6/testing/spectest/shared/common/light_client"
)
func TestMainnet_Electra_LightClient_UpdateRanking(t *testing.T) {
func TestMinimal_Electra_LightClient_UpdateRanking(t *testing.T) {
light_client.RunLightClientUpdateRankingTests(t, "minimal", version.Electra)
}

View File

@@ -14,6 +14,7 @@ go_library(
"//beacon-chain/core/light-client:go_default_library",
"//beacon-chain/state:go_default_library",
"//beacon-chain/state/state-native:go_default_library",
"//config/params:go_default_library",
"//consensus-types/interfaces:go_default_library",
"//consensus-types/light-client:go_default_library",
"//container/trie:go_default_library",

View File

@@ -7,6 +7,7 @@ import (
"github.com/OffchainLabs/prysm/v6/beacon-chain/core/helpers"
lightclient "github.com/OffchainLabs/prysm/v6/beacon-chain/core/light-client"
"github.com/OffchainLabs/prysm/v6/config/params"
"github.com/OffchainLabs/prysm/v6/consensus-types/interfaces"
lightclienttypes "github.com/OffchainLabs/prysm/v6/consensus-types/light-client"
ethpb "github.com/OffchainLabs/prysm/v6/proto/prysm/v1alpha1"
@@ -20,6 +21,24 @@ import (
// RunLightClientUpdateRankingTests executes "light_client/update_ranking/pyspec_tests/update_ranking" tests.
func RunLightClientUpdateRankingTests(t *testing.T, config string, v int) {
require.NoError(t, utils.SetConfig(t, config))
if v >= version.Altair {
params.BeaconConfig().AltairForkEpoch = 0
}
if v >= version.Bellatrix {
params.BeaconConfig().BellatrixForkEpoch = 0
}
if v >= version.Capella {
params.BeaconConfig().CapellaForkEpoch = 0
}
if v >= version.Deneb {
params.BeaconConfig().DenebForkEpoch = 0
}
if v >= version.Electra {
params.BeaconConfig().ElectraForkEpoch = 0
}
if v >= version.Fulu {
params.BeaconConfig().FuluForkEpoch = 0
}
_, testsFolderPath := utils.TestFolders(t, config, version.String(v), "light_client/update_ranking/pyspec_tests/")
testTypes, err := util.BazelListDirectories(testsFolderPath)