Skip to content

Commit

Permalink
Merge branch 'ccip-develop' into mod-self-ref
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Oct 4, 2024
2 parents a6b7cb0 + 29f7edf commit ff0df01
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/chains/evm/config/toml/defaults/Metis_Mainnet.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions core/services/ocr2/plugins/ccip/estimatorconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package estimatorconfig

import (
"context"
"errors"
"math/big"

"github.com/smartcontractkit/chainlink-common/pkg/types/ccip"
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4523,7 +4523,7 @@ GasLimit = 5400000
AutoCreateKey = true
BlockBackfillDepth = 10
BlockBackfillSkip = false
ChainType = 'metis'
ChainType = 'optimismBedrock'
FinalityDepth = 10
FinalityTagEnabled = true
LogBackfillBatchSize = 1000
Expand Down

0 comments on commit ff0df01

Please sign in to comment.