From b7fb85df6a5f078cea8691d6b428106be0bc0d09 Mon Sep 17 00:00:00 2001
From: Giulio rebuffo <giulio.rebuffo@gmail.com>
Date: Wed, 23 Mar 2022 10:28:32 +0100
Subject: [PATCH] demoted logs (#3753)

---
 cmd/rpcdaemon/commands/engine_api.go |  4 ++--
 eth/stagedsync/stage_headers.go      | 10 +++++-----
 ethdb/privateapi/ethbackend.go       |  8 ++++----
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/cmd/rpcdaemon/commands/engine_api.go b/cmd/rpcdaemon/commands/engine_api.go
index 81dd8ce323..7635d78992 100644
--- a/cmd/rpcdaemon/commands/engine_api.go
+++ b/cmd/rpcdaemon/commands/engine_api.go
@@ -87,7 +87,7 @@ func convertPayloadStatus(x *remote.EnginePayloadStatus) map[string]interface{}
 }
 
 func (e *EngineImpl) ForkchoiceUpdatedV1(ctx context.Context, forkChoiceState *ForkChoiceState, payloadAttributes *PayloadAttributes) (map[string]interface{}, error) {
-	log.Info("Received ForkchoiceUpdated", "head", forkChoiceState.HeadHash, "safe", forkChoiceState.HeadHash, "finalized", forkChoiceState.FinalizedBlockHash,
+	log.Trace("Received ForkchoiceUpdated", "head", forkChoiceState.HeadHash, "safe", forkChoiceState.HeadHash, "finalized", forkChoiceState.FinalizedBlockHash,
 		"build", payloadAttributes != nil)
 
 	var prepareParameters *remote.EnginePayloadAttributes
@@ -125,7 +125,7 @@ func (e *EngineImpl) ForkchoiceUpdatedV1(ctx context.Context, forkChoiceState *F
 // NewPayloadV1 processes new payloads (blocks) from the beacon chain.
 // See https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#engine_newpayloadv1
 func (e *EngineImpl) NewPayloadV1(ctx context.Context, payload *ExecutionPayload) (map[string]interface{}, error) {
-	log.Info("Received NewPayload", "height", uint64(payload.BlockNumber), "hash", payload.BlockHash)
+	log.Trace("Received NewPayload", "height", uint64(payload.BlockNumber), "hash", payload.BlockHash)
 
 	var baseFee *uint256.Int
 	if payload.BaseFeePerGas != nil {
diff --git a/eth/stagedsync/stage_headers.go b/eth/stagedsync/stage_headers.go
index 8e6a327775..c70ade477a 100644
--- a/eth/stagedsync/stage_headers.go
+++ b/eth/stagedsync/stage_headers.go
@@ -291,9 +291,9 @@ func handleForkChoice(
 		}
 	}
 
-	log.Info(fmt.Sprintf("[%s] Fork choice beginning unwind", s.LogPrefix()))
+	log.Trace(fmt.Sprintf("[%s] Fork choice beginning unwind", s.LogPrefix()))
 	u.UnwindTo(forkingPoint, common.Hash{})
-	log.Info(fmt.Sprintf("[%s] Fork choice unwind finished", s.LogPrefix()))
+	log.Trace(fmt.Sprintf("[%s] Fork choice unwind finished", s.LogPrefix()))
 
 	cfg.hd.SetPendingHeader(headerHash, headerNumber)
 
@@ -314,7 +314,7 @@ func handleNewPayload(
 	headerNumber := header.Number.Uint64()
 	headerHash := header.Hash()
 
-	log.Info(fmt.Sprintf("[%s] Handling new payload", s.LogPrefix()), "height", headerNumber, "hash", headerHash)
+	log.Trace(fmt.Sprintf("[%s] Handling new payload", s.LogPrefix()), "height", headerNumber, "hash", headerHash)
 
 	cfg.hd.UpdateTopSeenHeightPoS(headerNumber)
 
@@ -366,9 +366,9 @@ func handleNewPayload(
 
 	cfg.hd.BeaconRequestList.Remove(requestId)
 
-	log.Info(fmt.Sprintf("[%s] New payload begin verification", s.LogPrefix()))
+	log.Trace(fmt.Sprintf("[%s] New payload begin verification", s.LogPrefix()))
 	success, err := verifyAndSaveNewPoSHeader(requestStatus, s, tx, cfg, header, headerInserter)
-	log.Info(fmt.Sprintf("[%s] New payload verification ended", s.LogPrefix()), "success", success, "err", err)
+	log.Trace(fmt.Sprintf("[%s] New payload verification ended", s.LogPrefix()), "success", success, "err", err)
 	if err != nil || !success {
 		return err
 	}
diff --git a/ethdb/privateapi/ethbackend.go b/ethdb/privateapi/ethbackend.go
index 89d4e55c2f..748e2d8103 100644
--- a/ethdb/privateapi/ethbackend.go
+++ b/ethdb/privateapi/ethbackend.go
@@ -304,7 +304,7 @@ func (s *EthBackendServer) EngineNewPayloadV1(ctx context.Context, req *types2.E
 		return &remote.EnginePayloadStatus{Status: remote.EngineStatus_SYNCING}, nil
 	}
 
-	log.Info("[NewPayload] sending block", "height", header.Number, "hash", common.Hash(blockHash))
+	log.Trace("[NewPayload] sending block", "height", header.Number, "hash", common.Hash(blockHash))
 	s.requestList.AddPayloadRequest(&engineapi.PayloadMessage{
 		Header: &header,
 		Body: &types.RawBody{
@@ -314,7 +314,7 @@ func (s *EthBackendServer) EngineNewPayloadV1(ctx context.Context, req *types2.E
 	})
 
 	payloadStatus := <-s.statusCh
-	log.Info("[NewPayload] got reply", "payloadStatus", payloadStatus)
+	log.Trace("[NewPayload] got reply", "payloadStatus", payloadStatus)
 
 	if payloadStatus.CriticalError != nil {
 		return nil, payloadStatus.CriticalError
@@ -410,11 +410,11 @@ func (s *EthBackendServer) EngineForkChoiceUpdatedV1(ctx context.Context, req *r
 		FinalizedBlockHash: gointerfaces.ConvertH256ToHash(req.ForkchoiceState.FinalizedBlockHash),
 	}
 
-	log.Info("[ForkChoiceUpdated] sending forkChoiceMessage", "head", forkChoiceMessage.HeadBlockHash)
+	log.Trace("[ForkChoiceUpdated] sending forkChoiceMessage", "head", forkChoiceMessage.HeadBlockHash)
 	s.requestList.AddForkChoiceRequest(&forkChoiceMessage)
 
 	payloadStatus := <-s.statusCh
-	log.Info("[ForkChoiceUpdated] got reply", "payloadStatus", payloadStatus)
+	log.Trace("[ForkChoiceUpdated] got reply", "payloadStatus", payloadStatus)
 
 	if payloadStatus.CriticalError != nil {
 		return nil, payloadStatus.CriticalError
-- 
GitLab