From ed5cb0880a5c9cb1f31c4ecdadc05b1de0168f17 Mon Sep 17 00:00:00 2001 From: Joe Huang Date: Fri, 17 Jan 2025 15:13:36 -0600 Subject: [PATCH] Nonevm 1163/update plugin factory with extra args decoder (#15944) * interface change for plugin to support extra args codec, right now noop * add changeset * lint * go mod * remove error * fix lint * go import * implement evm * update name * go import * remove old comment * update * remove unused * update mod * update to master chainlink-ccip --- .changeset/soft-rivers-care.md | 5 +++++ core/capabilities/ccip/ccipevm/extraargscodec.go | 16 ++++++++++++++++ core/capabilities/ccip/oraclecreator/plugin.go | 2 ++ core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- deployment/go.mod | 2 +- deployment/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- integration-tests/smoke/ccip/ccip_reader_test.go | 8 ++++++-- 14 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 .changeset/soft-rivers-care.md create mode 100644 core/capabilities/ccip/ccipevm/extraargscodec.go diff --git a/.changeset/soft-rivers-care.md b/.changeset/soft-rivers-care.md new file mode 100644 index 00000000000..22eeea042ba --- /dev/null +++ b/.changeset/soft-rivers-care.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +interface change for plugin to support extra args codec, right now noop #added diff --git a/core/capabilities/ccip/ccipevm/extraargscodec.go b/core/capabilities/ccip/ccipevm/extraargscodec.go new file mode 100644 index 00000000000..8cd8bda48f7 --- /dev/null +++ b/core/capabilities/ccip/ccipevm/extraargscodec.go @@ -0,0 +1,16 @@ +package ccipevm + +import ( + cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" +) + +type ExtraArgsCodec struct{} + +func NewExtraArgsCodec() ExtraArgsCodec { + return ExtraArgsCodec{} +} + +func (ExtraArgsCodec) DecodeExtraData(extraArgs cciptypes.Bytes, sourceChainSelector cciptypes.ChainSelector) (map[string]any, error) { + // Not implemented and not return error + return nil, nil +} diff --git a/core/capabilities/ccip/oraclecreator/plugin.go b/core/capabilities/ccip/oraclecreator/plugin.go index d4c5596aeaf..f791a804586 100644 --- a/core/capabilities/ccip/oraclecreator/plugin.go +++ b/core/capabilities/ccip/oraclecreator/plugin.go @@ -263,6 +263,7 @@ func (i *pluginOracleCreator) createFactoryAndTransmitter( ccipreaderpkg.OCR3ConfigWithMeta(config), ccipevm.NewCommitPluginCodecV1(), ccipevm.NewMessageHasherV1(i.lggr.Named("MessageHasherV1")), + ccipevm.NewExtraArgsCodec(), i.homeChainReader, i.homeChainSelector, contractReaders, @@ -285,6 +286,7 @@ func (i *pluginOracleCreator) createFactoryAndTransmitter( ccipreaderpkg.OCR3ConfigWithMeta(config), ccipevm.NewExecutePluginCodecV1(), ccipevm.NewMessageHasherV1(i.lggr.Named("MessageHasherV1")), + ccipevm.NewExtraArgsCodec(), i.homeChainReader, ccipevm.NewEVMTokenDataEncoder(), ccipevm.NewGasEstimateProvider(), diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 823475e2f02..0428101e86c 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -311,7 +311,7 @@ require ( github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix // indirect github.com/smartcontractkit/chain-selectors v1.0.36 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd // indirect github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 5ad6415a060..18e6a6ba941 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1160,8 +1160,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd h1:1xtdmHoleuTNxXlcRAZ7MslnKATwDDWOZfdcBuaN2SE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= diff --git a/deployment/go.mod b/deployment/go.mod index bab3380833c..40d0629f35e 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -29,7 +29,7 @@ require ( github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix github.com/smartcontractkit/chain-selectors v1.0.36 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 diff --git a/deployment/go.sum b/deployment/go.sum index d36e4e68bc2..82fac992e8f 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1386,8 +1386,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd h1:1xtdmHoleuTNxXlcRAZ7MslnKATwDDWOZfdcBuaN2SE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= diff --git a/go.mod b/go.mod index bf7c8e44b69..83822155b9e 100644 --- a/go.mod +++ b/go.mod @@ -79,7 +79,7 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.34 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 diff --git a/go.sum b/go.sum index 29642366545..50f8fd0b1fc 100644 --- a/go.sum +++ b/go.sum @@ -1152,8 +1152,8 @@ github.com/smartcontractkit/chain-selectors v1.0.34 h1:MJ17OGu8+jjl426pcKrJkCf3f github.com/smartcontractkit/chain-selectors v1.0.34/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd h1:1xtdmHoleuTNxXlcRAZ7MslnKATwDDWOZfdcBuaN2SE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 2f8faf7601e..d3f5e88e940 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -46,7 +46,7 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.36 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index f581d1d41ca..fd165a64cf2 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1410,8 +1410,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd h1:1xtdmHoleuTNxXlcRAZ7MslnKATwDDWOZfdcBuaN2SE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b h1:UBXi9Yj8YSMHDDaxQLu273x1fWjyEL9xP58nuJsqZfg= github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250103152858-8973fd0c912b/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 0bd89ebc820..c2ad7725fce 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -411,7 +411,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartcontractkit/chain-selectors v1.0.36 // indirect github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250115135646-ac859d85e7e3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 6ede9ce3947..cc30e409cba 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1397,8 +1397,8 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1 h1:oyyxtlR27e+Ce1Pe01CTxRkeiy6NPJhJiyUQ0N7xBOM= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117154208-cf4b44591be1/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd h1:1xtdmHoleuTNxXlcRAZ7MslnKATwDDWOZfdcBuaN2SE= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20250117200850-6cf7498adbfd/go.mod h1:JJZMCB75aVSAiPNW032F9WUKTlLztTd8bbQB5MEaZa4= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51 h1:YdjQiEu5uHWM1ApwdV+nLyJmu1+tt3IeiwPKNGoXwBI= github.com/smartcontractkit/chainlink-common v0.4.2-0.20250116214855-f49c5c27db51/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= diff --git a/integration-tests/smoke/ccip/ccip_reader_test.go b/integration-tests/smoke/ccip/ccip_reader_test.go index beb7b00b85b..4345bd4d894 100644 --- a/integration-tests/smoke/ccip/ccip_reader_test.go +++ b/integration-tests/smoke/ccip/ccip_reader_test.go @@ -19,6 +19,7 @@ import ( "go.uber.org/zap/zapcore" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm" "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" "github.com/smartcontractkit/chainlink-ccip/plugintypes" @@ -290,6 +291,7 @@ func TestCCIPReader_GetOffRampConfigDigest(t *testing.T) { nil, chainD, addr.Bytes(), + ccipevm.NewExtraArgsCodec(), ) ccipReaderCommitDigest, err := reader.GetOffRampConfigDigest(ctx, consts.PluginTypeCommit) @@ -1409,7 +1411,8 @@ func testSetupRealContracts( contractReaders[chain] = cr } contractWriters := make(map[cciptypes.ChainSelector]types.ContractWriter) - reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(ctx, lggr, contractReaders, contractWriters, cciptypes.ChainSelector(destChain), nil) + edc := ccipevm.NewExtraArgsCodec() + reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(ctx, lggr, contractReaders, contractWriters, cciptypes.ChainSelector(destChain), nil, edc) return reader } @@ -1524,7 +1527,8 @@ func testSetup( contractReaders[chain] = cr } contractWriters := make(map[cciptypes.ChainSelector]types.ContractWriter) - reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(ctx, lggr, contractReaders, contractWriters, params.DestChain, nil) + edc := ccipevm.NewExtraArgsCodec() + reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(ctx, lggr, contractReaders, contractWriters, params.DestChain, nil, edc) t.Cleanup(func() { require.NoError(t, cr.Close())