From 7e55515f1a8cbf23264355ca01a534dd83f70b3e Mon Sep 17 00:00:00 2001 From: Gemene Narcis Date: Mon, 10 Jun 2024 14:45:02 +0300 Subject: [PATCH] (Optimism): Introduce a new config to limit max gas cost | Optimism --- .changeset/clean-humans-allow.md | 5 ++ .../evm/config/chain_scoped_gas_estimator.go | 4 ++ core/chains/evm/config/config.go | 1 + core/chains/evm/config/mocks/gas_estimator.go | 20 ++++++ core/chains/evm/config/toml/config.go | 5 ++ .../toml/defaults/Optimism_Sepolia.toml | 1 + .../evm/config/toml/defaults/fallback.toml | 1 + core/chains/evm/gas/helpers_test.go | 3 + core/chains/evm/gas/models.go | 29 +++++++- core/chains/evm/txmgr/test_helpers.go | 4 +- core/config/docs/chains-evm.toml | 3 + docs/CONFIG.md | 66 +++++++++++++++++++ 12 files changed, 139 insertions(+), 3 deletions(-) create mode 100644 .changeset/clean-humans-allow.md diff --git a/.changeset/clean-humans-allow.md b/.changeset/clean-humans-allow.md new file mode 100644 index 00000000000..95aab58fc64 --- /dev/null +++ b/.changeset/clean-humans-allow.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#added limit max gas cost for Optimism diff --git a/core/chains/evm/config/chain_scoped_gas_estimator.go b/core/chains/evm/config/chain_scoped_gas_estimator.go index 689d5e38b81..32ebc20ea23 100644 --- a/core/chains/evm/config/chain_scoped_gas_estimator.go +++ b/core/chains/evm/config/chain_scoped_gas_estimator.go @@ -59,6 +59,10 @@ func (g *gasEstimatorConfig) BumpMin() *assets.Wei { return g.c.BumpMin } +func (g *gasEstimatorConfig) CostMax() *assets.Wei { + return g.c.CostMax +} + func (g *gasEstimatorConfig) FeeCapDefault() *assets.Wei { return g.c.FeeCapDefault } diff --git a/core/chains/evm/config/config.go b/core/chains/evm/config/config.go index b44c112e204..deb58610275 100644 --- a/core/chains/evm/config/config.go +++ b/core/chains/evm/config/config.go @@ -128,6 +128,7 @@ type GasEstimator interface { LimitMax() uint64 LimitMultiplier() float32 LimitTransfer() uint64 + CostMax() *assets.Wei PriceDefault() *assets.Wei TipCapDefault() *assets.Wei TipCapMin() *assets.Wei diff --git a/core/chains/evm/config/mocks/gas_estimator.go b/core/chains/evm/config/mocks/gas_estimator.go index 549f16fe558..77e460cb27e 100644 --- a/core/chains/evm/config/mocks/gas_estimator.go +++ b/core/chains/evm/config/mocks/gas_estimator.go @@ -110,6 +110,26 @@ func (_m *GasEstimator) BumpTxDepth() uint32 { return r0 } +// CostMax provides a mock function with given fields: +func (_m *GasEstimator) CostMax() *assets.Wei { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for CostMax") + } + + var r0 *assets.Wei + if rf, ok := ret.Get(0).(func() *assets.Wei); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*assets.Wei) + } + } + + return r0 +} + // EIP1559DynamicFees provides a mock function with given fields: func (_m *GasEstimator) EIP1559DynamicFees() bool { ret := _m.Called() diff --git a/core/chains/evm/config/toml/config.go b/core/chains/evm/config/toml/config.go index dd724a6689c..cb517f64d38 100644 --- a/core/chains/evm/config/toml/config.go +++ b/core/chains/evm/config/toml/config.go @@ -555,6 +555,8 @@ type GasEstimator struct { TipCapDefault *assets.Wei TipCapMin *assets.Wei + CostMax *assets.Wei + BlockHistory BlockHistoryEstimator `toml:",omitempty"` } @@ -645,6 +647,9 @@ func (e *GasEstimator) setFrom(f *GasEstimator) { if v := f.PriceMin; v != nil { e.PriceMin = v } + if v := f.CostMax; v != nil { + e.CostMax = v + } e.LimitJobType.setFrom(&f.LimitJobType) e.BlockHistory.setFrom(&f.BlockHistory) } diff --git a/core/chains/evm/config/toml/defaults/Optimism_Sepolia.toml b/core/chains/evm/config/toml/defaults/Optimism_Sepolia.toml index 116ae9d680b..c5c4456b293 100644 --- a/core/chains/evm/config/toml/defaults/Optimism_Sepolia.toml +++ b/core/chains/evm/config/toml/defaults/Optimism_Sepolia.toml @@ -9,6 +9,7 @@ MinIncomingConfirmations = 1 EIP1559DynamicFees = true PriceMin = '1 wei' BumpMin = '100 wei' +CostMax = '1 ether' [GasEstimator.BlockHistory] BlockHistorySize = 60 diff --git a/core/chains/evm/config/toml/defaults/fallback.toml b/core/chains/evm/config/toml/defaults/fallback.toml index 5a16aca091c..67f301a7a49 100644 --- a/core/chains/evm/config/toml/defaults/fallback.toml +++ b/core/chains/evm/config/toml/defaults/fallback.toml @@ -45,6 +45,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1' TipCapMin = '1' +CostMax = '0 wei' [GasEstimator.BlockHistory] BatchSize = 25 diff --git a/core/chains/evm/gas/helpers_test.go b/core/chains/evm/gas/helpers_test.go index e64b6ad4779..4672b6d33c8 100644 --- a/core/chains/evm/gas/helpers_test.go +++ b/core/chains/evm/gas/helpers_test.go @@ -143,6 +143,7 @@ type MockGasEstimatorConfig struct { PriceMinF *assets.Wei PriceDefaultF *assets.Wei FeeCapDefaultF *assets.Wei + CostMaxF *assets.Wei LimitMaxF uint64 ModeF string } @@ -163,6 +164,8 @@ func (m *MockGasEstimatorConfig) BumpMin() *assets.Wei { return m.BumpMinF } +func (m *MockGasEstimatorConfig) CostMax() *assets.Wei { return m.CostMaxF } + func (m *MockGasEstimatorConfig) EIP1559DynamicFees() bool { return m.EIP1559DynamicFeesF } diff --git a/core/chains/evm/gas/models.go b/core/chains/evm/gas/models.go index 320834cabab..91b22b8a2f7 100644 --- a/core/chains/evm/gas/models.go +++ b/core/chains/evm/gas/models.go @@ -258,6 +258,29 @@ func (e *evmFeeEstimator) L1Oracle() rollups.L1Oracle { return e.EvmEstimator.L1Oracle() } +func (e *evmFeeEstimator) getAdjustedFeeToMaxGasCost(fee *assets.Wei) *assets.Wei { + if e.geCfg.CostMax() != nil { + return fee + } + maxGasCost := e.geCfg.CostMax().ToInt().Uint64() + if maxGasCost == 0 { + return fee + } + totalGasCost, err := commonfee.ApplyMultiplier(fee.ToInt().Uint64(), e.geCfg.LimitMultiplier()) + if err != nil { + return fee + } + if totalGasCost <= maxGasCost { + return fee + } + newFee, err := commonfee.ApplyMultiplier(maxGasCost, 1/e.geCfg.LimitMultiplier()) + if err != nil { + return fee + } + e.lggr.Warnf("estimated gas cost %d exceeds maximum allowed gas cost %d. old fee adjused from %d to %d", totalGasCost, maxGasCost, fee.ToInt().Uint64(), newFee) + return assets.NewWei(new(big.Int).SetUint64(newFee)) +} + func (e *evmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit uint64, maxFeePrice *assets.Wei, opts ...feetypes.Opt) (fee EvmFee, chainSpecificFeeLimit uint64, err error) { // get dynamic fee if e.EIP1559Enabled { @@ -271,14 +294,14 @@ func (e *evmFeeEstimator) GetFee(ctx context.Context, calldata []byte, feeLimit fee.DynamicTipCap = dynamicFee.TipCap return } - // get legacy fee fee.Legacy, chainSpecificFeeLimit, err = e.EvmEstimator.GetLegacyGas(ctx, calldata, feeLimit, maxFeePrice, opts...) if err != nil { return } - chainSpecificFeeLimit, err = commonfee.ApplyMultiplier(chainSpecificFeeLimit, e.geCfg.LimitMultiplier()) + chainSpecificFeeLimit, err = commonfee.ApplyMultiplier(chainSpecificFeeLimit, e.geCfg.LimitMultiplier()) + fee.Legacy = e.getAdjustedFeeToMaxGasCost(fee.Legacy) return } @@ -331,6 +354,7 @@ func (e *evmFeeEstimator) BumpFee(ctx context.Context, originalFee EvmFee, feeLi return } chainSpecificFeeLimit, err = commonfee.ApplyMultiplier(chainSpecificFeeLimit, e.geCfg.LimitMultiplier()) + bumpedFee.Legacy = e.getAdjustedFeeToMaxGasCost(bumpedFee.Legacy) return } @@ -348,6 +372,7 @@ type GasEstimatorConfig interface { BumpPercent() uint16 BumpThreshold() uint64 BumpMin() *assets.Wei + CostMax() *assets.Wei FeeCapDefault() *assets.Wei LimitMax() uint64 LimitMultiplier() float32 diff --git a/core/chains/evm/txmgr/test_helpers.go b/core/chains/evm/txmgr/test_helpers.go index 3b3584a988b..9137c714d85 100644 --- a/core/chains/evm/txmgr/test_helpers.go +++ b/core/chains/evm/txmgr/test_helpers.go @@ -95,7 +95,9 @@ func (g *TestGasEstimatorConfig) LimitJobType() evmconfig.LimitJobType { func (g *TestGasEstimatorConfig) PriceMaxKey(addr common.Address) *assets.Wei { return assets.NewWeiI(42) } - +func (g *TestGasEstimatorConfig) CostMax() *assets.Wei { + return assets.NewWeiI(1000000000000000000) +} func (e *TestEvmConfig) GasEstimator() evmconfig.GasEstimator { return &TestGasEstimatorConfig{bumpThreshold: e.BumpThreshold} } diff --git a/core/config/docs/chains-evm.toml b/core/config/docs/chains-evm.toml index a222d5269d7..d6a59aad6fa 100644 --- a/core/config/docs/chains-evm.toml +++ b/core/config/docs/chains-evm.toml @@ -242,6 +242,9 @@ TipCapDefault = '1 wei' # Default # (Only applies to EIP-1559 transactions) TipCapMin = '1 wei' # Default +# CostMax is the maximum gas cost allowed for a single Tx. O means that there is no limit. +CostMax = '0 wei' # Default + [EVM.GasEstimator.LimitJobType] # OCR overrides LimitDefault for OCR jobs. OCR = 100_000 # Example diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 07a26246d4e..e040dcbb62d 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -1780,6 +1780,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -1870,6 +1871,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -1960,6 +1962,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -2050,6 +2053,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -2141,6 +2145,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -2231,6 +2236,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 mwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -2321,6 +2327,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 mwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -2412,6 +2419,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -2502,6 +2510,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -2591,6 +2600,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -2680,6 +2690,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -2770,6 +2781,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -2861,6 +2873,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -2951,6 +2964,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -3041,6 +3055,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -3131,6 +3146,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -3221,6 +3237,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -3311,6 +3328,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -3401,6 +3419,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -3491,6 +3510,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -3581,6 +3601,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -3671,6 +3692,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -3762,6 +3784,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -3852,6 +3875,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -3941,6 +3965,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -4031,6 +4056,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -4121,6 +4147,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -4211,6 +4238,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '100 gwei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -4301,6 +4329,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '100 gwei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -4390,6 +4419,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 micro' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -4480,6 +4510,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -4570,6 +4601,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -4660,6 +4692,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -4750,6 +4783,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -4839,6 +4873,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -4929,6 +4964,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -5019,6 +5055,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -5110,6 +5147,7 @@ EIP1559DynamicFees = false FeeCapDefault = '1 micro' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -5200,6 +5238,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -5290,6 +5329,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -5380,6 +5420,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -5470,6 +5511,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -5559,6 +5601,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -5648,6 +5691,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -5737,6 +5781,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -5827,6 +5872,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -5917,6 +5963,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -6006,6 +6053,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -6096,6 +6144,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -6186,6 +6235,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -6277,6 +6327,7 @@ EIP1559DynamicFees = false FeeCapDefault = '1 micro' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -6368,6 +6419,7 @@ EIP1559DynamicFees = false FeeCapDefault = '1 micro' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -6458,6 +6510,7 @@ EIP1559DynamicFees = false FeeCapDefault = '1 micro' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -6548,6 +6601,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -6638,6 +6692,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -6728,6 +6783,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -6818,6 +6874,7 @@ EIP1559DynamicFees = true FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '1 ether' [GasEstimator.BlockHistory] BatchSize = 25 @@ -6908,6 +6965,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -6998,6 +7056,7 @@ EIP1559DynamicFees = false FeeCapDefault = '100 gwei' TipCapDefault = '1 wei' TipCapMin = '1 wei' +CostMax = '0' [GasEstimator.BlockHistory] BatchSize = 25 @@ -7333,6 +7392,7 @@ EIP1559DynamicFees = false # Default FeeCapDefault = '100 gwei' # Default TipCapDefault = '1 wei' # Default TipCapMin = '1 wei' # Default +CostMax = '0 wei' # Default ``` @@ -7516,6 +7576,12 @@ TipCapMinimum is the minimum gas tip to use when submitting transactions to the (Only applies to EIP-1559 transactions) +### CostMax +```toml +CostMax = '0 wei' # Default +``` +CostMax is the maximum gas cost allowed for a single Tx. O means that there is no limit. + ## EVM.GasEstimator.LimitJobType ```toml [EVM.GasEstimator.LimitJobType]