From a50942276da486d3817a565338b36181b735885b Mon Sep 17 00:00:00 2001 From: Chunkai Yang Date: Wed, 18 Oct 2023 05:37:12 -0400 Subject: [PATCH] Adding logs to debug missing L1 gas price (#217) --- core/chains/evm/gas/models.go | 1 + core/chains/evm/gas/rollups/l1_gas_price_oracle.go | 4 ++++ .../plugins/ccip/internal/ccipdata/commit_store_v1_2_0.go | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/core/chains/evm/gas/models.go b/core/chains/evm/gas/models.go index c6f8edbf04..65a8d9eeea 100644 --- a/core/chains/evm/gas/models.go +++ b/core/chains/evm/gas/models.go @@ -69,6 +69,7 @@ func NewEstimator(lggr logger.Logger, ethClient evmclient.Client, cfg Config, ge // create l1Oracle only if it is supported for the chain var l1Oracle rollups.L1Oracle + lggr.Infow("Checking if chain type is roll up", "chainType", cfg.ChainType(), "isRollUp", rollups.IsRollupWithL1Support(cfg.ChainType())) if rollups.IsRollupWithL1Support(cfg.ChainType()) { l1Oracle = rollups.NewL1GasPriceOracle(lggr, ethClient, cfg.ChainType()) } diff --git a/core/chains/evm/gas/rollups/l1_gas_price_oracle.go b/core/chains/evm/gas/rollups/l1_gas_price_oracle.go index 13ec5e29dd..b117cde6a2 100644 --- a/core/chains/evm/gas/rollups/l1_gas_price_oracle.go +++ b/core/chains/evm/gas/rollups/l1_gas_price_oracle.go @@ -79,6 +79,8 @@ func NewL1GasPriceOracle(lggr logger.Logger, ethClient ethClient, chainType conf panic(fmt.Sprintf("Received unspported chaintype %s", chainType)) } + lggr.Infow("Initializing L1GasPriceOracle with address and callargs", "address", address, "callArgs", callArgs) + return &l1GasPriceOracle{ client: ethClient, pollPeriod: PollPeriod, @@ -154,6 +156,8 @@ func (o *l1GasPriceOracle) refresh() (t *time.Timer) { } price := new(big.Int).SetBytes(b) + o.logger.Infow("Fetching l1GasPrice", "l1GasPrice", price.String()) + o.l1GasPriceMu.Lock() defer o.l1GasPriceMu.Unlock() o.l1GasPrice = assets.NewWei(price) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_v1_2_0.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_v1_2_0.go index 0db5c00bf7..e4be425a45 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_v1_2_0.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/commit_store_v1_2_0.go @@ -211,6 +211,8 @@ func (c *CommitStoreV1_2_0) ChangeConfig(onchainConfig []byte, offchainConfig [] return common.Address{}, err } c.configMu.Lock() + + c.lggr.Infow("Initializing NewDAGasPriceEstimator", "estimator", c.estimator, "l1Oracle", c.estimator.L1Oracle()) c.gasPriceEstimator = prices.NewDAGasPriceEstimator( c.estimator, big.NewInt(int64(offchainConfigParsed.MaxGasPrice)), @@ -361,6 +363,9 @@ func NewCommitStoreV1_2_0(lggr logger.Logger, addr common.Address, ec client.Cli if err := logpollerutil.RegisterLpFilters(lp, filters); err != nil { return nil, err } + + lggr.Infow("Initializing CommitStoreV1_2_0 with estimator", "estimator", estimator) + return &CommitStoreV1_2_0{ commitStore: commitStore, address: addr,