Skip to content

Commit

Permalink
Use new chainlink-ccip factory functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
winder committed Jan 31, 2025
1 parent 8af9a90 commit 7ac42f0
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 49 deletions.
71 changes: 37 additions & 34 deletions core/capabilities/ccip/oraclecreator/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/google/uuid"
"github.com/prometheus/client_golang/prometheus"

ccipcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"

chainsel "github.com/smartcontractkit/chain-selectors"
Expand Down Expand Up @@ -290,46 +291,48 @@ func (i *pluginOracleCreator) createFactoryAndTransmitter(

rmnCrypto := plugin.RMNCrypto(i.lggr.Named(chainFamily).Named("RMNCrypto"))

factory = commitocr3.NewPluginFactory(
i.lggr.
Named("CCIPCommitPlugin").
Named(destRelayID.String()).
Named(fmt.Sprintf("%d", config.Config.ChainSelector)).
Named(hexutil.Encode(config.Config.OfframpAddress)),
donID,
ccipreaderpkg.OCR3ConfigWithMeta(config),
plugin.CommitPluginCodec,
messageHasher,
plugin.ExtraArgsCodec,
i.homeChainReader,
i.homeChainSelector,
contractReaders,
chainWriters,
rmnPeerClient,
rmnCrypto,
)
factory = commitocr3.NewCommitPluginFactory(
commitocr3.CommitPluginFactoryParams{
Lggr: i.lggr.
Named("CCIPCommitPlugin").
Named(destRelayID.String()).
Named(fmt.Sprintf("%d", config.Config.ChainSelector)).
Named(hexutil.Encode(config.Config.OfframpAddress)),
DonID: donID,
OcrConfig: ccipreaderpkg.OCR3ConfigWithMeta(config),
CommitCodec: plugin.CommitPluginCodec,
MsgHasher: messageHasher,
ExtraDataCodec: plugin.ExtraArgsCodec,
HomeChainReader: i.homeChainReader,
HomeChainSelector: i.homeChainSelector,
ContractReaders: contractReaders,
ContractWriters: chainWriters,
RmnPeerClient: rmnPeerClient,
RmnCrypto: rmnCrypto,
})
factory = promwrapper.NewReportingPluginFactory[[]byte](factory, i.lggr, chainID, "CCIPCommit")
transmitter = ocrimpls.NewCommitContractTransmitter(destChainWriter,
ocrtypes.Account(destFromAccounts[0]),
hexutil.Encode(config.Config.OfframpAddress), // TODO: this works for evm only, how about non-evm?
)
} else if config.Config.PluginType == uint8(cctypes.PluginTypeCCIPExec) {
factory = execocr3.NewPluginFactory(
i.lggr.
Named("CCIPExecPlugin").
Named(destRelayID.String()).
Named(hexutil.Encode(config.Config.OfframpAddress)),
donID,
ccipreaderpkg.OCR3ConfigWithMeta(config),
plugin.ExecutePluginCodec,
messageHasher,
plugin.ExtraArgsCodec,
i.homeChainReader,
plugin.TokenDataEncoder,
plugin.GasEstimateProvider,
contractReaders,
chainWriters,
)
factory = execocr3.NewExecutePluginFactory(
execocr3.PluginFactoryParams{
Lggr: i.lggr.
Named("CCIPExecPlugin").
Named(destRelayID.String()).
Named(hexutil.Encode(config.Config.OfframpAddress)),
DonID: donID,
OcrConfig: ccipreaderpkg.OCR3ConfigWithMeta(config),
ExecCodec: plugin.ExecutePluginCodec,
MsgHasher: messageHasher,
ExtraDataCodec: plugin.ExtraArgsCodec,
HomeChainReader: i.homeChainReader,
TokenDataEncoder: plugin.TokenDataEncoder,
EstimateProvider: plugin.GasEstimateProvider,
ContractReaders: contractReaders,
ContractWriters: chainWriters,
})
factory = promwrapper.NewReportingPluginFactory[[]byte](factory, i.lggr, chainID, "CCIPExec")
transmitter = ocrimpls.NewExecContractTransmitter(destChainWriter,
ocrtypes.Account(destFromAccounts[0]),
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,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.37 // indirect
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250130101703-5ba045c38d49 // indirect
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7 // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128074412-9b02e505b268 // indirect
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20250130125138-3df261e09ddc // indirect
github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1329,8 +1329,8 @@ github.com/smartcontractkit/chain-selectors v1.0.37 h1:EKVl8wayhOVfnlqfVmEyZ8rXO
github.com/smartcontractkit/chain-selectors v1.0.37/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-20250130101703-5ba045c38d49 h1:Y9mC8DCJQUjU7IwGi0FVsH2Q8ujv9Na8DLq1StsGbso=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250130101703-5ba045c38d49/go.mod h1:UEnHaxkUsfreeA7rR45LMmua1Uen95tOFUR8/AI9BAo=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7 h1:x2E/Pqm+RpzyuheP8qpUIVnMfEs/XCctdv1qdcZKuU4=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7/go.mod h1:UEnHaxkUsfreeA7rR45LMmua1Uen95tOFUR8/AI9BAo=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128074412-9b02e505b268 h1:R1fQXQL1AKLfRqZHlbGO0NHN3uZKEkI3r2uBlctwt7k=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128074412-9b02e505b268/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60=
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250130202959-6f1f48342e36 h1:bS51NFGHVjkCy7yu9L2Ss4sBsCW6jpa5GuhRAdWWxzM=
Expand Down
2 changes: 1 addition & 1 deletion deployment/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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.37
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250130101703-5ba045c38d49
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128074412-9b02e505b268
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250130202959-6f1f48342e36
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250121205514-f73e2f86c23b
Expand Down
4 changes: 2 additions & 2 deletions deployment/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1394,8 +1394,8 @@ github.com/smartcontractkit/chain-selectors v1.0.37 h1:EKVl8wayhOVfnlqfVmEyZ8rXO
github.com/smartcontractkit/chain-selectors v1.0.37/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-20250130101703-5ba045c38d49 h1:Y9mC8DCJQUjU7IwGi0FVsH2Q8ujv9Na8DLq1StsGbso=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250130101703-5ba045c38d49/go.mod h1:UEnHaxkUsfreeA7rR45LMmua1Uen95tOFUR8/AI9BAo=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7 h1:x2E/Pqm+RpzyuheP8qpUIVnMfEs/XCctdv1qdcZKuU4=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7/go.mod h1:UEnHaxkUsfreeA7rR45LMmua1Uen95tOFUR8/AI9BAo=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128074412-9b02e505b268 h1:R1fQXQL1AKLfRqZHlbGO0NHN3uZKEkI3r2uBlctwt7k=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128074412-9b02e505b268/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60=
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250130202959-6f1f48342e36 h1:bS51NFGHVjkCy7yu9L2Ss4sBsCW6jpa5GuhRAdWWxzM=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ require (
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chain-selectors v1.0.37
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250130101703-5ba045c38d49
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250130202959-6f1f48342e36
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20250130125138-3df261e09ddc
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,8 @@ github.com/smartcontractkit/chain-selectors v1.0.37 h1:EKVl8wayhOVfnlqfVmEyZ8rXO
github.com/smartcontractkit/chain-selectors v1.0.37/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-20250130101703-5ba045c38d49 h1:Y9mC8DCJQUjU7IwGi0FVsH2Q8ujv9Na8DLq1StsGbso=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250130101703-5ba045c38d49/go.mod h1:UEnHaxkUsfreeA7rR45LMmua1Uen95tOFUR8/AI9BAo=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7 h1:x2E/Pqm+RpzyuheP8qpUIVnMfEs/XCctdv1qdcZKuU4=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7/go.mod h1:UEnHaxkUsfreeA7rR45LMmua1Uen95tOFUR8/AI9BAo=
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250130202959-6f1f48342e36 h1:bS51NFGHVjkCy7yu9L2Ss4sBsCW6jpa5GuhRAdWWxzM=
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250130202959-6f1f48342e36/go.mod h1:Z2e1ynSJ4pg83b4Qldbmryc5lmnrI3ojOdg1FUloa68=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20250130125138-3df261e09ddc h1:WZERXv2hTYRA0NpWg79ci/ZZSxucmvkty39iUOV8d7I=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ require (
github.com/slack-go/slack v0.15.0
github.com/smartcontractkit/chain-selectors v1.0.37
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250130101703-5ba045c38d49
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250130202959-6f1f48342e36
github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0
github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.7
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1422,8 +1422,8 @@ github.com/smartcontractkit/chain-selectors v1.0.37 h1:EKVl8wayhOVfnlqfVmEyZ8rXO
github.com/smartcontractkit/chain-selectors v1.0.37/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-20250130101703-5ba045c38d49 h1:Y9mC8DCJQUjU7IwGi0FVsH2Q8ujv9Na8DLq1StsGbso=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250130101703-5ba045c38d49/go.mod h1:UEnHaxkUsfreeA7rR45LMmua1Uen95tOFUR8/AI9BAo=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7 h1:x2E/Pqm+RpzyuheP8qpUIVnMfEs/XCctdv1qdcZKuU4=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7/go.mod h1:UEnHaxkUsfreeA7rR45LMmua1Uen95tOFUR8/AI9BAo=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128074412-9b02e505b268 h1:R1fQXQL1AKLfRqZHlbGO0NHN3uZKEkI3r2uBlctwt7k=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128074412-9b02e505b268/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60=
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250130202959-6f1f48342e36 h1:bS51NFGHVjkCy7yu9L2Ss4sBsCW6jpa5GuhRAdWWxzM=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/load/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require (
github.com/rs/zerolog v1.33.0
github.com/slack-go/slack v0.15.0
github.com/smartcontractkit/chain-selectors v1.0.37
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250130101703-5ba045c38d49
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250130202959-6f1f48342e36
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.21
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/load/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1409,8 +1409,8 @@ github.com/smartcontractkit/chain-selectors v1.0.37 h1:EKVl8wayhOVfnlqfVmEyZ8rXO
github.com/smartcontractkit/chain-selectors v1.0.37/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-20250130101703-5ba045c38d49 h1:Y9mC8DCJQUjU7IwGi0FVsH2Q8ujv9Na8DLq1StsGbso=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250130101703-5ba045c38d49/go.mod h1:UEnHaxkUsfreeA7rR45LMmua1Uen95tOFUR8/AI9BAo=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7 h1:x2E/Pqm+RpzyuheP8qpUIVnMfEs/XCctdv1qdcZKuU4=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250131200348-ba8a8d5e87c7/go.mod h1:UEnHaxkUsfreeA7rR45LMmua1Uen95tOFUR8/AI9BAo=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128074412-9b02e505b268 h1:R1fQXQL1AKLfRqZHlbGO0NHN3uZKEkI3r2uBlctwt7k=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128074412-9b02e505b268/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60=
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250130202959-6f1f48342e36 h1:bS51NFGHVjkCy7yu9L2Ss4sBsCW6jpa5GuhRAdWWxzM=
Expand Down

0 comments on commit 7ac42f0

Please sign in to comment.