Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

bump solana + cleanup types #13253

Merged
merged 13 commits into from
May 23, 2024
10 changes: 9 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ jobs:
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
- name: Pull Artfacts
- name: Pull Artifacts
if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
run: |
IMAGE_NAME=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }}
Expand All @@ -1232,12 +1232,20 @@ jobs:
docker rm "$CONTAINER_ID"
- name: Install Solana CLI # required for ensuring the local test validator is configured correctly
run: ./scripts/install-solana-ci.sh
- name: Install gauntlet
run: |
yarn --cwd ./gauntlet install --frozen-lockfile
yarn --cwd ./gauntlet build
yarn --cwd ./gauntlet gauntlet
- name: Generate config overrides
run: | # https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md
cat << EOF > config.toml
[ChainlinkImage]
image="${{ env.CHAINLINK_IMAGE }}"
version="${{ inputs.evm-ref || github.sha }}"
[Common]
user="${{ github.actor }}"
internal_docker_repo = "${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com"
EOF
# shellcheck disable=SC2002
BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0)
Expand Down
32 changes: 15 additions & 17 deletions core/cmd/shell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import (
"github.com/urfave/cli"

commoncfg "github.com/smartcontractkit/chainlink-common/pkg/config"
"github.com/smartcontractkit/chainlink-solana/pkg/solana"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
"github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config"
stkcfg "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config"
"github.com/smartcontractkit/chainlink/v2/core/cmd"
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
Expand Down Expand Up @@ -359,20 +357,20 @@ func TestSetupSolanaRelayer(t *testing.T) {
// 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 = solana.TOMLConfigs{
&solana.TOMLConfig{
c.Solana = solcfg.TOMLConfigs{
&solcfg.TOMLConfig{
ChainID: ptr[string]("solana-id-1"),
Enabled: ptr(true),
Chain: solcfg.Chain{},
Nodes: []*solcfg.Node{},
},
&solana.TOMLConfig{
&solcfg.TOMLConfig{
ChainID: ptr[string]("solana-id-2"),
Enabled: ptr(true),
Chain: solcfg.Chain{},
Nodes: []*solcfg.Node{},
},
&solana.TOMLConfig{
&solcfg.TOMLConfig{
ChainID: ptr[string]("disabled-solana-id-1"),
Enabled: ptr(false),
Chain: solcfg.Chain{},
Expand All @@ -382,8 +380,8 @@ func TestSetupSolanaRelayer(t *testing.T) {
})

t2Config := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) {
c.Solana = solana.TOMLConfigs{
&solana.TOMLConfig{
c.Solana = solcfg.TOMLConfigs{
&solcfg.TOMLConfig{
ChainID: ptr[string]("solana-id-1"),
Enabled: ptr(true),
Chain: solcfg.Chain{},
Expand Down Expand Up @@ -420,14 +418,14 @@ 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 = solana.TOMLConfigs{
&solana.TOMLConfig{
c.Solana = solcfg.TOMLConfigs{
&solcfg.TOMLConfig{
ChainID: ptr[string]("dupe"),
Enabled: ptr(true),
Chain: solcfg.Chain{},
Nodes: []*solcfg.Node{},
},
&solana.TOMLConfig{
&solcfg.TOMLConfig{
ChainID: ptr[string]("dupe"),
Enabled: ptr(true),
Chain: solcfg.Chain{},
Expand Down Expand Up @@ -478,21 +476,21 @@ func TestSetupStarkNetRelayer(t *testing.T) {
ChainID: ptr[string]("starknet-id-1"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
Nodes: []*stkcfg.Node{},
FeederURL: commoncfg.MustParseURL("https://feeder.url"),
},
&stkcfg.TOMLConfig{
ChainID: ptr[string]("starknet-id-2"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
Nodes: []*stkcfg.Node{},
FeederURL: commoncfg.MustParseURL("https://feeder.url"),
},
&stkcfg.TOMLConfig{
ChainID: ptr[string]("disabled-starknet-id-1"),
Enabled: ptr(false),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
Nodes: []*stkcfg.Node{},
FeederURL: commoncfg.MustParseURL("https://feeder.url"),
},
}
Expand All @@ -504,7 +502,7 @@ func TestSetupStarkNetRelayer(t *testing.T) {
ChainID: ptr[string]("starknet-id-3"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
Nodes: []*stkcfg.Node{},
FeederURL: commoncfg.MustParseURL("https://feeder.url"),
},
}
Expand Down Expand Up @@ -542,14 +540,14 @@ func TestSetupStarkNetRelayer(t *testing.T) {
ChainID: ptr[string]("dupe"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
Nodes: []*stkcfg.Node{},
FeederURL: commoncfg.MustParseURL("https://feeder.url"),
},
&stkcfg.TOMLConfig{
ChainID: ptr[string]("dupe"),
Enabled: ptr(true),
Chain: stkcfg.Chain{},
Nodes: []*config.Node{},
Nodes: []*stkcfg.Node{},
FeederURL: commoncfg.MustParseURL("https://feeder.url"),
},
}
Expand Down
4 changes: 2 additions & 2 deletions core/cmd/solana_chains_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-solana/pkg/solana"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
"github.com/smartcontractkit/chainlink/v2/core/cmd"
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils/solanatest"
Expand All @@ -16,7 +16,7 @@ func TestShell_IndexSolanaChains(t *testing.T) {
t.Parallel()

id := solanatest.RandomChainID()
cfg := solana.TOMLConfig{
cfg := solcfg.TOMLConfig{
ChainID: &id,
Enabled: ptr(true),
}
Expand Down
7 changes: 3 additions & 4 deletions core/cmd/solana_node_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/config"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"

"github.com/smartcontractkit/chainlink-solana/pkg/solana"
"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"
)

func solanaStartNewApplication(t *testing.T, cfgs ...*solana.TOMLConfig) *cltest.TestApplication {
func solanaStartNewApplication(t *testing.T, cfgs ...*solcfg.TOMLConfig) *cltest.TestApplication {
for i := range cfgs {
cfgs[i].SetDefaults()
}
Expand All @@ -41,9 +40,9 @@ func TestShell_IndexSolanaNodes(t *testing.T) {
Name: ptr("second"),
URL: config.MustParseURL("https://solana2.example"),
}
chain := solana.TOMLConfig{
chain := solcfg.TOMLConfig{
ChainID: &id,
Nodes: solana.SolanaNodes{&node1, &node2},
Nodes: solcfg.Nodes{&node1, &node2},
}
app := solanaStartNewApplication(t, &chain)
client, r := app.NewShellAndRenderer()
Expand Down
5 changes: 2 additions & 3 deletions core/cmd/solana_transaction_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/urfave/cli"

"github.com/smartcontractkit/chainlink-common/pkg/config"
"github.com/smartcontractkit/chainlink-solana/pkg/solana"
solanaClient "github.com/smartcontractkit/chainlink-solana/pkg/solana/client"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
Expand All @@ -32,9 +31,9 @@ func TestShell_SolanaSendSol(t *testing.T) {
Name: ptr(t.Name()),
URL: config.MustParseURL(url),
}
cfg := solana.TOMLConfig{
cfg := solcfg.TOMLConfig{
ChainID: &chainID,
Nodes: solana.SolanaNodes{&node},
Nodes: solcfg.Nodes{&node},
Enabled: ptr(true),
}
app := solanaStartNewApplication(t, &cfg)
Expand Down
4 changes: 2 additions & 2 deletions core/config/docs/docs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/require"

coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config"
"github.com/smartcontractkit/chainlink-solana/pkg/solana"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
stkcfg "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config"

"github.com/smartcontractkit/chainlink-common/pkg/config"
Expand Down Expand Up @@ -97,7 +97,7 @@ func TestDoc(t *testing.T) {
})

t.Run("Solana", func(t *testing.T) {
var fallbackDefaults solana.TOMLConfig
var fallbackDefaults solcfg.TOMLConfig
fallbackDefaults.SetDefaults()

assertTOML(t, fallbackDefaults.Chain, defaults.Solana[0].Chain)
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ require (
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240508101745-af1ed7bc8a69 // indirect
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 // indirect
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240422130241-13c17a91b2ab // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240510181707-46b1311a5a83 // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240522175655-cfbd93560a5d // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240508155030-1024f2b55c69 // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect
github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1193,8 +1193,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540/go.mod h1:sjAmX8K2kbQhvDarZE1ZZgDgmHJ50s0BBc/66vKY2ek=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240422130241-13c17a91b2ab h1:Ct1oUlyn03HDUVdFHJqtRGRUujMqdoMzvf/Cjhe30Ag=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240422130241-13c17a91b2ab/go.mod h1:RPUY7r8GxgzXxS1ijtU1P/fpJomOXztXgUbEziNmbCA=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240510181707-46b1311a5a83 h1:f3W82k9V/XA6ZP/VQVJcGMVR6CrL3pQrPJSwyQWVFys=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240510181707-46b1311a5a83/go.mod h1:RdAtOeBUWq2zByw2kEbwPlXaPIb7YlaDOmnn+nVUBJI=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240522175655-cfbd93560a5d h1:FkeNJF8GY4R7p1Hm92fuBrZPI0ACQHGaGgEE4kmkF2c=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240522175655-cfbd93560a5d/go.mod h1:sR0dMjjpvvEpX3qH8DPRANauPkbO9jgUUGYK95xjLRU=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240508155030-1024f2b55c69 h1:ssh/w3oXWu+C6bE88GuFRC1+0Bx/4ihsbc80XMLrl2k=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240508155030-1024f2b55c69/go.mod h1:VsfjhvWgjxqWja4q+FlXEtX5lu8BSxn10xRo6gi948g=
github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772 h1:LQmRsrzzaYYN3wEU1l5tWiccznhvbyGnu2N+wHSXZAo=
Expand Down
6 changes: 3 additions & 3 deletions core/services/chainlink/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
gotoml "github.com/pelletier/go-toml/v2"

coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config"
"github.com/smartcontractkit/chainlink-solana/pkg/solana"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
stkcfg "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config"

commoncfg "github.com/smartcontractkit/chainlink/v2/common/config"
Expand Down Expand Up @@ -39,7 +39,7 @@ type Config struct {

Cosmos coscfg.TOMLConfigs `toml:",omitempty"`

Solana solana.TOMLConfigs `toml:",omitempty"`
Solana solcfg.TOMLConfigs `toml:",omitempty"`

Starknet stkcfg.TOMLConfigs `toml:",omitempty"`
}
Expand Down Expand Up @@ -122,7 +122,7 @@ func (c *Config) setDefaults() {

for i := range c.Solana {
if c.Solana[i] == nil {
c.Solana[i] = new(solana.TOMLConfig)
c.Solana[i] = new(solcfg.TOMLConfig)
}
c.Solana[i].Chain.SetDefaults()
}
Expand Down
4 changes: 2 additions & 2 deletions core/services/chainlink/config_general.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"go.uber.org/zap/zapcore"

coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config"
"github.com/smartcontractkit/chainlink-solana/pkg/solana"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
starknet "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config"

commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config"
Expand Down Expand Up @@ -201,7 +201,7 @@ func (g *generalConfig) CosmosConfigs() coscfg.TOMLConfigs {
return g.c.Cosmos
}

func (g *generalConfig) SolanaConfigs() solana.TOMLConfigs {
func (g *generalConfig) SolanaConfigs() solcfg.TOMLConfigs {
return g.c.Solana
}

Expand Down
7 changes: 3 additions & 4 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
commoncfg "github.com/smartcontractkit/chainlink-common/pkg/config"
"github.com/smartcontractkit/chainlink-common/pkg/utils/hex"
coscfg "github.com/smartcontractkit/chainlink-cosmos/pkg/cosmos/config"
"github.com/smartcontractkit/chainlink-solana/pkg/solana"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
stkcfg "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config"
commonconfig "github.com/smartcontractkit/chainlink/v2/common/config"
Expand Down Expand Up @@ -160,7 +159,7 @@ var (
{Name: ptr("secondary"), TendermintURL: commoncfg.MustParseURL("http://bombay.cosmos.com")},
}},
},
Solana: []*solana.TOMLConfig{
Solana: []*solcfg.TOMLConfig{
{
ChainID: ptr("mainnet"),
Chain: solcfg.Chain{
Expand Down Expand Up @@ -632,7 +631,7 @@ func TestConfig_Marshal(t *testing.T) {
},
}},
}
full.Solana = []*solana.TOMLConfig{
full.Solana = []*solcfg.TOMLConfig{
{
ChainID: ptr("mainnet"),
Enabled: ptr(false),
Expand Down Expand Up @@ -1546,7 +1545,7 @@ func TestConfig_setDefaults(t *testing.T) {
var c Config
c.EVM = evmcfg.EVMConfigs{{ChainID: ubig.NewI(99999133712345)}}
c.Cosmos = coscfg.TOMLConfigs{{ChainID: ptr("unknown cosmos chain")}}
c.Solana = solana.TOMLConfigs{{ChainID: ptr("unknown solana chain")}}
c.Solana = solcfg.TOMLConfigs{{ChainID: ptr("unknown solana chain")}}
c.Starknet = stkcfg.TOMLConfigs{{ChainID: ptr("unknown starknet chain")}}
c.setDefaults()
if s, err := c.TOMLString(); assert.NoError(t, err) {
Expand Down
10 changes: 5 additions & 5 deletions core/services/chainlink/mocks/general_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
stkcfg "github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config"

"github.com/smartcontractkit/chainlink-solana/pkg/solana"
ubig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils/big"
"github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm"
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
Expand Down Expand Up @@ -75,8 +74,8 @@ func TestCoreRelayerChainInteroperators(t *testing.T) {
Nodes: evmcfg.EVMNodes{&node2_1},
})

c.Solana = solana.TOMLConfigs{
&solana.TOMLConfig{
c.Solana = solcfg.TOMLConfigs{
&solcfg.TOMLConfig{
ChainID: &solanaChainID1,
Enabled: ptr(true),
Chain: solcfg.Chain{},
Expand All @@ -85,7 +84,7 @@ func TestCoreRelayerChainInteroperators(t *testing.T) {
URL: ((*commonconfig.URL)(commonconfig.MustParseURL("http://localhost:8547").URL())),
}},
},
&solana.TOMLConfig{
&solcfg.TOMLConfig{
ChainID: &solanaChainID2,
Enabled: ptr(true),
Chain: solcfg.Chain{},
Expand Down
Loading
Loading