Skip to content

Commit 14f712c

Browse files
authored
Merge branch 'develop' into chore/skip-flaky-tests-may-12
2 parents c0da446 + e0efbcc commit 14f712c

File tree

221 files changed

+6072
-5549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+6072
-5549
lines changed

.changeset/better-buckets-hang.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"chainlink": patch
3+
---
4+
5+
#internal add env var CL_SKIP_APP_VERSION_CHECK to enable booting prior app versions

.changeset/chatty-toes-press.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"chainlink": patch
3+
---
4+
5+
#updated Bump chainlink-solana
6+
#updated Bump chainlink-ccip
7+
#updated Bump mcms

.changeset/tasty-pillows-drum.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"chainlink": minor
3+
---
4+
5+
Cleanup and refactoring several functions to use the plugin map #added

.github/e2e-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ runner-test-matrix:
214214
- Merge Queue CRE E2E Core Tests
215215
- Nightly E2E Tests
216216
- Push CRE E2E Core Tests
217-
test_cmd: cd tests && pushd smoke/cre/cmd > /dev/null && go run main.go download all --output-dir ../ --gh-token-env-var-name GITHUB_API_TOKEN --cre-cli-version v0.1.5 --capability-name cron --capability-version v1.0.2-alpha 1>&2 && popd > /dev/null && { go test github.com/smartcontractkit/chainlink/system-tests/tests/smoke/cre -v -run "^(TestCRE_OCR3_PoR_Workflow_SingleDon_MultipleWriters_MockedPrice)$" -timeout 30m -count=1 -test.parallel=1 -json; exit_code=$?; ../../tools/ci/wait-for-containers-to-stop.sh 30; exit $exit_code; } # Sleep to allow testcontainers to stop
217+
test_cmd: cd tests && pushd smoke/cre/cmd > /dev/null && go run main.go download all --output-dir ../ --gh-token-env-var-name GITHUB_API_TOKEN --cre-cli-version v0.2.0 --capability-names cron --capability-version v1.0.2-alpha 1>&2 && popd > /dev/null && { go test github.com/smartcontractkit/chainlink/system-tests/tests/smoke/cre -v -run "^(TestCRE_OCR3_PoR_Workflow_SingleDon_MultipleWriters_MockedPrice)$" -timeout 30m -count=1 -test.parallel=1 -json; exit_code=$?; ../../tools/ci/wait-for-containers-to-stop.sh 30; exit $exit_code; } # Sleep to allow testcontainers to stop
218218
pyroscope_env: ci-smoke-cre-evm-simulated
219219
test_env_vars:
220220
E2E_TEST_CHAINLINK_VERSION: "{{ env.DEFAULT_CHAINLINK_PLUGINS_VERSION }}" # This is the chainlink version that has the plugins
@@ -235,7 +235,7 @@ runner-test-matrix:
235235
- Merge Queue CRE E2E Core Tests
236236
- Nightly E2E Tests
237237
- Push CRE E2E Core Tests
238-
test_cmd: cd tests && pushd smoke/cre/cmd > /dev/null && go run main.go download all --output-dir ../ --gh-token-env-var-name GITHUB_API_TOKEN --cre-cli-version v0.1.5 --capability-name cron --capability-version v1.0.2-alpha 1>&2 && popd > /dev/null && { go test github.com/smartcontractkit/chainlink/system-tests/tests/smoke/cre -v -run "^(TestCRE_OCR3_PoR_Workflow_GatewayDon_MockedPrice)$" -timeout 30m -count=1 -test.parallel=1 -json; exit_code=$?; ../../tools/ci/wait-for-containers-to-stop.sh 30; exit $exit_code; } # Sleep to allow testcontainers to stop
238+
test_cmd: cd tests && pushd smoke/cre/cmd > /dev/null && go run main.go download all --output-dir ../ --gh-token-env-var-name GITHUB_API_TOKEN --cre-cli-version v0.2.0 --capability-names cron --capability-version v1.0.2-alpha 1>&2 && popd > /dev/null && { go test github.com/smartcontractkit/chainlink/system-tests/tests/smoke/cre -v -run "^(TestCRE_OCR3_PoR_Workflow_GatewayDon_MockedPrice)$" -timeout 30m -count=1 -test.parallel=1 -json; exit_code=$?; ../../tools/ci/wait-for-containers-to-stop.sh 30; exit $exit_code; } # Sleep to allow testcontainers to stop
239239
pyroscope_env: ci-smoke-capabilities-evm-simulated
240240
test_env_vars:
241241
E2E_TEST_CHAINLINK_VERSION: "{{ env.DEFAULT_CHAINLINK_PLUGINS_VERSION }}" # This is the chainlink version that has the plugins
@@ -256,7 +256,7 @@ runner-test-matrix:
256256
- Merge Queue CRE E2E Core Tests
257257
- Nightly E2E Tests
258258
- Push CRE E2E Core Tests
259-
test_cmd: cd tests && pushd smoke/cre/cmd > /dev/null && go run main.go download all --output-dir ../ --gh-token-env-var-name GITHUB_API_TOKEN --cre-cli-version v0.1.5 --capability-name cron --capability-version v1.0.2-alpha 1>&2 && popd > /dev/null && { go test github.com/smartcontractkit/chainlink/system-tests/tests/smoke/cre -v -run "^(TestCRE_OCR3_PoR_Workflow_CapabilitiesDons_LivePrice)$" -timeout 30m -count=1 -test.parallel=1 -json; exit_code=$?; ../../tools/ci/wait-for-containers-to-stop.sh 30; exit $exit_code; } # Sleep to allow testcontainers to stop
259+
test_cmd: cd tests && pushd smoke/cre/cmd > /dev/null && go run main.go download all --output-dir ../ --gh-token-env-var-name GITHUB_API_TOKEN --cre-cli-version v0.2.0 --capability-names cron --capability-version v1.0.2-alpha 1>&2 && popd > /dev/null && { go test github.com/smartcontractkit/chainlink/system-tests/tests/smoke/cre -v -run "^(TestCRE_OCR3_PoR_Workflow_CapabilitiesDons_LivePrice)$" -timeout 30m -count=1 -test.parallel=1 -json; exit_code=$?; ../../tools/ci/wait-for-containers-to-stop.sh 30; exit $exit_code; } # Sleep to allow testcontainers to stop
260260
pyroscope_env: ci-smoke-capabilities-evm-simulated
261261
test_env_vars:
262262
E2E_TEST_CHAINLINK_VERSION: "{{ env.DEFAULT_CHAINLINK_PLUGINS_VERSION }}" # This is the chainlink version that has the plugins

