Skip to content

Commit

Permalink
fix issue in CreateDefaultLightClientUpdate function (#14585)
Browse files Browse the repository at this point in the history
* use state in `CreateDefaultLightClientUpdate`

* lint

* add `stateSlot` to `update.go` structs

* Revert "add `stateSlot` to `update.go` structs"

This reverts commit 84468ae.

* set sync committee based on attestedHeader in updateElectra

* dependencies

* add check to `SetNextSyncCommitteeBranchElectra`

* add detailed error messages to `update.go`

* dependencies

* fix `createDefaultLightClientUpdate`

* deps

* fix errors

* deps

* revert error messages

* deps
  • Loading branch information
rupam-04 authored and rkapka committed Nov 3, 2024
1 parent be92c1e commit d528dbb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion beacon-chain/core/light-client/lightclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/db/kv/lightclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d528dbb

Please sign in to comment.