Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support address codec implementation #16485

Merged
merged 17 commits into from
Feb 20, 2025
16 changes: 16 additions & 0 deletions core/capabilities/ccip/ccipevm/addresscodec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ccipevm

import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
)

type AddressCodec struct{}

func (a AddressCodec) AddressBytesToString(addr []byte) (string, error) {
return hexutil.Encode(addr), nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this, use this version:
common.BytesToAddress(addr).Hex()

The reason is because the latter is EIP55-compliant.
More context: https://medium.com/@zakhard/eip-55-explained-solving-the-address-checksum-problem-01ac2bb0efc4

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Now that this is inside chainlink we can use the standard evm libraries.

}

func (a AddressCodec) AddressStringToBytes(addr string) ([]byte, error) {
return common.HexToAddress(addr).Bytes(), nil
}
21 changes: 21 additions & 0 deletions core/capabilities/ccip/ccipsolana/addresscodec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package ccipsolana

import (
"fmt"

"github.com/gagliardetto/solana-go"
)

type AddressCodec struct{}

func (a AddressCodec) AddressBytesToString(addr []byte) (string, error) {
return solana.PublicKeyFromBytes(addr).String(), nil
}

func (a AddressCodec) AddressStringToBytes(addr string) ([]byte, error) {
pk, err := solana.PublicKeyFromBase58(addr)
if err != nil {
return nil, fmt.Errorf("failed to decode SVM address '%s': %w", addr, err)
}
return pk.Bytes(), nil
}
76 changes: 76 additions & 0 deletions core/capabilities/ccip/common/addresscodec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package common

import (
"fmt"

chainsel "github.com/smartcontractkit/chain-selectors"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
)

type ChainSpecificAddressCodec interface {
AddressBytesToString([]byte) (string, error)
AddressStringToBytes(string) ([]byte, error)
}

type AddressCodec struct {
EVMAddressCodec ChainSpecificAddressCodec
SolanaAddressCodec ChainSpecificAddressCodec
}

// AddressCodecParams is a struct that holds the parameters for creating a AddressCodec
type AddressCodecParams struct {
evmAddressCodec ChainSpecificAddressCodec
solanaAddressCodec ChainSpecificAddressCodec
}

// NewAddressCodecParams is a constructor for AddressCodecParams
func NewAddressCodecParams(evmAddressCodec ChainSpecificAddressCodec, solanaAddressCodec ChainSpecificAddressCodec) AddressCodecParams {
return AddressCodecParams{
evmAddressCodec: evmAddressCodec,
solanaAddressCodec: solanaAddressCodec,
}
}

// NewAddressCodec is a constructor for AddressCodec
func NewAddressCodec(params AddressCodecParams) AddressCodec {
return AddressCodec{
EVMAddressCodec: params.evmAddressCodec,
SolanaAddressCodec: params.solanaAddressCodec,
}
}

func (ac AddressCodec) AddressBytesToString(addr cciptypes.UnknownAddress, chainSelector cciptypes.ChainSelector) (string, error) {
family, err := chainsel.GetSelectorFamily(uint64(chainSelector))
if err != nil {
return "", fmt.Errorf("failed to get chain family for selector %d: %w", chainSelector, err)
}

switch family {
case chainsel.FamilyEVM:
return ac.EVMAddressCodec.AddressBytesToString(addr)

case chainsel.FamilySolana:
return ac.SolanaAddressCodec.AddressBytesToString(addr)

default:
return "", fmt.Errorf("unsupported family for address encode type %s", family)
}
}

