Skip to content

Commit e93c7e8

Browse files
committed
fix(slot_exporter): disable late-slot-proposal only for holesky
1 parent dfecf1f commit e93c7e8

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

backend/pkg/exporter/modules/dashboard_data.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ func (d *dashboardData) fetchEpochValidatorStates(epochStart uint64, epochEnd ui
881881
slots = append(slots, 0)
882882
continue
883883
}
884-
slots = append(slots, uint64(i)*utils.Config.Chain.ClConfig.SlotsPerEpoch-1)
884+
slots = append(slots, i*utils.Config.Chain.ClConfig.SlotsPerEpoch-1)
885885
}
886886
writeMutex := &sync.Mutex{}
887887
d.log.Debugf("fetching states for epochs %d to %d using slots %v", epochStart, epochEnd, slots)

backend/pkg/exporter/modules/slot_exporter.go

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,11 @@ func (d *slotExporterData) OnHead(_ *constypes.StandardEventHeadResponse) (err e
199199
for _, dbSlot := range dbNonFinalSlots {
200200
nodeSlotFinalized := dbSlot.Slot <= head.FinalizedSlot
201201

202+
var header *constypes.StandardBeaconHeaderResponse
203+
202204
if nodeSlotFinalized != dbSlot.Finalized {
203205
log.Infof("checking slot %d for finalization / reorgs", dbSlot.Slot)
204-
header, err := d.Client.GetBlockHeader(dbSlot.Slot)
206+
header, err = d.Client.GetBlockHeader(dbSlot.Slot)
205207

206208
if err != nil {
207209
return fmt.Errorf("error retrieving block root for slot %v: %w", dbSlot.Slot, err)
@@ -271,15 +273,18 @@ func (d *slotExporterData) OnHead(_ *constypes.StandardEventHeadResponse) (err e
271273
}
272274
}
273275
}
274-
} else { // check if a late slot has been proposed in the meantime
276+
} else {
277+
// check if a late slot has been proposed in the meantime
275278
// TODO: reenable once holesky is close to recovery
276-
// if len(dbSlot.BlockRoot) < 32 && header != nil { // we have no slot in the db, but the node has a slot, export it
277-
// log.Infof("exporting new slot %v", dbSlot.Slot)
278-
// err := ExportSlot(d.Client, dbSlot.Slot, utils.EpochOfSlot(dbSlot.Slot) == head.HeadEpoch, tx)
279-
// if err != nil {
280-
// return fmt.Errorf("error exporting slot %v: %w", dbSlot.Slot, err)
281-
// }
282-
// }
279+
if utils.Config.Chain.Id != 17000 {
280+
if len(dbSlot.BlockRoot) < 32 && header != nil { // we have no slot in the db, but the node has a slot, export it
281+
log.Infof("exporting new slot %v", dbSlot.Slot)
282+
err := ExportSlot(d.Client, dbSlot.Slot, utils.EpochOfSlot(dbSlot.Slot) == head.HeadEpoch, tx)
283+
if err != nil {
284+
return fmt.Errorf("error exporting slot %v: %w", dbSlot.Slot, err)
285+
}
286+
}
287+
}
283288
}
284289
}
285290

0 commit comments

Comments
 (0)