diff --git a/core/capabilities/ccip/ccipsolana/executecodec.go b/core/capabilities/ccip/ccipsolana/executecodec.go index 76a5598fe19..fb13a4eaa3d 100644 --- a/core/capabilities/ccip/ccipsolana/executecodec.go +++ b/core/capabilities/ccip/ccipsolana/executecodec.go @@ -8,7 +8,6 @@ import ( "fmt" "strings" - ethcommon "github.com/ethereum/go-ethereum/common" agbinary "github.com/gagliardetto/binary" "github.com/gagliardetto/solana-go" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common" @@ -112,7 +111,7 @@ func (e *ExecutePluginCodecV1) Encode(ctx context.Context, report cciptypes.Exec TokenAmounts: tokenAmounts, ExtraArgs: extraArgs, // TODO: is this available? - OnRampAddress: ethcommon.LeftPadBytes(msg.Header.OnRamp, 64), + OnRampAddress: msg.Header.OnRamp, } // should only have an offchain token data if there are tokens as part of the message @@ -131,7 +130,6 @@ func (e *ExecutePluginCodecV1) Encode(ctx context.Context, report cciptypes.Exec Message: message, OffchainTokenData: offChainTokenData, Proofs: solanaProofs, - Root: chainReport.Root, } var buf bytes.Buffer diff --git a/core/capabilities/ccip/configs/solana/contract_reader.go b/core/capabilities/ccip/configs/solana/contract_reader.go index 1f0521aa6be..4507d9d11c7 100644 --- a/core/capabilities/ccip/configs/solana/contract_reader.go +++ b/core/capabilities/ccip/configs/solana/contract_reader.go @@ -41,6 +41,15 @@ func DestContractReaderConfig() (config.ContractReader, error) { }, }) + // Prepend custom type so it takes priority over the IDL + offRampIDL.Types = append([]solanacodec.IdlTypeDef{{ + Name: "OnRampAddress", + Type: solanacodec.IdlTypeDefTy{ + Kind: solanacodec.IdlTypeDefTyKindCustom, + Codec: "onramp_address", + }, + }}, offRampIDL.Types...) + var routerIDL solanacodec.IDL if err := json.Unmarshal([]byte(ccipRouterIDL), &routerIDL); err != nil { return config.ContractReader{}, fmt.Errorf("unexpected error: invalid CCIP Router IDL, error: %w", err) diff --git a/deployment/ccip/changeset/solana/cs_add_remote_chain.go b/deployment/ccip/changeset/solana/cs_add_remote_chain.go index 93278ac0560..d2895b4b3e0 100644 --- a/deployment/ccip/changeset/solana/cs_add_remote_chain.go +++ b/deployment/ccip/changeset/solana/cs_add_remote_chain.go @@ -6,7 +6,6 @@ import ( "fmt" "strconv" - "github.com/ethereum/go-ethereum/common" "github.com/gagliardetto/solana-go" "github.com/smartcontractkit/mcms" @@ -162,11 +161,12 @@ func doAddRemoteChainToSolana( } for remoteChainSel, update := range updates { - var onRampBytes [64]byte + var onRampAddress solOffRamp.OnRampAddress + // var onRampBytes [64]byte // already verified, skipping errcheck addressBytes, _ := s.GetOnRampAddressBytes(remoteChainSel) - addressBytes = common.LeftPadBytes(addressBytes, 64) - copy(onRampBytes[:], addressBytes) + copy(onRampAddress.Bytes[:], addressBytes) + onRampAddress.Len = uint32(len(addressBytes)) // verified while loading state fqRemoteChainPDA, _, _ := solState.FindFqDestChainPDA(remoteChainSel, feeQuoterID) @@ -286,7 +286,7 @@ func doAddRemoteChainToSolana( solOffRamp.SetProgramID(offRampID) validSourceChainConfig := solOffRamp.SourceChainConfig{ - OnRamp: [2][64]byte{onRampBytes, [64]byte{}}, + OnRamp: [2]solOffRamp.OnRampAddress{onRampAddress, {}}, IsEnabled: update.EnabledAsSource, } if offRampUsingMCMS { diff --git a/deployment/ccip/changeset/testhelpers/test_assertions.go b/deployment/ccip/changeset/testhelpers/test_assertions.go index 9e6c78bb1b4..abe1f949b57 100644 --- a/deployment/ccip/changeset/testhelpers/test_assertions.go +++ b/deployment/ccip/changeset/testhelpers/test_assertions.go @@ -542,7 +542,7 @@ func ConfirmCommitWithExpectedSeqNumRangeSol( select { case commitEvent := <-sink: // if merkle root is zero, it only contains price updates - if commitEvent.Report.MerkleRoot == [32]uint8{} { + if commitEvent.Report == nil { t.Logf("Skipping CommitReportAccepted with only price updates") continue }