func (ac AddressCodec) AddressStringToBytes(addr string, chainSelector cciptypes.ChainSelector) (cciptypes.UnknownAddress, error) {
family, err := chainsel.GetSelectorFamily(uint64(chainSelector))
if err != nil {
return nil, fmt.Errorf("failed to get chain family for selector %d: %w", chainSelector, err)
}

switch family {
case chainsel.FamilyEVM:
return ac.EVMAddressCodec.AddressStringToBytes(addr)

case chainsel.FamilySolana:
return ac.SolanaAddressCodec.AddressStringToBytes(addr)

default:
return nil, fmt.Errorf("unsupported family for address decode type %s", family)
}
}
11 changes: 8 additions & 3 deletions core/capabilities/ccip/oraclecreator/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ var plugins = map[string]plugin{
chainsel.FamilyEVM: {
CommitPluginCodec: ccipevm.NewCommitPluginCodecV1(),
ExecutePluginCodec: ccipevm.NewExecutePluginCodecV1(extraDataCodec),
ExtraArgsCodec: extraDataCodec,
MessageHasher: func(lggr logger.Logger) cciptypes.MessageHasher {
return ccipevm.NewMessageHasherV1(lggr, extraDataCodec)
},
Expand All @@ -75,7 +74,6 @@ var plugins = map[string]plugin{
chainsel.FamilySolana: {
CommitPluginCodec: ccipsolana.NewCommitPluginCodecV1(),
ExecutePluginCodec: ccipsolana.NewExecutePluginCodecV1(extraDataCodec),
ExtraArgsCodec: extraDataCodec,
MessageHasher: func(lggr logger.Logger) cciptypes.MessageHasher {
return ccipsolana.NewMessageHasherV1(lggr, extraDataCodec)
},
Expand All @@ -93,7 +91,6 @@ const (
type plugin struct {
CommitPluginCodec cciptypes.CommitPluginCodec
ExecutePluginCodec cciptypes.ExecutePluginCodec
ExtraArgsCodec ccipcommon.ExtraDataCodec
MessageHasher func(lggr logger.Logger) cciptypes.MessageHasher
TokenDataEncoder cciptypes.TokenDataEncoder
GasEstimateProvider cciptypes.EstimateProvider
Expand Down Expand Up @@ -307,6 +304,12 @@ func (i *pluginOracleCreator) createFactoryAndTransmitter(
return nil, nil, fmt.Errorf("unsupported chain %v", chainFamily)
}
messageHasher := plugin.MessageHasher(i.lggr.Named(chainFamily).Named("MessageHasherV1"))
addressCodec := ccipcommon.NewAddressCodec(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you instead create this addressCodec in NewPluginOracleCreator(), store it as a member of the pluginOracleCreator struct, and then here in this function, pass the same instance to the commit/exec plugin factories.
We basically only need 1 instance. No need to create separate one per-chain or plugn

ccipcommon.NewAddressCodecParams(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to send these?
Why can't the NewAddressCodecParams() just create locally itself?

Copy link
Contributor Author

@huangzhen1997 huangzhen1997 Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's not ideal, but a workaround for the import circle when I import ccipevm or ccipsolana from common

ccipevm.AddressCodec{},
ccipsolana.AddressCodec{},
),
)

if config.Config.PluginType == uint8(cctypes.PluginTypeCCIPCommit) {
if !i.peerWrapper.IsStarted() {
Expand Down Expand Up @@ -335,6 +338,7 @@ func (i *pluginOracleCreator) createFactoryAndTransmitter(
OcrConfig: ccipreaderpkg.OCR3ConfigWithMeta(config),
CommitCodec: plugin.CommitPluginCodec,
MsgHasher: messageHasher,
AddrCodec: addressCodec,
HomeChainReader: i.homeChainReader,
HomeChainSelector: i.homeChainSelector,
ContractReaders: contractReaders,
Expand All @@ -357,6 +361,7 @@ func (i *pluginOracleCreator) createFactoryAndTransmitter(
OcrConfig: ccipreaderpkg.OCR3ConfigWithMeta(config),
ExecCodec: plugin.ExecutePluginCodec,
MsgHasher: messageHasher,
AddrCodec: addressCodec,
HomeChainReader: i.homeChainReader,
TokenDataEncoder: plugin.TokenDataEncoder,
EstimateProvider: plugin.GasEstimateProvider,
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ require (
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix // indirect
github.com/smartcontractkit/chain-selectors v1.0.40 // indirect
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219000908-751d873236f2 // indirect
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407 // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 // indirect
github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250207205350-420ccacab78a // 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 @@ -1086,8 +1086,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D
github.com/smartcontractkit/chain-selectors v1.0.40/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-20250219000908-751d873236f2 h1:cXUlW1NIbTFT+oaV2Xio+shr3MHESzaYr+hke14YORU=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219000908-751d873236f2/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407 h1:6QFJU21jZtcN2jJwO/PmdfOTgge1Y88V+o1+mnHDJs4=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60=
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea h1:/1f/pWf7vSV9acTR9UPn2exPAwQG/LHGa4l9OywhS00=
Expand Down
2 changes: 1 addition & 1 deletion deployment/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,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.40
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219000908-751d873236f2
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250211162441-3d6cea220efb
Expand Down
4 changes: 2 additions & 2 deletions deployment/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1134,8 +1134,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D
github.com/smartcontractkit/chain-selectors v1.0.40/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-20250219000908-751d873236f2 h1:cXUlW1NIbTFT+oaV2Xio+shr3MHESzaYr+hke14YORU=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219000908-751d873236f2/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407 h1:6QFJU21jZtcN2jJwO/PmdfOTgge1Y88V+o1+mnHDJs4=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60=
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea h1:/1f/pWf7vSV9acTR9UPn2exPAwQG/LHGa4l9OywhS00=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ require (
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chain-selectors v1.0.40
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219000908-751d873236f2
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea
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 @@ -1018,8 +1018,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D
github.com/smartcontractkit/chain-selectors v1.0.40/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-20250219000908-751d873236f2 h1:cXUlW1NIbTFT+oaV2Xio+shr3MHESzaYr+hke14YORU=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219000908-751d873236f2/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407 h1:6QFJU21jZtcN2jJwO/PmdfOTgge1Y88V+o1+mnHDJs4=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60=
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea h1:/1f/pWf7vSV9acTR9UPn2exPAwQG/LHGa4l9OywhS00=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ require (
github.com/slack-go/slack v0.15.0
github.com/smartcontractkit/chain-selectors v1.0.40
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219000908-751d873236f2
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea
github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02
github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1386,8 +1386,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D
github.com/smartcontractkit/chain-selectors v1.0.40/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-20250219000908-751d873236f2 h1:cXUlW1NIbTFT+oaV2Xio+shr3MHESzaYr+hke14YORU=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219000908-751d873236f2/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407 h1:6QFJU21jZtcN2jJwO/PmdfOTgge1Y88V+o1+mnHDJs4=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60=
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea h1:/1f/pWf7vSV9acTR9UPn2exPAwQG/LHGa4l9OywhS00=
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.40
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219000908-751d873236f2
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea
github.com/smartcontractkit/chainlink-integrations/evm v0.0.0-20250213145514-41d874782c02
github.com/smartcontractkit/chainlink-testing-framework/lib v1.51.0
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 @@ -1369,8 +1369,8 @@ github.com/smartcontractkit/chain-selectors v1.0.40 h1:iLvvoZeehVq6/7F+zzolQLF0D
github.com/smartcontractkit/chain-selectors v1.0.40/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-20250219000908-751d873236f2 h1:cXUlW1NIbTFT+oaV2Xio+shr3MHESzaYr+hke14YORU=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219000908-751d873236f2/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407 h1:6QFJU21jZtcN2jJwO/PmdfOTgge1Y88V+o1+mnHDJs4=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250219214835-2eff21298407/go.mod h1:Hht/OJq/PxC+gnBCIPyzHt4Otsw6mYwUVsmtOqIvlxo=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60=
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250214231858-f365e2bdecea h1:/1f/pWf7vSV9acTR9UPn2exPAwQG/LHGa4l9OywhS00=
Expand Down
14 changes: 11 additions & 3 deletions integration-tests/smoke/ccip/ccip_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient/simulated"
"github.com/jmoiron/sqlx"
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm"
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipsolana"
ccipcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zapcore"
Expand Down Expand Up @@ -283,6 +286,7 @@ func TestCCIPReader_GetRMNRemoteConfig(t *testing.T) {
})
require.NoError(t, err)

addrCodec := ccipcommon.NewAddressCodec(ccipcommon.NewAddressCodecParams(ccipevm.AddressCodec{}, ccipsolana.AddressCodec{}))
reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(
ctx,
lggr,
Expand All @@ -292,6 +296,7 @@ func TestCCIPReader_GetRMNRemoteConfig(t *testing.T) {
nil,
chainD,
rmnRemoteAddr.Bytes(),
addrCodec,
)

exp, err := rmnRemote.GetVersionedConfig(&bind.CallOpts{
Expand Down Expand Up @@ -405,7 +410,7 @@ func TestCCIPReader_GetOffRampConfigDigest(t *testing.T) {
},
})
require.NoError(t, err)

addrCodec := ccipcommon.NewAddressCodec(ccipcommon.NewAddressCodecParams(ccipevm.AddressCodec{}, ccipsolana.AddressCodec{}))
reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(
ctx,
lggr,
Expand All @@ -415,6 +420,7 @@ func TestCCIPReader_GetOffRampConfigDigest(t *testing.T) {
nil,
chainD,
addr.Bytes(),
addrCodec,
)

ccipReaderCommitDigest, err := reader.GetOffRampConfigDigest(ctx, consts.PluginTypeCommit)
Expand Down Expand Up @@ -1541,7 +1547,8 @@ func testSetupRealContracts(
contractReaders[chain] = cr
}
contractWriters := make(map[cciptypes.ChainSelector]types.ContractWriter)
reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(ctx, lggr, contractReaders, contractWriters, cciptypes.ChainSelector(destChain), nil)
addrCodec := ccipcommon.NewAddressCodec(ccipcommon.NewAddressCodecParams(ccipevm.AddressCodec{}, ccipsolana.AddressCodec{}))
reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(ctx, lggr, contractReaders, contractWriters, cciptypes.ChainSelector(destChain), nil, addrCodec)

return reader
}
Expand Down Expand Up @@ -1656,7 +1663,8 @@ func testSetup(
contractReaders[chain] = cr
}
contractWriters := make(map[cciptypes.ChainSelector]types.ContractWriter)
reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(ctx, lggr, contractReaders, contractWriters, params.DestChain, nil)
addrCodec := ccipcommon.NewAddressCodec(ccipcommon.NewAddressCodecParams(ccipevm.AddressCodec{}, ccipsolana.AddressCodec{}))
reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(ctx, lggr, contractReaders, contractWriters, params.DestChain, nil, addrCodec)

t.Cleanup(func() {
require.NoError(t, cr.Close())
Expand Down
Loading