diff --git a/beacon-chain/sync/initial-sync/round_robin.go b/beacon-chain/sync/initial-sync/round_robin.go index 4a3028c51..bbd89aec8 100644 --- a/beacon-chain/sync/initial-sync/round_robin.go +++ b/beacon-chain/sync/initial-sync/round_robin.go @@ -110,7 +110,7 @@ func (s *Service) processFetchedData( // Use Batch Block Verify to process and verify batches directly. if err := s.processBatchedBlocks(ctx, genesis, data.blocks, s.chain.ReceiveBlockBatch); err != nil { - log.WithField("err", err.Error()).Warn("Batch is not processed") + log.WithError(err).Warn("Batch is not processed") } } @@ -125,20 +125,20 @@ func (s *Service) processFetchedDataRegSync( if err := s.processBlock(ctx, genesis, blk, blockReceiver); err != nil { switch { case errors.Is(err, errBlockAlreadyProcessed): - log.WithField("err", err.Error()).Debug("Block is not processed") + log.WithError(err).Debug("Block is not processed") invalidBlocks++ case errors.Is(err, errParentDoesNotExist): - log.WithField("err", err.Error()).Debug("Block is not processed") + log.WithError(err).Debug("Block is not processed") invalidBlocks++ default: - log.WithField("err", err.Error()).Warn("Block is not processed") + log.WithError(err).Warn("Block is not processed") } continue } } // Add more visible logging if all blocks cannot be processed. if len(data.blocks) == invalidBlocks { - log.WithField("err", "Range had no valid blocks to process").Warn("Range is not processed") + log.WithField("error", "Range had no valid blocks to process").Warn("Range is not processed") } }