Skip to content

Commit

Permalink
Fix empty tick check.
Browse files Browse the repository at this point in the history
  • Loading branch information
LINCKODE committed Jul 29, 2024
1 parent 1f2fbda commit 2ecdbae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions validator/tick/empty_tick.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func CalculateEmptyTicksForEpoch(ctx context.Context, ps *store.PebbleStore, epo
var emptyTicks uint32

for _, interval := range e.Intervals {
fmt.Printf("Interbal: %d -> %d\n", interval.InitialProcessedTick, interval.LastProcessedTick)
for tickOffset := range interval.LastProcessedTick - interval.InitialProcessedTick + 1 {
tickNumber := tickOffset + interval.InitialProcessedTick

Expand All @@ -33,7 +34,7 @@ func CalculateEmptyTicksForEpoch(ctx context.Context, ps *store.PebbleStore, epo
}

if CheckIfTickIsEmptyProto(tickData) {
fmt.Printf("Found empty tick.\n")
fmt.Printf("Found empty tick: %d\n", tickNumber)
emptyTicks += 1
continue
}
Expand All @@ -45,7 +46,7 @@ func CalculateEmptyTicksForEpoch(ctx context.Context, ps *store.PebbleStore, epo
}

func CheckIfTickIsEmptyProto(tickData *protobuff.TickData) bool {
if tickData == nil {
if tickData == nil || tickData.VarStruct == nil {
return true
}

Expand Down

0 comments on commit 2ecdbae

Please sign in to comment.