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

merge develop + bump dependencies #723

Merged
merged 5 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cmd/monitoring/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,22 @@ func main() {
metrics.NewFeedBalances(logger.With(log, "component", promMetrics)),
)
reportObservationsFactory := exporter.NewReportObservationsFactory(
logger.With(log, "component", "solana-prome-exporter"),
logger.With(log, "component", promExporter),
metrics.NewReportObservations(logger.With(log, "component", promMetrics)),
)
feesFactory := exporter.NewFeesFactory(
logger.With(log, "component", "solana-prome-exporter"),
logger.With(log, "component", promExporter),
metrics.NewFees(logger.With(log, "component", promMetrics)),
)
nodeSuccessFactory := exporter.NewNodeSuccessFactory(
logger.With(log, "component", promExporter),
metrics.NewNodeSuccess(logger.With(log, "component", promMetrics)),
)
monitor.ExporterFactories = append(monitor.ExporterFactories,
feedBalancesExporterFactory,
reportObservationsFactory,
feesFactory,
nodeSuccessFactory,
)

// network exporters
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/mitchellh/mapstructure v1.5.0
github.com/pelletier/go-toml/v2 v2.1.1
github.com/prometheus/client_golang v1.17.0
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524093536-4faf6e011d6d
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303
github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c
github.com/stretchr/testify v1.9.0
go.uber.org/zap v1.26.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,8 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524093536-4faf6e011d6d h1:TkEpsNaANB6cdi4ODNOqo9onpe0ddmQxlRQT1dVYnvw=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524093536-4faf6e011d6d/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303 h1:iyLE5c2YFxy89t2v5u+aQOHqRE4c+sCMze70KIo07mI=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs=
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss=
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4=
github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU=
Expand Down
39 changes: 4 additions & 35 deletions integration-tests/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,18 @@ import (
"github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/chainlink"
mock_adapter "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/mock-adapter"
"github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/sol"
"github.com/smartcontractkit/chainlink-testing-framework/utils/ptr"

"github.com/smartcontractkit/chainlink/integration-tests/client"
"github.com/smartcontractkit/chainlink/integration-tests/contracts"
"github.com/smartcontractkit/chainlink/integration-tests/docker/test_env"
"github.com/smartcontractkit/chainlink/integration-tests/types/config/node"

cl "github.com/smartcontractkit/chainlink/v2/core/services/chainlink"
"github.com/smartcontractkit/chainlink/v2/core/services/job"
"github.com/smartcontractkit/chainlink/v2/core/store/models"

"github.com/smartcontractkit/chainlink-common/pkg/config"
commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config"

chainConfig "github.com/smartcontractkit/chainlink-solana/integration-tests/config"
test_env_sol "github.com/smartcontractkit/chainlink-solana/integration-tests/docker/testenv"
"github.com/smartcontractkit/chainlink-solana/integration-tests/solclient"
tc "github.com/smartcontractkit/chainlink-solana/integration-tests/testconfig"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
)

type Common struct {
Expand Down Expand Up @@ -170,6 +163,9 @@ func New(testConfig *tc.TestConfig) *Common {
},
Env: &environment.Environment{},
}
// provide getters for TestConfig (pointers to chain details)
c.TestConfig.GetChainID = func() string { return c.ChainDetails.ChainID }
c.TestConfig.GetURL = func() string { return c.ChainDetails.RPCUrl }

return c
}
Expand Down Expand Up @@ -483,32 +479,6 @@ func BuildNodeContractPairID(node *client.ChainlinkClient, ocr2Addr string) (str
return strings.ToLower(fmt.Sprintf("node_%s_contract_%s", shortNodeAddr, shortOCRAddr)), nil
}

func (c *Common) DefaultNodeConfig() *cl.Config {
solConfig := solcfg.TOMLConfig{
Enabled: ptr.Ptr(true),
ChainID: ptr.Ptr(c.ChainDetails.ChainID),
Nodes: []*solcfg.Node{
{
Name: ptr.Ptr("primary"),
URL: config.MustParseURL(c.ChainDetails.RPCUrl),
},
},
}
baseConfig := node.NewBaseConfig()
baseConfig.Solana = solcfg.TOMLConfigs{
&solConfig,
}
baseConfig.OCR2.Enabled = ptr.Ptr(true)
baseConfig.P2P.V2.Enabled = ptr.Ptr(true)
fiveSecondDuration := commonconfig.MustNewDuration(5 * time.Second)

baseConfig.P2P.V2.DeltaDial = fiveSecondDuration
baseConfig.P2P.V2.DeltaReconcile = fiveSecondDuration
baseConfig.P2P.V2.ListenAddresses = &[]string{"0.0.0.0:6690"}

return baseConfig
}

