Skip to content

Commit

Permalink
Log RPC error code when block is skipped
Browse files Browse the repository at this point in the history
Add RPC error code logging to provide better insight into why a fetcher block was skipped. This will aid in debugging and improve the traceability of block fetch errors by including the specific RPC error code alongside the block number.
  • Loading branch information
billettc committed Nov 28, 2024
1 parent 738621b commit 8c8632c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/fetcher/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (f *RPCFetcher) fetch(ctx context.Context, requestedSlot uint64, lastConfir
if errors.As(err, &rpcErr) {

if rpcErr.Code == -32009 || rpcErr.Code == -32007 {
f.logger.Info("fetcher block was skipped", zap.Uint64("block_num", currentSlot))
f.logger.Info("fetcher block was skipped", zap.Uint64("block_num", currentSlot), zap.Int("rpc_error_code", rpcErr.Code))
return nil, true, nil
}

Expand Down

0 comments on commit 8c8632c

Please sign in to comment.