diff --git a/main.go b/main.go index b910e22..16ad27f 100644 --- a/main.go +++ b/main.go @@ -51,7 +51,8 @@ func run() error { ProcessTickTimeout time.Duration `conf:"default:5s"` } EmptyTicks struct { - CalculateAll bool `conf:"default:false"` + CalculateAll bool `conf:"default:false"` + Timeout time.Duration `conf:"default:30m"` } } @@ -91,7 +92,7 @@ func run() error { if cfg.EmptyTicks.CalculateAll == true { - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) + ctx, cancel := context.WithTimeout(context.Background(), cfg.EmptyTicks.Timeout) defer cancel() epochs, err := ps.GetLastProcessedTicksPerEpoch(ctx) if err != nil { @@ -99,6 +100,7 @@ func run() error { } for epoch, _ := range epochs { + fmt.Printf("Calculating empty ticks for epoch %d\n", epoch) emptyTicksPerEpoch, err := tick.CalculateEmptyTicksForEpoch(ctx, ps, epoch) if err != nil { return errors.Wrapf(err, "calculating empty ticks for epoch %d", epoch) diff --git a/validator/tick/empty_tick.go b/validator/tick/empty_tick.go index ec2268d..b6c3c66 100644 --- a/validator/tick/empty_tick.go +++ b/validator/tick/empty_tick.go @@ -2,6 +2,7 @@ package tick import ( "context" + "fmt" "github.com/pkg/errors" "github.com/qubic/go-archiver/protobuff" "github.com/qubic/go-archiver/store" @@ -32,6 +33,7 @@ func CalculateEmptyTicksForEpoch(ctx context.Context, ps *store.PebbleStore, epo } if CheckIfTickIsEmptyProto(tickData) { + fmt.Printf("Found empty tick.\n") emptyTicks += 1 continue }