Skip to content

Commit 008aec7

Browse files
[DPA-1584]: fix(solana): update rootSignaturesPDA to include new seed (#323)
Include authority as part of the rootSignaturesPDA seed **Do not merge** this PR until - core repo [supports the latest version](#320) of chainlink-ccip/solana - ~Jade's [PR](smartcontractkit/chainlink-ccip#657) is merged~ Context: https://chainlink-core.slack.com/archives/C084CRQEQ5B/p1740497581832509?thread_ts=1740130591.644569&cid=C084CRQEQ5B JIRA: https://smartcontract-it.atlassian.net/browse/DPA-1584
1 parent fc04e76 commit 008aec7

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

.changeset/nasty-teachers-relax.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@smartcontractkit/mcms": patch
3+
---
4+
5+
solana: update rootSignaturesPDA to include authority as new seed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/joho/godotenv v1.5.1
1414
github.com/karalabe/hid v1.0.1-0.20240306101548-573246063e52
1515
github.com/smartcontractkit/chain-selectors v1.0.36
16-
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01
16+
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250226104101-11778f2ead98
1717
github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.7
1818
github.com/spf13/cast v1.7.1
1919
github.com/stretchr/testify v1.10.0

go.sum

+4
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ github.com/smartcontractkit/chain-selectors v1.0.36 h1:KSpO8I+JOiuyN4FuXsV471sPo
381381
github.com/smartcontractkit/chain-selectors v1.0.36/go.mod h1:xsKM0aN3YGcQKTPRPDDtPx2l4mlTN1Djmg0VVXV40b8=
382382
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01 h1:R3OD6Phi0ULIQ2uvHiKVWYdgpi/O1Mt46CUK1UApcXU=
383383
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250214202341-4190f2db1c01/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60=
384+
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250225164838-7c5ccfb7353e h1:jYPm/3OMAfZ+D0jaLQGl0pR7+WCJ6u1tSnJyQL2B4rY=
385+
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250225164838-7c5ccfb7353e/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60=
386+
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250226104101-11778f2ead98 h1:uHdawaiGBA3Xmju92tzbQ2SwsG2DDVJS5E+Jm5QnsQg=
387+
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250226104101-11778f2ead98/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60=
384388
github.com/smartcontractkit/chainlink-common v0.4.0 h1:GZ9MhHt5QHXSaK/sAZvKDxkEqF4fPiFHWHEPqs/2C2o=
385389
github.com/smartcontractkit/chainlink-common v0.4.0/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ=
386390
github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.7 h1:E7k5Sym9WnMOc4X40lLnQb6BMosxi8DfUBU9pBJjHOQ=

sdk/solana/common.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ func FindExpiringRootAndOpCountPDA(programID solana.PublicKey, pdaSeed PDASeed)
4545
}
4646

4747
func FindRootSignaturesPDA(
48-
programID solana.PublicKey, msigID PDASeed, root common.Hash, validUntil uint32,
48+
programID solana.PublicKey, msigID PDASeed, root common.Hash, validUntil uint32, authority solana.PublicKey,
4949
) (solana.PublicKey, error) {
50-
seeds := [][]byte{[]byte("root_signatures"), msigID[:], root[:], validUntilBytes(validUntil)}
50+
seeds := [][]byte{[]byte("root_signatures"), msigID[:], root[:], validUntilBytes(validUntil), authority[:]}
5151
return findPDA(programID, seeds)
5252
}
5353

sdk/solana/common_test.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,12 @@ func Test_FindExpiringRootAndOpCountPDA(t *testing.T) {
6767

6868
func Test_FindRootSignaturesPDA(t *testing.T) {
6969
t.Parallel()
70-
pda, err := FindRootSignaturesPDA(testMCMProgramID, testPDASeed, testRoot, 1735689600)
70+
authority, err := solana.PublicKeyFromBase58("LoCoNsJFuhTkSQjfdDfn3yuwqhSYoPujmviRHVCzsqn")
7171
require.NoError(t, err)
72-
require.Empty(t, cmp.Diff(pda, solana.MustPublicKeyFromBase58("528jBx5Mn1EPt4vG47CRkr1zhj8QVfSMvfvBZksZdrHr")))
72+
73+
pda, err := FindRootSignaturesPDA(testMCMProgramID, testPDASeed, testRoot, 1735689600, authority)
74+
require.NoError(t, err)
75+
require.Empty(t, cmp.Diff(pda, solana.MustPublicKeyFromBase58("98m4KuqTruBS7oXDm4Kzq43TmF1Lih3J6pHHZ6Lo9hty")))
7376
}
7477

7578
func Test_FindSeenSignedHashesPDA(t *testing.T) {

sdk/solana/executor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func (e *Executor) SetRoot(
153153
if err != nil {
154154
return types.TransactionResult{}, err
155155
}
156-
rootSignaturesPDA, err := FindRootSignaturesPDA(programID, pdaSeed, root, validUntil)
156+
rootSignaturesPDA, err := FindRootSignaturesPDA(programID, pdaSeed, root, validUntil, e.auth.PublicKey())
157157
if err != nil {
158158
return types.TransactionResult{}, err
159159
}

0 commit comments

Comments
 (0)