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

DO NOT MERGE NONEVM-748 logpoller perf testing 3 #1056

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
942f1da
Make work with EventSignatures & Discriminator consistent
dhaidashenko Feb 6, 2025
4ad5f72
Ensure get block job is canceled in case of an error
dhaidashenko Feb 6, 2025
0aedb57
Support non addressable arrays in IndexedValue
dhaidashenko Feb 6, 2025
2e217cd
Fix log
dhaidashenko Feb 6, 2025
39491b9
fix linter
dhaidashenko Feb 6, 2025
ff42fa4
revert hardcoding from per test
dhaidashenko Feb 6, 2025
7bc5663
mimicing LP
dhaidashenko Feb 6, 2025
6275202
fix build
dhaidashenko Feb 6, 2025
4d1d043
fix discriminator test
dhaidashenko Feb 6, 2025
8bb66bb
Merge branch 'fix/logpoller-e2e-test-fixes' into feature/NONEVM-748-l…
dhaidashenko Feb 7, 2025
b8527bd
Merge branch 'develop' into feature/NONEVM-748-logpoller-perf-testing-2
dhaidashenko Feb 7, 2025
ed96449
update lgos to match new version
dhaidashenko Feb 7, 2025
85c43fe
Trigger CI
dhaidashenko Feb 7, 2025
24b3673
Revert "Trigger CI"
dhaidashenko Feb 7, 2025
7a793ad
Fix CI
dhaidashenko Feb 7, 2025
283519f
Revert "Revert "Trigger CI""
dhaidashenko Feb 7, 2025
37c8f60
mocked rate test
dhaidashenko Feb 10, 2025
997ef33
Trigger CI
dhaidashenko Feb 10, 2025
41a14c9
Trigger CI
dhaidashenko Feb 10, 2025
1487f8f
Merge branch 'develop' into feature/NONEVM-748-logpoller-perf-testing-3
dhaidashenko Feb 10, 2025
0b7c50c
fix starting block delay
dhaidashenko Feb 10, 2025
3315b08
Trigger CI
dhaidashenko Feb 10, 2025
69b6da8
Trigger CI
dhaidashenko Feb 10, 2025
96c326d
Trigger CI
dhaidashenko Feb 10, 2025
ab61cd2
measure block sorter queue size
dhaidashenko Feb 10, 2025
b0a3226
fallback to log
dhaidashenko Feb 10, 2025
8ed5e91
fix block sorter memory leak
dhaidashenko Feb 11, 2025
4b670b1
improve logging
dhaidashenko Feb 11, 2025
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
12 changes: 6 additions & 6 deletions .github/workflows/e2e_custom_cl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ jobs:
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@b49a9d04744b0237908831730f8553f26d73a94b # v2.3.17
with:
repository: chainlink
tag: solana.${{ env.CUSTOM_CORE_REF || github.event.inputs.cl_branch_ref || github.sha }}
tag: solana.${{ github.sha }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
- name: Build Image
Expand All @@ -224,7 +224,7 @@ jobs:
cl_repo: smartcontractkit/chainlink
cl_ref: ${{ env.CUSTOM_CORE_REF || github.event.inputs.cl_branch_ref }}
dep_solana_sha: ${{ github.event.pull_request.head.sha }}
push_tag: ${{ env.CL_ECR }}:solana.${{ env.CUSTOM_CORE_REF || github.event.inputs.cl_branch_ref || github.sha }}
push_tag: ${{ env.CL_ECR }}:solana.${{ github.sha }}
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}

