diff --git a/.github/integration-in-memory-tests.yml b/.github/integration-in-memory-tests.yml index 135765c6de6..0a8a436b110 100644 --- a/.github/integration-in-memory-tests.yml +++ b/.github/integration-in-memory-tests.yml @@ -54,22 +54,6 @@ runner-test-matrix: -- -v -run "Test_CCIPMessaging_EVM2EVM" -timeout 18m -count=1 -parallel=4 ./smoke/ccip test_go_project_path: integration-tests - - id: smoke/ccip/ccip_messaging_test.go:Test_CCIPMessaging_EVM2Solana - path: integration-tests/smoke/ccip/ccip_messaging_test.go - test_env_type: in-memory - runs_on: ubuntu-latest - runs_on_self_hosted: runs-on/cpu=8/ram=32/family=m6i+m5.*/spot=false/image=ubuntu24-full-x64/extras=s3-cache+tmpfs - triggers: - - PR Integration CCIP Tests - - Nightly Integration CCIP Tests - test_cmd: | - gotestsum \ - --junitfile=/tmp/junit.xml \ - --jsonfile=/tmp/gotest.log \ - --format=github-actions \ - -- -v -run "Test_CCIPMessaging_EVM2Solana" -timeout 18m -count=1 -parallel=4 ./smoke/ccip - test_go_project_path: integration-tests - - id: smoke/ccip/ccip_messaging_test.go:Test_CCIPMessaging_EVM2Solana_LOOPP path: integration-tests/smoke/ccip/ccip_messaging_test.go test_env_type: in-memory @@ -86,24 +70,6 @@ runner-test-matrix: -- -v -run "Test_CCIPMessaging_EVM2Solana" -timeout 18m -count=1 -parallel=4 ./smoke/ccip test_go_project_path: integration-tests install_plugins_public: true - test_env_vars: - CL_SOLANA_CMD: chainlink-solana - - - id: smoke/ccip/ccip_messaging_test.go:Test_CCIPMessaging_Solana2EVM - path: integration-tests/smoke/ccip/ccip_messaging_test.go - test_env_type: in-memory - runs_on: ubuntu-latest - runs_on_self_hosted: runs-on/cpu=8/ram=32/family=m6i+m5.*/spot=false/image=ubuntu24-full-x64/extras=s3-cache+tmpfs - triggers: - - PR Integration CCIP Tests - - Nightly Integration CCIP Tests - test_cmd: | - gotestsum \ - --junitfile=/tmp/junit.xml \ - --jsonfile=/tmp/gotest.log \ - --format=github-actions \ - -- -v -run "Test_CCIPMessaging_Solana2EVM" -timeout 18m -count=1 -parallel=4 ./smoke/ccip - test_go_project_path: integration-tests - id: smoke/ccip/ccip_messaging_test.go:Test_CCIPMessaging_Solana2EVM_LOOPP path: integration-tests/smoke/ccip/ccip_messaging_test.go @@ -121,8 +87,6 @@ runner-test-matrix: -- -v -run "Test_CCIPMessaging_Solana2EVM" -timeout 18m -count=1 -parallel=4 ./smoke/ccip test_go_project_path: integration-tests install_plugins_public: true - test_env_vars: - CL_SOLANA_CMD: chainlink-solana - id: smoke/ccip/ccip_messaging_test.go:Test_CCIPMessaging_Revert_EVM2Solana_LOOPP path: integration-tests/smoke/ccip/ccip_messaging_test.go @@ -140,8 +104,6 @@ runner-test-matrix: -- -v -run "Test_CCIPMessaging_Revert_EVM2Solana" -timeout 18m -count=1 -parallel=4 ./smoke/ccip test_go_project_path: integration-tests install_plugins_public: true - test_env_vars: - CL_SOLANA_CMD: chainlink-solana - id: smoke/ccip/ccip_messaging_test.go:Test_CCIPMessaging_MultiExecReports_EVM2Solana path: integration-tests/smoke/ccip/ccip_messaging_test.go @@ -399,6 +361,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run ".*" -timeout 16m -count=1 -parallel=2 smoke/ccip/ccip_token_transfer_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_token_transfer_test.go:*_LOOPP path: integration-tests/smoke/ccip/ccip_token_transfer_test.go @@ -416,8 +379,6 @@ runner-test-matrix: -- -v -run ".*" -timeout 16m -count=1 -parallel=2 smoke/ccip/ccip_token_transfer_test.go test_go_project_path: integration-tests install_plugins_public: true - test_env_vars: - CL_SOLANA_CMD: chainlink-solana - id: smoke/ccip/ccip_cs_update_rmn_config_test.go:* path: integration-tests/smoke/ccip/ccip_cs_update_rmn_config_test.go @@ -449,6 +410,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNCurse$" -timeout 20m -count=1 -parallel=4 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNCurseUncurseAptos path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -482,6 +444,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNCurseMCMS$" -timeout 20m -count=1 -parallel=4 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNCurseBypass path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -498,6 +461,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNCurseBypass$" -timeout 20m -count=1 -parallel=4 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNCurseIdempotent path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -513,6 +477,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNCurseIdempotent$" -timeout 20m -count=1 -parallel=4 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNUncurseIdempotent path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -528,6 +493,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNUncurseIdempotent$" -timeout 20m -count=1 -parallel=4 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNUncurse path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -544,6 +510,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNUncurse$" -timeout 20m -count=1 -parallel=4 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNUncurseMCMS path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -560,6 +527,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNUncurseMCMS$" -timeout 20m -count=1 -parallel=4 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNUncurseBypass path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -576,6 +544,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNUncurseBypass$" -timeout 20m -count=1 -parallel=4 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNCurseConfigValidate path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -592,6 +561,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNCurseConfigValidate$" -timeout 20m -count=1 -parallel=2 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNCurseNoConnectedLanes path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -607,6 +577,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNCurseNoConnectedLanes$" -timeout 20m -count=1 -parallel=1 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNCurseOneConnectedLanes path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -622,6 +593,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNCurseOneConnectedLanes$" -timeout 20m -count=1 -parallel=1 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNCurseOneConnectedLanesSolana path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -637,6 +609,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNCurseOneConnectedLanesSolana$" -timeout 20m -count=1 -parallel=1 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNCurseOneConnectedLanesGlobalOnly path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -652,6 +625,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNCurseOneConnectedLanesGlobalOnly$" -timeout 20m -count=1 -parallel=1 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNCurseOneConnectedLanesLaneOnlyOnSource path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -667,6 +641,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNCurseOneConnectedLanesLaneOnlyOnSource$" -timeout 20m -count=1 -parallel=1 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNUncurseForceOption path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -683,6 +658,7 @@ runner-test-matrix: --format=github-actions \ -- -v -run "^TestRMNUncurseForceOption$" -timeout 20m -count=1 -parallel=4 smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go test_go_project_path: integration-tests + install_plugins_public: true - id: smoke/ccip/ccip_disable_lane_test.go:* path: integration-tests/smoke/ccip/ccip_disable_lane_test.go diff --git a/core/capabilities/ccip/ccipsolana/pluginconfig.go b/core/capabilities/ccip/ccipsolana/pluginconfig.go index ca70b3774b9..919ffe9d6e3 100644 --- a/core/capabilities/ccip/ccipsolana/pluginconfig.go +++ b/core/capabilities/ccip/ccipsolana/pluginconfig.go @@ -6,8 +6,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/types/ccip/consts" "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" - "github.com/smartcontractkit/chainlink/v2/core/config/env" - ccipcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ocrimpls" ) @@ -26,7 +24,7 @@ func InitializePluginConfig(lggr logger.Logger, extraDataCodec ccipocr3.ExtraDat ChainRW: ChainRWProvider{}, ExtraDataCodec: ExtraDataDecoder{}, PriceOnlyCommitFn: consts.MethodCommitPriceOnly, - CCIPProviderSupported: env.SolanaPlugin.Cmd.Get() != "", + CCIPProviderSupported: true, } } diff --git a/core/cmd/blocks_commands_integration_test.go b/core/cmd/blocks_commands_integration_test.go new file mode 100644 index 00000000000..ebe246d2d6b --- /dev/null +++ b/core/cmd/blocks_commands_integration_test.go @@ -0,0 +1,37 @@ +//go:build integration + +package cmd_test + +import ( + "flag" + "testing" + + "github.com/stretchr/testify/require" + "github.com/urfave/cli" + + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" +) + +func Test_ReplayFromBlock_Solana(t *testing.T) { + t.Parallel() + + chain := chainlink.RawConfig{ + "ChainID": "devnet", + "Enabled": true, + "Nodes": []map[string]any{{ + "Name": "primary", + "URL": "http://solana.example", + }}, + } + app := solanaStartNewApplication(t, chain) + client, _ := app.NewShellAndRenderer() + + set := flag.NewFlagSet("test", 0) + flagSetApplyFromAction(client.ReplayFromBlock, set, "") + + require.NoError(t, set.Set("block-number", "1")) + require.NoError(t, set.Set("chain-id", "devnet")) + require.NoError(t, set.Set("family", "solana")) + c := cli.NewContext(nil, set, nil) + require.NoError(t, client.ReplayFromBlock(c)) +} diff --git a/core/cmd/blocks_commands_test.go b/core/cmd/blocks_commands_test.go index a510df01054..da50bc03060 100644 --- a/core/cmd/blocks_commands_test.go +++ b/core/cmd/blocks_commands_test.go @@ -9,7 +9,6 @@ import ( "github.com/urfave/cli" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) @@ -19,13 +18,6 @@ func Test_ReplayFromBlock(t *testing.T) { app := startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { c.EVM[0].ChainID = (*sqlutil.Big)(big.NewInt(5)) c.EVM[0].Enabled = ptr(true) - - solCfg := &config.TOMLConfig{ - ChainID: ptr("devnet"), - Enabled: ptr(true), - } - solCfg.SetDefaults() - c.Solana = config.TOMLConfigs{solCfg} }) client, _ := app.NewShellAndRenderer() @@ -59,14 +51,6 @@ func Test_ReplayFromBlock(t *testing.T) { c := cli.NewContext(nil, set, nil) require.NoError(t, client.ReplayFromBlock(c)) }) - - t.Run("solana replay", func(t *testing.T) { - require.NoError(t, set.Set("block-number", "1")) - require.NoError(t, set.Set("chain-id", "devnet")) - require.NoError(t, set.Set("family", "solana")) - c := cli.NewContext(nil, set, nil) - require.NoError(t, client.ReplayFromBlock(c)) - }) } func Test_FindLCA(t *testing.T) { diff --git a/core/cmd/chains_commands_integration_test.go b/core/cmd/chains_commands_integration_test.go index 8427f483b3e..c173b28e9b6 100644 --- a/core/cmd/chains_commands_integration_test.go +++ b/core/cmd/chains_commands_integration_test.go @@ -11,6 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/cosmostest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/solanatest" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) @@ -35,3 +36,26 @@ func TestShell_IndexCosmosChains(t *testing.T) { assert.Equal(t, chainID, c.ID) assertTableRenders(t, r) } + +func TestShell_IndexSolanaChains(t *testing.T) { + t.Parallel() + + id := solanatest.RandomChainID() + chain := chainlink.RawConfig{ + "ChainID": id, + "Enabled": true, + "Nodes": []map[string]any{{ + "Name": "primary", + "URL": "http://solana.example", + }}, + } + app := solanaStartNewApplication(t, chain) + client, r := app.NewShellAndRenderer() + + require.NoError(t, cmd.NewChainClient(client, "solana").IndexChains(cltest.EmptyCLIContext())) + chains := *r.Renders[0].(*cmd.ChainPresenters) + require.Len(t, chains, 1) + c := chains[0] + assert.Equal(t, id, c.ID) + assertTableRenders(t, r) +} diff --git a/core/cmd/chains_commands_test.go b/core/cmd/chains_commands_test.go index c509cf7f5eb..645b0d4551e 100644 --- a/core/cmd/chains_commands_test.go +++ b/core/cmd/chains_commands_test.go @@ -7,14 +7,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" - "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" client2 "github.com/smartcontractkit/chainlink-evm/pkg/client" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/solanatest" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) @@ -39,22 +36,3 @@ func TestShell_IndexEVMChains(t *testing.T) { assert.Equal(t, strconv.Itoa(client2.NullClientChainID), c.ID) assertTableRenders(t, r) } - -func TestShell_IndexSolanaChains(t *testing.T) { - t.Parallel() - - id := solanatest.RandomChainID() - cfg := solcfg.TOMLConfig{ - ChainID: &id, - Enabled: ptr(true), - } - app := solanaStartNewApplication(t, &cfg) - client, r := app.NewShellAndRenderer() - - require.NoError(t, cmd.NewChainClient(client, "solana").IndexChains(cltest.EmptyCLIContext())) - chains := *r.Renders[0].(*cmd.ChainPresenters) - require.Len(t, chains, 1) - c := chains[0] - assert.Equal(t, id, c.ID) - assertTableRenders(t, r) -} diff --git a/core/cmd/node_commands_integration_test.go b/core/cmd/node_commands_integration_test.go index 5e81319ae54..6ac3c3e60c6 100644 --- a/core/cmd/node_commands_integration_test.go +++ b/core/cmd/node_commands_integration_test.go @@ -12,9 +12,11 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/cosmostest" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/solanatest" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) @@ -25,6 +27,13 @@ func cosmosStartNewApplication(t *testing.T, cfgs ...chainlink.RawConfig) *cltes }) } +func solanaStartNewApplication(t *testing.T, cfgs ...chainlink.RawConfig) *cltest.TestApplication { + return startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { + c.Solana = cfgs + c.EVM = nil + }) +} + func TestShell_IndexCosmosNodes(t *testing.T) { t.Parallel() @@ -132,3 +141,60 @@ func TestShell_IndexStarkNetNodes(t *testing.T) { assert.Contains(t, renderLines[11], "State") assert.Contains(t, renderLines[11], n2.State) } + +func TestShell_IndexSolanaNodes(t *testing.T) { + t.Parallel() + + id := solanatest.RandomChainID() + node1 := map[string]any{ + "Name": ptr("first"), + "URL": config.MustParseURL("https://solana1.example"), + "SendOnly": false, + } + node2 := map[string]any{ + "Name": ptr("second"), + "URL": config.MustParseURL("https://solana2.example"), + "SendOnly": false, + } + chain := chainlink.RawConfig{ + "ChainID": id, + "Nodes": []any{node1, node2}, + } + app := solanaStartNewApplication(t, chain) + client, r := app.NewShellAndRenderer() + + require.NoError(t, cmd.NewNodeClient(client, "solana").IndexNodes(cltest.EmptyCLIContext())) + require.NotEmpty(t, r.Renders) + nodes := *r.Renders[0].(*cmd.NodePresenters) + require.Len(t, nodes, 2) + n1 := nodes[0] + n2 := nodes[1] + assert.Equal(t, id, n1.ChainID) + assert.Equal(t, cltest.FormatWithPrefixedChainID(id, "first"), n1.ID) + assert.Equal(t, "first", n1.Name) + assert.Equal(t, "Name = 'first'\nURL = 'https://solana1.example'\nSendOnly = false\n", n1.Config) + assert.Equal(t, id, n2.ChainID) + assert.Equal(t, cltest.FormatWithPrefixedChainID(id, "second"), n2.ID) + assert.Equal(t, "second", n2.Name) + assert.Equal(t, "Name = 'second'\nURL = 'https://solana2.example'\nSendOnly = false\n", n2.Config) + assertTableRenders(t, r) + + // Render table and check the fields order + b := new(bytes.Buffer) + rt := cmd.RendererTable{b} + require.NoError(t, nodes.RenderTable(rt)) + renderLines := strings.Split(b.String(), "\n") + assert.Len(t, renderLines, 19) + assert.Contains(t, renderLines[2], "Name") + assert.Contains(t, renderLines[2], n1.Name) + assert.Contains(t, renderLines[3], "Chain ID") + assert.Contains(t, renderLines[3], n1.ChainID) + assert.Contains(t, renderLines[4], "State") + assert.Contains(t, renderLines[4], n1.State) + assert.Contains(t, renderLines[10], "Name") + assert.Contains(t, renderLines[10], n2.Name) + assert.Contains(t, renderLines[11], "Chain ID") + assert.Contains(t, renderLines[11], n2.ChainID) + assert.Contains(t, renderLines[12], "State") + assert.Contains(t, renderLines[12], n2.State) +} diff --git a/core/cmd/node_commands_test.go b/core/cmd/node_commands_test.go index 53021b33216..3841d8ddece 100644 --- a/core/cmd/node_commands_test.go +++ b/core/cmd/node_commands_test.go @@ -10,12 +10,10 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-common/pkg/config" - solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" configtoml "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/solanatest" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" ) @@ -96,71 +94,3 @@ func TestShell_IndexEVMNodes(t *testing.T) { assert.Contains(t, renderLines[14], n2.State) } -func solanaStartNewApplication(t *testing.T, cfgs ...*solcfg.TOMLConfig) *cltest.TestApplication { - for i := range cfgs { - cfgs[i].SetDefaults() - } - return startNewApplicationV2(t, func(c *chainlink.Config, s *chainlink.Secrets) { - c.Solana = cfgs - c.EVM = nil - }) -} - -func TestShell_IndexSolanaNodes(t *testing.T) { - t.Parallel() - - id := solanatest.RandomChainID() - node1 := solcfg.Node{ - Name: ptr("first"), - URL: config.MustParseURL("https://solana1.example"), - } - node2 := solcfg.Node{ - Name: ptr("second"), - URL: config.MustParseURL("https://solana2.example"), - } - chain := solcfg.TOMLConfig{ - ChainID: &id, - Nodes: solcfg.Nodes{&node1, &node2}, - } - app := solanaStartNewApplication(t, &chain) - client, r := app.NewShellAndRenderer() - - require.NoError(t, cmd.NewNodeClient(client, "solana").IndexNodes(cltest.EmptyCLIContext())) - require.NotEmpty(t, r.Renders) - nodes := *r.Renders[0].(*cmd.NodePresenters) - require.Len(t, nodes, 2) - n1 := nodes[0] - n2 := nodes[1] - assert.Equal(t, id, n1.ChainID) - assert.Equal(t, cltest.FormatWithPrefixedChainID(id, *node1.Name), n1.ID) - assert.Equal(t, *node1.Name, n1.Name) - wantConfig, err := toml.Marshal(node1) - require.NoError(t, err) - assert.Equal(t, string(wantConfig), n1.Config) - assert.Equal(t, id, n2.ChainID) - assert.Equal(t, cltest.FormatWithPrefixedChainID(id, *node2.Name), n2.ID) - assert.Equal(t, *node2.Name, n2.Name) - wantConfig2, err := toml.Marshal(node2) - require.NoError(t, err) - assert.Equal(t, string(wantConfig2), n2.Config) - assertTableRenders(t, r) - - // Render table and check the fields order - b := new(bytes.Buffer) - rt := cmd.RendererTable{b} - require.NoError(t, nodes.RenderTable(rt)) - renderLines := strings.Split(b.String(), "\n") - assert.Len(t, renderLines, 19) - assert.Contains(t, renderLines[2], "Name") - assert.Contains(t, renderLines[2], n1.Name) - assert.Contains(t, renderLines[3], "Chain ID") - assert.Contains(t, renderLines[3], n1.ChainID) - assert.Contains(t, renderLines[4], "State") - assert.Contains(t, renderLines[4], n1.State) - assert.Contains(t, renderLines[10], "Name") - assert.Contains(t, renderLines[10], n2.Name) - assert.Contains(t, renderLines[11], "Chain ID") - assert.Contains(t, renderLines[11], n2.ChainID) - assert.Contains(t, renderLines[12], "State") - assert.Contains(t, renderLines[12], n2.State) -} diff --git a/core/cmd/shell_remote_test.go b/core/cmd/shell_remote_test.go index 4c110cced8d..319dcbe0c47 100644 --- a/core/cmd/shell_remote_test.go +++ b/core/cmd/shell_remote_test.go @@ -24,7 +24,7 @@ import ( commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-evm/pkg/client/clienttest" - "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" + "github.com/smartcontractkit/chainlink/v2/core/auth" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/cmd" @@ -122,13 +122,6 @@ func TestShell_ReplayBlocks(t *testing.T) { c.EVM[0].NonceAutoSync = ptr(false) c.EVM[0].BalanceMonitor.Enabled = ptr(false) c.EVM[0].GasEstimator.Mode = ptr("FixedPrice") - - solCfg := &config.TOMLConfig{ - ChainID: ptr("devnet"), - Enabled: ptr(true), - } - solCfg.SetDefaults() - c.Solana = config.TOMLConfigs{solCfg} }) client, _ := app.NewShellAndRenderer() @@ -144,10 +137,6 @@ func TestShell_ReplayBlocks(t *testing.T) { require.NoError(t, set.Set("chain-id", testutils.FixtureChainID.String())) c = cli.NewContext(nil, set, nil) assert.NoError(t, client.ReplayFromBlock(c)) - - require.NoError(t, set.Set("chain-id", "devnet")) - require.NoError(t, set.Set("family", "solana")) - assert.NoError(t, client.ReplayFromBlock(c)) } func TestShell_CreateExternalInitiator(t *testing.T) { diff --git a/core/cmd/shell_test.go b/core/cmd/shell_test.go index c5a72a93a1d..905b57501b4 100644 --- a/core/cmd/shell_test.go +++ b/core/cmd/shell_test.go @@ -20,9 +20,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/beholder/beholdertest" commoncfg "github.com/smartcontractkit/chainlink-common/pkg/config" - "github.com/smartcontractkit/chainlink-common/pkg/sqlutil/sqltest" commonevents "github.com/smartcontractkit/chainlink-protos/workflows/go/common" - solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" @@ -358,45 +356,36 @@ func TestNewUserCache(t *testing.T) { func TestSetupSolanaRelayer(t *testing.T) { lggr := logger.TestLogger(t) reg := plugins.NewTestLoopRegistry(lggr) - ks := &keystore.StarknetLooppSigner{StarkNet: mocks.NewStarkNet(t)} + ks := &keystore.SolanaLooppSigner{Solana: mocks.NewSolana(t)} ksCSA := &keystore.CSASigner{CSA: mocks.NewCSA(t)} - ds := sqltest.NewNoOpDataSource() // config 3 chains but only enable 2 => should only be 2 relayer nEnabledChains := 2 tConfig := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { - c.Solana = solcfg.TOMLConfigs{ - &solcfg.TOMLConfig{ - ChainID: ptr[string]("solana-id-1"), - Enabled: ptr(true), - Nodes: []*solcfg.Node{}, + c.Solana = chainlink.RawConfigs{ + { + "ChainID": "solana-id-1", + "Enabled": true, }, - &solcfg.TOMLConfig{ - ChainID: ptr[string]("solana-id-2"), - Enabled: ptr(true), - Nodes: []*solcfg.Node{}, + { + "ChainID": "solana-id-2", + "Enabled": true, }, - &solcfg.TOMLConfig{ - ChainID: ptr[string]("disabled-solana-id-1"), - Enabled: ptr(false), - Nodes: []*solcfg.Node{}, + { + "ChainID": "disabled-solana-id-1", + "Enabled": false, }, } - for i := range c.Solana { - c.Solana[i].SetDefaults() - } }) t2Config := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { - c.Solana = solcfg.TOMLConfigs{ - &solcfg.TOMLConfig{ - ChainID: ptr[string]("solana-id-1"), - Enabled: ptr(true), - Nodes: []*solcfg.Node{}, + c.Solana = chainlink.RawConfigs{ + { + "ChainID": "solana-id-1", + "Enabled": true, }, } - c.Solana[0].SetDefaults() }) rf := chainlink.RelayerFactory{ @@ -404,24 +393,10 @@ func TestSetupSolanaRelayer(t *testing.T) { LoopRegistry: reg, } - cfg := chainlink.SolanaFactoryConfig{ - TOMLConfigs: tConfig.SolanaConfigs(), - DS: ds} - - // not parallel; shared state - t.Run("no plugin", func(t *testing.T) { - relayers, err := rf.NewSolana(ks, ksCSA, cfg) - require.NoError(t, err) - require.NotNil(t, relayers) - require.Len(t, relayers, nEnabledChains) - // no using plugin, so registry should be empty - require.Empty(t, reg.List()) - }) - t.Run("plugin", func(t *testing.T) { t.Setenv("CL_SOLANA_CMD", "phony_solana_cmd") - relayers, err := rf.NewSolana(ks, ksCSA, cfg) + relayers, err := rf.NewSolana(ks, ksCSA, tConfig.SolanaConfigs()) require.NoError(t, err) require.NotNil(t, relayers) require.Len(t, relayers, nEnabledChains) @@ -431,34 +406,21 @@ func TestSetupSolanaRelayer(t *testing.T) { // test that duplicate enabled chains is an error when duplicateConfig := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { - c.Solana = solcfg.TOMLConfigs{ - &solcfg.TOMLConfig{ - ChainID: ptr[string]("dupe"), - Enabled: ptr(true), + c.Solana = chainlink.RawConfigs{ + { + "ChainID": "dupe", + "Enabled": true, }, - &solcfg.TOMLConfig{ - ChainID: ptr[string]("dupe"), - Enabled: ptr(true), + { + "ChainID": "dupe", + "Enabled": true, }, } - for i := range c.Solana { - c.Solana[i].SetDefaults() - } - }) - dupCfg := chainlink.SolanaFactoryConfig{ - TOMLConfigs: duplicateConfig.SolanaConfigs(), - DS: ds, - } - - // not parallel; shared state - t.Run("no plugin, duplicate chains", func(t *testing.T) { - _, err := rf.NewSolana(ks, ksCSA, dupCfg) - require.Error(t, err) }) t.Run("plugin, duplicate chains", func(t *testing.T) { t.Setenv("CL_SOLANA_CMD", "phony_solana_cmd") - _, err := rf.NewSolana(ks, ksCSA, dupCfg) + _, err := rf.NewSolana(ks, ksCSA, duplicateConfig.SolanaConfigs()) require.Error(t, err) }) @@ -466,20 +428,17 @@ func TestSetupSolanaRelayer(t *testing.T) { t.Setenv("CL_SOLANA_CMD", "phony_solana_cmd") t.Setenv("CL_SOLANA_ENV", "fake_path") - _, err := rf.NewSolana(ks, ksCSA, chainlink.SolanaFactoryConfig{ - TOMLConfigs: t2Config.SolanaConfigs(), - DS: ds, - }) + _, err := rf.NewSolana(ks, ksCSA, t2Config.SolanaConfigs()) require.Error(t, err) - require.Contains(t, err.Error(), "failed to parse Solana env file") + require.Contains(t, err.Error(), "failed to parse env file") }) t.Run("plugin already registered", func(t *testing.T) { t.Setenv("CL_SOLANA_CMD", "phony_solana_cmd") - _, err := rf.NewSolana(ks, ksCSA, cfg) + _, err := rf.NewSolana(ks, ksCSA, tConfig.SolanaConfigs()) require.Error(t, err) - require.Contains(t, err.Error(), "failed to create Solana LOOP command") + require.Contains(t, err.Error(), "failed to create LOOP command") }) } diff --git a/core/cmd/solana_transaction_commands_test.go b/core/cmd/solana_transaction_commands_test.go index b7623840095..7d4031d7d2a 100644 --- a/core/cmd/solana_transaction_commands_test.go +++ b/core/cmd/solana_transaction_commands_test.go @@ -15,10 +15,9 @@ import ( "github.com/stretchr/testify/require" "github.com/urfave/cli" - "github.com/smartcontractkit/chainlink-common/pkg/config" - solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" solanatesting "github.com/smartcontractkit/chainlink-solana/pkg/solana/testing" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" + "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/cmd" ) @@ -28,16 +27,14 @@ func TestShell_SolanaSendSol(t *testing.T) { ctx := testutils.Context(t) chainID := "localnet" url := solanatesting.SetupLocalSolNode(t) - node := solcfg.Node{ - Name: ptr(t.Name()), - URL: config.MustParseURL(url), + chain := chainlink.RawConfig{ + "ChainID": chainID, + "Enabled": true, + "Nodes": []any{ + map[string]any{"Name": t.Name(), "URL": url}, + }, } - cfg := solcfg.TOMLConfig{ - ChainID: &chainID, - Nodes: solcfg.Nodes{&node}, - Enabled: ptr(true), - } - app := solanaStartNewApplication(t, &cfg) + app := solanaStartNewApplication(t, chain) from, err := app.GetKeyStore().Solana().Create(ctx) require.NoError(t, err) to, err := solanago.NewRandomPrivateKey() diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 1ae7f077d05..e15cb58e8df 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -514,7 +514,7 @@ require ( github.com/smartcontractkit/chainlink-protos/storage-service v0.3.0 // indirect github.com/smartcontractkit/chainlink-protos/svr v1.2.0 // indirect github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf // indirect github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-20260421131224-c46cbfe7bc6c // indirect github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556 // indirect github.com/smartcontractkit/chainlink-sui/deployment v0.0.0-20260427132612-76b9f754a556 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index fb6dd1c6779..9c94c5b0db0 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1713,8 +1713,8 @@ github.com/smartcontractkit/chainlink-protos/svr v1.2.0 h1:7jjgqRgORQS/ikL3z0ZgJ github.com/smartcontractkit/chainlink-protos/svr v1.2.0/go.mod h1:TcOliTQU6r59DwG4lo3U+mFM9WWyBHGuFkkxQpvSujo= github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997 h1:W0HKHO8eE8BckTRnhSdqjHKbJcnk068nEWYnWRu6tJY= github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997/go.mod h1:GTpDgyK0OObf7jpch6p8N281KxN92wbB8serZhU9yRc= -github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932 h1:aD5KjYqbHiL6OJl3f8tsopVkkAG68UsRJCKjDIACO6w= -github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932/go.mod h1:sUsEwLtVPBlz0wPcysaolS+HVj9cOAt4jYhwE6J8dXg= +github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf h1:GyBD65Cc4HuwRKZ6k4UCtFaG7njGTnZyR+z3VPm3Vyo= +github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf/go.mod h1:sUsEwLtVPBlz0wPcysaolS+HVj9cOAt4jYhwE6J8dXg= github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-20260421131224-c46cbfe7bc6c h1:Hn/80PyYFrQhRlNSaq9HY4cjc/7AuP9zyWLle22t34A= github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-20260421131224-c46cbfe7bc6c/go.mod h1:C5pZsbYX3qkhZTYWr1aYJi9QMfonFAun+Jl1npQ7UJA= github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556 h1:Nz70a+A7aNnWRYdLpGdUf8NeauMvZFOBEPfZTm8vxwI= diff --git a/core/services/chainlink/application.go b/core/services/chainlink/application.go index b9f70144d12..430d58defc8 100644 --- a/core/services/chainlink/application.go +++ b/core/services/chainlink/application.go @@ -327,11 +327,7 @@ func NewApplication(ctx context.Context, opts ApplicationOpts) (Application, err initOps = append(initOps, InitCosmos(relayerFactory, keyStore.Cosmos(), keyStore.CSA(), cfg.CosmosConfigs())) } if cfg.SolanaEnabled() { - solanaCfg := SolanaFactoryConfig{ - TOMLConfigs: cfg.SolanaConfigs(), - DS: opts.DS, - } - initOps = append(initOps, InitSolana(relayerFactory, keyStore.Solana(), keyStore.CSA(), solanaCfg)) + initOps = append(initOps, InitSolana(relayerFactory, keyStore.Solana(), keyStore.CSA(), cfg.SolanaConfigs())) } if cfg.StarkNetEnabled() { initOps = append(initOps, InitStarknet(relayerFactory, keyStore.StarkNet(), keyStore.CSA(), cfg.StarknetConfigs())) diff --git a/core/services/chainlink/config.go b/core/services/chainlink/config.go index 160beb95e30..e65da56a227 100644 --- a/core/services/chainlink/config.go +++ b/core/services/chainlink/config.go @@ -10,7 +10,6 @@ import ( gotoml "github.com/pelletier/go-toml/v2" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" - solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" configtoml "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" "github.com/smartcontractkit/chainlink/v2/core/config/docs" @@ -37,7 +36,7 @@ type Config struct { Cosmos RawConfigs `toml:",omitempty"` - Solana solcfg.TOMLConfigs `toml:",omitempty"` + Solana RawConfigs `toml:",omitempty"` Starknet RawConfigs `toml:",omitempty"` @@ -334,12 +333,7 @@ func (c *Config) setDefaults() { c.Cosmos.SetDefaults() - for i := range c.Solana { - if c.Solana[i] == nil { - c.Solana[i] = new(solcfg.TOMLConfig) - } - c.Solana[i].SetDefaults() - } + c.Solana.SetDefaults() c.Starknet.SetDefaults() @@ -361,7 +355,7 @@ func (c *Config) SetFrom(f *Config) (err error) { appendErr(c.EVM.SetFrom(&f.EVM), "EVM") appendErr(c.Cosmos.SetFrom(f.Cosmos), "Cosmos") - appendErr(c.Solana.SetFrom(&f.Solana), "Solana") + appendErr(c.Solana.SetFrom(f.Solana), "Solana") appendErr(c.Starknet.SetFrom(f.Starknet), "Starknet") appendErr(c.Aptos.SetFrom(f.Aptos), "Aptos") appendErr(c.Tron.SetFrom(f.Tron), "Tron") diff --git a/core/services/chainlink/config_general.go b/core/services/chainlink/config_general.go index ed18c6ca7a0..66f9a27294a 100644 --- a/core/services/chainlink/config_general.go +++ b/core/services/chainlink/config_general.go @@ -15,7 +15,6 @@ import ( commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" evmcfg "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" - solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" "github.com/smartcontractkit/chainlink-common/keystore/corekeys" "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" @@ -202,7 +201,7 @@ func (g *generalConfig) CosmosConfigs() RawConfigs { return g.c.Cosmos } -func (g *generalConfig) SolanaConfigs() solcfg.TOMLConfigs { +func (g *generalConfig) SolanaConfigs() RawConfigs { return g.c.Solana } diff --git a/core/services/chainlink/config_test.go b/core/services/chainlink/config_test.go index d0e668897b9..696011f6317 100644 --- a/core/services/chainlink/config_test.go +++ b/core/services/chainlink/config_test.go @@ -9,7 +9,6 @@ import ( "testing" "time" - "github.com/gagliardetto/solana-go" "github.com/kylelemons/godebug/diff" "github.com/shopspring/decimal" "github.com/stretchr/testify/assert" @@ -25,8 +24,6 @@ import ( commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/utils/hex" "github.com/smartcontractkit/chainlink-framework/multinode" - mnCfg "github.com/smartcontractkit/chainlink-framework/multinode/config" - solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" "github.com/smartcontractkit/chainlink-evm/pkg/assets" "github.com/smartcontractkit/chainlink-evm/pkg/config/chaintype" @@ -156,68 +153,6 @@ var ( }, }}, }, - Solana: []*solcfg.TOMLConfig{ - { - ChainID: ptr("mainnet"), - Chain: solcfg.Chain{ - MaxRetries: ptr[int64](12), - }, - MultiNode: mnCfg.MultiNodeConfig{ - MultiNode: mnCfg.MultiNode{ - Enabled: ptr(false), - PollFailureThreshold: ptr[uint32](5), - PollInterval: &second, - SelectionMode: &selectionMode, - SyncThreshold: ptr[uint32](5), - NodeIsSyncingEnabled: ptr(false), - LeaseDuration: &minute, - NewHeadsPollInterval: &second, - FinalizedBlockPollInterval: &second, - EnforceRepeatableRead: ptr(true), - DeathDeclarationDelay: &minute, - VerifyChainID: ptr(true), - NodeNoNewHeadsThreshold: &minute, - NoNewFinalizedHeadsThreshold: &minute, - FinalityDepth: ptr[uint32](0), - FinalityTagEnabled: ptr(true), - FinalizedBlockOffset: ptr[uint32](0), - }, - }, - Nodes: []*solcfg.Node{ - {Name: ptr("primary"), URL: commoncfg.MustParseURL("http://mainnet.solana.com"), Order: ptr(int32(1))}, - }, - }, - { - ChainID: ptr("testnet"), - Chain: solcfg.Chain{ - OCR2CachePollPeriod: commoncfg.MustNewDuration(time.Minute), - }, - MultiNode: mnCfg.MultiNodeConfig{ - MultiNode: mnCfg.MultiNode{ - Enabled: ptr(false), - PollFailureThreshold: ptr[uint32](5), - PollInterval: &second, - SelectionMode: &selectionMode, - SyncThreshold: ptr[uint32](5), - NodeIsSyncingEnabled: ptr(false), - LeaseDuration: &minute, - NewHeadsPollInterval: &second, - FinalizedBlockPollInterval: &second, - EnforceRepeatableRead: ptr(true), - DeathDeclarationDelay: &minute, - VerifyChainID: ptr(true), - NodeNoNewHeadsThreshold: &minute, - NoNewFinalizedHeadsThreshold: &minute, - FinalityDepth: ptr[uint32](0), - FinalityTagEnabled: ptr(true), - FinalizedBlockOffset: ptr[uint32](0), - }, - }, - Nodes: []*solcfg.Node{ - {Name: ptr("secondary"), URL: commoncfg.MustParseURL("http://testnet.solana.com"), Order: ptr(int32(2))}, - }, - }, - }, } ) @@ -880,76 +815,6 @@ func TestConfig_Marshal(t *testing.T) { }, }}, } - full.Solana = []*solcfg.TOMLConfig{ - { - ChainID: ptr("mainnet"), - Enabled: ptr(false), - Chain: solcfg.Chain{ - BlockTime: commoncfg.MustNewDuration(500 * time.Millisecond), - BalancePollPeriod: commoncfg.MustNewDuration(time.Minute), - ConfirmPollPeriod: commoncfg.MustNewDuration(time.Second), - OCR2CachePollPeriod: commoncfg.MustNewDuration(time.Minute), - OCR2CacheTTL: commoncfg.MustNewDuration(time.Hour), - TxTimeout: commoncfg.MustNewDuration(time.Hour), - TxRetryTimeout: commoncfg.MustNewDuration(time.Minute), - TxConfirmTimeout: commoncfg.MustNewDuration(time.Second), - TxExpirationRebroadcast: ptr(false), - TxRetentionTimeout: commoncfg.MustNewDuration(0 * time.Second), - SkipPreflight: ptr(true), - Commitment: ptr("banana"), - MaxRetries: ptr[int64](7), - FeeEstimatorMode: ptr("fixed"), - ComputeUnitPriceMax: ptr[uint64](1000), - ComputeUnitPriceMin: ptr[uint64](10), - ComputeUnitPriceDefault: ptr[uint64](100), - FeeBumpPeriod: commoncfg.MustNewDuration(time.Minute), - BlockHistoryPollPeriod: commoncfg.MustNewDuration(time.Minute), - BlockHistorySize: ptr[uint64](1), - BlockHistoryBatchLoadSize: ptr[uint64](20), - ComputeUnitLimitDefault: ptr[uint32](100_000), - EstimateComputeUnitLimit: ptr(false), - LogPollerStartingLookback: commoncfg.MustNewDuration(24 * time.Hour), - LogPollerCPIEventsEnabled: ptr(true), - LogPollerSlotsBatchSize: ptr[int64](100), - }, - MultiNode: mnCfg.MultiNodeConfig{ - MultiNode: mnCfg.MultiNode{ - Enabled: ptr(false), - PollFailureThreshold: ptr[uint32](5), - PollInterval: &second, - SelectionMode: &selectionMode, - SyncThreshold: ptr[uint32](5), - NodeIsSyncingEnabled: ptr(false), - LeaseDuration: &minute, - NewHeadsPollInterval: &second, - FinalizedBlockPollInterval: &second, - EnforceRepeatableRead: ptr(true), - DeathDeclarationDelay: &minute, - VerifyChainID: ptr(true), - NodeNoNewHeadsThreshold: &minute, - NoNewFinalizedHeadsThreshold: &minute, - FinalityDepth: ptr[uint32](0), - FinalityTagEnabled: ptr(true), - FinalizedBlockOffset: ptr[uint32](0), - }, - }, - Nodes: []*solcfg.Node{ - {Name: ptr("primary"), URL: commoncfg.MustParseURL("http://solana.web"), Order: ptr(int32(1))}, - {Name: ptr("foo"), URL: commoncfg.MustParseURL("http://solana.foo"), SendOnly: true, Order: ptr(int32(2))}, - {Name: ptr("bar"), URL: commoncfg.MustParseURL("http://solana.bar"), SendOnly: true, Order: ptr(int32(3))}, - }, - Workflow: solcfg.WorkflowConfig{ - AcceptanceTimeout: commoncfg.MustNewDuration(time.Second * 45), - FromAddress: ptr(solana.MustPublicKeyFromBase58("4BJXYkfvg37zEmBbsacZjeQDpTNx91KppxFJxRqrz48e")), - ForwarderAddress: ptr(solana.MustPublicKeyFromBase58("14grJpemFaf88c8tiVb77W7TYg2W3ir6pfkKz3YjhhZ5")), - ForwarderState: ptr(solana.MustPublicKeyFromBase58("14grJpemFaf88c8tiVb77W7TYg2W3ir6pfkKz3YjhhZ5")), - TxAcceptanceState: ptr(commontypes.Finalized), - PollPeriod: commoncfg.MustNewDuration(time.Second * 3), - Local: ptr(true), - GasLimitDefault: ptr(uint64(0)), - }, - }, - } full.Mercury = toml.Mercury{ Cache: toml.MercuryCache{ LatestReportTTL: commoncfg.MustNewDuration(100 * time.Second), @@ -1406,83 +1271,6 @@ HTTPURL = 'https://bar.com' Name = 'broadcast' HTTPURL = 'http://broadcast.mirror' SendOnly = true -`}, - {"Solana", Config{Solana: full.Solana}, `[[Solana]] -ChainID = 'mainnet' -Enabled = false -BlockTime = '500ms' -BalancePollPeriod = '1m0s' -ConfirmPollPeriod = '1s' -OCR2CachePollPeriod = '1m0s' -OCR2CacheTTL = '1h0m0s' -TxTimeout = '1h0m0s' -TxRetryTimeout = '1m0s' -TxConfirmTimeout = '1s' -TxExpirationRebroadcast = false -TxRetentionTimeout = '0s' -SkipPreflight = true -Commitment = 'banana' -MaxRetries = 7 -FeeEstimatorMode = 'fixed' -ComputeUnitPriceMax = 1000 -ComputeUnitPriceMin = 10 -ComputeUnitPriceDefault = 100 -FeeBumpPeriod = '1m0s' -BlockHistoryPollPeriod = '1m0s' -BlockHistorySize = 1 -BlockHistoryBatchLoadSize = 20 -ComputeUnitLimitDefault = 100000 -EstimateComputeUnitLimit = false -LogPollerStartingLookback = '24h0m0s' -LogPollerCPIEventsEnabled = true -LogPollerSlotsBatchSize = 100 - -[Solana.Workflow] -AcceptanceTimeout = '45s' -ForwarderAddress = '14grJpemFaf88c8tiVb77W7TYg2W3ir6pfkKz3YjhhZ5' -ForwarderState = '14grJpemFaf88c8tiVb77W7TYg2W3ir6pfkKz3YjhhZ5' -FromAddress = '4BJXYkfvg37zEmBbsacZjeQDpTNx91KppxFJxRqrz48e' -GasLimitDefault = 0 -Local = true -PollPeriod = '3s' -TxAcceptanceState = 3 - -[Solana.MultiNode] -Enabled = false -PollFailureThreshold = 5 -PollInterval = '1s' -SelectionMode = 'HighestHead' -SyncThreshold = 5 -NodeIsSyncingEnabled = false -LeaseDuration = '1m0s' -NewHeadsPollInterval = '1s' -FinalizedBlockPollInterval = '1s' -EnforceRepeatableRead = true -DeathDeclarationDelay = '1m0s' -VerifyChainID = true -NodeNoNewHeadsThreshold = '1m0s' -NoNewFinalizedHeadsThreshold = '1m0s' -FinalityDepth = 0 -FinalityTagEnabled = true -FinalizedBlockOffset = 0 - -[[Solana.Nodes]] -Name = 'primary' -URL = 'http://solana.web' -SendOnly = false -Order = 1 - -[[Solana.Nodes]] -Name = 'foo' -URL = 'http://solana.foo' -SendOnly = true -Order = 2 - -[[Solana.Nodes]] -Name = 'bar' -URL = 'http://solana.bar' -SendOnly = true -Order = 3 `}, {"Mercury", Config{Core: toml.Core{Mercury: full.Mercury}}, `[Mercury] VerboseLogging = true @@ -1597,14 +1385,6 @@ func TestConfig_full(t *testing.T) { } } - for c := range got.Solana { - for n := range got.Solana[c].Nodes { - if got.Solana[c].Nodes[n].IsLoadBalancedRPC == nil { - got.Solana[c].Nodes[n].IsLoadBalancedRPC = ptr(false) - } - } - } - configtest.AssertFieldsNotNil(t, got) } @@ -1695,11 +1475,11 @@ func TestConfig_Validate(t *testing.T) { - Nodes: missing: expected at least one node - Solana: 4 errors: - 1.ChainID: invalid value (mainnet): duplicate - must be unique - - 0.Nodes: missing: must have at least one node - - 1.Nodes.0.URL: missing: required for all nodes + - 1.Nodes.1.Name: invalid value (bar): duplicate - must be unique + - 0.Nodes: missing: expected at least one node - 2: 2 errors: - - ChainID: empty: required for all chains - - Nodes: missing: must have at least one node + - ChainID: missing: required for all chains + - Nodes: missing: expected at least one node - Starknet: 3 errors: - 0.Nodes.1.Name: invalid value (primary): duplicate - must be unique - 0.ChainID: missing: required for all chains @@ -1947,7 +1727,7 @@ func TestConfig_setDefaults(t *testing.T) { var c Config c.EVM = evmcfg.EVMConfigs{{ChainID: sqlutil.NewI(99999133712345)}} c.Cosmos = RawConfigs{{"ChainID": ptr("unknown cosmos chain")}} - c.Solana = solcfg.TOMLConfigs{{ChainID: ptr("unknown solana chain")}} + c.Solana = RawConfigs{{"ChainID": ptr("unknown solana chain")}} c.Starknet = RawConfigs{{"ChainID": ptr("unknown starknet chain")}} c.setDefaults() diff --git a/core/services/chainlink/mocks/general_config.go b/core/services/chainlink/mocks/general_config.go index d6d602c9899..fb2df951ef5 100644 --- a/core/services/chainlink/mocks/general_config.go +++ b/core/services/chainlink/mocks/general_config.go @@ -7,7 +7,6 @@ import ( uuid "github.com/google/uuid" toml "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" - solanaconfig "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" config "github.com/smartcontractkit/chainlink/v2/core/config" chainlink "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" mock "github.com/stretchr/testify/mock" @@ -2098,19 +2097,19 @@ func (_c *GeneralConfig_ShutdownGracePeriod_Call) RunAndReturn(run func() time.D } // SolanaConfigs provides a mock function with no fields -func (_m *GeneralConfig) SolanaConfigs() solanaconfig.TOMLConfigs { +func (_m *GeneralConfig) SolanaConfigs() chainlink.RawConfigs { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for SolanaConfigs") } - var r0 solanaconfig.TOMLConfigs - if rf, ok := ret.Get(0).(func() solanaconfig.TOMLConfigs); ok { + var r0 chainlink.RawConfigs + if rf, ok := ret.Get(0).(func() chainlink.RawConfigs); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(solanaconfig.TOMLConfigs) + r0 = ret.Get(0).(chainlink.RawConfigs) } } @@ -2134,12 +2133,12 @@ func (_c *GeneralConfig_SolanaConfigs_Call) Run(run func()) *GeneralConfig_Solan return _c } -func (_c *GeneralConfig_SolanaConfigs_Call) Return(_a0 solanaconfig.TOMLConfigs) *GeneralConfig_SolanaConfigs_Call { +func (_c *GeneralConfig_SolanaConfigs_Call) Return(_a0 chainlink.RawConfigs) *GeneralConfig_SolanaConfigs_Call { _c.Call.Return(_a0) return _c } -func (_c *GeneralConfig_SolanaConfigs_Call) RunAndReturn(run func() solanaconfig.TOMLConfigs) *GeneralConfig_SolanaConfigs_Call { +func (_c *GeneralConfig_SolanaConfigs_Call) RunAndReturn(run func() chainlink.RawConfigs) *GeneralConfig_SolanaConfigs_Call { _c.Call.Return(run) return _c } diff --git a/core/services/chainlink/relayer_chain_interoperators.go b/core/services/chainlink/relayer_chain_interoperators.go index b585b6e7ad6..ce4ea40e818 100644 --- a/core/services/chainlink/relayer_chain_interoperators.go +++ b/core/services/chainlink/relayer_chain_interoperators.go @@ -158,9 +158,9 @@ func InitCosmos(factory RelayerFactory, ks keystore.Cosmos, csaKS keystore.CSA, } // InitSolana is a option for instantiating Solana relayers -func InitSolana(factory RelayerFactory, ks keystore.Solana, csaKS keystore.CSA, config SolanaFactoryConfig) CoreRelayerChainInitFunc { +func InitSolana(factory RelayerFactory, ks keystore.Solana, csaKS keystore.CSA, chainCfgs RawConfigs) CoreRelayerChainInitFunc { return func(op *CoreRelayerChainInteroperators) error { - solRelayers, err := factory.NewSolana(&keystore.SolanaLooppSigner{Solana: ks}, &keystore.CSASigner{CSA: csaKS}, config) + solRelayers, err := factory.NewSolana(&keystore.SolanaLooppSigner{Solana: ks}, &keystore.CSASigner{CSA: csaKS}, chainCfgs) if err != nil { return fmt.Errorf("failed to setup Solana relayer: %w", err) } diff --git a/core/services/chainlink/relayer_chain_interoperators_test.go b/core/services/chainlink/relayer_chain_interoperators_test.go index 54d8b7ab747..6d52913f107 100644 --- a/core/services/chainlink/relayer_chain_interoperators_test.go +++ b/core/services/chainlink/relayer_chain_interoperators_test.go @@ -16,8 +16,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" - "github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm" "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" @@ -34,7 +32,6 @@ import ( func TestCoreRelayerChainInteroperators(t *testing.T) { evmChainID1, evmChainID2 := sqlutil.New(big.NewInt(1)), sqlutil.New(big.NewInt(2)) - solanaChainID1, solanaChainID2 := "solana-id-1", "solana-id-2" newConfig := func() chainlink.GeneralConfig { return configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { @@ -75,28 +72,6 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { Enabled: ptr(true), Nodes: toml.EVMNodes{&node2_1}, }) - - c.Solana = solcfg.TOMLConfigs{ - &solcfg.TOMLConfig{ - ChainID: &solanaChainID1, - Enabled: ptr(true), - Nodes: []*solcfg.Node{{ - Name: ptr("solana chain 1 node 1"), - URL: commonconfig.MustParseURL("http://localhost:8547"), - }}, - }, - &solcfg.TOMLConfig{ - ChainID: &solanaChainID2, - Enabled: ptr(true), - Nodes: []*solcfg.Node{{ - Name: ptr("solana chain 2 node 1"), - URL: commonconfig.MustParseURL("http://localhost:8527"), - }}, - }, - } - for i := range c.Solana { - c.Solana[i].SetDefaults() - } }) } @@ -124,10 +99,6 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { expectedEVMNodeCnt int expectedEVMRelayerIds []types.RelayID - expectedSolanaChainCnt int - expectedSolanaNodeCnt int - expectedSolanaRelayerIds []types.RelayID - expectedStarknetChainCnt int expectedStarknetNodeCnt int @@ -137,6 +108,9 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { expectedCosmosChainCnt int expectedCosmosNodeCnt int + + expectedSolanaChainCnt int + expectedSolanaNodeCnt int }{ {name: "2 evm chains with 3 nodes", @@ -163,23 +137,8 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { expectedRelayerNetworks: map[string]struct{}{relay.NetworkEVM: {}}, }, - {name: "2 solana chain with 2 node", - initFuncs: []chainlink.CoreRelayerChainInitFunc{ - chainlink.InitSolana(factory, keyStore.Solana(), keyStore.CSA(), chainlink.SolanaFactoryConfig{ - TOMLConfigs: newConfig().SolanaConfigs()}), - }, - expectedSolanaChainCnt: 2, - expectedSolanaNodeCnt: 2, - expectedSolanaRelayerIds: []types.RelayID{ - {Network: relay.NetworkSolana, ChainID: solanaChainID1}, - {Network: relay.NetworkSolana, ChainID: solanaChainID2}, - }, - expectedRelayerNetworks: map[string]struct{}{relay.NetworkSolana: {}}, - }, - {name: "all chains", - initFuncs: []chainlink.CoreRelayerChainInitFunc{chainlink.InitSolana(factory, keyStore.Solana(), keyStore.CSA(), chainlink.SolanaFactoryConfig{ - TOMLConfigs: newConfig().SolanaConfigs()}), + initFuncs: []chainlink.CoreRelayerChainInitFunc{ chainlink.InitEVM(factory, chainlink.EVMFactoryConfig{ ChainOpts: legacyevm.ChainOpts{ ChainConfigs: cfg.EVMConfigs(), @@ -195,6 +154,7 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { }), chainlink.InitStarknet(factory, keyStore.StarkNet(), keyStore.CSA(), cfg.StarknetConfigs()), chainlink.InitCosmos(factory, keyStore.Cosmos(), keyStore.CSA(), cfg.CosmosConfigs()), + chainlink.InitSolana(factory, keyStore.Solana(), keyStore.CSA(), cfg.SolanaConfigs()), }, expectedEVMChainCnt: 2, expectedEVMNodeCnt: 3, @@ -203,13 +163,6 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { {Network: relay.NetworkEVM, ChainID: evmChainID2.String()}, }, - expectedSolanaChainCnt: 2, - expectedSolanaNodeCnt: 2, - expectedSolanaRelayerIds: []types.RelayID{ - {Network: relay.NetworkSolana, ChainID: solanaChainID1}, - {Network: relay.NetworkSolana, ChainID: solanaChainID2}, - }, - expectedRelayerNetworks: map[string]struct{}{relay.NetworkEVM: {}, relay.NetworkCosmos: {}, relay.NetworkSolana: {}, relay.NetworkStarkNet: {}}, }, } @@ -293,7 +246,6 @@ func TestCoreRelayerChainInteroperators(t *testing.T) { allRelayerIds := [][]types.RelayID{ tt.expectedEVMRelayerIds, - tt.expectedSolanaRelayerIds, } for _, chainSpecificRelayerIds := range allRelayerIds { diff --git a/core/services/chainlink/relayer_factory.go b/core/services/chainlink/relayer_factory.go index 2b391e52556..1ddb0867c56 100644 --- a/core/services/chainlink/relayer_factory.go +++ b/core/services/chainlink/relayer_factory.go @@ -12,15 +12,12 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/loop" - "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/types" coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core" "github.com/smartcontractkit/chainlink-data-streams/mercury/wsrpc" "github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm" evmtoml "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" "github.com/smartcontractkit/chainlink-evm/pkg/keys" - "github.com/smartcontractkit/chainlink-solana/pkg/solana" - solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" coreconfig "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/config/env" @@ -137,72 +134,8 @@ func (r *RelayerFactory) NewEVM(config EVMFactoryConfig) (map[types.RelayID]evmr return relayers, nil } -type SolanaFactoryConfig struct { - solcfg.TOMLConfigs - DS sqlutil.DataSource -} - -func (r *RelayerFactory) NewSolana(ks, ksCSA coretypes.Keystore, config SolanaFactoryConfig) (map[types.RelayID]loop.Relayer, error) { - chainCfgs, ds := config.TOMLConfigs, config.DS - solanaRelayers := make(map[types.RelayID]loop.Relayer) - var solLggr = logger.Named(r.Logger, "Solana") - - unique := make(map[string]struct{}) - // create one relayer per chain id - for _, chainCfg := range chainCfgs { - relayID := types.RelayID{Network: relay.NetworkSolana, ChainID: *chainCfg.ChainID} - _, alreadyExists := unique[relayID.Name()] - if alreadyExists { - return nil, fmt.Errorf("duplicate chain definitions for %s", relayID.Name()) - } - unique[relayID.Name()] = struct{}{} - - // skip disabled chains from further processing - if !chainCfg.IsEnabled() { - solLggr.Warnw("Skipping disabled chain", "id", chainCfg.ChainID) - continue - } - - lggr := logger.Named(solLggr, relayID.ChainID) - - if cmdName := env.SolanaPlugin.Cmd.Get(); cmdName != "" { - // setup the solana relayer to be a LOOP - cfgTOML, err := toml.Marshal(struct { - Solana solcfg.TOMLConfig - }{Solana: *chainCfg}) - if err != nil { - return nil, fmt.Errorf("failed to marshal Solana configs: %w", err) - } - envVars, err := plugins.ParseEnvFile(env.SolanaPlugin.Env.Get()) - if err != nil { - return nil, fmt.Errorf("failed to parse Solana env file: %w", err) - } - solCmdFn, err := plugins.NewCmdFactory(r.Register, plugins.CmdConfig{ - ID: relayID.Name(), - Cmd: cmdName, - Env: envVars, - }) - if err != nil { - return nil, fmt.Errorf("failed to create Solana LOOP command: %w", err) - } - - solanaRelayers[relayID] = loop.NewRelayerService(lggr, r.GRPCOpts, solCmdFn, string(cfgTOML), ks, ksCSA, r.CapabilitiesRegistry) - } else { - // fallback to embedded chain - opts := solana.ChainOpts{ - Logger: lggr, - KeyStore: ks, - DS: ds, - } - - chain, err := solana.NewChain(chainCfg, opts) - if err != nil { - return nil, err - } - solanaRelayers[relayID] = relay.NewServerAdapter(solana.NewRelayer(lggr, chain, r.CapabilitiesRegistry, ks)) - } - } - return solanaRelayers, nil +func (r *RelayerFactory) NewSolana(ks, ksCSA coretypes.Keystore, chainCfgs RawConfigs) (map[types.RelayID]loop.Relayer, error) { + return r.NewLOOPRelayer("Solana", relay.NetworkSolana, env.SolanaPlugin, ks, ksCSA, chainCfgs) } func (r *RelayerFactory) NewStarkNet(ks, ksCSA coretypes.Keystore, chainCfgs RawConfigs) (map[types.RelayID]loop.Relayer, error) { diff --git a/core/services/chainlink/testdata/config-full.toml b/core/services/chainlink/testdata/config-full.toml index 2ebb20cc5a6..b0e5953b55e 100644 --- a/core/services/chainlink/testdata/config-full.toml +++ b/core/services/chainlink/testdata/config-full.toml @@ -619,80 +619,3 @@ HTTPURL = 'https://bar.com' Name = 'broadcast' HTTPURL = 'http://broadcast.mirror' SendOnly = true - -[[Solana]] -ChainID = 'mainnet' -Enabled = false -BlockTime = '500ms' -BalancePollPeriod = '1m0s' -ConfirmPollPeriod = '1s' -OCR2CachePollPeriod = '1m0s' -OCR2CacheTTL = '1h0m0s' -TxTimeout = '1h0m0s' -TxRetryTimeout = '1m0s' -TxConfirmTimeout = '1s' -TxExpirationRebroadcast = false -TxRetentionTimeout = '0s' -SkipPreflight = true -Commitment = 'banana' -MaxRetries = 7 -FeeEstimatorMode = 'fixed' -ComputeUnitPriceMax = 1000 -ComputeUnitPriceMin = 10 -ComputeUnitPriceDefault = 100 -FeeBumpPeriod = '1m0s' -BlockHistoryPollPeriod = '1m0s' -BlockHistorySize = 1 -BlockHistoryBatchLoadSize = 20 -ComputeUnitLimitDefault = 100000 -EstimateComputeUnitLimit = false -LogPollerStartingLookback = '24h0m0s' -LogPollerCPIEventsEnabled = true -LogPollerSlotsBatchSize = 100 - -[Solana.Workflow] -AcceptanceTimeout = '45s' -ForwarderAddress = '14grJpemFaf88c8tiVb77W7TYg2W3ir6pfkKz3YjhhZ5' -ForwarderState = '14grJpemFaf88c8tiVb77W7TYg2W3ir6pfkKz3YjhhZ5' -FromAddress = '4BJXYkfvg37zEmBbsacZjeQDpTNx91KppxFJxRqrz48e' -GasLimitDefault = 0 -Local = true -PollPeriod = '3s' -TxAcceptanceState = 3 - -[Solana.MultiNode] -Enabled = false -PollFailureThreshold = 5 -PollInterval = '1s' -SelectionMode = 'HighestHead' -SyncThreshold = 5 -NodeIsSyncingEnabled = false -LeaseDuration = '1m0s' -NewHeadsPollInterval = '1s' -FinalizedBlockPollInterval = '1s' -EnforceRepeatableRead = true -DeathDeclarationDelay = '1m0s' -VerifyChainID = true -NodeNoNewHeadsThreshold = '1m0s' -NoNewFinalizedHeadsThreshold = '1m0s' -FinalityDepth = 0 -FinalityTagEnabled = true -FinalizedBlockOffset = 0 - -[[Solana.Nodes]] -Name = 'primary' -URL = 'http://solana.web' -SendOnly = false -Order = 1 - -[[Solana.Nodes]] -Name = 'foo' -URL = 'http://solana.foo' -SendOnly = true -Order = 2 - -[[Solana.Nodes]] -Name = 'bar' -URL = 'http://solana.bar' -SendOnly = true -Order = 3 diff --git a/core/services/chainlink/testdata/config-multi-chain-effective.toml b/core/services/chainlink/testdata/config-multi-chain-effective.toml index d9b08fd9d15..b0ebe292170 100644 --- a/core/services/chainlink/testdata/config-multi-chain-effective.toml +++ b/core/services/chainlink/testdata/config-multi-chain-effective.toml @@ -774,133 +774,3 @@ AcceptanceTimeout = '30s' [[EVM.Nodes]] Name = 'bar' WSURL = 'wss://web.socket/test/bar' - -[[Solana]] -ChainID = 'mainnet' -Enabled = true -BlockTime = '500ms' -BalancePollPeriod = '5s' -ConfirmPollPeriod = '500ms' -OCR2CachePollPeriod = '1s' -OCR2CacheTTL = '1m0s' -TxTimeout = '1m0s' -TxRetryTimeout = '10s' -TxConfirmTimeout = '30s' -TxExpirationRebroadcast = false -TxRetentionTimeout = '0s' -SkipPreflight = true -Commitment = 'confirmed' -MaxRetries = 12 -FeeEstimatorMode = 'fixed' -ComputeUnitPriceMax = 1000 -ComputeUnitPriceMin = 0 -ComputeUnitPriceDefault = 0 -FeeBumpPeriod = '3s' -BlockHistoryPollPeriod = '5s' -BlockHistorySize = 1 -BlockHistoryBatchLoadSize = 20 -ComputeUnitLimitDefault = 200000 -EstimateComputeUnitLimit = false -LogPollerStartingLookback = '24h0m0s' -LogPollerCPIEventsEnabled = true -LogPollerSlotsBatchSize = 1000 - -[Solana.Workflow] -AcceptanceTimeout = '45s' -ForwarderAddress = '11111111111111111111111111111111' -ForwarderState = '11111111111111111111111111111111' -FromAddress = '11111111111111111111111111111111' -GasLimitDefault = 300000 -Local = false -PollPeriod = '3s' -TxAcceptanceState = 3 - -[Solana.MultiNode] -Enabled = false -PollFailureThreshold = 5 -PollInterval = '1s' -SelectionMode = 'HighestHead' -SyncThreshold = 5 -NodeIsSyncingEnabled = false -LeaseDuration = '1m0s' -NewHeadsPollInterval = '1s' -FinalizedBlockPollInterval = '1s' -EnforceRepeatableRead = true -DeathDeclarationDelay = '1m0s' -VerifyChainID = true -NodeNoNewHeadsThreshold = '1m0s' -NoNewFinalizedHeadsThreshold = '1m0s' -FinalityDepth = 0 -FinalityTagEnabled = true -FinalizedBlockOffset = 0 - -[[Solana.Nodes]] -Name = 'primary' -URL = 'http://mainnet.solana.com' -SendOnly = false -Order = 1 - -[[Solana]] -ChainID = 'testnet' -Enabled = true -BlockTime = '500ms' -BalancePollPeriod = '5s' -ConfirmPollPeriod = '500ms' -OCR2CachePollPeriod = '1m0s' -OCR2CacheTTL = '1m0s' -TxTimeout = '1m0s' -TxRetryTimeout = '10s' -TxConfirmTimeout = '30s' -TxExpirationRebroadcast = false -TxRetentionTimeout = '0s' -SkipPreflight = true -Commitment = 'confirmed' -MaxRetries = 0 -FeeEstimatorMode = 'fixed' -ComputeUnitPriceMax = 1000 -ComputeUnitPriceMin = 0 -ComputeUnitPriceDefault = 0 -FeeBumpPeriod = '3s' -BlockHistoryPollPeriod = '5s' -BlockHistorySize = 1 -BlockHistoryBatchLoadSize = 20 -ComputeUnitLimitDefault = 200000 -EstimateComputeUnitLimit = false -LogPollerStartingLookback = '24h0m0s' -LogPollerCPIEventsEnabled = true -LogPollerSlotsBatchSize = 1000 - -[Solana.Workflow] -AcceptanceTimeout = '45s' -ForwarderAddress = '11111111111111111111111111111111' -ForwarderState = '11111111111111111111111111111111' -FromAddress = '11111111111111111111111111111111' -GasLimitDefault = 300000 -Local = false -PollPeriod = '3s' -TxAcceptanceState = 3 - -[Solana.MultiNode] -Enabled = false -PollFailureThreshold = 5 -PollInterval = '1s' -SelectionMode = 'HighestHead' -SyncThreshold = 5 -NodeIsSyncingEnabled = false -LeaseDuration = '1m0s' -NewHeadsPollInterval = '1s' -FinalizedBlockPollInterval = '1s' -EnforceRepeatableRead = true -DeathDeclarationDelay = '1m0s' -VerifyChainID = true -NodeNoNewHeadsThreshold = '1m0s' -NoNewFinalizedHeadsThreshold = '1m0s' -FinalityDepth = 0 -FinalityTagEnabled = true -FinalizedBlockOffset = 0 - -[[Solana.Nodes]] -Name = 'secondary' -URL = 'http://testnet.solana.com' -SendOnly = false -Order = 2 diff --git a/core/services/chainlink/testdata/config-multi-chain.toml b/core/services/chainlink/testdata/config-multi-chain.toml index 7db000b7c85..88ff3ecd299 100644 --- a/core/services/chainlink/testdata/config-multi-chain.toml +++ b/core/services/chainlink/testdata/config-multi-chain.toml @@ -76,61 +76,3 @@ Mode = 'FixedPrice' [[EVM.Nodes]] Name = 'bar' WSURL = 'wss://web.socket/test/bar' - -[[Solana]] -ChainID = 'mainnet' -MaxRetries = 12 - -[Solana.MultiNode] -Enabled = false -PollFailureThreshold = 5 -PollInterval = '1s' -SelectionMode = 'HighestHead' -SyncThreshold = 5 -NodeIsSyncingEnabled = false -LeaseDuration = '1m0s' -NewHeadsPollInterval = '1s' -FinalizedBlockPollInterval = '1s' -EnforceRepeatableRead = true -DeathDeclarationDelay = '1m0s' -VerifyChainID = true -NodeNoNewHeadsThreshold = '1m0s' -NoNewFinalizedHeadsThreshold = '1m0s' -FinalityDepth = 0 -FinalityTagEnabled = true -FinalizedBlockOffset = 0 - -[[Solana.Nodes]] -Name = 'primary' -URL = 'http://mainnet.solana.com' -SendOnly = false -Order = 1 - -[[Solana]] -ChainID = 'testnet' -OCR2CachePollPeriod = '1m0s' - -[Solana.MultiNode] -Enabled = false -PollFailureThreshold = 5 -PollInterval = '1s' -SelectionMode = 'HighestHead' -SyncThreshold = 5 -NodeIsSyncingEnabled = false -LeaseDuration = '1m0s' -NewHeadsPollInterval = '1s' -FinalizedBlockPollInterval = '1s' -EnforceRepeatableRead = true -DeathDeclarationDelay = '1m0s' -VerifyChainID = true -NodeNoNewHeadsThreshold = '1m0s' -NoNewFinalizedHeadsThreshold = '1m0s' -FinalityDepth = 0 -FinalityTagEnabled = true -FinalizedBlockOffset = 0 - -[[Solana.Nodes]] -Name = 'secondary' -URL = 'http://testnet.solana.com' -SendOnly = false -Order = 2 diff --git a/core/services/chainlink/types.go b/core/services/chainlink/types.go index 037ee88019f..ea7f196461c 100644 --- a/core/services/chainlink/types.go +++ b/core/services/chainlink/types.go @@ -1,8 +1,6 @@ package chainlink import ( - solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" - "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" "github.com/smartcontractkit/chainlink/v2/core/config" coreconfig "github.com/smartcontractkit/chainlink/v2/core/config" @@ -12,7 +10,7 @@ type GeneralConfig interface { config.AppConfig toml.HasEVMConfigs CosmosConfigs() RawConfigs - SolanaConfigs() solcfg.TOMLConfigs + SolanaConfigs() RawConfigs StarknetConfigs() RawConfigs AptosConfigs() RawConfigs TronConfigs() RawConfigs diff --git a/core/web/chains_controller_integration_test.go b/core/web/chains_controller_integration_test.go index 6e80932e1c8..35be8af90f0 100644 --- a/core/web/chains_controller_integration_test.go +++ b/core/web/chains_controller_integration_test.go @@ -5,6 +5,7 @@ package web_test import ( "cmp" "fmt" + "math/rand/v2" "net/http" "testing" @@ -14,6 +15,7 @@ import ( "github.com/stretchr/testify/require" commonTypes "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" @@ -214,3 +216,217 @@ func setupCosmosChainsControllerTestV2(t *testing.T, cfgs ...chainlink.RawConfig client: client, } } + +func Test_SolanaChainsController_Show(t *testing.T) { + t.Parallel() + + const validID = "Chainlink-12" + + testCases := []struct { + name string + inputID string + wantStatusCode int + want func(t *testing.T, app *cltest.TestApplication) *commonTypes.ChainStatus + }{ + { + inputID: validID, + name: "success", + want: func(t *testing.T, app *cltest.TestApplication) *commonTypes.ChainStatus { + return &commonTypes.ChainStatus{ + ID: validID, + Enabled: true, + Config: `ChainID = 'Chainlink-12' +Enabled = true +BlockTime = '500ms' +BalancePollPeriod = '5s' +ConfirmPollPeriod = '500ms' +OCR2CachePollPeriod = '1s' +OCR2CacheTTL = '1m0s' +TxTimeout = '1h0m0s' +TxRetryTimeout = '10s' +TxConfirmTimeout = '30s' +TxExpirationRebroadcast = false +TxRetentionTimeout = '0s' +SkipPreflight = false +Commitment = 'confirmed' +MaxRetries = 0 +FeeEstimatorMode = 'fixed' +ComputeUnitPriceMax = 1000 +ComputeUnitPriceMin = 0 +ComputeUnitPriceDefault = 0 +FeeBumpPeriod = '3s' +BlockHistoryPollPeriod = '5s' +BlockHistorySize = 1 +BlockHistoryBatchLoadSize = 20 +ComputeUnitLimitDefault = 200000 +EstimateComputeUnitLimit = false +LogPollerStartingLookback = '24h0m0s' +LogPollerCPIEventsEnabled = true +LogPollerSlotsBatchSize = 1000 + +[Workflow] +AcceptanceTimeout = '45s' +ForwarderAddress = '11111111111111111111111111111111' +ForwarderState = '11111111111111111111111111111111' +FromAddress = '11111111111111111111111111111111' +GasLimitDefault = 300000 +Local = false +PollPeriod = '3s' +TxAcceptanceState = 3 + +[MultiNode] +Enabled = false +PollFailureThreshold = 5 +PollInterval = '15s' +SelectionMode = 'PriorityLevel' +SyncThreshold = 10 +NodeIsSyncingEnabled = false +LeaseDuration = '1m0s' +NewHeadsPollInterval = '5s' +FinalizedBlockPollInterval = '5s' +EnforceRepeatableRead = true +DeathDeclarationDelay = '20s' +VerifyChainID = true +NodeNoNewHeadsThreshold = '20s' +NoNewFinalizedHeadsThreshold = '20s' +FinalityDepth = 0 +FinalityTagEnabled = true +FinalizedBlockOffset = 50 + +[[Nodes]] +Name = 'primary' +URL = 'http://solana.example' +SendOnly = false +`, + } + }, + wantStatusCode: http.StatusOK, + }, + { + inputID: "234", + name: "not found", + want: func(t *testing.T, app *cltest.TestApplication) *commonTypes.ChainStatus { + return nil + }, + wantStatusCode: http.StatusBadRequest, + }, + } + + for _, testCase := range testCases { + tc := testCase + + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + controller := setupSolanaChainsControllerTestV2(t, chainlink.RawConfig{ + "ChainID": validID, + "SkipPreflight": false, + "TxTimeout": "1h0m0s", + "Nodes": []map[string]any{{ + "Name": "primary", + "URL": "http://solana.example", + }}, + }) + + wantedResult := tc.want(t, controller.app) + resp, cleanup := controller.client.Get( + "/v2/chains/solana/" + tc.inputID, + ) + t.Cleanup(cleanup) + require.Equal(t, tc.wantStatusCode, resp.StatusCode) + + if wantedResult != nil { + resource1 := presenters.ChainResource{} + err := web.ParseJSONAPIResponse(cltest.ParseResponseBody(t, resp), &resource1) + require.NoError(t, err) + + assert.Equal(t, wantedResult.ID, resource1.ID) + assert.Equal(t, wantedResult.Enabled, resource1.Enabled) + assert.Equal(t, wantedResult.Config, resource1.Config) + } + }) + } +} + +func Test_SolanaChainsController_Index(t *testing.T) { + t.Parallel() + + chainA := chainlink.RawConfig{ + "ChainID": fmt.Sprintf("ChainlinktestA-%d", rand.Int32N(999999)), + "TxTimeout": "1h0m0s", + "Nodes": []map[string]any{{ + "Name": "primary", + "URL": "http://solana.example", + }}, + } + chainB := chainlink.RawConfig{ + "ChainID": fmt.Sprintf("ChainlinktestB-%d", rand.Int32N(999999)), + "SkipPreflight": false, + "Nodes": []map[string]any{{ + "Name": "primary", + "URL": "http://solana.example", + }}, + } + controller := setupSolanaChainsControllerTestV2(t, chainA, chainB) + + badResp, cleanup := controller.client.Get("/v2/chains/solana?size=asd") + t.Cleanup(cleanup) + require.Equal(t, http.StatusUnprocessableEntity, badResp.StatusCode) + + resp, cleanup := controller.client.Get("/v2/chains/solana?size=1") + t.Cleanup(cleanup) + require.Equal(t, http.StatusOK, resp.StatusCode) + + body := cltest.ParseResponseBody(t, resp) + + metaCount, err := cltest.ParseJSONAPIResponseMetaCount(body) + require.NoError(t, err) + require.Equal(t, 2, metaCount) + + var links jsonapi.Links + + chains := []presenters.ChainResource{} + err = web.ParsePaginatedResponse(body, &chains, &links) + require.NoError(t, err) + assert.NotEmpty(t, links["next"].Href) + assert.Empty(t, links["prev"].Href) + + assert.Len(t, links, 1) + assert.Equal(t, chainA.ChainID(), chains[0].ID) + assert.NotEmpty(t, chains[0].Config) + + resp, cleanup = controller.client.Get(links["next"].Href) + t.Cleanup(cleanup) + require.Equal(t, http.StatusOK, resp.StatusCode) + + chains = []presenters.ChainResource{} + err = web.ParsePaginatedResponse(cltest.ParseResponseBody(t, resp), &chains, &links) + require.NoError(t, err) + assert.Empty(t, links["next"].Href) + assert.NotEmpty(t, links["prev"].Href) + + assert.Len(t, links, 1) + assert.Equal(t, chainB.ChainID(), chains[0].ID) + assert.NotEmpty(t, chains[0].Config) +} + +type TestSolanaChainsController struct { + app *cltest.TestApplication + client cltest.HTTPClientCleaner +} + +func setupSolanaChainsControllerTestV2(t *testing.T, cfgs ...chainlink.RawConfig) *TestSolanaChainsController { + cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { + c.Solana = cfgs + c.EVM = nil + }) + app := cltest.NewApplicationWithConfig(t, cfg) + require.NoError(t, app.Start(testutils.Context(t))) + + client := app.NewHTTPClient(nil) + + return &TestSolanaChainsController{ + app: app, + client: client, + } +} diff --git a/core/web/chains_controller_test.go b/core/web/chains_controller_test.go index 2b3f14b0ee3..84aa901b9e4 100644 --- a/core/web/chains_controller_test.go +++ b/core/web/chains_controller_test.go @@ -1,24 +1,18 @@ package web_test import ( - "fmt" "math/big" "net/http" "sort" "testing" - "time" "github.com/manyminds/api2go/jsonapi" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/exp/rand" "github.com/smartcontractkit/quarantine" - commoncfg "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - commonTypes "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" "github.com/smartcontractkit/chainlink-evm/pkg/types" @@ -230,167 +224,4 @@ func setupEVMChainsControllerTest(t *testing.T, cfg chainlink.GeneralConfig) *Te } } -func Test_SolanaChainsController_Show(t *testing.T) { - t.Parallel() - - const validID = "Chainlink-12" - - testCases := []struct { - name string - inputID string - wantStatusCode int - want func(t *testing.T, app *cltest.TestApplication) *commonTypes.ChainStatus - }{ - { - inputID: validID, - name: "success", - want: func(t *testing.T, app *cltest.TestApplication) *commonTypes.ChainStatus { - wc := &config.TOMLConfig{ - ChainID: ptr(validID), - Chain: config.Chain{ - SkipPreflight: ptr(false), - TxTimeout: commoncfg.MustNewDuration(time.Hour), - }, - } - wc.SetDefaults() - cfgStr, err := wc.TOMLString() - require.NoError(t, err) - return &commonTypes.ChainStatus{ - ID: validID, - Enabled: true, - Config: cfgStr, - } - }, - wantStatusCode: http.StatusOK, - }, - { - inputID: "234", - name: "not found", - want: func(t *testing.T, app *cltest.TestApplication) *commonTypes.ChainStatus { - return nil - }, - wantStatusCode: http.StatusBadRequest, - }, - } - - for _, testCase := range testCases { - tc := testCase - - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - - controller := setupSolanaChainsControllerTestV2(t, &config.TOMLConfig{ - ChainID: ptr(validID), - Chain: config.Chain{ - SkipPreflight: ptr(false), - TxTimeout: commoncfg.MustNewDuration(time.Hour), - }, - }) - - wantedResult := tc.want(t, controller.app) - resp, cleanup := controller.client.Get( - "/v2/chains/solana/" + tc.inputID, - ) - t.Cleanup(cleanup) - require.Equal(t, tc.wantStatusCode, resp.StatusCode) - - if wantedResult != nil { - resource1 := presenters.ChainResource{} - err := web.ParseJSONAPIResponse(cltest.ParseResponseBody(t, resp), &resource1) - require.NoError(t, err) - - assert.Equal(t, wantedResult.ID, resource1.ID) - assert.Equal(t, wantedResult.Enabled, resource1.Enabled) - assert.Equal(t, wantedResult.Config, resource1.Config) - } - }) - } -} - -func Test_SolanaChainsController_Index(t *testing.T) { - t.Parallel() - - chainA := &config.TOMLConfig{ - ChainID: ptr(fmt.Sprintf("ChainlinktestA-%d", rand.Int31n(999999))), - Chain: config.Chain{ - TxTimeout: commoncfg.MustNewDuration(time.Hour), - }, - } - chainB := &config.TOMLConfig{ - ChainID: ptr(fmt.Sprintf("ChainlinktestB-%d", rand.Int31n(999999))), - Chain: config.Chain{ - SkipPreflight: ptr(false), - }, - } - controller := setupSolanaChainsControllerTestV2(t, chainA, chainB) - - badResp, cleanup := controller.client.Get("/v2/chains/solana?size=asd") - t.Cleanup(cleanup) - require.Equal(t, http.StatusUnprocessableEntity, badResp.StatusCode) - - resp, cleanup := controller.client.Get("/v2/chains/solana?size=1") - t.Cleanup(cleanup) - require.Equal(t, http.StatusOK, resp.StatusCode) - - body := cltest.ParseResponseBody(t, resp) - - metaCount, err := cltest.ParseJSONAPIResponseMetaCount(body) - require.NoError(t, err) - require.Equal(t, 2, metaCount) - - var links jsonapi.Links - - chains := []presenters.ChainResource{} - err = web.ParsePaginatedResponse(body, &chains, &links) - require.NoError(t, err) - assert.NotEmpty(t, links["next"].Href) - assert.Empty(t, links["prev"].Href) - - assert.Len(t, links, 1) - assert.Equal(t, *chainA.ChainID, chains[0].ID) - tomlA, err := chainA.TOMLString() - require.NoError(t, err) - assert.Equal(t, tomlA, chains[0].Config) - - resp, cleanup = controller.client.Get(links["next"].Href) - t.Cleanup(cleanup) - require.Equal(t, http.StatusOK, resp.StatusCode) - - chains = []presenters.ChainResource{} - err = web.ParsePaginatedResponse(cltest.ParseResponseBody(t, resp), &chains, &links) - require.NoError(t, err) - assert.Empty(t, links["next"].Href) - assert.NotEmpty(t, links["prev"].Href) - - assert.Len(t, links, 1) - assert.Equal(t, *chainB.ChainID, chains[0].ID) - tomlB, err := chainB.TOMLString() - require.NoError(t, err) - assert.Equal(t, tomlB, chains[0].Config) -} - -type TestSolanaChainsController struct { - app *cltest.TestApplication - client cltest.HTTPClientCleaner -} - -func setupSolanaChainsControllerTestV2(t *testing.T, cfgs ...*config.TOMLConfig) *TestSolanaChainsController { - for i := range cfgs { - cfgs[i].SetDefaults() - } - cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) { - c.Solana = cfgs - c.EVM = nil - }) - app := cltest.NewApplicationWithConfig(t, cfg) - require.NoError(t, app.Start(testutils.Context(t))) - - client := app.NewHTTPClient(nil) - - return &TestSolanaChainsController{ - app: app, - client: client, - } -} - func ptr[T any](t T) *T { return &t } diff --git a/core/web/health_controller_test.go b/core/web/health_controller_test.go index 90911991700..78f34df8a9e 100644 --- a/core/web/health_controller_test.go +++ b/core/web/health_controller_test.go @@ -13,8 +13,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink-common/pkg/config" - solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" @@ -136,15 +134,7 @@ func TestHealthController_Health_body(t *testing.T) { {".txt-failing", "/health.txt?failing", nil, bodyTXTFailing}, } { t.Run(tc.name, func(t *testing.T) { - cfg := configtest.NewGeneralConfig(t, func(cfg *chainlink.Config, secrets *chainlink.Secrets) { - cfg.Solana = []*solcfg.TOMLConfig{{ - ChainID: ptr("Bar"), - Nodes: solcfg.Nodes{ - {Name: ptr("primary"), URL: config.MustParseURL("http://solana.web")}, - }, - }} - cfg.Solana[0].SetDefaults() - }) + cfg := configtest.NewGeneralConfig(t, func(cfg *chainlink.Config, secrets *chainlink.Secrets) {}) app := cltest.NewApplicationWithConfigAndKey(t, cfg) require.NoError(t, app.Start(testutils.Context(t))) diff --git a/core/web/resolver/testdata/config-full.toml b/core/web/resolver/testdata/config-full.toml index e939e064563..7385e8678eb 100644 --- a/core/web/resolver/testdata/config-full.toml +++ b/core/web/resolver/testdata/config-full.toml @@ -594,77 +594,3 @@ HTTPURL = 'https://bar.com' Name = 'broadcast' HTTPURL = 'http://broadcast.mirror' SendOnly = true - -[[Solana]] -ChainID = 'mainnet' -Enabled = true -BlockTime = '500ms' -BalancePollPeriod = '1m0s' -ConfirmPollPeriod = '1s' -OCR2CachePollPeriod = '1m0s' -OCR2CacheTTL = '1h0m0s' -TxTimeout = '1h0m0s' -TxRetryTimeout = '1m0s' -TxConfirmTimeout = '1s' -TxExpirationRebroadcast = false -TxRetentionTimeout = '0s' -SkipPreflight = true -Commitment = 'banana' -MaxRetries = 7 -FeeEstimatorMode = 'fixed' -ComputeUnitPriceMax = 1000000 -ComputeUnitPriceMin = 0 -ComputeUnitPriceDefault = 0 -FeeBumpPeriod = '3s' -BlockHistoryPollPeriod = '5s' -BlockHistorySize = 1 -BlockHistoryBatchLoadSize = 20 -ComputeUnitLimitDefault = 200000 -EstimateComputeUnitLimit = false -LogPollerStartingLookback = '24h0m0s' -LogPollerCPIEventsEnabled = true -LogPollerSlotsBatchSize = 100 - -[Solana.Workflow] -AcceptanceTimeout = '45s' -ForwarderAddress = '14grJpemFaf88c8tiVb77W7TYg2W3ir6pfkKz3YjhhZ5' -ForwarderState = '14grJpemFaf88c8tiVb77W7TYg2W3ir6pfkKz3YjhhZ5' -FromAddress = '4BJXYkfvg37zEmBbsacZjeQDpTNx91KppxFJxRqrz48e' -GasLimitDefault = 0 -Local = true -PollPeriod = '3s' -TxAcceptanceState = 3 - -[Solana.MultiNode] -Enabled = false -PollFailureThreshold = 5 -PollInterval = '1s' -SelectionMode = 'HighestHead' -SyncThreshold = 5 -NodeIsSyncingEnabled = false -LeaseDuration = '1m0s' -NewHeadsPollInterval = '5s' -FinalizedBlockPollInterval = '1s' -EnforceRepeatableRead = true -DeathDeclarationDelay = '1m0s' -VerifyChainID = true -NodeNoNewHeadsThreshold = '1m0s' -NoNewFinalizedHeadsThreshold = '1m0s' -FinalityDepth = 0 -FinalityTagEnabled = true -FinalizedBlockOffset = 0 - -[[Solana.Nodes]] -Name = 'primary' -URL = 'http://solana.web' -SendOnly = false - -[[Solana.Nodes]] -Name = 'foo' -URL = 'http://solana.foo' -SendOnly = false - -[[Solana.Nodes]] -Name = 'bar' -URL = 'http://solana.bar' -SendOnly = false diff --git a/core/web/resolver/testdata/config-multi-chain-effective.toml b/core/web/resolver/testdata/config-multi-chain-effective.toml index 9c6c9b42cda..31c170489a7 100644 --- a/core/web/resolver/testdata/config-multi-chain-effective.toml +++ b/core/web/resolver/testdata/config-multi-chain-effective.toml @@ -774,131 +774,3 @@ AcceptanceTimeout = '30s' [[EVM.Nodes]] Name = 'bar' WSURL = 'wss://web.socket/test/bar' - -[[Solana]] -ChainID = 'mainnet' -Enabled = true -BlockTime = '500ms' -BalancePollPeriod = '5s' -ConfirmPollPeriod = '500ms' -OCR2CachePollPeriod = '1s' -OCR2CacheTTL = '1m0s' -TxTimeout = '1m0s' -TxRetryTimeout = '10s' -TxConfirmTimeout = '30s' -TxExpirationRebroadcast = false -TxRetentionTimeout = '0s' -SkipPreflight = true -Commitment = 'confirmed' -MaxRetries = 12 -FeeEstimatorMode = 'fixed' -ComputeUnitPriceMax = 1000 -ComputeUnitPriceMin = 0 -ComputeUnitPriceDefault = 0 -FeeBumpPeriod = '3s' -BlockHistoryPollPeriod = '5s' -BlockHistorySize = 1 -BlockHistoryBatchLoadSize = 20 -ComputeUnitLimitDefault = 200000 -EstimateComputeUnitLimit = false -LogPollerStartingLookback = '24h0m0s' -LogPollerCPIEventsEnabled = true -LogPollerSlotsBatchSize = 1000 - -[Solana.Workflow] -AcceptanceTimeout = '45s' -ForwarderAddress = '11111111111111111111111111111111' -ForwarderState = '11111111111111111111111111111111' -FromAddress = '11111111111111111111111111111111' -GasLimitDefault = 300000 -Local = false -PollPeriod = '3s' -TxAcceptanceState = 3 - -[Solana.MultiNode] -Enabled = false -PollFailureThreshold = 5 -PollInterval = '1s' -SelectionMode = 'HighestHead' -SyncThreshold = 5 -NodeIsSyncingEnabled = false -LeaseDuration = '1m0s' -NewHeadsPollInterval = '5s' -FinalizedBlockPollInterval = '1s' -EnforceRepeatableRead = true -DeathDeclarationDelay = '1m0s' -VerifyChainID = true -NodeNoNewHeadsThreshold = '1m0s' -NoNewFinalizedHeadsThreshold = '1m0s' -FinalityDepth = 0 -FinalityTagEnabled = true -FinalizedBlockOffset = 0 - -[[Solana.Nodes]] -Name = 'primary' -URL = 'http://mainnet.solana.com' -SendOnly = false - -[[Solana]] -ChainID = 'testnet' -Enabled = true -BlockTime = '500ms' -BalancePollPeriod = '5s' -ConfirmPollPeriod = '500ms' -OCR2CachePollPeriod = '1m0s' -OCR2CacheTTL = '1m0s' -TxTimeout = '1m0s' -TxRetryTimeout = '10s' -TxConfirmTimeout = '30s' -TxExpirationRebroadcast = false -TxRetentionTimeout = '0s' -SkipPreflight = true -Commitment = 'confirmed' -MaxRetries = 0 -FeeEstimatorMode = 'fixed' -ComputeUnitPriceMax = 1000 -ComputeUnitPriceMin = 0 -ComputeUnitPriceDefault = 0 -FeeBumpPeriod = '3s' -BlockHistoryPollPeriod = '5s' -BlockHistorySize = 1 -BlockHistoryBatchLoadSize = 20 -ComputeUnitLimitDefault = 200000 -EstimateComputeUnitLimit = false -LogPollerStartingLookback = '24h0m0s' -LogPollerCPIEventsEnabled = true -LogPollerSlotsBatchSize = 2000 - -[Solana.Workflow] -AcceptanceTimeout = '45s' -ForwarderAddress = '11111111111111111111111111111111' -ForwarderState = '11111111111111111111111111111111' -FromAddress = '11111111111111111111111111111111' -GasLimitDefault = 300000 -Local = false -PollPeriod = '3s' -TxAcceptanceState = 3 - -[Solana.MultiNode] -Enabled = false -PollFailureThreshold = 5 -PollInterval = '1s' -SelectionMode = 'HighestHead' -SyncThreshold = 5 -NodeIsSyncingEnabled = false -LeaseDuration = '1m0s' -NewHeadsPollInterval = '5s' -FinalizedBlockPollInterval = '1s' -EnforceRepeatableRead = true -DeathDeclarationDelay = '1m0s' -VerifyChainID = true -NodeNoNewHeadsThreshold = '1m0s' -NoNewFinalizedHeadsThreshold = '1m0s' -FinalityDepth = 0 -FinalityTagEnabled = true -FinalizedBlockOffset = 0 - -[[Solana.Nodes]] -Name = 'secondary' -URL = 'http://testnet.solana.com' -SendOnly = false diff --git a/core/web/resolver/testdata/config-multi-chain.toml b/core/web/resolver/testdata/config-multi-chain.toml index 4bb46de4ccb..de243b708e8 100644 --- a/core/web/resolver/testdata/config-multi-chain.toml +++ b/core/web/resolver/testdata/config-multi-chain.toml @@ -82,58 +82,3 @@ Mode = 'FixedPrice' [[EVM.Nodes]] Name = 'bar' WSURL = 'wss://web.socket/test/bar' - -[[Solana]] -ChainID = 'mainnet' -MaxRetries = 12 - -[Solana.MultiNode] -Enabled = false -PollFailureThreshold = 5 -PollInterval = '1s' -SelectionMode = 'HighestHead' -SyncThreshold = 5 -NodeIsSyncingEnabled = false -LeaseDuration = '1m0s' -FinalizedBlockPollInterval = '1s' -EnforceRepeatableRead = true -DeathDeclarationDelay = '1m0s' -VerifyChainID = true -NodeNoNewHeadsThreshold = '1m0s' -NoNewFinalizedHeadsThreshold = '1m0s' -FinalityDepth = 0 -FinalityTagEnabled = true -FinalizedBlockOffset = 0 - -[[Solana.Nodes]] -Name = 'primary' -URL = 'http://mainnet.solana.com' -SendOnly = false - -[[Solana]] -ChainID = 'testnet' -OCR2CachePollPeriod = '1m0s' -LogPollerSlotsBatchSize = 2000 - -[Solana.MultiNode] -Enabled = false -PollFailureThreshold = 5 -PollInterval = '1s' -SelectionMode = 'HighestHead' -SyncThreshold = 5 -NodeIsSyncingEnabled = false -LeaseDuration = '1m0s' -FinalizedBlockPollInterval = '1s' -EnforceRepeatableRead = true -DeathDeclarationDelay = '1m0s' -VerifyChainID = true -NodeNoNewHeadsThreshold = '1m0s' -NoNewFinalizedHeadsThreshold = '1m0s' -FinalityDepth = 0 -FinalityTagEnabled = true -FinalizedBlockOffset = 0 - -[[Solana.Nodes]] -Name = 'secondary' -URL = 'http://testnet.solana.com' -SendOnly = false diff --git a/core/web/testdata/body/health.html b/core/web/testdata/body/health.html index cf189621cf5..851f5e6902f 100644 --- a/core/web/testdata/body/health.html +++ b/core/web/testdata/body/health.html @@ -126,24 +126,6 @@
RetirementReportCache
-
- Solana -
- Bar -
- Chain -
- BalanceMonitor -
-
- Txm -
-
-
- Relayer -
-
-
TelemetryManager
diff --git a/core/web/testdata/body/health.json b/core/web/testdata/body/health.json index 31054ef17e7..5f6fae19e30 100644 --- a/core/web/testdata/body/health.json +++ b/core/web/testdata/body/health.json @@ -252,42 +252,6 @@ "output": "" } }, - { - "type": "checks", - "id": "Solana.Bar.Chain", - "attributes": { - "name": "Solana.Bar.Chain", - "status": "passing", - "output": "" - } - }, - { - "type": "checks", - "id": "Solana.Bar.Chain.BalanceMonitor", - "attributes": { - "name": "Solana.Bar.Chain.BalanceMonitor", - "status": "passing", - "output": "" - } - }, - { - "type": "checks", - "id": "Solana.Bar.Chain.Txm", - "attributes": { - "name": "Solana.Bar.Chain.Txm", - "status": "passing", - "output": "" - } - }, - { - "type": "checks", - "id": "Solana.Bar.Relayer", - "attributes": { - "name": "Solana.Bar.Relayer", - "status": "passing", - "output": "" - } - }, { "type": "checks", "id": "TelemetryManager", diff --git a/core/web/testdata/body/health.txt b/core/web/testdata/body/health.txt index 59a77f4a057..1070a89f475 100644 --- a/core/web/testdata/body/health.txt +++ b/core/web/testdata/body/health.txt @@ -27,9 +27,5 @@ ok PipelineORM ok PipelineRunner ok PipelineRunner.BridgeCache ok RetirementReportCache -ok Solana.Bar.Chain -ok Solana.Bar.Chain.BalanceMonitor -ok Solana.Bar.Chain.Txm -ok Solana.Bar.Relayer ok TelemetryManager ok WorkflowStore diff --git a/deployment/go.mod b/deployment/go.mod index 84ee7bf9652..9be0565cffa 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -48,11 +48,10 @@ require ( github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260429123911-44d13c62c6e1 github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260403151002-2c91155b5501 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260421142741-9c7fbaf7c828 - github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20260423135514-5b1a7565a99c github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260420204255-a3f3bdd56877 github.com/smartcontractkit/chainlink-protos/job-distributor v0.18.0 github.com/smartcontractkit/chainlink-protos/orchestrator v0.10.0 - github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932 + github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-20260421131224-c46cbfe7bc6c github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556 github.com/smartcontractkit/chainlink-sui/deployment v0.0.0-20260427132612-76b9f754a556 @@ -432,6 +431,7 @@ require ( github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20260423135514-5b1a7565a99c // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20260423135514-5b1a7565a99c // indirect github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20260423135514-5b1a7565a99c // indirect + github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20260423135514-5b1a7565a99c // indirect github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20251024234028-0988426d98f4 // indirect github.com/smartcontractkit/chainlink-protos/chainlink-ccv/committee-verifier v0.0.0-20251211142334-5c3421fe2c8d // indirect github.com/smartcontractkit/chainlink-protos/chainlink-ccv/heartbeat v0.0.0-20260115142640-f6b99095c12e // indirect diff --git a/deployment/go.sum b/deployment/go.sum index ef59f88a5fb..5ac8e28a9b6 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1457,8 +1457,8 @@ github.com/smartcontractkit/chainlink-protos/svr v1.2.0 h1:7jjgqRgORQS/ikL3z0ZgJ github.com/smartcontractkit/chainlink-protos/svr v1.2.0/go.mod h1:TcOliTQU6r59DwG4lo3U+mFM9WWyBHGuFkkxQpvSujo= github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997 h1:W0HKHO8eE8BckTRnhSdqjHKbJcnk068nEWYnWRu6tJY= github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997/go.mod h1:GTpDgyK0OObf7jpch6p8N281KxN92wbB8serZhU9yRc= -github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932 h1:aD5KjYqbHiL6OJl3f8tsopVkkAG68UsRJCKjDIACO6w= -github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932/go.mod h1:sUsEwLtVPBlz0wPcysaolS+HVj9cOAt4jYhwE6J8dXg= +github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf h1:GyBD65Cc4HuwRKZ6k4UCtFaG7njGTnZyR+z3VPm3Vyo= +github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf/go.mod h1:sUsEwLtVPBlz0wPcysaolS+HVj9cOAt4jYhwE6J8dXg= github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-20260421131224-c46cbfe7bc6c h1:Hn/80PyYFrQhRlNSaq9HY4cjc/7AuP9zyWLle22t34A= github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-20260421131224-c46cbfe7bc6c/go.mod h1:C5pZsbYX3qkhZTYWr1aYJi9QMfonFAun+Jl1npQ7UJA= github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556 h1:Nz70a+A7aNnWRYdLpGdUf8NeauMvZFOBEPfZTm8vxwI= diff --git a/deployment/utils/nodetestutils/node.go b/deployment/utils/nodetestutils/node.go index f01a9daf0ba..586fcc5bd0e 100644 --- a/deployment/utils/nodetestutils/node.go +++ b/deployment/utils/nodetestutils/node.go @@ -38,11 +38,9 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/keys" evmlptesting "github.com/smartcontractkit/chainlink-evm/pkg/logpoller/testing" "github.com/smartcontractkit/chainlink-evm/pkg/testutils" - mnCfg "github.com/smartcontractkit/chainlink-framework/multinode/config" nodev1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/shared/ptypes" pb "github.com/smartcontractkit/chainlink-protos/orchestrator/feedsmanager" - solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" sollptesting "github.com/smartcontractkit/chainlink-solana/pkg/solana/logpoller/testing" tonlptesting "github.com/smartcontractkit/chainlink-ton/pkg/logpoller/store/postgres/testing" "github.com/smartcontractkit/chainlink/deployment" @@ -437,7 +435,7 @@ func NewNode( } c.EVM = evmConfigs - var solConfigs solcfg.TOMLConfigs + var solConfigs chainlink.RawConfigs for chainID, chain := range nodecfg.BlockChains.SolanaChains() { solanaChainID, err := chainsel.GetChainIDFromSelector(chainID) if err != nil { @@ -822,39 +820,22 @@ func createConfigV2Chain(chainID uint64) *v2toml.EVMConfig { } } -func createSolanaChainConfig(chainID string, chain cldf_solana.Chain) *solcfg.TOMLConfig { - var chainConfig solcfg.Chain - - // CCIP requires a non-zero execution fee estimate - computeUnitPriceDefault := uint64(100) - txRetentionTimeout := config.MustNewDuration(10 * time.Minute) - chainConfig.ComputeUnitPriceDefault = &computeUnitPriceDefault - chainConfig.TxRetentionTimeout = txRetentionTimeout - skip := true - chainConfig.SkipPreflight = &skip - - url, err := config.ParseURL(chain.URL) - if err != nil { - panic(err) - } - - cfg := &solcfg.TOMLConfig{ - ChainID: &chainID, - Enabled: pointer.To(true), - Chain: chainConfig, - MultiNode: mnCfg.MultiNodeConfig{ - MultiNode: mnCfg.MultiNode{ - VerifyChainID: pointer.To(false), - }, +func createSolanaChainConfig(chainID string, chain cldf_solana.Chain) chainlink.RawConfig { + return chainlink.RawConfig{ + "ChainID": chainID, + "Enabled": true, + "ComputeUnitPriceDefault": uint64(100), + "TxRetentionTimeout": "10m0s", + "SkipPreflight": true, + "MultiNode": map[string]any{ + "VerifyChainID": false, }, - Nodes: []*solcfg.Node{{ - Name: pointer.To("primary"), - URL: url, - SendOnly: false, + "Nodes": []map[string]any{{ + "Name": "primary", + "URL": chain.URL, + "SendOnly": false, }}, } - cfg.SetDefaults() - return cfg } func setupJD(t *testing.T, app chainlink.Application) { diff --git a/go.mod b/go.mod index 371010b8239..c00c248812c 100644 --- a/go.mod +++ b/go.mod @@ -103,7 +103,7 @@ require ( github.com/smartcontractkit/chainlink-protos/ring/go v0.0.0-20260331131315-f08a616d8dcd github.com/smartcontractkit/chainlink-protos/storage-service v0.3.0 github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997 - github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932 + github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556 github.com/smartcontractkit/chainlink-ton v0.0.0-20260423161209-5ce1dba9785e github.com/smartcontractkit/cre-sdk-go v1.5.0 diff --git a/go.sum b/go.sum index c7e70b5b889..b160618b45f 100644 --- a/go.sum +++ b/go.sum @@ -1298,8 +1298,8 @@ github.com/smartcontractkit/chainlink-protos/svr v1.2.0 h1:7jjgqRgORQS/ikL3z0ZgJ github.com/smartcontractkit/chainlink-protos/svr v1.2.0/go.mod h1:TcOliTQU6r59DwG4lo3U+mFM9WWyBHGuFkkxQpvSujo= github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997 h1:W0HKHO8eE8BckTRnhSdqjHKbJcnk068nEWYnWRu6tJY= github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997/go.mod h1:GTpDgyK0OObf7jpch6p8N281KxN92wbB8serZhU9yRc= -github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932 h1:aD5KjYqbHiL6OJl3f8tsopVkkAG68UsRJCKjDIACO6w= -github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932/go.mod h1:sUsEwLtVPBlz0wPcysaolS+HVj9cOAt4jYhwE6J8dXg= +github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf h1:GyBD65Cc4HuwRKZ6k4UCtFaG7njGTnZyR+z3VPm3Vyo= +github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf/go.mod h1:sUsEwLtVPBlz0wPcysaolS+HVj9cOAt4jYhwE6J8dXg= github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556 h1:Nz70a+A7aNnWRYdLpGdUf8NeauMvZFOBEPfZTm8vxwI= github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556/go.mod h1:xJ1UT4DKu1znbsm4ehkrfr92rgn8Hxgcp3Z9rgfXRjM= github.com/smartcontractkit/chainlink-ton v0.0.0-20260423161209-5ce1dba9785e h1:hoHL/UDtmasVzu78vwCkfLhDktqjPEhRK7DN58fnn1U= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index ad790e18bd3..1b38ae9cb57 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -429,7 +429,7 @@ require ( github.com/smartcontractkit/chainlink-protos/storage-service v0.3.0 // indirect github.com/smartcontractkit/chainlink-protos/svr v1.2.0 // indirect github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf // indirect github.com/smartcontractkit/chainlink-testing-framework/framework v0.15.18 // indirect github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20260408092456-3c6369888d4a // indirect github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 4ef96e8fb78..02884cdd786 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1442,8 +1442,8 @@ github.com/smartcontractkit/chainlink-protos/svr v1.2.0 h1:7jjgqRgORQS/ikL3z0ZgJ github.com/smartcontractkit/chainlink-protos/svr v1.2.0/go.mod h1:TcOliTQU6r59DwG4lo3U+mFM9WWyBHGuFkkxQpvSujo= github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997 h1:W0HKHO8eE8BckTRnhSdqjHKbJcnk068nEWYnWRu6tJY= github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997/go.mod h1:GTpDgyK0OObf7jpch6p8N281KxN92wbB8serZhU9yRc= -github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932 h1:aD5KjYqbHiL6OJl3f8tsopVkkAG68UsRJCKjDIACO6w= -github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932/go.mod h1:sUsEwLtVPBlz0wPcysaolS+HVj9cOAt4jYhwE6J8dXg= +github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf h1:GyBD65Cc4HuwRKZ6k4UCtFaG7njGTnZyR+z3VPm3Vyo= +github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf/go.mod h1:sUsEwLtVPBlz0wPcysaolS+HVj9cOAt4jYhwE6J8dXg= github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556 h1:Nz70a+A7aNnWRYdLpGdUf8NeauMvZFOBEPfZTm8vxwI= github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556/go.mod h1:xJ1UT4DKu1znbsm4ehkrfr92rgn8Hxgcp3Z9rgfXRjM= github.com/smartcontractkit/chainlink-sui/deployment v0.0.0-20260427132612-76b9f754a556 h1:6ocsoNPu3T0LsBiZ1tGZrjhKu8pGC1opUFz5KgHALSU= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 0e95ca25fc9..a99814555ed 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -507,7 +507,7 @@ require ( github.com/smartcontractkit/chainlink-protos/storage-service v0.3.0 // indirect github.com/smartcontractkit/chainlink-protos/svr v1.2.0 // indirect github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf // indirect github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556 // indirect github.com/smartcontractkit/chainlink-sui/deployment v0.0.0-20260427132612-76b9f754a556 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib v1.54.7 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index d25d7504e3a..659f1b569aa 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1710,8 +1710,8 @@ github.com/smartcontractkit/chainlink-protos/svr v1.2.0 h1:7jjgqRgORQS/ikL3z0ZgJ github.com/smartcontractkit/chainlink-protos/svr v1.2.0/go.mod h1:TcOliTQU6r59DwG4lo3U+mFM9WWyBHGuFkkxQpvSujo= github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997 h1:W0HKHO8eE8BckTRnhSdqjHKbJcnk068nEWYnWRu6tJY= github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997/go.mod h1:GTpDgyK0OObf7jpch6p8N281KxN92wbB8serZhU9yRc= -github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932 h1:aD5KjYqbHiL6OJl3f8tsopVkkAG68UsRJCKjDIACO6w= -github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932/go.mod h1:sUsEwLtVPBlz0wPcysaolS+HVj9cOAt4jYhwE6J8dXg= +github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf h1:GyBD65Cc4HuwRKZ6k4UCtFaG7njGTnZyR+z3VPm3Vyo= +github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf/go.mod h1:sUsEwLtVPBlz0wPcysaolS+HVj9cOAt4jYhwE6J8dXg= github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556 h1:Nz70a+A7aNnWRYdLpGdUf8NeauMvZFOBEPfZTm8vxwI= github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556/go.mod h1:xJ1UT4DKu1znbsm4ehkrfr92rgn8Hxgcp3Z9rgfXRjM= github.com/smartcontractkit/chainlink-sui/deployment v0.0.0-20260427132612-76b9f754a556 h1:6ocsoNPu3T0LsBiZ1tGZrjhKu8pGC1opUFz5KgHALSU= diff --git a/plugins/plugins.public.yaml b/plugins/plugins.public.yaml index 700209c18e1..31e4eca3b57 100644 --- a/plugins/plugins.public.yaml +++ b/plugins/plugins.public.yaml @@ -35,7 +35,7 @@ plugins: solana: - moduleURI: "github.com/smartcontractkit/chainlink-solana" - gitRef: "v1.1.2-0.20260428015924-9456bb6d8932" + gitRef: "v1.1.2-0.20260428170719-7ad4e58aaacf" installPath: "./pkg/solana/cmd/chainlink-solana" starknet: diff --git a/system-tests/lib/cre/don/config/config.go b/system-tests/lib/cre/don/config/config.go index a3c6dd33b7d..019872cc730 100644 --- a/system-tests/lib/cre/don/config/config.go +++ b/system-tests/lib/cre/don/config/config.go @@ -22,7 +22,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-evm/pkg/config/chaintype" evmconfigtoml "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" - solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" "github.com/smartcontractkit/chainlink-testing-framework/framework" chipingressset "github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose/chip_ingress_set" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" @@ -854,20 +853,20 @@ func appendEVMChain(existingConfig *evmconfigtoml.EVMConfigs, evmChain *evmChain *existingConfig = append(*existingConfig, &cfg) } -func appendSolanaChain(existingConfig *solcfg.TOMLConfigs, solChain *solanaChain) { +func appendSolanaChain(existingConfig *corechainlink.RawConfigs, solChain *solanaChain) { for _, existingSol := range *existingConfig { - if existingSol.ChainID != nil && *existingSol.ChainID == solChain.ChainID { + if existingSol.ChainID() == solChain.ChainID { return } } - *existingConfig = append(*existingConfig, &solcfg.TOMLConfig{ - Enabled: ptr.Ptr(true), - ChainID: ptr.Ptr(solChain.ChainID), - Nodes: []*solcfg.Node{ + *existingConfig = append(*existingConfig, corechainlink.RawConfig{ + "Enabled": true, + "ChainID": solChain.ChainID, + "Nodes": []map[string]any{ { - Name: &solChain.Name, - URL: commonconfig.MustParseURL(solChain.NodeURL), + "Name": solChain.Name, + "URL": solChain.NodeURL, }, }, }) diff --git a/system-tests/lib/cre/features/solana/v2/solana.go b/system-tests/lib/cre/features/solana/v2/solana.go index 64af56ef840..c7c8bd7e10f 100644 --- a/system-tests/lib/cre/features/solana/v2/solana.go +++ b/system-tests/lib/cre/features/solana/v2/solana.go @@ -22,7 +22,6 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/datastore" "github.com/smartcontractkit/chainlink-deployments-framework/operations" kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" - solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/cre/forwarder" @@ -445,12 +444,10 @@ func updateNodeConfig(workerNode *cre.NodeMetadata, chainID string, data input, return nil, fmt.Errorf("only 1 Solana chain is supported, but found %d for node at index %d", len(typedConfig.Solana), workerNode.Index) } - if typedConfig.Solana[0].ChainID == nil { - return nil, fmt.Errorf("solana chainID is nil for node at index %d", workerNode.Index) + if typedConfig.Solana[0].ChainID() == "" { + return nil, fmt.Errorf("solana chainID is empty for node at index %d", workerNode.Index) } - var solCfg solcfg.WorkflowConfig - // Execute template with chain's workflow configuration tmpl, err := template.New("solanaWorkflowConfig").Parse(solWorkflowConfigTemplate) if err != nil { @@ -467,12 +464,13 @@ func updateNodeConfig(workerNode *cre.NodeMetadata, chainID string, data input, return nil, fmt.Errorf("%s template validation failed: %w\nRendered template: %s", flag, err, configStr) } - unmarshallErr = toml.Unmarshal([]byte(configStr), &solCfg) + var solWorkflow map[string]any + unmarshallErr = toml.Unmarshal([]byte(configStr), &solWorkflow) if unmarshallErr != nil { return nil, errors.Wrap(unmarshallErr, "failed to unmarshal Solana.Workflow config") } - typedConfig.Solana[0].Workflow = solCfg + typedConfig.Solana[0]["Workflow"] = solWorkflow stringifiedConfig, mErr := toml.Marshal(typedConfig) if mErr != nil { diff --git a/system-tests/lib/go.mod b/system-tests/lib/go.mod index 5a71fe5b82d..75a9f23b646 100644 --- a/system-tests/lib/go.mod +++ b/system-tests/lib/go.mod @@ -42,7 +42,6 @@ require ( github.com/smartcontractkit/chainlink-protos/job-distributor v0.18.0 github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997 - github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932 github.com/smartcontractkit/chainlink-testing-framework/framework v0.15.18 github.com/smartcontractkit/chainlink-testing-framework/framework/components/chiprouter v1.0.2 github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose v0.1.15 @@ -479,6 +478,7 @@ require ( github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 // indirect github.com/smartcontractkit/chainlink-protos/storage-service v0.3.0 // indirect github.com/smartcontractkit/chainlink-protos/svr v1.2.0 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf // indirect github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-20260421131224-c46cbfe7bc6c // indirect github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556 // indirect github.com/smartcontractkit/chainlink-sui/deployment v0.0.0-20260427132612-76b9f754a556 // indirect diff --git a/system-tests/lib/go.sum b/system-tests/lib/go.sum index b66491f764e..577df946423 100644 --- a/system-tests/lib/go.sum +++ b/system-tests/lib/go.sum @@ -1678,8 +1678,8 @@ github.com/smartcontractkit/chainlink-protos/svr v1.2.0 h1:7jjgqRgORQS/ikL3z0ZgJ github.com/smartcontractkit/chainlink-protos/svr v1.2.0/go.mod h1:TcOliTQU6r59DwG4lo3U+mFM9WWyBHGuFkkxQpvSujo= github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997 h1:W0HKHO8eE8BckTRnhSdqjHKbJcnk068nEWYnWRu6tJY= github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997/go.mod h1:GTpDgyK0OObf7jpch6p8N281KxN92wbB8serZhU9yRc= -github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932 h1:aD5KjYqbHiL6OJl3f8tsopVkkAG68UsRJCKjDIACO6w= -github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932/go.mod h1:sUsEwLtVPBlz0wPcysaolS+HVj9cOAt4jYhwE6J8dXg= +github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf h1:GyBD65Cc4HuwRKZ6k4UCtFaG7njGTnZyR+z3VPm3Vyo= +github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf/go.mod h1:sUsEwLtVPBlz0wPcysaolS+HVj9cOAt4jYhwE6J8dXg= github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-20260421131224-c46cbfe7bc6c h1:Hn/80PyYFrQhRlNSaq9HY4cjc/7AuP9zyWLle22t34A= github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-20260421131224-c46cbfe7bc6c/go.mod h1:C5pZsbYX3qkhZTYWr1aYJi9QMfonFAun+Jl1npQ7UJA= github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556 h1:Nz70a+A7aNnWRYdLpGdUf8NeauMvZFOBEPfZTm8vxwI= diff --git a/system-tests/tests/go.mod b/system-tests/tests/go.mod index 674b2dfd66d..c3dfe04a5dc 100644 --- a/system-tests/tests/go.mod +++ b/system-tests/tests/go.mod @@ -157,7 +157,7 @@ require ( github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d // indirect github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d // indirect github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260319180422-b5808c964785 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf // indirect github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-20260421131224-c46cbfe7bc6c // indirect github.com/smartcontractkit/chainlink-sui/deployment v0.0.0-20260427132612-76b9f754a556 // indirect github.com/smartcontractkit/cld-changesets v0.0.0-20260427210718-b873c54e8d22 // indirect diff --git a/system-tests/tests/go.sum b/system-tests/tests/go.sum index aaeb5959694..0dad6a91db0 100644 --- a/system-tests/tests/go.sum +++ b/system-tests/tests/go.sum @@ -1893,8 +1893,8 @@ github.com/smartcontractkit/chainlink-protos/svr v1.2.0 h1:7jjgqRgORQS/ikL3z0ZgJ github.com/smartcontractkit/chainlink-protos/svr v1.2.0/go.mod h1:TcOliTQU6r59DwG4lo3U+mFM9WWyBHGuFkkxQpvSujo= github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997 h1:W0HKHO8eE8BckTRnhSdqjHKbJcnk068nEWYnWRu6tJY= github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260323124644-faea187e6997/go.mod h1:GTpDgyK0OObf7jpch6p8N281KxN92wbB8serZhU9yRc= -github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932 h1:aD5KjYqbHiL6OJl3f8tsopVkkAG68UsRJCKjDIACO6w= -github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428015924-9456bb6d8932/go.mod h1:sUsEwLtVPBlz0wPcysaolS+HVj9cOAt4jYhwE6J8dXg= +github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf h1:GyBD65Cc4HuwRKZ6k4UCtFaG7njGTnZyR+z3VPm3Vyo= +github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260428170719-7ad4e58aaacf/go.mod h1:sUsEwLtVPBlz0wPcysaolS+HVj9cOAt4jYhwE6J8dXg= github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-20260421131224-c46cbfe7bc6c h1:Hn/80PyYFrQhRlNSaq9HY4cjc/7AuP9zyWLle22t34A= github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-20260421131224-c46cbfe7bc6c/go.mod h1:C5pZsbYX3qkhZTYWr1aYJi9QMfonFAun+Jl1npQ7UJA= github.com/smartcontractkit/chainlink-sui v0.0.0-20260427132612-76b9f754a556 h1:Nz70a+A7aNnWRYdLpGdUf8NeauMvZFOBEPfZTm8vxwI= diff --git a/testdata/scripts/health/multi-chain.txtar b/testdata/scripts/health/multi-chain.txtar index ad456fc2db8..ec3e64b65b4 100644 --- a/testdata/scripts/health/multi-chain.txtar +++ b/testdata/scripts/health/multi-chain.txtar @@ -46,13 +46,6 @@ Name = 'fake' WSURL = 'wss://foo.bar/ws' HTTPURL = 'https://foo.bar' -[[Solana]] -ChainID = 'Bar' - -[[Solana.Nodes]] -Name = 'primary' -URL = 'http://solana.web' - -- out.txt -- ok BridgeStatusReporter ok CRE @@ -83,10 +76,6 @@ ok PipelineORM ok PipelineRunner ok PipelineRunner.BridgeCache ok RetirementReportCache -ok Solana.Bar.Chain -ok Solana.Bar.Chain.BalanceMonitor -ok Solana.Bar.Chain.Txm -ok Solana.Bar.Relayer ok TelemetryManager ok WorkflowStore @@ -349,42 +338,6 @@ ok WorkflowStore "output": "" } }, - { - "type": "checks", - "id": "Solana.Bar.Chain", - "attributes": { - "name": "Solana.Bar.Chain", - "status": "passing", - "output": "" - } - }, - { - "type": "checks", - "id": "Solana.Bar.Chain.BalanceMonitor", - "attributes": { - "name": "Solana.Bar.Chain.BalanceMonitor", - "status": "passing", - "output": "" - } - }, - { - "type": "checks", - "id": "Solana.Bar.Chain.Txm", - "attributes": { - "name": "Solana.Bar.Chain.Txm", - "status": "passing", - "output": "" - } - }, - { - "type": "checks", - "id": "Solana.Bar.Relayer", - "attributes": { - "name": "Solana.Bar.Relayer", - "status": "passing", - "output": "" - } - }, { "type": "checks", "id": "TelemetryManager", diff --git a/testdata/scripts/node/validate/invalid-duplicates.txtar b/testdata/scripts/node/validate/invalid-duplicates.txtar index 7cb1bbe6b6b..c45237d410d 100644 --- a/testdata/scripts/node/validate/invalid-duplicates.txtar +++ b/testdata/scripts/node/validate/invalid-duplicates.txtar @@ -96,10 +96,9 @@ Error running app: invalid configuration: 5 errors: - Cosmos: 2 errors: - 1.ChainID: invalid value (Malaga-420): duplicate - must be unique - 1.Nodes.1.Name: invalid value (primary): duplicate - must be unique - - Solana: 3 errors: + - Solana: 2 errors: - 1.ChainID: invalid value (mainnet): duplicate - must be unique - 1.Nodes.1.Name: invalid value (primary): duplicate - must be unique - - 1.Nodes.1.URL: invalid value (http://solana.web): duplicate - must be unique - Starknet: 2 errors: - 1.ChainID: invalid value (foobar): duplicate - must be unique - 1.Nodes.1.Name: invalid value (primary): duplicate - must be unique diff --git a/testdata/scripts/nodes/solana/list/list.txtar b/testdata/scripts/nodes/solana/list/list.txtar index dc65e06103f..81f5ec851f8 100644 --- a/testdata/scripts/nodes/solana/list/list.txtar +++ b/testdata/scripts/nodes/solana/list/list.txtar @@ -10,6 +10,7 @@ exec chainlink --remote-node-url $NODEURL admin login -file creds --bypass-versi exec chainlink --remote-node-url $NODEURL nodes solana list cmp stdout out.txt +-- go:build.integration -- -- testdb.txt -- CL_DATABASE_URL -- testport.txt --