Skip to content

Commit

Permalink
(BIDS-2612) add missing sync committee epoch fields
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelsc committed Oct 31, 2023
1 parent 0c45392 commit 9d22fe0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions handlers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1023,12 +1023,14 @@ func getSyncCommitteeInfoForValidators(validators []uint64, period uint64) ([]in
rows, err := db.ReaderDb.Query(
`SELECT
period,
GREATEST(period*$3, $4) AS start_epoch,
((period+1)*$3)-1 AS end_epoch,
ARRAY_AGG(validatorindex ORDER BY committeeindex) AS validators
FROM sync_committees
WHERE period = $1 AND validatorindex = ANY($2)
GROUP BY period`,
period,
pq.Array(validators),
period, pq.Array(validators),
utils.Config.Chain.ClConfig.EpochsPerSyncCommitteePeriod, utils.Config.Chain.ClConfig.AltairForkEpoch,
)
if err != nil {
return nil, fmt.Errorf("could not get sync committee for period %d: %w", period, err)
Expand Down

0 comments on commit 9d22fe0

Please sign in to comment.