diff --git a/beacon-chain/core/light-client/lightclient.go b/beacon-chain/core/light-client/lightclient.go index c009fc5a5a9..d07813fc7a5 100644 --- a/beacon-chain/core/light-client/lightclient.go +++ b/beacon-chain/core/light-client/lightclient.go @@ -253,7 +253,7 @@ func CreateDefaultLightClientUpdate(currentSlot primitives.Slot, attestedState s } var nextSyncCommitteeBranch [][]byte - if currentEpoch >= params.BeaconConfig().ElectraForkEpoch { + if attestedState.Version() >= version.Electra { nextSyncCommitteeBranch = make([][]byte, fieldparams.SyncCommitteeBranchDepthElectra) } else { nextSyncCommitteeBranch = make([][]byte, fieldparams.SyncCommitteeBranchDepth) diff --git a/beacon-chain/db/kv/lightclient_test.go b/beacon-chain/db/kv/lightclient_test.go index fc7b6cbeef2..84702567a37 100644 --- a/beacon-chain/db/kv/lightclient_test.go +++ b/beacon-chain/db/kv/lightclient_test.go @@ -457,7 +457,7 @@ func createDefaultLightClientUpdate(currentSlot primitives.Slot, attestedState s } var nextSyncCommitteeBranch [][]byte - if currentEpoch >= params.BeaconConfig().ElectraForkEpoch { + if attestedState.Version() >= version.Electra { nextSyncCommitteeBranch = make([][]byte, fieldparams.SyncCommitteeBranchDepthElectra) } else { nextSyncCommitteeBranch = make([][]byte, fieldparams.SyncCommitteeBranchDepth)