Skip to content

Commit

Permalink
pkg/solana: bump framework; pass context to select rpc (#1043)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Feb 5, 2025
1 parent 8c3390b commit c3ca047
Show file tree
Hide file tree
Showing 25 changed files with 421 additions and 361 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250128162345-af4c8fd4481a
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128162345-af4c8fd4481a
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250127125541-a8fa42cc0f36
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250203183025-939526523893
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250205165125-271e20f6de0a
github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919
github.com/stretchr/testify v1.10.0
go.uber.org/zap v1.27.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128162345-a
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128162345-af4c8fd4481a/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60=
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250127125541-a8fa42cc0f36 h1:dytZPggag6auyzmbhpIDmkHu7KrflIBEhLLec4/xFIk=
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250127125541-a8fa42cc0f36/go.mod h1:Z2e1ynSJ4pg83b4Qldbmryc5lmnrI3ojOdg1FUloa68=
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250203183025-939526523893 h1:hQEEpKrWRqZ//SkA/m1G5puVHK1mYhZzturgX7VsPhk=
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250203183025-939526523893/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU=
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250205165125-271e20f6de0a h1:ZG8v7aQxyp9cOYXpW6oodL+OWgwDku544qyzXPPgs7M=
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250205165125-271e20f6de0a/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU=
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs=
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA=
github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 h1:IpGoPTXpvllN38kT2z2j13sifJMz4nbHglidvop7mfg=
Expand Down
14 changes: 7 additions & 7 deletions integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ require (
github.com/pelletier/go-toml/v2 v2.2.3
github.com/rs/zerolog v1.33.0
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250130202959-6f1f48342e36
github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250203214419-38982a7fc48b
github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250204221232-93cfb3ea152b
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.21
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250203214543-d9da97d53b9b
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250203214543-d9da97d53b9b
github.com/smartcontractkit/chainlink/v2 v2.19.0-ccip1.5.16-alpha.0.0.20250203214543-d9da97d53b9b
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250204221413-c69897a24c5d
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250204221413-c69897a24c5d
github.com/smartcontractkit/chainlink/v2 v2.19.0-ccip1.5.16-alpha.0.0.20250204221413-c69897a24c5d
github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.35.0
Expand Down Expand Up @@ -342,13 +342,13 @@ require (
github.com/slack-go/slack v0.15.0 // indirect
github.com/smartcontractkit/chain-selectors v1.0.37 // indirect
github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250203130001-13e2609047e9 // indirect
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250203132120-f0d42463e405 // indirect
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128162345-af4c8fd4481a // indirect
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20250130125138-3df261e09ddc // indirect
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5 // indirect
github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250203160922-fbdf168bb92a // indirect
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250203183025-939526523893 // indirect
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250204211601-c6bfa53cfb1c // indirect
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250205165125-271e20f6de0a // indirect
github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect
github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20250117224137-afdcdd75070d // indirect
Expand Down
24 changes: 12 additions & 12 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1227,8 +1227,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-20250203130001-13e2609047e9 h1:+/KEPuWctPObgOoEEBCnli1/H3XnjMdCY3Tn+J32XRM=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250203130001-13e2609047e9/go.mod h1:UEnHaxkUsfreeA7rR45LMmua1Uen95tOFUR8/AI9BAo=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250203132120-f0d42463e405 h1:5QyaPGLmt+rlnvQL7drAE23Wq9rX5hO35kTZirAb97A=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250203132120-f0d42463e405/go.mod h1:UEnHaxkUsfreeA7rR45LMmua1Uen95tOFUR8/AI9BAo=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128162345-af4c8fd4481a h1:1MrD2OiP/CRfyBSwTQE66R1+gLWBgWcU/SYl/+DmZ/Y=
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250128162345-af4c8fd4481a/go.mod h1:Bmwq4lNb5tE47sydN0TKetcLEGbgl+VxHEWp4S0LI60=
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250130202959-6f1f48342e36 h1:bS51NFGHVjkCy7yu9L2Ss4sBsCW6jpa5GuhRAdWWxzM=
Expand All @@ -1239,10 +1239,10 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8=
github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c=
github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4=
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250203160922-fbdf168bb92a h1:fVtn9CDfoGF40FeqGwLvp9belfIw7VT3lgQTctFGP5E=
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250203160922-fbdf168bb92a/go.mod h1:tHem58EihQh63kR2LlAOKDAs9Vbghf1dJKZRGy6LG8g=
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250203183025-939526523893 h1:hQEEpKrWRqZ//SkA/m1G5puVHK1mYhZzturgX7VsPhk=
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250203183025-939526523893/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU=
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250204211601-c6bfa53cfb1c h1:/Bai8iDJQ8l+93i57cZGibTos4QJh6P4YKbMkRLHjBQ=
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250204211601-c6bfa53cfb1c/go.mod h1:tHem58EihQh63kR2LlAOKDAs9Vbghf1dJKZRGy6LG8g=
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250205165125-271e20f6de0a h1:ZG8v7aQxyp9cOYXpW6oodL+OWgwDku544qyzXPPgs7M=
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250205165125-271e20f6de0a/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU=
github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ=
github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo=
github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 h1:c77Gi/APraqwbBO8fbd/5JY2wW+MSIpYg8Uma9MEZFE=
Expand All @@ -1253,12 +1253,12 @@ github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.21 h1:1UYLu0QA
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.21/go.mod h1:y6pVvAT/R+YGocAqoQIat+AEaZz2Jdmj/0uUBmwvLCU=
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10 h1:Yf+n3T/fnUWcYyfe7bsygV4sWAkNo0QhN58APJFIKIc=
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.10/go.mod h1:05duR85P8YHuIfIkA7sn2bvrhKo/pDpFKV2rliYHNOo=
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250203214543-d9da97d53b9b h1:CJbV0ra65AiR5K1GZpbXHyDcPtDP5j82U6RY1pDWpPg=
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250203214543-d9da97d53b9b/go.mod h1:/9iouaqMDOAyPkHKFiYzzPL/5516U7mjp/t14XiN59I=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250203214543-d9da97d53b9b h1:x3mtyzJAGovCmjawrmTHW4XHvchFjOXJtrL15OujeM0=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250203214543-d9da97d53b9b/go.mod h1:e/GI2DNI54CKvpTY6Wqq8fcpZ3xYztWv+ihG5CF1XUc=
github.com/smartcontractkit/chainlink/v2 v2.19.0-ccip1.5.16-alpha.0.0.20250203214543-d9da97d53b9b h1:fWFIcI6tzCzF3j2FBcbOGv3E7rfX0URmxI2zO3tFuXA=
github.com/smartcontractkit/chainlink/v2 v2.19.0-ccip1.5.16-alpha.0.0.20250203214543-d9da97d53b9b/go.mod h1:huBdm7XEfj6DniyGxYLxV7g41McNvkyUhPRQIO/yXko=
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250204221413-c69897a24c5d h1:zekv9FnVSvP6GR/sgjQplPM18mPck4yQGbILWmVfkwM=
github.com/smartcontractkit/chainlink/deployment v0.0.0-20250204221413-c69897a24c5d/go.mod h1:gmWQ4kQvNftID+6cPFwtWz+6OvEzK8IU+6FWWDuJ4NE=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250204221413-c69897a24c5d h1:Wccwi7MYscyorqG9fm5Dq7hdrEJAk6oOmD3VlW3WUeM=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20250204221413-c69897a24c5d/go.mod h1:pmyE+ZZRMQITcQ0lf1ZfKNSuqVh8dMrf0xSiHVPHFlw=
github.com/smartcontractkit/chainlink/v2 v2.19.0-ccip1.5.16-alpha.0.0.20250204221413-c69897a24c5d h1:amubfj+/h+BTJBkyQA+pREL8CbfVKHtBvRivrjYVScQ=
github.com/smartcontractkit/chainlink/v2 v2.19.0-ccip1.5.16-alpha.0.0.20250204221413-c69897a24c5d/go.mod h1:Jpn6AiX4YGRO8u9RT4/T0u/6i0oVB5QuOnU5OQG4UYQ=
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs=
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA=
github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 h1:IpGoPTXpvllN38kT2z2j13sifJMz4nbHglidvop7mfg=
Expand Down
7 changes: 3 additions & 4 deletions integration-tests/relayinterface/chain_components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives"
"github.com/smartcontractkit/chainlink-common/pkg/utils/tests"

contract "github.com/smartcontractkit/chainlink-solana/contracts/generated/contract_reader_interface"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/codec"

contract "github.com/smartcontractkit/chainlink-solana/contracts/generated/contract_reader_interface"
"github.com/smartcontractkit/chainlink-solana/integration-tests/solclient"
"github.com/smartcontractkit/chainlink-solana/integration-tests/utils"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/chainreader"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
solanautils "github.com/smartcontractkit/chainlink-solana/pkg/solana/utils"
)

func TestChainComponents(t *testing.T) {
Expand Down Expand Up @@ -242,13 +241,13 @@ func (h *helper) Init(t *testing.T) {
privateKey, err := solana.PrivateKeyFromBase58(solclient.DefaultPrivateKeysSolValidator[1])
require.NoError(t, err)

h.rpcURL, h.wsURL = solanautils.SetupTestValidatorWithAnchorPrograms(t, privateKey.PublicKey().String(), []string{"contract-reader-interface"})
h.rpcURL, h.wsURL = utils.SetupTestValidatorWithAnchorPrograms(t, privateKey.PublicKey().String(), []string{"contract-reader-interface"})
h.wsClient, err = ws.Connect(tests.Context(t), h.wsURL)
h.rpcClient = rpc.New(h.rpcURL)

require.NoError(t, err)

solanautils.FundAccounts(t, []solana.PrivateKey{privateKey}, h.rpcClient)
utils.FundAccounts(t, []solana.PrivateKey{privateKey}, h.rpcClient)

pubkey, err := solana.PublicKeyFromBase58(programPubKey)
require.NoError(t, err)
Expand Down
15 changes: 8 additions & 7 deletions integration-tests/relayinterface/lookups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ import (
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-common/pkg/logger"
commonutils "github.com/smartcontractkit/chainlink-common/pkg/utils"
"github.com/smartcontractkit/chainlink-common/pkg/utils/tests"

"github.com/smartcontractkit/chainlink-solana/integration-tests/utils"

"github.com/smartcontractkit/chainlink-solana/pkg/solana/chainwriter"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/client"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/txm"
keyMocks "github.com/smartcontractkit/chainlink-solana/pkg/solana/txm/mocks"
"github.com/smartcontractkit/chainlink-solana/pkg/solana/utils"
solanautils "github.com/smartcontractkit/chainlink-solana/pkg/solana/utils"
)

type InnerAccountArgs struct {
Expand Down Expand Up @@ -475,7 +476,7 @@ func TestLookupTables(t *testing.T) {
solanaClient, err := client.NewClient(url, cfg, 5*time.Second, nil)
require.NoError(t, err)

loader := commonutils.NewLazyLoad(func() (client.ReaderWriter, error) { return solanaClient, nil })
loader := solanautils.NewStaticLoader[client.ReaderWriter](solanaClient)
mkey := keyMocks.NewSimpleKeystore(t)
lggr := logger.Test(t)

Expand All @@ -485,7 +486,7 @@ func TestLookupTables(t *testing.T) {

t.Run("StaticLookup table resolves properly", func(t *testing.T) {
pubKeys := chainwriter.CreateTestPubKeys(t, 8)
table := chainwriter.CreateTestLookupTable(ctx, t, rpcClient, sender, pubKeys)
table := utils.CreateTestLookupTable(ctx, t, rpcClient, sender, pubKeys)
lookupConfig := chainwriter.LookupTables{
DerivedLookupTables: nil,
StaticLookupTables: []solana.PublicKey{table},
Expand All @@ -496,7 +497,7 @@ func TestLookupTables(t *testing.T) {
})
t.Run("Derived lookup table resolves properly with constant address", func(t *testing.T) {
pubKeys := chainwriter.CreateTestPubKeys(t, 8)
table := chainwriter.CreateTestLookupTable(ctx, t, rpcClient, sender, pubKeys)
table := utils.CreateTestLookupTable(ctx, t, rpcClient, sender, pubKeys)
lookupConfig := chainwriter.LookupTables{
DerivedLookupTables: []chainwriter.DerivedLookupTable{
{
Expand Down Expand Up @@ -559,7 +560,7 @@ func TestLookupTables(t *testing.T) {

t.Run("Derived lookup table resolves properly with account lookup address", func(t *testing.T) {
pubKeys := chainwriter.CreateTestPubKeys(t, 8)
table := chainwriter.CreateTestLookupTable(ctx, t, rpcClient, sender, pubKeys)
table := utils.CreateTestLookupTable(ctx, t, rpcClient, sender, pubKeys)
lookupConfig := chainwriter.LookupTables{
DerivedLookupTables: []chainwriter.DerivedLookupTable{
{
Expand Down Expand Up @@ -595,7 +596,7 @@ func TestLookupTables(t *testing.T) {
programID := solana.MustPublicKeyFromBase58("6AfuXF6HapDUhQfE4nQG9C1SGtA1YjP3icaJyRfU4RyE")

lookupKeys := chainwriter.CreateTestPubKeys(t, 5)
lookupTable := chainwriter.CreateTestLookupTable(ctx, t, rpcClient, sender, lookupKeys)
lookupTable := utils.CreateTestLookupTable(ctx, t, rpcClient, sender, lookupKeys)

chainwriter.InitializeDataAccount(ctx, t, rpcClient, programID, sender, lookupTable)

Expand Down
Loading

0 comments on commit c3ca047

Please sign in to comment.