Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/optional ws url #1534

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
7c1c746
cherry-pick - feat: Add support for parsing deployed 1.0 contracts wh…
AnieeG Aug 27, 2024
5c71121
Bump chain-selectors => v1.0.23 (#1395)
friedemannf Aug 30, 2024
a44b9c2
Fix RPCClient Deadlock on Unsubscribe and NewHead (#14236) (#1426)
0xnogo Sep 11, 2024
22d3d18
Bump version for CCIP 2.14.0-ccip1.5.2
0xnogo Sep 12, 2024
16dda4c
Gas limit estimation feature (#14041)
amit-momin Aug 22, 2024
3290ed3
Set From address for gas limit estimation feature (#14246)
amit-momin Aug 27, 2024
ee84efc
Update EstimateGasLimit config name to EstimateLimit (#14297)
amit-momin Sep 3, 2024
d2cd08f
Add Mantle errors (#14053)
DylanTinianov Aug 8, 2024
1493add
Changed Optimism L1 Oracle to support Mantle (#14160)
ma33r Aug 22, 2024
57e10f6
Mantle use vanilla l1 oracle (#14471)
matYang Sep 18, 2024
74ed3a2
FeeHistory estimator (#13833)
dimriou Sep 4, 2024
11bdcc3
Add node level OOC error (#14315)
friedemannf Sep 5, 2024
7725c8c
Change Polygon zkEVM to use FeeHistory estimator (#14161)
friedemannf Sep 23, 2024
00c81f8
Add Zircuit Configs (#14541)
friedemannf Sep 24, 2024
2f7705c
Use Astar Chain Type (#1465)
flodesi Sep 25, 2024
e8e20f1
Zp/update mockrouter (#1427)
zeuslawyer Sep 12, 2024
da80ec5
Bump version for CCIP 2.14.0-ccip1.5.3
valerii-kabisov-cll Oct 3, 2024
ad546bd
[CCIP-2590] Transfer Data Availability costs to the DAGasEstimator (#…
valerii-kabisov-cll Aug 29, 2024
b84dc2c
[CCIP-3376] Add component into CCIP price estimators to account for c…
valerii-kabisov-cll Sep 24, 2024
b664c36
Revert "Bump version for CCIP 2.14.0-ccip1.5.3"
valerii-kabisov-cll Oct 3, 2024
0d172d1
Bump version for CCIP 2.14.0-ccip1.5.4
valerii-kabisov-cll Oct 3, 2024
943e011
Chore: Change metis config (#1345)
stackman27 Aug 26, 2024
28e5fec
Chore: Metis change (#1485)
stackman27 Oct 4, 2024
047109f
Do not return the error in case if onRamp not initialized (#1487)
valerii-kabisov-cll Oct 4, 2024
890450d
use chain Id as opposed to chain type to identify Mantle (#1489)
matYang Oct 6, 2024
dbe6589
Bump chainselectors cherrypicked (#1493)
fernandezlautaro Oct 8, 2024
5b3e0c2
bump package version
matYang Oct 10, 2024
7711683
updated chain-selectors to 1.0.27 (#1500) (#1502)
simsonraj Oct 15, 2024
a917e9a
Fix Nil pointer error in TXM stuck tx detector (CCIP 1.5) (#1499)
amit-momin Oct 15, 2024
909ecdf
Add Mantle NonceTooLow Error (#14859) (#1505)
matYang Oct 21, 2024
463d5e3
Bump version for CCIP 2.14.0-ccip1.5.6
bukata-sa Oct 23, 2024
d507af3
[CCIP-2611] Report new heads to atlas' OTI (#13647) (#1508)
bukata-sa Oct 23, 2024
4cc3609
Adding TOML configs for B^2, BoB, Berachain, Unichain, Worldchain (#1…
fernandezlautaro Nov 8, 2024
694518d
LogBroadcaster feature flag (#14354)
huangzhen1997 Sep 9, 2024
0a3cb23
support new heads polling over http rpc client (#14373)
huangzhen1997 Sep 23, 2024
7c91b65
tmp fix broken dep
dhaidashenko Nov 9, 2024
8028b5e
fixing multinode state transition logic by register polling subscript…
huangzhen1997 Sep 30, 2024
b5ee3df
WS URL can be optional when LogBroadcaster is disabled (#14364)
huangzhen1997 Oct 3, 2024
9dfa696
Config validation requires ws url when http polling disabled (#14929)
huangzhen1997 Oct 24, 2024
2d049bc
Revert "tmp fix broken dep"
dhaidashenko Nov 9, 2024
b66b04b
remove defaults-override as it was introduced by PR that is not inclu…
dhaidashenko Nov 9, 2024
36815f4
fix lint issue
dhaidashenko Nov 9, 2024
9093754
disable integration-tests linter to unblock run of the tests (linter …
dhaidashenko Nov 12, 2024
494fc05
better way to force run integration tests on linter error
dhaidashenko Nov 12, 2024
acae0ac
Revert "better way to force run integration tests on linter error"
dhaidashenko Nov 12, 2024
9eaef36
Revert "disable integration-tests linter to unblock run of the tests …
dhaidashenko Nov 12, 2024
61f5878
force run integration tests on linter error
dhaidashenko Nov 12, 2024
9ba1ed8
hotfix integration tests failure caused by loki issue
dhaidashenko Nov 12, 2024
9328fed
fix integration tests config validation for loki
dhaidashenko Nov 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update EstimateGasLimit config name to EstimateLimit (#14297)
* Updated EstimateGasLimit config name to EstimateLimit

* Updated mocks

* Fixed linting

* Updated changeset
  • Loading branch information
amit-momin authored and valerii-kabisov-cll committed Oct 3, 2024
commit ee84efc5136aa0803d755cc6903cdf4164012cd3
2 changes: 1 addition & 1 deletion .changeset/loud-windows-call.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"chainlink": minor
---

Added gas limit estimation feature to EVM gas estimators #added
Added gas limit estimation feature to EVM gas estimators. Introduced a new config `EVM.GasEstimator.EstimateLimit` to toggle this feature. #added
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ func (g *TestGasEstimatorConfig) LimitJobType() evmconfig.LimitJobType {
func (g *TestGasEstimatorConfig) PriceMaxKey(addr common.Address) *assets.Wei {
return assets.GWei(1)
}
func (g *TestGasEstimatorConfig) EstimateGasLimit() bool { return false }
func (g *TestGasEstimatorConfig) EstimateLimit() bool { return false }

func (e *TestEvmConfig) GasEstimator() evmconfig.GasEstimator {
return &TestGasEstimatorConfig{bumpThreshold: e.BumpThreshold}
Expand Down
4 changes: 2 additions & 2 deletions core/chains/evm/config/chain_scoped_gas_estimator.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ func (g *gasEstimatorConfig) LimitJobType() LimitJobType {
return &limitJobTypeConfig{c: g.c.LimitJobType}
}

func (g *gasEstimatorConfig) EstimateGasLimit() bool {
return *g.c.EstimateGasLimit
func (g *gasEstimatorConfig) EstimateLimit() bool {
return *g.c.EstimateLimit
}

type limitJobTypeConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ type GasEstimator interface {
PriceMin() *assets.Wei
Mode() string
PriceMaxKey(gethcommon.Address) *assets.Wei
EstimateGasLimit() bool
EstimateLimit() bool
}

type LimitJobType interface {
Expand Down
1 change: 1 addition & 0 deletions core/chains/evm/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ func TestChainScopedConfig_GasEstimator(t *testing.T) {
assert.Equal(t, assets.GWei(100), ge.FeeCapDefault())
assert.Equal(t, assets.NewWeiI(1), ge.TipCapDefault())
assert.Equal(t, assets.NewWeiI(1), ge.TipCapMin())
assert.Equal(t, false, ge.EstimateLimit())
}

func TestChainScopedConfig_BSCDefaults(t *testing.T) {
Expand Down
22 changes: 11 additions & 11 deletions core/chains/evm/config/mocks/gas_estimator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions core/chains/evm/config/toml/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,12 +549,12 @@ type GasEstimator struct {
PriceMax *assets.Wei
PriceMin *assets.Wei

LimitDefault *uint64
LimitMax *uint64
LimitMultiplier *decimal.Decimal
LimitTransfer *uint64
LimitJobType GasLimitJobType `toml:",omitempty"`
EstimateGasLimit *bool
LimitDefault *uint64
LimitMax *uint64
LimitMultiplier *decimal.Decimal
LimitTransfer *uint64
LimitJobType GasLimitJobType `toml:",omitempty"`
EstimateLimit *bool

BumpMin *assets.Wei
BumpPercent *uint16
Expand Down Expand Up @@ -642,8 +642,8 @@ func (e *GasEstimator) setFrom(f *GasEstimator) {
if v := f.LimitTransfer; v != nil {
e.LimitTransfer = v
}
if v := f.EstimateGasLimit; v != nil {
e.EstimateGasLimit = v
if v := f.EstimateLimit; v != nil {
e.EstimateLimit = v
}
if v := f.PriceDefault; v != nil {
e.PriceDefault = v
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/config/toml/defaults/fallback.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ EIP1559DynamicFees = false
FeeCapDefault = '100 gwei'
TipCapDefault = '1'
TipCapMin = '1'
EstimateGasLimit = false
EstimateLimit = false

[GasEstimator.BlockHistory]
BatchSize = 25
Expand Down
6 changes: 3 additions & 3 deletions core/chains/evm/gas/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ type MockGasEstimatorConfig struct {
FeeCapDefaultF *assets.Wei
LimitMaxF uint64
ModeF string
EstimateGasLimitF bool
EstimateLimitF bool
}

func NewMockGasConfig() *MockGasEstimatorConfig {
Expand Down Expand Up @@ -216,6 +216,6 @@ func (m *MockGasEstimatorConfig) Mode() string {
return m.ModeF
}

func (m *MockGasEstimatorConfig) EstimateGasLimit() bool {
return m.EstimateGasLimitF
func (m *MockGasEstimatorConfig) EstimateLimit() bool {
return m.EstimateLimitF
}
12 changes: 6 additions & 6 deletions core/chains/evm/gas/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types"
)

// EstimateGasBuffer is a multiplier applied to estimated gas when the EstimateGasLimit feature is enabled
// EstimateGasBuffer is a multiplier applied to estimated gas when the EstimateLimit feature is enabled
const EstimateGasBuffer = float32(1.15)

// EvmFeeEstimator provides a unified interface that wraps EvmEstimator and can determine if legacy or dynamic fee estimation should be used
Expand Down Expand Up @@ -74,7 +74,7 @@ func NewEstimator(lggr logger.Logger, ethClient feeEstimatorClient, cfg Config,
"tipCapMin", geCfg.TipCapMin(),
"priceMax", geCfg.PriceMax(),
"priceMin", geCfg.PriceMin(),
"estimateGasLimit", geCfg.EstimateGasLimit(),
"estimateLimit", geCfg.EstimateLimit(),
)
df := geCfg.EIP1559DynamicFees()

Expand Down Expand Up @@ -353,8 +353,8 @@ func (e *evmFeeEstimator) estimateFeeLimit(ctx context.Context, feeLimit uint64,
if err != nil {
return estimatedFeeLimit, err
}
// Use provided fee limit by default if EstimateGasLimit is disabled
if !e.geCfg.EstimateGasLimit() {
// Use provided fee limit by default if EstimateLimit is disabled
if !e.geCfg.EstimateLimit() {
return providedGasLimit, nil
}
// Create call msg for gas limit estimation
Expand Down Expand Up @@ -393,7 +393,7 @@ func (e *evmFeeEstimator) estimateFeeLimit(ctx context.Context, feeLimit uint64,
e.lggr.Debugw("estimated gas limit with buffer exceeds the provided gas limit with multiplier. falling back to the provided gas limit with multiplier", "estimatedGasLimit", estimatedFeeLimit, "providedGasLimitWithMultiplier", providedGasLimit)
estimatedFeeLimit = providedGasLimit
}

return
}

Expand All @@ -418,7 +418,7 @@ type GasEstimatorConfig interface {
PriceMin() *assets.Wei
PriceMax() *assets.Wei
Mode() string
EstimateGasLimit() bool
EstimateLimit() bool
}

type BlockHistoryConfig interface {
Expand Down
12 changes: 6 additions & 6 deletions core/chains/evm/gas/models_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func TestWrappedEvmEstimator(t *testing.T) {
lggr := logger.Test(t)
// expect legacy fee data
dynamicFees := false
geCfg.EstimateGasLimitF = true
geCfg.EstimateLimitF = true
ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(estimatedGasLimit, nil).Twice()
estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient)
Expand All @@ -288,7 +288,7 @@ func TestWrappedEvmEstimator(t *testing.T) {
lggr := logger.Test(t)
// expect legacy fee data
dynamicFees := false
geCfg.EstimateGasLimitF = true
geCfg.EstimateLimitF = true
ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(estimatedGasLimit, nil).Twice()
estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient)
Expand All @@ -306,7 +306,7 @@ func TestWrappedEvmEstimator(t *testing.T) {
estimatedGasLimit := uint64(15) // same as provided limit
lggr := logger.Test(t)
dynamicFees := false // expect legacy fee data
geCfg.EstimateGasLimitF = true
geCfg.EstimateLimitF = true
ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(estimatedGasLimit, nil).Twice()
estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient)
Expand All @@ -331,7 +331,7 @@ func TestWrappedEvmEstimator(t *testing.T) {
lggr := logger.Test(t)
// expect legacy fee data
dynamicFees := false
geCfg.EstimateGasLimitF = true
geCfg.EstimateLimitF = true
ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(uint64(0), errors.New("something broke")).Twice()
estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient)
Expand Down Expand Up @@ -362,7 +362,7 @@ func TestWrappedEvmEstimator(t *testing.T) {
lggr := logger.Test(t)
// expect legacy fee data
dynamicFees := false
geCfg.EstimateGasLimitF = true
geCfg.EstimateLimitF = true
ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(estimatedGasLimit, nil).Twice()
estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient)
Expand Down Expand Up @@ -392,7 +392,7 @@ func TestWrappedEvmEstimator(t *testing.T) {
lggr := logger.Test(t)
// expect legacy fee data
dynamicFees := false
geCfg.EstimateGasLimitF = true
geCfg.EstimateLimitF = true
ethClient := testutils.NewEthClientMockWithDefaultChain(t)
ethClient.On("EstimateGas", mock.Anything, mock.Anything).Return(uint64(0), errors.New("something broke")).Twice()
estimator := gas.NewEvmFeeEstimator(lggr, getRootEst, dynamicFees, geCfg, ethClient)
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/txmgr/broadcaster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,7 @@ func TestEthBroadcaster_ProcessUnstartedEthTxs_GasEstimationError(t *testing.T)

db := pgtest.NewSqlxDB(t)
cfg := configtest.NewTestGeneralConfig(t)
cfg.EVMConfigs()[0].GasEstimator.EstimateGasLimit = ptr(true) // Enabled gas limit estimation
cfg.EVMConfigs()[0].GasEstimator.EstimateLimit = ptr(true) // Enabled gas limit estimation
limitMultiplier := float32(1.25)
cfg.EVMConfigs()[0].GasEstimator.LimitMultiplier = ptr(decimal.NewFromFloat32(limitMultiplier)) // Set LimitMultiplier for the buffer
txStore := cltest.NewTestTxStore(t, db)
Expand Down
2 changes: 1 addition & 1 deletion core/chains/evm/txmgr/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (g *TestGasEstimatorConfig) LimitTransfer() uint64 { return 42 }
func (g *TestGasEstimatorConfig) PriceMax() *assets.Wei { return assets.NewWeiI(42) }
func (g *TestGasEstimatorConfig) PriceMin() *assets.Wei { return assets.NewWeiI(42) }
func (g *TestGasEstimatorConfig) Mode() string { return "FixedPrice" }
func (g *TestGasEstimatorConfig) EstimateGasLimit() bool { return false }
func (g *TestGasEstimatorConfig) EstimateLimit() bool { return false }
func (g *TestGasEstimatorConfig) LimitJobType() evmconfig.LimitJobType {
return &TestLimitJobTypeConfig{}
}
Expand Down
4 changes: 2 additions & 2 deletions core/config/docs/chains-evm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ LimitMax = 8_000_000 # Default
LimitMultiplier = '1.0' # Default
# LimitTransfer is the gas limit used for an ordinary ETH transfer.
LimitTransfer = 21_000 # Default
# EstimateGasLimit enables estimating gas limits for transactions. This feature respects the gas limit provided during transaction creation as an upper bound.
EstimateGasLimit = false # Default
# EstimateLimit enables estimating gas limits for transactions. This feature respects the gas limit provided during transaction creation as an upper bound.
EstimateLimit = false # Default
# BumpMin is the minimum fixed amount of wei by which gas is bumped on each transaction attempt.
BumpMin = '5 gwei' # Default
# BumpPercent is the percentage by which to bump gas on a transaction that has exceeded `BumpThreshold`. The larger of `BumpPercent` and `BumpMin` is taken for gas bumps.
Expand Down
4 changes: 2 additions & 2 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ func TestConfig_Marshal(t *testing.T) {
LimitMax: ptr[uint64](17),
LimitMultiplier: mustDecimal("1.234"),
LimitTransfer: ptr[uint64](100),
EstimateGasLimit: ptr(false),
EstimateLimit: ptr(false),
TipCapDefault: assets.NewWeiI(2),
TipCapMin: assets.NewWeiI(1),
PriceDefault: assets.NewWeiI(math.MaxInt64),
Expand Down Expand Up @@ -1025,7 +1025,7 @@ LimitDefault = 12
LimitMax = 17
LimitMultiplier = '1.234'
LimitTransfer = 100
EstimateGasLimit = false
EstimateLimit = false
BumpMin = '100 wei'
BumpPercent = 10
BumpThreshold = 6
Expand Down
2 changes: 1 addition & 1 deletion core/services/chainlink/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ LimitDefault = 12
LimitMax = 17
LimitMultiplier = '1.234'
LimitTransfer = 100
EstimateGasLimit = false
EstimateLimit = false
BumpMin = '100 wei'
BumpPercent = 10
BumpThreshold = 6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ LimitDefault = 8000000
LimitMax = 8000000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateGasLimit = false
EstimateLimit = false
BumpMin = '5 gwei'
BumpPercent = 20
BumpThreshold = 3
Expand Down Expand Up @@ -404,7 +404,7 @@ LimitDefault = 8000000
LimitMax = 8000000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateGasLimit = false
EstimateLimit = false
BumpMin = '5 gwei'
BumpPercent = 20
BumpThreshold = 3
Expand Down Expand Up @@ -499,7 +499,7 @@ LimitDefault = 8000000
LimitMax = 8000000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateGasLimit = false
EstimateLimit = false
BumpMin = '20 gwei'
BumpPercent = 20
BumpThreshold = 5
Expand Down
2 changes: 1 addition & 1 deletion core/web/resolver/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ LimitDefault = 12
LimitMax = 17
LimitMultiplier = '1.234'
LimitTransfer = 100
EstimateGasLimit = false
EstimateLimit = false
BumpMin = '100 wei'
BumpPercent = 10
BumpThreshold = 6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ LimitDefault = 8000000
LimitMax = 8000000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateGasLimit = false
EstimateLimit = false
BumpMin = '5 gwei'
BumpPercent = 20
BumpThreshold = 3
Expand Down Expand Up @@ -404,7 +404,7 @@ LimitDefault = 8000000
LimitMax = 8000000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateGasLimit = false
EstimateLimit = false
BumpMin = '5 gwei'
BumpPercent = 20
BumpThreshold = 3
Expand Down Expand Up @@ -499,7 +499,7 @@ LimitDefault = 8000000
LimitMax = 8000000
LimitMultiplier = '1'
LimitTransfer = 21000
EstimateGasLimit = false
EstimateLimit = false
BumpMin = '20 gwei'
BumpPercent = 20
BumpThreshold = 5
Expand Down
Loading