Skip to content

Commit

Permalink
Update log levels (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbuchwald authored Apr 10, 2023
1 parent 4e2eab7 commit a1865cc
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/ethapi/transaction_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
8 changes: 4 additions & 4 deletions plugin/evm/message/cross_chain_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion plugin/evm/syncervm_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions plugin/evm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion rpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
}
Expand Down
4 changes: 2 additions & 2 deletions sync/handlers/block_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion sync/handlers/code_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion warp/handlers/signature_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit a1865cc

Please sign in to comment.