func (c *Common) Default(t *testing.T, namespacePrefix string) (*Common, error) {
c.TestEnvDetails.K8Config = &environment.Config{
NamespacePrefix: fmt.Sprintf("solana-%s", namespacePrefix),
Expand All @@ -517,8 +487,7 @@ func (c *Common) Default(t *testing.T, namespacePrefix string) (*Common, error)
}

if *c.TestConfig.Common.InsideK8s {
toml := c.DefaultNodeConfig()
tomlString, err := toml.TOMLString()
tomlString, err := c.TestConfig.GetNodeConfigTOML()
if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion integration-tests/common/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ func (m *OCRv2TestState) DeployCluster(contractsDir string) {
WithTestInstance(m.Config.T).
WithTestConfig(m.Config.TestConfig).
WithMockAdapter().
WithCLNodeConfig(m.Common.DefaultNodeConfig()).
WithCLNodes(*m.Config.TestConfig.OCR2.NodeCount).
WithCLNodeOptions(m.Common.TestEnvDetails.NodeOpts...).
WithStandardCleanup().
Expand Down
12 changes: 6 additions & 6 deletions integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ require (
github.com/lib/pq v1.10.9
github.com/pelletier/go-toml/v2 v2.1.1
github.com/rs/zerolog v1.30.0
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524093536-4faf6e011d6d
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240523174813-45db170c1ccc
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240524160213-b47649f55e0b
github.com/smartcontractkit/chainlink-testing-framework v1.28.15
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240515225456-aeb9f4d50d65
github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240524101405-efc810b13911
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240524164411-7a51959eb75a
github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240524164411-7a51959eb75a
github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c
github.com/smartcontractkit/seth v1.0.9
github.com/stretchr/testify v1.9.0
Expand Down Expand Up @@ -359,10 +359,10 @@ require (
github.com/slack-go/slack v0.12.2 // indirect
github.com/smartcontractkit/chain-selectors v1.0.10 // indirect
github.com/smartcontractkit/chainlink-automation v1.0.3 // indirect
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240523163133-2618ef1e488d // indirect
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524163550-be7ac130554f // indirect
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 // indirect
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240523163038-20a173d8e5ec // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240524163844-2b5c69896faa // indirect
github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449 // indirect
github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772 // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect
Expand Down
20 changes: 10 additions & 10 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1406,26 +1406,26 @@ github.com/smartcontractkit/chain-selectors v1.0.10 h1:t9kJeE6B6G+hKD0GYR4kGJSCq
github.com/smartcontractkit/chain-selectors v1.0.10/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE=
github.com/smartcontractkit/chainlink-automation v1.0.3 h1:h/ijT0NiyV06VxYVgcNfsE3+8OEzT3Q0Z9au0z1BPWs=
github.com/smartcontractkit/chainlink-automation v1.0.3/go.mod h1:RjboV0Qd7YP+To+OrzHGXaxUxoSONveCoAK2TQ1INLU=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524093536-4faf6e011d6d h1:TkEpsNaANB6cdi4ODNOqo9onpe0ddmQxlRQT1dVYnvw=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524093536-4faf6e011d6d/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240523163133-2618ef1e488d h1:pSguOk4l9YHLnV2R1ioe7rVmrFjqoNwCLFCK3isag94=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240523163133-2618ef1e488d/go.mod h1:WUzz+a/UgUsLOo3fdrSJQpXocLmghNg5LrcJIhRAq8Q=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303 h1:iyLE5c2YFxy89t2v5u+aQOHqRE4c+sCMze70KIo07mI=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240524173852-a74b009c7303/go.mod h1:DUZccDEW98n+J1mhdWGO7wr/Njad9p9Fzks839JN7Rs=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524163550-be7ac130554f h1:k8h4Yjj3kXKm11dujvcknkplDOqmFz+d+8bwQFOzq6E=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524163550-be7ac130554f/go.mod h1:reWTkkx0lPclYjRa3kFaV2fmbDl6H06HLiAFhsNoP8E=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 h1:xFSv8561jsLtF6gYZr/zW2z5qUUAkcFkApin2mnbYTo=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540/go.mod h1:sjAmX8K2kbQhvDarZE1ZZgDgmHJ50s0BBc/66vKY2ek=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 h1:MD80ZRCTvxxJ8PBmhtrKoTnky8cVNYrCrIBLVRbrOM0=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917/go.mod h1:jwVxhctE6BgLOSSsVq9wbREpZ8Ev34H+UBxeUhESZRs=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240523163038-20a173d8e5ec h1:s4WCsBQmE39uYEAgik/Pqzh2MtUPsH3U0Axg3bsZzn4=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240523163038-20a173d8e5ec/go.mod h1:Dk/jiFcvg86hlxhbLQjdPkb6GRr6yEiti9m2koHbZuY=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240524163844-2b5c69896faa h1:mbjbmV83e5u761pqWqbGg+MyH64z0B9QM5ZjboVG2js=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240524163844-2b5c69896faa/go.mod h1:DBWzejxlSL855eM8DphHrxvJ9WhQ9C6cBHEGbcomFwQ=
github.com/smartcontractkit/chainlink-testing-framework v1.28.15 h1:mga7N6jtXQ3UOCt43IdsEnCMBh9xjOWPaE9BiM6kr6Q=
github.com/smartcontractkit/chainlink-testing-framework v1.28.15/go.mod h1:x1zDOz8zcLjEvs9fNA9y/DMguLam/2+CJdpxX0+rM8A=
github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449 h1:fX/xmGm1GBsD1ZZnooNT+eWA0hiTAqFlHzOC5CY4dy8=
github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240328204215-ac91f55f1449/go.mod h1:DC8sQMyTlI/44UCTL8QWFwb0bYNoXCfjwCv2hMivYZU=
github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772 h1:LQmRsrzzaYYN3wEU1l5tWiccznhvbyGnu2N+wHSXZAo=
github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772/go.mod h1:Kn1Hape05UzFZ7bOUnm3GVsHzP0TNrVmpfXYNHdqGGs=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240515225456-aeb9f4d50d65 h1:8AoBDPHOLgZA1JodqysYK/JxcVbjwNhyGfmwzQuep4s=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240515225456-aeb9f4d50d65/go.mod h1:DOeyxJuvSV8No26UHAtmvZTycuGe0S4w/XMMj1EGMV8=
github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240524101405-efc810b13911 h1:txjA8yF/ztl/B3BgOIyUfoEnw7k4JJwRQvQ2qZtFqPg=
github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240524101405-efc810b13911/go.mod h1:N+101og7dx8dY81uqMJqpCqu56IY2G55DoYbMGwvruM=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240524164411-7a51959eb75a h1:MvkbkOXU5SKKCEMWcqvuEYDTjDOLBT1UvOaPDFMITtY=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240524164411-7a51959eb75a/go.mod h1:CD4LdBwQCtHjpID2UZTUuISMd06R8AnmcgcYGAgA9+I=
github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240524164411-7a51959eb75a h1:C3yHYi9OuddN3mi3h6aaAbxjz0pNHhV2T+MD1sCIaZM=
github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240524164411-7a51959eb75a/go.mod h1:hTGmFkhasOS1P+DeUppBu1FmjMKAv/Vijumuqh3o2ow=
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss=
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4=
github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU=
Expand Down
54 changes: 53 additions & 1 deletion integration-tests/testconfig/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import (
"encoding/base64"
"errors"
"fmt"
"log"
"os"
"strings"
"time"

"github.com/barkimedes/go-deepcopy"
"github.com/google/uuid"
Expand All @@ -15,14 +17,18 @@ import (
"golang.org/x/text/cases"
"golang.org/x/text/language"

"github.com/smartcontractkit/chainlink-common/pkg/config"
"github.com/smartcontractkit/chainlink/integration-tests/types/config/node"
"github.com/smartcontractkit/seth"

ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config"
k8s_config "github.com/smartcontractkit/chainlink-testing-framework/k8s/config"
"github.com/smartcontractkit/chainlink-testing-framework/logging"
"github.com/smartcontractkit/chainlink-testing-framework/utils/osutil"
"github.com/smartcontractkit/chainlink-testing-framework/utils/ptr"

ocr2_config "github.com/smartcontractkit/chainlink-solana/integration-tests/testconfig/ocr2"
solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config"
)

type TestConfig struct {
Expand All @@ -34,6 +40,10 @@ type TestConfig struct {
OCR2 *ocr2_config.Config `toml:"OCR2"`
SolanaConfig *SolanaConfig `toml:"SolanaConfig"`
ConfigurationName string `toml:"-"`

// getter funcs for passing parameters
GetChainID func() string
GetURL func() string
}

func (c *TestConfig) GetLoggingConfig() *ctf_config.LoggingConfig {
Expand All @@ -53,7 +63,49 @@ func (c *TestConfig) GetSethConfig() *seth.Config {
}

func (c *TestConfig) GetNodeConfig() *ctf_config.NodeConfig {
return nil
cfgTOML, err := c.GetNodeConfigTOML()
if err != nil {
log.Fatalf("failed to parse TOML config: %s", err)
return nil
}

return &ctf_config.NodeConfig{
BaseConfigTOML: cfgTOML,
}
}

func (c *TestConfig) GetNodeConfigTOML() (string, error) {
var chainID, url string
if c.GetChainID != nil {
chainID = c.GetChainID()
}
if c.GetURL != nil {
url = c.GetURL()
}

solConfig := solcfg.TOMLConfig{
Enabled: ptr.Ptr(true),
ChainID: ptr.Ptr(chainID),
Nodes: []*solcfg.Node{
{
Name: ptr.Ptr("primary"),
URL: config.MustParseURL(url),
},
},
}
baseConfig := node.NewBaseConfig()
baseConfig.Solana = solcfg.TOMLConfigs{
&solConfig,
}
baseConfig.OCR2.Enabled = ptr.Ptr(true)
baseConfig.P2P.V2.Enabled = ptr.Ptr(true)
fiveSecondDuration := config.MustNewDuration(5 * time.Second)

baseConfig.P2P.V2.DeltaDial = fiveSecondDuration
baseConfig.P2P.V2.DeltaReconcile = fiveSecondDuration
baseConfig.P2P.V2.ListenAddresses = &[]string{"0.0.0.0:6690"}

return baseConfig.TOMLString()
}

var embeddedConfigs embed.FS
Expand Down
Loading
Loading