From 4db2b213c8fc9fa40eacdf0a7fc7f3eca23119db Mon Sep 17 00:00:00 2001 From: Sishir Giri Date: Thu, 3 Oct 2024 23:29:22 -0700 Subject: [PATCH 1/2] Chore: Metis change (#1485) ## Motivation ## Solution --- core/chains/evm/config/toml/defaults/Metis_Mainnet.toml | 2 +- docs/CONFIG.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/chains/evm/config/toml/defaults/Metis_Mainnet.toml b/core/chains/evm/config/toml/defaults/Metis_Mainnet.toml index f057400d01..388b9f00b0 100644 --- a/core/chains/evm/config/toml/defaults/Metis_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Metis_Mainnet.toml @@ -1,6 +1,6 @@ # Metis is an L2 chain based on Optimism. ChainID = '1088' -ChainType = 'metis' +ChainType = 'optimismBedrock' # Sequencer offers absolute finality FinalityDepth = 10 FinalityTagEnabled = true diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 10e2519049..196da084ab 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -4523,7 +4523,7 @@ GasLimit = 5400000 AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -ChainType = 'metis' +ChainType = 'optimismBedrock' FinalityDepth = 10 FinalityTagEnabled = true LogBackfillBatchSize = 1000 From 29f7edf3ce0e9f91cf0293c286640e3a42516bec Mon Sep 17 00:00:00 2001 From: Valerii Kabisov <172247313+valerii-kabisov-cll@users.noreply.github.com> Date: Fri, 4 Oct 2024 22:58:42 +0900 Subject: [PATCH 2/2] Do not return the error in case if onRamp not initialized (#1487) ## Motivation For the exec provider, in some cases, the onRamp reader is not initialized. For immediate reaction, we need to allow execution without blocking in cases if onRamp is not initialized. It fails due the issue when onRampReader is not initialized for execProvider. This fix should fix this issue. In case the onRamp reader is not initialized, the module will return 0 values and DAGasEstimator will behave as it worked before this feature been implemented. --- .../services/ocr2/plugins/ccip/estimatorconfig/config.go | 3 +-- .../ocr2/plugins/ccip/estimatorconfig/config_test.go | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/services/ocr2/plugins/ccip/estimatorconfig/config.go b/core/services/ocr2/plugins/ccip/estimatorconfig/config.go index 0e66f4fb39..4737bd33e8 100644 --- a/core/services/ocr2/plugins/ccip/estimatorconfig/config.go +++ b/core/services/ocr2/plugins/ccip/estimatorconfig/config.go @@ -2,7 +2,6 @@ package estimatorconfig import ( "context" - "errors" "math/big" "github.com/smartcontractkit/chainlink-common/pkg/types/ccip" @@ -42,7 +41,7 @@ func (c *FeeEstimatorConfigService) SetOnRampReader(reader ccip.OnRampReader) { // GetDynamicConfig should be cached in the onRamp reader to avoid unnecessary on-chain calls func (c *FeeEstimatorConfigService) GetDataAvailabilityConfig(ctx context.Context) (destDataAvailabilityOverheadGas, destGasPerDataAvailabilityByte, destDataAvailabilityMultiplierBps int64, err error) { if c.onRampReader == nil { - return 0, 0, 0, errors.New("no OnRampReader has been configured") + return 0, 0, 0, nil } cfg, err := c.onRampReader.GetDynamicConfig(ctx) diff --git a/core/services/ocr2/plugins/ccip/estimatorconfig/config_test.go b/core/services/ocr2/plugins/ccip/estimatorconfig/config_test.go index 0ed7510591..3ecd88ae3b 100644 --- a/core/services/ocr2/plugins/ccip/estimatorconfig/config_test.go +++ b/core/services/ocr2/plugins/ccip/estimatorconfig/config_test.go @@ -24,8 +24,11 @@ func TestFeeEstimatorConfigService(t *testing.T) { var expectedDestDataAvailabilityMultiplierBps int64 = 3 onRampReader := mocks.NewOnRampReader(t) - _, _, _, err := svc.GetDataAvailabilityConfig(ctx) - require.Error(t, err) + destDataAvailabilityOverheadGas, destGasPerDataAvailabilityByte, destDataAvailabilityMultiplierBps, err := svc.GetDataAvailabilityConfig(ctx) + require.NoError(t, err) // if onRampReader not set, return nil error and 0 values + require.EqualValues(t, 0, destDataAvailabilityOverheadGas) + require.EqualValues(t, 0, destGasPerDataAvailabilityByte) + require.EqualValues(t, 0, destDataAvailabilityMultiplierBps) svc.SetOnRampReader(onRampReader) onRampReader.On("GetDynamicConfig", ctx). @@ -35,7 +38,7 @@ func TestFeeEstimatorConfigService(t *testing.T) { DestDataAvailabilityMultiplierBps: uint16(expectedDestDataAvailabilityMultiplierBps), }, nil).Once() - destDataAvailabilityOverheadGas, destGasPerDataAvailabilityByte, destDataAvailabilityMultiplierBps, err := svc.GetDataAvailabilityConfig(ctx) + destDataAvailabilityOverheadGas, destGasPerDataAvailabilityByte, destDataAvailabilityMultiplierBps, err = svc.GetDataAvailabilityConfig(ctx) require.NoError(t, err) require.Equal(t, expectedDestDataAvailabilityOverheadGas, destDataAvailabilityOverheadGas) require.Equal(t, expectedDestGasPerDataAvailabilityByte, destGasPerDataAvailabilityByte)