diff --git a/.changeset/funny-monkeys-heal.md b/.changeset/funny-monkeys-heal.md new file mode 100644 index 00000000000..6267569432e --- /dev/null +++ b/.changeset/funny-monkeys-heal.md @@ -0,0 +1,6 @@ +--- +"chainlink": patch +--- + +#changed: +AUTO-10539: adjust logging for offchain config and gas control diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice.go index 2c376443fa5..f84a48c1ff8 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/gasprice/gasprice.go @@ -4,6 +4,8 @@ import ( "context" "math/big" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/smartcontractkit/chainlink/v2/core/cbor" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" @@ -27,17 +29,18 @@ type UpkeepOffchainConfig struct { // CheckGasPrice retrieves the current gas price and compare against the max gas price configured in upkeep's offchain config // any errors in offchain config decoding will result in max gas price check disabled func CheckGasPrice(ctx context.Context, upkeepId *big.Int, offchainConfigBytes []byte, ge gas.EvmFeeEstimator, lggr logger.Logger) encoding.UpkeepFailureReason { + // check for empty offchain config if len(offchainConfigBytes) == 0 { return encoding.UpkeepFailureReasonNone } var offchainConfig UpkeepOffchainConfig if err := cbor.ParseDietCBORToStruct(offchainConfigBytes, &offchainConfig); err != nil { - lggr.Errorw("failed to parse upkeep offchain config, gas price check is disabled", "upkeepId", upkeepId.String(), "err", err) + lggr.Warnw("failed to parse upkeep offchain config, gas price check is disabled", "offchainconfig", hexutil.Encode(offchainConfigBytes), "upkeepId", upkeepId.String(), "err", err) return encoding.UpkeepFailureReasonNone } if offchainConfig.MaxGasPrice == nil || offchainConfig.MaxGasPrice.Int64() <= 0 { - lggr.Warnw("maxGasPrice is not configured or incorrectly configured in upkeep offchain config, gas price check is disabled", "upkeepId", upkeepId.String()) + lggr.Debugw("maxGasPrice is not configured or incorrectly configured in upkeep offchain config, gas price check is disabled", "offchainconfig", hexutil.Encode(offchainConfigBytes), "upkeepId", upkeepId.String()) return encoding.UpkeepFailureReasonNone } lggr.Debugf("successfully decode offchain config for %s, max gas price is %s", upkeepId.String(), offchainConfig.MaxGasPrice.String()) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_check_pipeline.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_check_pipeline.go index e341730c794..491099496cb 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_check_pipeline.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/registry_check_pipeline.go @@ -313,7 +313,7 @@ func (r *EvmRegistry) simulatePerformUpkeeps(ctx context.Context, checkResults [ } fr := gasprice.CheckGasPrice(ctx, upkeepId, oc, r.ge, r.lggr) if uint8(fr) == uint8(encoding.UpkeepFailureReasonGasPriceTooHigh) { - r.lggr.Infof("upkeep %s upkeep failure reason is %d", upkeepId, fr) + r.lggr.Debugf("upkeep %s upkeep failure reason is %d", upkeepId, fr) checkResults[i].Eligible = false checkResults[i].Retryable = false checkResults[i].IneligibilityReason = uint8(fr)