.github/workflows/ci-core.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ jobs:
640640
runs-on: ubuntu-latest
641641
env:
642642
SH_TEST_RUNNER: runs-on=${{ github.run_id }}/cpu=32+64/ram=64+128/family=c6id+m6id+m6idn/spot=false/extras=s3-cache
643+
SH_DEPLOYMENT_TEST_RUNNER: runs-on=${{ github.run_id }}/cpu=48/ram=96/family=c6id/spot=false/extras=s3-cache
643644
SH_FUZZ_RUNNER: runs-on=${{ github.run_id}}/cpu=8+16/ram=32+64/family=c6id+m6id+m6idn/spot=false/extras=s3-cache
644645
SH_RACE_TEST_RUNNER: runs-on=${{ github.run_id}}/cpu=64+128/ram=128+128/family=c7+m7/disk=large/spot=false/extras=s3-cache
645646
GH_TEST_RUNNER: ubuntu22.04-32cores-128GB
@@ -716,7 +717,7 @@ jobs:
716717
717718
echo "Opt-out is false for current run. Using self-hosted runner for deployment tests."
718719
echo "deployment-tests-is-self-hosted=true" | tee -a $GITHUB_OUTPUT
719-
echo "deployment-tests-runner=${SH_TEST_RUNNER}" | tee -a $GITHUB_OUTPUT
720+
echo "deployment-tests-runner=${SH_DEPLOYMENT_TEST_RUNNER}" | tee -a $GITHUB_OUTPUT
720721
721722
- name: Select runners for core tests
722723
id: core-tests

.github/workflows/flakeguard.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,11 @@ jobs:
322322
id: gen_id
323323
run: echo "id=$(uuidgen)" >> "$GITHUB_OUTPUT"
324324

