From 0b7c50cbfebfced145f85156a258e24052b27797 Mon Sep 17 00:00:00 2001 From: Dmytro Haidashenko Date: Mon, 10 Feb 2025 16:27:42 +0100 Subject: [PATCH] fix starting block delay --- integration-tests/common/common.go | 2 +- integration-tests/soak/log_poller_test.go | 9 ++++----- integration-tests/testconfig/testconfig.go | 2 +- pkg/solana/logpoller/log_poller_mimic_contract.go | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/integration-tests/common/common.go b/integration-tests/common/common.go index 27b1aca3f..9cbf2702a 100644 --- a/integration-tests/common/common.go +++ b/integration-tests/common/common.go @@ -36,7 +36,7 @@ type Common struct { TestConfig *tc.TestConfig TestEnvDetails *TestEnvDetails ClConfig map[string]interface{} - EnvVariables map[string]interface{} + EnvVariables map[string]string Env *environment.Environment DockerEnv *SolCLClusterTestEnv AccountDetails *AccountDetails diff --git a/integration-tests/soak/log_poller_test.go b/integration-tests/soak/log_poller_test.go index f6dfa4e1a..810b326f8 100644 --- a/integration-tests/soak/log_poller_test.go +++ b/integration-tests/soak/log_poller_test.go @@ -1,7 +1,6 @@ package soak import ( - "os" "testing" "github.com/stretchr/testify/require" @@ -16,10 +15,10 @@ func TestLogPollerPerformance(t *testing.T) { if err != nil { t.Fatal(err) } - config.EnvVariables = map[string]interface{}{ - "LOG_POLLER_TEST": os.Getenv("LOG_POLLER_TEST"), // MIMIC|MOCKER_RATE - "SOURCE_CONTRACT_ADDRESS": "", // only required for MIMIC test - "EVENTS_PER_SEC": "10", // only used by MOCKED_RATE + 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) diff --git a/integration-tests/testconfig/testconfig.go b/integration-tests/testconfig/testconfig.go index be3d96b23..0f58c93af 100644 --- a/integration-tests/testconfig/testconfig.go +++ b/integration-tests/testconfig/testconfig.go @@ -40,7 +40,7 @@ type TestConfig struct { OCR2 *ocr2_config.Config `toml:"OCR2"` SolanaConfig *SolanaConfig `toml:"SolanaConfig"` ConfigurationName string `toml:"-"` - EnvVariables map[string]interface{} `toml:"-"` + EnvVariables map[string]string `toml:"-"` // getter funcs for passing parameters GetChainID func() string diff --git a/pkg/solana/logpoller/log_poller_mimic_contract.go b/pkg/solana/logpoller/log_poller_mimic_contract.go index e5326b5f8..3a9046a3c 100644 --- a/pkg/solana/logpoller/log_poller_mimic_contract.go +++ b/pkg/solana/logpoller/log_poller_mimic_contract.go @@ -69,7 +69,7 @@ func tryRegisterCCIPMessageSentFilter(ctx context.Context, lp *Service) error { return fmt.Errorf("failed to get latest slot: %w", err) } - startingBlock := slot - 500 // 8 hours delay + startingBlock := slot - 72000 // 8 hours delay version := client.MaxSupportTransactionVersion block, err := lp.client.GetBlockWithOpts(ctx, startingBlock, &rpc.GetBlockOpts{MaxSupportedTransactionVersion: &version}) if err != nil {