Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong sync committee participation association #2682

Merged
merged 12 commits into from
Nov 27, 2023
Prev Previous commit
Next Next commit
(NOBIDS) db finalized epoch not service
manuelsc committed Nov 14, 2023
commit bc6461a720d728a125f889fdcd9689d5fe33961c
14 changes: 12 additions & 2 deletions cmd/misc/main.go
Original file line number Diff line number Diff line change
@@ -1246,7 +1246,12 @@ func exportSyncCommitteePeriods(rpcClient rpc.Client, bt *db.Bigtable, startDay,

firstPeriod := utils.SyncPeriodOfEpoch(utils.Config.Chain.ClConfig.AltairForkEpoch)
if endDay <= 0 {
currEpoch = services.LatestFinalizedEpoch()
var err error
currEpoch, err = db.GetLatestFinalizedEpoch()
if err != nil {
logrus.WithError(err).Errorf("error getting latest finalized epoch")
LuccaBitfly marked this conversation as resolved.
Show resolved Hide resolved
return
}
if currEpoch > 0 { // guard against underflows
currEpoch = currEpoch - 1
}
@@ -1291,7 +1296,12 @@ func exportSyncCommitteeValidatorStats(rpcClient rpc.Client, bt *db.Bigtable, st
var currEpoch = uint64(0)

if endDay <= 0 {
currEpoch = services.LatestFinalizedEpoch()
var err error
currEpoch, err = db.GetLatestFinalizedEpoch()
if err != nil {
logrus.WithError(err).Errorf("error getting latest finalized epoch")
return
}
if currEpoch > 0 { // guard against underflows
currEpoch = currEpoch - 1
}