Skip to content

Commit

Permalink
Node: Polygon checkpoint logging
Browse files Browse the repository at this point in the history
Change-Id: I31305812cc784845aa98497ada24b2a2041cad71
  • Loading branch information
bruce-riley authored and evan-gray committed Dec 2, 2022
1 parent 3e0cabc commit 16e8bb3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions node/pkg/watchers/evm/connectors/polygon.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ func (c *PolygonConnector) SubscribeForBlocks(ctx context.Context, sink chan<- *
return nil, fmt.Errorf("failed to get initial block: %w", err)
}

c.logger.Info("queried initial block", zap.Uint64("initialBlock", initialBlock.Uint64()))

if err = c.postBlock(ctx, initialBlock, sink); err != nil {
return nil, fmt.Errorf("failed to post initial block: %w", err)
}
Expand All @@ -133,6 +135,7 @@ func (c *PolygonConnector) SubscribeForBlocks(ctx context.Context, sink chan<- *
var bigOne = big.NewInt(1)

func (c *PolygonConnector) processCheckpoint(ctx context.Context, sink chan<- *NewBlock, checkpoint *rootAbi.AbiRootChainNewHeaderBlock) error {
c.logger.Info("processing checkpoint", zap.Uint64("start", checkpoint.Start.Uint64()), zap.Uint64("end", checkpoint.End.Uint64()))
for blockNum := checkpoint.Start; blockNum.Cmp(checkpoint.End) <= 0; blockNum.Add(blockNum, bigOne) {
if err := c.postBlock(ctx, blockNum, sink); err != nil {
return fmt.Errorf("failed to post block %s: %w", blockNum.String(), err)
Expand Down

0 comments on commit 16e8bb3

Please sign in to comment.