Set starting slot and improve error gap capturing
This commit is contained in:
parent
d674df1ef0
commit
31e1ef0082
@ -59,7 +59,6 @@ type BeaconClient struct {
|
|||||||
StartingSlot int // If we're performing head tracking. What is the first slot we processed.
|
StartingSlot int // If we're performing head tracking. What is the first slot we processed.
|
||||||
PreviousSlot int // Whats the previous slot we processed
|
PreviousSlot int // Whats the previous slot we processed
|
||||||
PreviousBlockRoot string // Whats the previous block root, used to check the next blocks parent.
|
PreviousBlockRoot string // Whats the previous block root, used to check the next blocks parent.
|
||||||
CheckKnownGaps bool // Should we check for gaps at start up.
|
|
||||||
HeadTracking *SseEvents[Head] // Track the head block
|
HeadTracking *SseEvents[Head] // Track the head block
|
||||||
ReOrgTracking *SseEvents[ChainReorg] // Track all Reorgs
|
ReOrgTracking *SseEvents[ChainReorg] // Track all Reorgs
|
||||||
//FinalizationTracking *SseEvents[FinalizedCheckpoint] // Track all finalization checkpoints
|
//FinalizationTracking *SseEvents[FinalizedCheckpoint] // Track all finalization checkpoints
|
||||||
|
@ -53,13 +53,19 @@ func (bc *BeaconClient) handleHead() {
|
|||||||
if errorSlots != 0 && bc.PreviousSlot != 0 {
|
if errorSlots != 0 && bc.PreviousSlot != 0 {
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"lastProcessedSlot": bc.PreviousSlot,
|
"lastProcessedSlot": bc.PreviousSlot,
|
||||||
"errorMessages": errorSlots,
|
"errorSlots": errorSlots,
|
||||||
}).Warn("We added slots to the knownGaps table because we got bad head messages.")
|
}).Warn("We added slots to the knownGaps table because we got bad head messages.")
|
||||||
writeKnownGaps(bc.Db, bc.KnownGapTableIncrement, bc.PreviousSlot, bcSlotsPerEpoch+errorSlots, fmt.Errorf("Bad Head Messages"), "headProcessing", bc.Metrics)
|
writeKnownGaps(bc.Db, bc.KnownGapTableIncrement, bc.PreviousSlot+1, slot, fmt.Errorf("Bad Head Messages"), "headProcessing", bc.Metrics)
|
||||||
|
errorSlots = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
log.WithFields(log.Fields{"head": head}).Debug("We are going to start processing the slot.")
|
log.WithFields(log.Fields{"head": head}).Debug("We are going to start processing the slot.")
|
||||||
|
|
||||||
|
// Not used anywhere yet but might be useful to have.
|
||||||
|
if bc.PreviousSlot == 0 && bc.PreviousBlockRoot == "" {
|
||||||
|
bc.StartingSlot = slot
|
||||||
|
}
|
||||||
|
|
||||||
go processHeadSlot(bc.Db, bc.ServerEndpoint, slot, head.Block, head.State, bc.PreviousSlot, bc.PreviousBlockRoot, bc.Metrics, bc.KnownGapTableIncrement, bc.CheckDb)
|
go processHeadSlot(bc.Db, bc.ServerEndpoint, slot, head.Block, head.State, bc.PreviousSlot, bc.PreviousBlockRoot, bc.Metrics, bc.KnownGapTableIncrement, bc.CheckDb)
|
||||||
|
|
||||||
log.WithFields(log.Fields{"head": head.Slot}).Debug("We finished calling processHeadSlot.")
|
log.WithFields(log.Fields{"head": head.Slot}).Debug("We finished calling processHeadSlot.")
|
||||||
|
Loading…
Reference in New Issue
Block a user