Expand Down Expand Up @@ -305,7 +305,7 @@ jobs:
run: | # https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md
cat << EOF > config.toml
[ChainlinkImage]
version="solana.${{ env.CUSTOM_CORE_REF || github.event.inputs.cl_branch_ref || github.sha }}"
version="solana.${{ github.sha }}"
[Common]
user="${{ github.actor }}"
internal_docker_repo = "${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com"
Expand All @@ -326,7 +326,7 @@ jobs:
download_contract_artifacts_path: ${{ env.CONTRACT_ARTIFACTS_PATH }}
go_mod_path: ./integration-tests/go.mod
cl_repo: ${{ env.CL_ECR }}
cl_image_tag: solana.${{ env.CUSTOM_CORE_REF || github.event.inputs.cl_branch_ref || github.sha }}
cl_image_tag: solana.${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
artifacts_name: smoke-test-logs
Expand Down Expand Up @@ -389,7 +389,7 @@ jobs:
cat << EOF > config.toml
[ChainlinkImage]
image="${{ env.CL_ECR }}"
version="solana.${{ env.CUSTOM_CORE_REF || github.event.inputs.cl_branch_ref || github.sha }}"
version="solana.${{ github.sha }}"
[Common]
user="${{ github.actor }}"
internal_docker_repo = "${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com"
Expand All @@ -410,7 +410,7 @@ jobs:
download_contract_artifacts_path: ${{ env.CONTRACT_ARTIFACTS_PATH }}
go_mod_path: ./integration-tests/go.mod
cl_repo: ${{ env.CL_ECR }}
cl_image_tag: solana.${{ env.CUSTOM_CORE_REF || github.event.inputs.cl_branch_ref || github.sha }}
cl_image_tag: solana.${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
artifacts_name: smoke-test-logs
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/e2e_testnet_daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@b49a9d04744b0237908831730f8553f26d73a94b # v2.3.17
with:
repository: chainlink
tag: solana.${{ env.CUSTOM_CORE_REF || github.event.inputs.cl_branch_ref || github.sha }}
tag: solana.${{ github.sha }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
- name: Build Image
Expand All @@ -99,7 +99,7 @@ jobs:
cl_repo: smartcontractkit/chainlink
cl_ref: ${{ env.CUSTOM_CORE_REF || github.event.inputs.cl_branch_ref }}
dep_solana_sha: ${{ github.event.pull_request.head.sha }}
push_tag: ${{ env.CL_ECR }}:solana.${{ env.CUSTOM_CORE_REF || github.event.inputs.cl_branch_ref || github.sha }}
push_tag: ${{ env.CL_ECR }}:solana.${{ github.sha }}
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}

Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
run: | # https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md
cat << EOF > config.toml
[ChainlinkImage]
version="solana.${{ env.CUSTOM_CORE_REF || github.event.inputs.cl_branch_ref || github.sha }}"
version="solana.${{ github.sha }}"
[Common]
user="${{ github.actor }}"
network="devnet"
Expand All @@ -164,7 +164,7 @@ jobs:
download_contract_artifacts_path: ${{ env.CONTRACT_ARTIFACTS_PATH }}
go_mod_path: ./integration-tests/go.mod
cl_repo: ${{ env.CL_ECR }}
cl_image_tag: solana.${{ env.CUSTOM_CORE_REF || github.event.inputs.cl_branch_ref || github.sha }}
cl_image_tag: solana.${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
artifacts_name: smoke-test-logs
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ require (
github.com/google/uuid v1.6.0
github.com/hashicorp/go-plugin v1.6.2
github.com/jackc/pgx/v4 v4.18.3
github.com/jmoiron/sqlx v1.4.0
github.com/lib/pq v1.10.9
github.com/pelletier/go-toml/v2 v2.2.3
github.com/prometheus/client_golang v1.20.5
github.com/scylladb/go-reflectx v1.0.1
github.com/smartcontractkit/chainlink-ccip v0.0.0-20250203132120-f0d42463e405
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20250206215114-fb6c3c35e8e3
github.com/smartcontractkit/chainlink-common v0.4.2-0.20250205141137-8f50d72601bb
Expand Down Expand Up @@ -45,6 +47,7 @@ require (
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/confluentinc/confluent-kafka-go/v2 v2.3.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/docker/docker v27.3.1+incompatible // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
Expand Down Expand Up @@ -78,7 +81,6 @@ require (
github.com/jackc/pgproto3/v2 v2.3.3 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgtype v1.14.0 // indirect
github.com/jmoiron/sqlx v1.4.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.11 // indirect
Expand Down Expand Up @@ -117,7 +119,6 @@ require (
github.com/rogpeppe/go-internal v1.13.1 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
github.com/scylladb/go-reflectx v1.0.1 // indirect
github.com/shirou/gopsutil/v3 v3.24.3 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/dfuse-io/logging v0.0.0-20201110202154-26697de88c79/go.mod h1:V+ED4kT/t/lKtH99JQmKIb0v9WL3VaYkJ36CfHlVECI=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
Expand Down
18 changes: 11 additions & 7 deletions integration-tests/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (
"github.com/lib/pq"
"gopkg.in/guregu/null.v4"

mock_adapter "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/mock-adapter"
"github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/sol"

ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/lib/config"
ctf_test_env "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env"
"github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment"
"github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/chainlink"
mock_adapter "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/mock-adapter"
"github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/sol"

client "github.com/smartcontractkit/chainlink/deployment/environment/nodeclient"
"github.com/smartcontractkit/chainlink/integration-tests/docker/test_env"

Expand All @@ -36,7 +36,7 @@ type Common struct {
TestConfig *tc.TestConfig
TestEnvDetails *TestEnvDetails
ClConfig map[string]interface{}
EnvConfig map[string]interface{}
EnvVariables map[string]string
Env *environment.Environment
DockerEnv *SolCLClusterTestEnv
AccountDetails *AccountDetails
Expand Down Expand Up @@ -112,8 +112,9 @@ func New(testConfig *tc.TestConfig) *Common {
privateKeyString := fmt.Sprintf("[%s]", formatBuffer([]byte(privateKey)))
publicKey := privateKey.PublicKey().String()

if *testConfig.Common.Network == "devnet" {
if *testConfig.Common.Network == "devnet" || *testConfig.Common.Network == "mainnet" {
config = chainConfig.DevnetConfig()
config.ChainID = *testConfig.Common.Network
privateKeyString = *testConfig.Common.PrivateKey

if len(*testConfig.Common.RPCURLs) > 0 {
Expand Down Expand Up @@ -142,7 +143,8 @@ func New(testConfig *tc.TestConfig) *Common {
PrivateKey: privateKeyString,
PublicKey: publicKey,
},
Env: &environment.Environment{},
Env: &environment.Environment{},
EnvVariables: testConfig.EnvVariables,
}
// provide getters for TestConfig (pointers to chain details)
c.TestConfig.GetChainID = func() string { return c.ChainDetails.ChainID }
Expand Down Expand Up @@ -414,6 +416,7 @@ func (c *Common) Default(t *testing.T, namespacePrefix string) (*Common, error)
}
cd := chainlink.NewWithOverride(0, map[string]any{
"toml": tomlString,
"env": c.EnvVariables,
"replicas": *c.TestConfig.OCR2.NodeCount,
"chainlink": map[string]interface{}{
"resources": map[string]interface{}{
Expand All @@ -435,7 +438,8 @@ func (c *Common) Default(t *testing.T, namespacePrefix string) (*Common, error)
},
}, c.TestConfig.ChainlinkImage, overrideFn)
c.Env = environment.New(c.TestEnvDetails.K8Config).
AddHelm(sol.New(nil)).
AddHelm(
sol.New(nil)).
AddHelm(mock_adapter.New(nil)).
AddHelm(cd)
}
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/common/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (m *OCRv2TestState) DeployCluster(contractsDir string) {
m.Common.ChainDetails.RPCURLExternal = m.Common.Env.URLs["sol"][0]
m.Common.ChainDetails.WSURLExternal = m.Common.Env.URLs["sol"][1]

if *m.Config.TestConfig.Common.Network == "devnet" {
if *m.Config.TestConfig.Common.Network == "devnet" || *m.Config.TestConfig.Common.Network == "mainnet" {
m.Common.ChainDetails.RPCUrls = *m.Config.TestConfig.Common.RPCURLs
m.Common.ChainDetails.RPCURLExternal = (*m.Config.TestConfig.Common.RPCURLs)[0]
m.Common.ChainDetails.WSURLExternal = (*m.Config.TestConfig.Common.WsURLs)[0]
Expand Down
4 changes: 3 additions & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ require (
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20250130125138-3df261e09ddc // indirect
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5 // indirect
github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250204211601-c6bfa53cfb1c // indirect
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250205171936-649f95193678 // indirect
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250205165125-271e20f6de0a // indirect
github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect
github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 // indirect
Expand Down Expand Up @@ -473,5 +473,7 @@ replace (
// replicating the replace directive on cosmos SDK
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

github.com/smartcontractkit/chainlink-framework/chains => github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250205171936-649f95193678

github.com/sourcegraph/sourcegraph/lib => github.com/sourcegraph/sourcegraph-public-snapshot/lib v0.0.0-20240822153003-c864f15af264
)
4 changes: 2 additions & 2 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1239,8 +1239,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20250128203428-08031923fbe5/go.mod h1:pDZagSGjs9U+l4YIFhveDznMHqxuuz+5vRxvVgpbdr8=
github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c=
github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4=
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250204211601-c6bfa53cfb1c h1:/Bai8iDJQ8l+93i57cZGibTos4QJh6P4YKbMkRLHjBQ=
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250204211601-c6bfa53cfb1c/go.mod h1:tHem58EihQh63kR2LlAOKDAs9Vbghf1dJKZRGy6LG8g=
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250205171936-649f95193678 h1:C4SZwpcq3SkDrQNAAPpEkFI7Zylurl4L59crgXYJNuA=
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20250205171936-649f95193678/go.mod h1:tHem58EihQh63kR2LlAOKDAs9Vbghf1dJKZRGy6LG8g=
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250205165125-271e20f6de0a h1:ZG8v7aQxyp9cOYXpW6oodL+OWgwDku544qyzXPPgs7M=
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250205165125-271e20f6de0a/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU=
github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ=
Expand Down
27 changes: 27 additions & 0 deletions integration-tests/soak/log_poller_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package soak

import (
"testing"

"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-solana/integration-tests/common"
tc "github.com/smartcontractkit/chainlink-solana/integration-tests/testconfig"
"github.com/smartcontractkit/chainlink-solana/integration-tests/utils"
)

func TestLogPollerPerformance(t *testing.T) {
config, err := tc.GetConfig("Smoke", tc.OCR2)
if err != nil {
t.Fatal(err)
}
config.EnvVariables = map[string]string{
"LOG_POLLER_TEST": "MOCKER_RATE", // MIMIC|MOCKER_RATE
"SOURCE_CONTRACT_ADDRESS": "", // only required for MIMIC test
"EVENTS_PER_SEC": "10", // only used by MOCKED_RATE
}
name := "lp-mimic-performance"
state, err := common.NewOCRv2State(t, 1, name, &config)
require.NoError(t, err, "Could not setup the ocrv2 state")
state.DeployCluster(utils.ContractsDir)
}
4 changes: 2 additions & 2 deletions integration-tests/testconfig/ocr2/ocr2.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ type Config struct {
}

func (o *Config) Validate() error {
if o.NodeCount != nil && *o.NodeCount < 3 {
return errors.New("node_count must be set and cannot be less than 3")
if o.NodeCount != nil && *o.NodeCount < 1 {
return errors.New("node_count must be set and cannot be less than 1")
}

if o.TestDuration == nil {
Expand Down
10 changes: 5 additions & 5 deletions integration-tests/testconfig/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ package testconfig
import (
"embed"
"encoding/base64"
"errors"
"fmt"
"log"
"os"
"strings"
"time"

"errors"

"github.com/barkimedes/go-deepcopy"
"github.com/google/uuid"
"github.com/pelletier/go-toml/v2"
Expand Down Expand Up @@ -41,6 +40,7 @@ type TestConfig struct {
OCR2 *ocr2_config.Config `toml:"OCR2"`
SolanaConfig *SolanaConfig `toml:"SolanaConfig"`
ConfigurationName string `toml:"-"`
EnvVariables map[string]string `toml:"-"`

// getter funcs for passing parameters
GetChainID func() string
Expand Down Expand Up @@ -422,19 +422,19 @@ func (c *Common) Validate() error {
if c.DevnetImage == nil {
return fmt.Errorf("devnet_image must be set")
}
case "devnet":
case "devnet", "mainnet":
if c.PrivateKey == nil {
return fmt.Errorf("private_key must be set")
}
if c.RPCURLs == nil {
return fmt.Errorf("rpc_url must be set")
}
if c.WsURLs == nil {
return fmt.Errorf("rpc_url must be set")
return fmt.Errorf("ws rpc_url must be set")
}

default:
return fmt.Errorf("network must be either 'localnet' or 'devnet'")
return fmt.Errorf("network must be either 'localnet' or 'devnet' or 'mainnet'")
}

if c.InsideK8s == nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/solana/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ func (c *chain) Start(ctx context.Context) error {
startAll := []services.StartClose{c.txm, c.balanceMonitor}
if c.cfg.MultiNode.Enabled() {
c.lggr.Debug("Starting multinode")
startAll = append(startAll, c.multiNode, c.txSender)
startAll = append(startAll, c.multiNode, c.txSender, c.lp)
}
return ms.Start(ctx, startAll...)
})
Expand Down
4 changes: 4 additions & 0 deletions pkg/solana/logpoller/blocks_sorter.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ func (p *blocksSorter) readBlocks(ctx context.Context) {

p.mu.Lock()
p.readyBlocks[block.SlotNumber] = block
if len(p.readyBlocks) >= 1024 {
p.lggr.Warnf("Number of ready blocks exceeds is too large: %d", len(p.readyBlocks))
}
p.mu.Unlock()
// try leaving a msg that new block is ready
select {
Expand Down Expand Up @@ -113,6 +116,7 @@ func (p *blocksSorter) readNextReadyBlock() *Block {
if !ok {
return nil
}
delete(p.readyBlocks, slotNumber)

p.queue.Remove(element)
return &block
Expand Down
3 changes: 2 additions & 1 deletion pkg/solana/logpoller/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type RPCClient interface {
GetBlockWithOpts(context.Context, uint64, *rpc.GetBlockOpts) (*rpc.GetBlockResult, error)
GetSignaturesForAddressWithOpts(context.Context, solana.PublicKey, *rpc.GetSignaturesForAddressOpts) ([]*rpc.TransactionSignature, error)
SlotHeightWithCommitment(ctx context.Context, commitment rpc.CommitmentType) (uint64, error)
GetBlocks(ctx context.Context, startSlot uint64, endSlot *uint64) (out rpc.BlocksResult, err error)
}

type WorkerGroup interface {
Expand Down Expand Up @@ -140,7 +141,7 @@ func (c *EncodedLogCollector) BackfillForAddresses(ctx context.Context, addresse
return nil, func() {}, fmt.Errorf("failed to identify slots to fetch: %w", err)
}

c.lggr.Debugw("Got all slots that need fetching for backfill operations", "addresses", PublicKeysToString(addresses), "fromSlot", fromSlot, "toSlot", toSlot, "slotsToFetch", slotsToFetch)
c.lggr.Debugw("Got all slots that need fetching for backfill operations", "addresses", PublicKeysToString(addresses), "fromSlot", fromSlot, "toSlot", toSlot, "slotsToFetch", len(slotsToFetch))

ctx, cancelJobs := context.WithCancel(ctx)
defer func() {
Expand Down
Loading
Loading