Skip to content

Commit

Permalink
Adding logs to debug missing L1 gas price (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
matYang authored Oct 18, 2023
1 parent ecf4aec commit a509422
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/chains/evm/gas/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down
4 changes: 4 additions & 0 deletions core/chains/evm/gas/rollups/l1_gas_price_oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a509422

Please sign in to comment.