From 13308c5f7d7e134ed9fdcb58edcadbe0c93a7196 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Thu, 6 Apr 2023 13:00:39 -0400 Subject: [PATCH] Update log levels --- accounts/abi/bind/backends/simulated.go | 2 +- core/blockchain.go | 2 +- internal/ethapi/api.go | 4 ++-- internal/ethapi/transaction_args.go | 2 +- plugin/evm/message/cross_chain_handler.go | 8 ++++---- plugin/evm/syncervm_client.go | 2 +- plugin/evm/vm.go | 4 ++-- rpc/handler.go | 2 +- sync/handlers/block_request.go | 4 ++-- sync/handlers/code_request.go | 2 +- warp/handlers/signature_request.go | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index a74cf34d60..d71be6ca53 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -572,7 +572,7 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call interfaces.Call if transfer == nil { transfer = new(big.Int) } - log.Warn("Gas estimation capped by limited funds", "original", hi, "balance", balance, + log.Info("Gas estimation capped by limited funds", "original", hi, "balance", balance, "sent", transfer, "feecap", feeCap, "fundable", allowance) hi = allowance.Uint64() } diff --git a/core/blockchain.go b/core/blockchain.go index 0e14ec8e76..e9dc0a98f2 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1508,7 +1508,7 @@ func (bc *BlockChain) reorg(oldBlock, newBlock *types.Block) error { logFn(msg, "number", commonBlock.Number(), "hash", commonBlock.Hash(), "drop", len(oldChain), "dropfrom", oldChain[0].Hash(), "add", len(newChain), "addfrom", newChain[0].Hash()) } else { - log.Warn("Unlikely preference change (rewind to ancestor) occurred", "oldnum", oldHead.Number(), "oldhash", oldHead.Hash(), "newnum", newHead.Number(), "newhash", newHead.Hash()) + log.Debug("Preference change (rewind to ancestor) occurred", "oldnum", oldHead.Number(), "oldhash", oldHead.Hash(), "newnum", newHead.Number(), "newhash", newHead.Hash()) } // Insert the new chain(except the head block(reverse order)), // taking care of the proper incremental order. diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 3083753aa9..3ea8b6ab52 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1162,14 +1162,14 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr if transfer == nil { transfer = new(hexutil.Big) } - log.Warn("Gas estimation capped by limited funds", "original", hi, "balance", balance, + log.Info("Gas estimation capped by limited funds", "original", hi, "balance", balance, "sent", transfer.ToInt(), "maxFeePerGas", feeCap, "fundable", allowance) hi = allowance.Uint64() } } // Recap the highest gas allowance with specified gascap. if gasCap != 0 && hi > gasCap { - log.Warn("Caller gas above allowance, capping", "requested", hi, "cap", gasCap) + log.Info("Caller gas above allowance, capping", "requested", hi, "cap", gasCap) hi = gasCap } cap = hi diff --git a/internal/ethapi/transaction_args.go b/internal/ethapi/transaction_args.go index 6cff3a1d08..37e50f676e 100644 --- a/internal/ethapi/transaction_args.go +++ b/internal/ethapi/transaction_args.go @@ -235,7 +235,7 @@ func (args *TransactionArgs) ToMessage(globalGasCap uint64, baseFee *big.Int) (t gas = uint64(*args.Gas) } if globalGasCap != 0 && globalGasCap < gas { - log.Warn("Caller gas above allowance, capping", "requested", gas, "cap", globalGasCap) + log.Info("Caller gas above allowance, capping", "requested", gas, "cap", globalGasCap) gas = globalGasCap } var ( diff --git a/plugin/evm/message/cross_chain_handler.go b/plugin/evm/message/cross_chain_handler.go index f356684ee3..f470e576fd 100644 --- a/plugin/evm/message/cross_chain_handler.go +++ b/plugin/evm/message/cross_chain_handler.go @@ -43,19 +43,19 @@ func (c *crossChainHandler) HandleEthCallRequest(ctx context.Context, requesting transactionArgs := ethapi.TransactionArgs{} err := json.Unmarshal(ethCallRequest.RequestArgs, &transactionArgs) if err != nil { - log.Debug("error occurred with JSON unmarshalling ethCallRequest.RequestArgs", "err", err) + log.Error("error occurred with JSON unmarshalling ethCallRequest.RequestArgs", "err", err) return nil, nil } result, err := ethapi.DoCall(ctx, c.backend, transactionArgs, lastAcceptedBlockNumberOrHash, nil, c.backend.RPCEVMTimeout(), c.backend.RPCGasCap()) if err != nil { - log.Debug("error occurred with EthCall", "err", err, "transactionArgs", ethCallRequest.RequestArgs, "blockNumberOrHash", lastAcceptedBlockNumberOrHash) + log.Error("error occurred with EthCall", "err", err, "transactionArgs", ethCallRequest.RequestArgs, "blockNumberOrHash", lastAcceptedBlockNumberOrHash) return nil, nil } executionResult, err := json.Marshal(&result) if err != nil { - log.Debug("error occurred with JSON marshalling result", "err", err) + log.Error("error occurred with JSON marshalling result", "err", err) return nil, nil } @@ -65,7 +65,7 @@ func (c *crossChainHandler) HandleEthCallRequest(ctx context.Context, requesting responseBytes, err := c.crossChainCodec.Marshal(Version, response) if err != nil { - log.Warn("error occurred with marshalling EthCallResponse", "err", err, "EthCallResponse", response) + log.Error("error occurred with marshalling EthCallResponse", "err", err, "EthCallResponse", response) return nil, nil } diff --git a/plugin/evm/syncervm_client.go b/plugin/evm/syncervm_client.go index bf185900c0..caa3682d77 100644 --- a/plugin/evm/syncervm_client.go +++ b/plugin/evm/syncervm_client.go @@ -257,7 +257,7 @@ func (client *stateSyncerClient) syncBlocks(ctx context.Context, fromHash common } blocks, err := client.client.GetBlocks(ctx, nextHash, nextHeight, parentsPerRequest) if err != nil { - log.Warn("could not get blocks from peer", "err", err, "nextHash", nextHash, "remaining", i+1) + log.Error("could not get blocks from peer", "err", err, "nextHash", nextHash, "remaining", i+1) return err } for _, block := range blocks { diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go index a37d7824f8..1f979b0181 100644 --- a/plugin/evm/vm.go +++ b/plugin/evm/vm.go @@ -304,7 +304,7 @@ func (vm *VM) Initialize( vm.syntacticBlockValidator = NewBlockValidator() if g.Config.FeeConfig == commontype.EmptyFeeConfig { - log.Warn("No fee config given in genesis, setting default fee config", "DefaultFeeConfig", params.DefaultFeeConfig) + log.Info("No fee config given in genesis, setting default fee config", "DefaultFeeConfig", params.DefaultFeeConfig) g.Config.FeeConfig = params.DefaultFeeConfig } @@ -369,7 +369,7 @@ func (vm *VM) Initialize( log.Info("Setting fee recipient", "address", address) vm.ethConfig.Miner.Etherbase = address } else { - log.Warn("Config has not specified any coinbase address. Defaulting to the blackhole address.") + log.Info("Config has not specified any coinbase address. Defaulting to the blackhole address.") vm.ethConfig.Miner.Etherbase = constants.BlackholeAddr } diff --git a/rpc/handler.go b/rpc/handler.go index abc4dae504..fec952f92a 100644 --- a/rpc/handler.go +++ b/rpc/handler.go @@ -400,7 +400,7 @@ func (h *handler) handleCallMsg(ctx *callProc, msg *jsonrpcMessage) *jsonrpcMess if resp.Error.Data != nil { ctx = append(ctx, "errdata", resp.Error.Data) } - h.log.Warn("Served "+msg.Method, ctx...) + h.log.Info("Served "+msg.Method, ctx...) } else { h.log.Debug("Served "+msg.Method, ctx...) } diff --git a/sync/handlers/block_request.go b/sync/handlers/block_request.go index 59577d8e73..76203b78bc 100644 --- a/sync/handlers/block_request.go +++ b/sync/handlers/block_request.go @@ -80,7 +80,7 @@ func (b *BlockRequestHandler) OnBlockRequest(ctx context.Context, nodeID ids.Nod buf := new(bytes.Buffer) if err := block.EncodeRLP(buf); err != nil { - log.Warn("failed to RLP encode block", "hash", block.Hash(), "height", block.NumberU64(), "err", err) + log.Error("failed to RLP encode block", "hash", block.Hash(), "height", block.NumberU64(), "err", err) return nil, nil } @@ -100,7 +100,7 @@ func (b *BlockRequestHandler) OnBlockRequest(ctx context.Context, nodeID ids.Nod } responseBytes, err := b.codec.Marshal(message.Version, response) if err != nil { - log.Warn("failed to marshal BlockResponse, dropping request", "nodeID", nodeID, "requestID", requestID, "hash", blockRequest.Hash, "parents", blockRequest.Parents, "blocksLen", len(response.Blocks), "err", err) + log.Error("failed to marshal BlockResponse, dropping request", "nodeID", nodeID, "requestID", requestID, "hash", blockRequest.Hash, "parents", blockRequest.Parents, "blocksLen", len(response.Blocks), "err", err) return nil, nil } diff --git a/sync/handlers/code_request.go b/sync/handlers/code_request.go index ba45a7bbb7..08162b85af 100644 --- a/sync/handlers/code_request.go +++ b/sync/handlers/code_request.go @@ -75,7 +75,7 @@ func (n *CodeRequestHandler) OnCodeRequest(_ context.Context, nodeID ids.NodeID, codeResponse := message.CodeResponse{Data: codeBytes} responseBytes, err := n.codec.Marshal(message.Version, codeResponse) if err != nil { - log.Warn("could not marshal CodeResponse, dropping request", "nodeID", nodeID, "requestID", requestID, "request", codeRequest, "err", err) + log.Error("could not marshal CodeResponse, dropping request", "nodeID", nodeID, "requestID", requestID, "request", codeRequest, "err", err) return nil, nil } n.stats.UpdateCodeBytesReturned(uint32(totalBytes)) diff --git a/warp/handlers/signature_request.go b/warp/handlers/signature_request.go index a0198509fa..992adc07f0 100644 --- a/warp/handlers/signature_request.go +++ b/warp/handlers/signature_request.go @@ -61,7 +61,7 @@ func (s *signatureRequestHandler) OnSignatureRequest(ctx context.Context, nodeID response := message.SignatureResponse{Signature: signature} responseBytes, err := s.codec.Marshal(message.Version, &response) if err != nil { - log.Warn("could not marshal SignatureResponse, dropping request", "nodeID", nodeID, "requestID", requestID, "err", err) + log.Error("could not marshal SignatureResponse, dropping request", "nodeID", nodeID, "requestID", requestID, "err", err) return nil, nil }