From 8c8632cddc5b63ba7a9deef5536a53460963ee14 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Thu, 28 Nov 2024 09:15:03 -0500 Subject: [PATCH] Log RPC error code when block is skipped 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. --- block/fetcher/rpc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/fetcher/rpc.go b/block/fetcher/rpc.go index f137c85..6bea3e5 100644 --- a/block/fetcher/rpc.go +++ b/block/fetcher/rpc.go @@ -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 }