Skip to content

Commit

Permalink
added log when found a skipped block
Browse files Browse the repository at this point in the history
  • Loading branch information
billettc committed Jan 17, 2024
1 parent bec02fb commit e4d3234
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion block/fetcher/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,13 @@ func (f *RPCFetcher) fetchRpcBlock(ctx context.Context, requestedSlot uint64) (s
func (f *RPCFetcher) fetch(ctx context.Context, requestedSlot uint64) (slot uint64, out *rpc.GetBlockResult, err error) {
currentSlot := requestedSlot
for {
resolvedSlot, blockResult, err := f.fetchBlock(ctx, requestedSlot)
//f.logger.Info("getting block", zap.Uint64("block_num", currentSlot))
resolvedSlot, blockResult, err := f.fetchBlock(ctx, currentSlot)
if err != nil {
var rpcErr *jsonrpc.RPCError
if errors.As(err, &rpcErr) {
if rpcErr.Code == -32009 {
f.logger.Info("block was skipped", zap.Uint64("block_num", currentSlot))
currentSlot += 1
continue
}
Expand Down

0 comments on commit e4d3234

Please sign in to comment.