325-
- name: Install flakeguard
325+
- name: Install flakeguard and gotestsum
326326
shell: bash
327-
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@bc66d27e3325a1fecedc0fc932d13d3e54ff6f25 # [email protected]
327+
run: |
328+
go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@bc66d27e3325a1fecedc0fc932d13d3e54ff6f25 # [email protected]
329+
go install gotest.tools/[email protected] # needed for flakeguard output formatting
328330
329331
- name: Run tests with flakeguard
330332
shell: bash

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,7 @@ vendor/*
109109
contracts/lcov.info
110110
contracts/out/
111111
/cache
112+
113+
# Used by plugins/chianlink.prebuilt.Dockerfile
114+
bin/
115+
lib/

.mockery.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ packages:
2727
OracleCreator:
2828
github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common:
2929
interfaces:
30-
ExtraDataCodec:
30+
SourceChainExtraDataCodec:
31+
ChainSpecificAddressCodec:
3132
github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types:
3233
interfaces:
3334
Dispatcher:
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
package ccipevm
2+
3+
import (
4+
"context"
5+
"encoding/json"
6+
"fmt"
7+
8+
"github.com/ethereum/go-ethereum/common"
9+
"github.com/smartcontractkit/chainlink-common/pkg/types"
10+
ccipcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"
11+
evmconfig "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm"
12+
evmrelaytypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types"
13+
)
14+
15+
// ChainCWProvider is a struct that implements the ChainRWProvider interface for EVM chains.
16+
type ChainCWProvider struct{}
17+
18+
// GetChainReader returns a new ContractReader for EVM chains.
19+
func (g ChainCWProvider) GetChainReader(ctx context.Context, params ccipcommon.ChainReaderProviderOpts) (types.ContractReader, error) {
20+
var chainReaderConfig evmrelaytypes.ChainReaderConfig
21+
if params.ChainID == params.DestChainID {
22+
chainReaderConfig = evmconfig.DestReaderConfig
23+
} else {
24+
chainReaderConfig = evmconfig.SourceReaderConfig
25+
}
26+
27+
if !params.Ofc.CommitEmpty() && params.Ofc.Commit.PriceFeedChainSelector == params.ChainSelector {
28+
params.Lggr.Debugw("Adding feed reader config", "chainID", params.ChainID)
29+
chainReaderConfig = evmconfig.MergeReaderConfigs(chainReaderConfig, evmconfig.FeedReaderConfig)
30+
}
31+
32+
if isUSDCEnabled(params.Ofc) {
33+
params.Lggr.Debugw("Adding USDC reader config", "chainID", params.ChainID)
34+
chainReaderConfig = evmconfig.MergeReaderConfigs(chainReaderConfig, evmconfig.USDCReaderConfig)
35+
}
36+
37+
if params.ChainID == params.HomeChainID {
38+
params.Lggr.Debugw("Adding home chain reader config", "chainID", params.ChainID)
39+
chainReaderConfig = evmconfig.MergeReaderConfigs(chainReaderConfig, evmconfig.HomeChainReaderConfigRaw)
40+
}
41+
42+
marshaledConfig, err := json.Marshal(chainReaderConfig)
43+
if err != nil {
44+
return nil, fmt.Errorf("failed to marshal chain reader config: %w", err)
45+
}
46+
47+
cr, err := params.Relayer.NewContractReader(ctx, marshaledConfig)
48+
if err != nil {
49+
return nil, err
50+
}
51+
52+
return cr, nil
53+
}
54+
55+
// GetChainWriter returns a new ContractWriter for EVM chains.
56+
func (g ChainCWProvider) GetChainWriter(ctx context.Context, params ccipcommon.ChainWriterProviderOpts) (types.ContractWriter, error) {
57+
var fromAddress common.Address
58+
transmitter, ok := params.Transmitters[types.NewRelayID(params.ChainFamily, params.ChainID)]
59+
if ok {
60+
fromAddress = common.HexToAddress(transmitter[0])
61+
}
62+
63+
evmConfig, err := evmconfig.ChainWriterConfigRaw(
64+
fromAddress,
65+
defaultCommitGasLimit,
66+
params.ExecBatchGasLimit)
67+
if err != nil {
68+
return nil, fmt.Errorf("failed to create EVM chain writer config: %w", err)
69+
}
70+
71+
chainWriterConfig, err := json.Marshal(evmConfig)
72+
if err != nil {
73+
return nil, fmt.Errorf("failed to marshal EVM chain writer config: %w", err)
74+
}
75+
76+
cw, err := params.Relayer.NewContractWriter(ctx, chainWriterConfig)
77+
if err != nil {
78+
return nil, fmt.Errorf("failed to create chain writer for chain %s: %w", params.ChainID, err)
79+
}
80+
81+
return cw, nil
82+
}
83+
84+
func isUSDCEnabled(ofc ccipcommon.OffChainConfig) bool {
85+
if ofc.ExecEmpty() {
86+
return false
87+
}
88+
89+
return ofc.Execute.IsUSDCEnabled()
90+
}

core/capabilities/ccip/ccipevm/executecodec.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ import (
88
"github.com/ethereum/go-ethereum/accounts/abi"
99
"github.com/ethereum/go-ethereum/common"
1010
chainsel "github.com/smartcontractkit/chain-selectors"
11-
12-
ccipcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"
13-
14-
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
15-
1611
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/offramp"
12+
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
13+
ccipcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"
1714
"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers"
1815
)
1916

@@ -62,7 +59,6 @@ func (e *ExecutePluginCodecV1) Encode(ctx context.Context, report cciptypes.Exec
6259
evmMessages := make([]offramp.InternalAny2EVMRampMessage, 0, len(chainReport.Messages))
6360
for _, message := range chainReport.Messages {
6461
receiver := common.BytesToAddress(message.Receiver)
65-
6662
tokenAmounts := make([]offramp.InternalAny2EVMTokenTransfer, 0, len(message.TokenAmounts))
6763
for _, tokenAmount := range message.TokenAmounts {
6864
if tokenAmount.Amount.IsEmpty() {

core/capabilities/ccip/ccipevm/executecodec_test.go

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,19 @@ import (
1111
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
1212
"github.com/ethereum/go-ethereum/common"
1313
"github.com/ethereum/go-ethereum/core"
14-
"github.com/stretchr/testify/assert"
15-
"github.com/stretchr/testify/mock"
16-
"github.com/stretchr/testify/require"
17-
18-
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipsolana"
19-
ccipcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"
20-
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common/mocks"
21-
2214
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/message_hasher"
2315
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/offramp"
2416
"github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/report_codec"
2517
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
2618
"github.com/smartcontractkit/chainlink-evm/pkg/assets"
2719
evmtestutils "github.com/smartcontractkit/chainlink-evm/pkg/testutils"
2820
"github.com/smartcontractkit/chainlink-evm/pkg/utils"
21+
ccipcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"
22+
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common/mocks"
2923
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
24+
"github.com/stretchr/testify/assert"
25+
"github.com/stretchr/testify/mock"
26+
"github.com/stretchr/testify/require"
3027
)
3128

3229
var randomExecuteReport = func(t *testing.T, d *testSetupData, chainSelector uint64, gasLimit *big.Int, destGasAmount uint32) cciptypes.ExecutePluginReport {
@@ -100,13 +97,13 @@ var randomExecuteReport = func(t *testing.T, d *testSetupData, chainSelector uin
10097
func TestExecutePluginCodecV1(t *testing.T) {
10198
d := testSetup(t)
10299
ctx := testutils.Context(t)
103-
mockExtraDataCodec := &mocks.ExtraDataCodec{}
100+
mockExtraDataCodec := mocks.NewSourceChainExtraDataCodec(t)
104101
destGasAmount := rand.Uint32()
105102
gasLimit := utils.RandUint256()
106-
mockExtraDataCodec.On("DecodeTokenAmountDestExecData", mock.Anything, mock.Anything).Return(map[string]any{
103+
mockExtraDataCodec.On("DecodeDestExecDataToMap", mock.Anything).Return(map[string]any{
107104
"destgasamount": destGasAmount,
108105
}, nil)
109-
mockExtraDataCodec.On("DecodeExtraArgs", mock.Anything, mock.Anything).Return(map[string]any{
106+
mockExtraDataCodec.On("DecodeExtraArgsToMap", mock.Anything).Return(map[string]any{
110107
"gasLimit": utils.RandUint256(),
111108
"accountIsWritableBitmap": gasLimit,
112109
}, nil)
@@ -185,7 +182,7 @@ func TestExecutePluginCodecV1(t *testing.T) {
185182

186183
for _, tc := range testCases {
187184
t.Run(tc.name, func(t *testing.T) {
188-
codec := NewExecutePluginCodecV1(mockExtraDataCodec)
185+
codec := NewExecutePluginCodecV1(ccipcommon.NewExtraDataCodec(mockExtraDataCodec, mockExtraDataCodec))
189186
report := tc.report(randomExecuteReport(t, d, tc.chainSelector, tc.gasLimit, tc.destGasAmount))
190187
bytes, err := codec.Encode(ctx, report)
191188
if tc.expErr {
@@ -227,7 +224,6 @@ func TestExecutePluginCodecV1(t *testing.T) {
227224
}
228225

229226
func Test_DecodeReport(t *testing.T) {
230-
ExtraDataCodec := ccipcommon.NewExtraDataCodec(ccipcommon.NewExtraDataCodecParams(ExtraDataDecoder{}, ccipsolana.ExtraDataDecoder{}))
231227
offRampABI, err := offramp.OffRampMetaData.GetAbi()
232228
require.NoError(t, err)
233229

@@ -245,8 +241,7 @@ func Test_DecodeReport(t *testing.T) {
245241
t.Logf("reportCtx[0]: %x, reportCtx[1]: %x", reportCtx[0], reportCtx[1])
246242

247243
rawReport := *abi.ConvertType(executeInputs[1], new([]byte)).(*[]byte)
248-
249-
codec := NewExecutePluginCodecV1(ExtraDataCodec)
244+
codec := NewExecutePluginCodecV1(extraDataCodec)
250245
decoded, err := codec.Decode(t.Context(), rawReport)
251246
require.NoError(t, err)
252247

core/capabilities/ccip/ccipevm/extradatadecoder.go renamed to core/capabilities/ccip/ccipevm/extradatacodec.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@ import (
44
"fmt"
55

66
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
7+
ccipcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"
78
)
89

9-
// ExtraDataDecoder is a concrete implementation of ExtraDataDecoder
10-
type ExtraDataDecoder struct{}
10+
const (
11+
svmV1DecodeStructName = "decodeSVMExtraArgsStruct"
12+
evmV1DecodeName = "decodeEVMExtraArgsV1"
13+
evmV2DecodeName = "decodeEVMExtraArgsV2"
14+
evmDestExecDataKey = "destGasAmount"
15+
)
16+
17+
// ExtraDataCodec is a concrete implementation of SourceChainExtraDataCodec
18+
type ExtraDataCodec struct{}
1119

1220
// DecodeDestExecDataToMap reformats bytes into a chain agnostic map[string]interface{} representation for dest exec data
13-
func (d ExtraDataDecoder) DecodeDestExecDataToMap(destExecData cciptypes.Bytes) (map[string]interface{}, error) {
21+
func (d ExtraDataCodec) DecodeDestExecDataToMap(destExecData cciptypes.Bytes) (map[string]interface{}, error) {
1422
destGasAmount, err := abiDecodeUint32(destExecData)
1523
if err != nil {
1624
return nil, fmt.Errorf("decode dest gas amount: %w", err)
@@ -22,7 +30,7 @@ func (d ExtraDataDecoder) DecodeDestExecDataToMap(destExecData cciptypes.Bytes)
2230
}
2331

2432
// DecodeExtraArgsToMap reformats bytes into a chain agnostic map[string]any representation for extra args
25-
func (d ExtraDataDecoder) DecodeExtraArgsToMap(extraArgs cciptypes.Bytes) (map[string]any, error) {
33+
func (d ExtraDataCodec) DecodeExtraArgsToMap(extraArgs cciptypes.Bytes) (map[string]any, error) {
2634
if len(extraArgs) < 4 {
2735
return nil, fmt.Errorf("extra args too short: %d, should be at least 4 (i.e the extraArgs tag)", len(extraArgs))
2836
}
@@ -76,3 +84,6 @@ func (d ExtraDataDecoder) DecodeExtraArgsToMap(extraArgs cciptypes.Bytes) (map[s
7684

7785
return output, nil
7886
}
87+
88+
// Ensure ExtraDataCodec implements the SourceChainExtraDataCodec interface
89+
var _ ccipcommon.SourceChainExtraDataCodec = &ExtraDataCodec{}

core/capabilities/ccip/ccipevm/extradatadecoder_test.go renamed to core/capabilities/ccip/ccipevm/extradatacodec_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func Test_decodeExtraData(t *testing.T) {
1616
d := testSetup(t)
1717
gasLimit := big.NewInt(rand.Int63())
18-
extraDataDecoder := &ExtraDataDecoder{}
18+
extraDataDecoder := &ExtraDataCodec{}
1919

2020
t.Run("decode extra args into map evm v1", func(t *testing.T) {
2121
encoded, err := d.contract.EncodeEVMExtraArgsV1(nil, message_hasher.ClientEVMExtraArgsV1{
@@ -68,7 +68,7 @@ func Test_decodeExtraData(t *testing.T) {
6868

6969
func TestExtraDataDecoder_DecodeExtraArgsToMap_SVMDestination(t *testing.T) {
7070
d := testSetup(t)
71-
extraDataDecoder := &ExtraDataDecoder{}
71+
extraDataDecoder := &ExtraDataCodec{}
7272

7373
t.Run("decode extra args into map svm", func(t *testing.T) {
7474
key, err := solana.NewRandomPrivateKey()

core/capabilities/ccip/ccipevm/gas_helpers_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func Test_calculateMessageMaxGas(t *testing.T) {
8080
}
8181
// Set the source chain selector to be EVM for now
8282
msg.Header.SourceChainSelector = ccipocr3.ChainSelector(chainsel.ETHEREUM_TESTNET_SEPOLIA.Selector)
83-
ep := EstimateProvider{extraDataCodec: ExtraDataCodec}
83+
ep := EstimateProvider{extraDataCodec: extraDataCodec}
8484
got := ep.CalculateMessageMaxGas(msg)
8585
t.Log(got)
8686
assert.Equalf(t, tt.want, got, "calculateMessageMaxGas(%v, %v)", tt.args.dataLen, tt.args.numTokens)
@@ -138,7 +138,7 @@ func TestCalculateMaxGas(t *testing.T) {
138138
}
139139

140140
msg.Header.SourceChainSelector = ccipocr3.ChainSelector(chainsel.ETHEREUM_TESTNET_SEPOLIA.Selector)
141-
ep := EstimateProvider{extraDataCodec: ExtraDataCodec}
141+
ep := EstimateProvider{extraDataCodec: extraDataCodec}
142142
gotTree := ep.CalculateMerkleTreeGas(tt.numRequests)
143143
gotMsg := ep.CalculateMessageMaxGas(msg)
144144
t.Log("want", tt.want, "got", gotTree+gotMsg)

core/capabilities/ccip/ccipevm/helpers.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ import (
1313
ccipcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"
1414
)
1515

16-
const (
17-
svmV1DecodeStructName = "decodeSVMExtraArgsStruct"
18-
evmV1DecodeName = "decodeEVMExtraArgsV1"
19-
evmV2DecodeName = "decodeEVMExtraArgsV2"
20-
evmDestExecDataKey = "destGasAmount"
21-
)
22-
2316
// abiEncodeMethodInputs encodes the inputs for a method call.
2417
// example abi: `[{ "name" : "method", "type": "function", "inputs": [{"name": "a", "type": "uint256"}]}]`
2518
func abiEncodeMethodInputs(abiDef abi.ABI, inputs ...interface{}) ([]byte, error) {

core/capabilities/ccip/ccipevm/helpers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
func Test_decodeExtraArgs(t *testing.T) {
1414
d := testSetup(t)
1515
gasLimit := big.NewInt(rand.Int63())
16-
extraDataDecoder := &ExtraDataDecoder{}
16+
extraDataDecoder := &ExtraDataCodec{}
1717

1818
t.Run("decode extra args into map evm v1", func(t *testing.T) {
1919
encoded, err := d.contract.EncodeEVMExtraArgsV1(nil, message_hasher.ClientEVMExtraArgsV1{

0 commit comments

Comments
 (0)