From 0e7bbc3403e0a47db07f25063e425cf997af99d0 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Tue, 11 Jun 2024 18:18:03 +0200 Subject: [PATCH] [TT-1152] use different network for Besu, update CTF (#934) --- .../action.yml | 6 +- .../setup-create-base64-config/action.yml | 2 +- .../ccip-client-compatibility-tests.yml | 58 +++++++-- .../ccip-tests/testconfig/ccip.go | 9 +- .../testconfig/tomls/ccip-default.toml | 6 +- integration-tests/chaos/ocr_chaos_test.go | 12 +- .../docker/test_env/test_env_builder.go | 10 +- integration-tests/experiments/gas_test.go | 7 +- integration-tests/go.mod | 6 +- integration-tests/go.sum | 12 +- integration-tests/load/functions/setup.go | 8 +- integration-tests/load/go.mod | 6 +- integration-tests/load/go.sum | 12 +- integration-tests/load/ocr/ocr_test.go | 6 +- integration-tests/soak/ocr_test.go | 6 +- integration-tests/testsetups/ocr.go | 11 +- integration-tests/utils/seth.go | 122 ------------------ 17 files changed, 106 insertions(+), 193 deletions(-) delete mode 100644 integration-tests/utils/seth.go diff --git a/.github/actions/setup-create-base64-config-ccip/action.yml b/.github/actions/setup-create-base64-config-ccip/action.yml index 039d64cbed..88d9fe8078 100644 --- a/.github/actions/setup-create-base64-config-ccip/action.yml +++ b/.github/actions/setup-create-base64-config-ccip/action.yml @@ -49,6 +49,7 @@ runs: id: base64-config-override env: RUN_ID: ${{ inputs.runId }} + SELECTED_NETWORKS: ${{ inputs.selectedNetworks }} EXISTING_NAMESPACE: ${{ inputs.existingNamespace }} TEST_LOG_COLLECT: ${{ inputs.testLogCollect }} CHAINLINK_IMAGE: ${{ inputs.chainlinkImage }} @@ -79,7 +80,8 @@ runs: echo "$toml_array_format" } - log_targets=$(convert_to_toml_array "$LOGSTREAM_LOG_TARGETS") + selected_networks=$(convert_to_toml_array "$SELECTED_NETWORKS") + log_targets=$(convert_to_toml_array "$LOGSTREAM_LOG_TARGETS") if [ -n "$TEST_LOG_COLLECT" ]; then test_log_collect=true @@ -140,6 +142,8 @@ runs: [CCIP] [CCIP.Env] EnvToConnect="$EXISTING_NAMESPACE" + [CCIP.Env.Network] + selected_networks = $selected_networks [CCIP.Env.NewCLCluster] [CCIP.Env.NewCLCluster.Common] [CCIP.Env.NewCLCluster.Common.ChainlinkImage] diff --git a/.github/actions/setup-create-base64-config/action.yml b/.github/actions/setup-create-base64-config/action.yml index cf4e8d3a01..5a7ba36a67 100644 --- a/.github/actions/setup-create-base64-config/action.yml +++ b/.github/actions/setup-create-base64-config/action.yml @@ -157,5 +157,5 @@ runs: EOF BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) - echo ::add-mask::$BASE64_CONFIG_OVERRIDE + echo ::add-mask::$BASE64_CONFIG_OVERRIDE echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV diff --git a/.github/workflows/ccip-client-compatibility-tests.yml b/.github/workflows/ccip-client-compatibility-tests.yml index 1b0568f407..c03e8668be 100644 --- a/.github/workflows/ccip-client-compatibility-tests.yml +++ b/.github/workflows/ccip-client-compatibility-tests.yml @@ -4,8 +4,8 @@ on: tags: - '*' # TODO: Uncomment when CCIP-2255 is resolved - # schedule: - # - cron: "30 5 * * *" + schedule: + - cron: "30 5 * * *" workflow_dispatch: env: @@ -48,9 +48,41 @@ jobs: AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + check-ecr-images-exist: + environment: integration + permissions: + id-token: write + contents: read + name: Check images used as test dependencies exist in ECR + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + mirror: + - name: ethereum/client-go + expression: '^(alltools-v|v)[0-9]\.[0-9]+\.[0-9]+$' + - name: hyperledger/besu + expression: '^[0-9]+\.[0-9]+(\.[0-9]+)?$' + page_size: 300 + - name: thorax/erigon + expression: '^v[0-9]+\.[0-9]+\.[0-9]+$' + - name: nethermind/nethermind + expression: '^[0-9]+\.[0-9]+\.[0-9]+$' + steps: + - name: Update internal ECR if the latest Ethereum client image does not exist + uses: smartcontractkit/chainlink-testing-framework/.github/actions/update-internal-mirrors@7eb04a030823b316d8dd5bb555f1e49593a503fc #v1.28.16 + with: + aws_region: ${{ secrets.QA_AWS_REGION }} + role_to_assume: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + aws_account_number: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + image_name: ${{ matrix.mirror.name }} + expression: ${{ matrix.mirror.expression }} + page_size: ${{ matrix.mirror.page_size }} + get-latest-available-images: environment: integration runs-on: ubuntu-latest + needs: [check-ecr-images-exist] permissions: id-token: write contents: read @@ -107,7 +139,7 @@ jobs: echo "NETHERMIND_TAG=$nethermind_tag" >> $GITHUB_ENV echo "Nethermind latest tag: $nethermind_tag" - besu_tag=$(get_latest_version_tag hyperledger/besu '^[0-9]+\.[0-9]+$') + besu_tag=$(get_latest_version_tag hyperledger/besu '^[0-9]+\.[0-9]+(\.[0-9]+)?$') echo "BESU_TAG=$besu_tag" >> $GITHUB_ENV echo "Besu latest tag: $besu_tag" @@ -126,7 +158,6 @@ jobs: contents: read needs: [build-chainlink, get-latest-available-images] env: - SELECTED_NETWORKS: SIMULATED_1,SIMULATED_2 CHAINLINK_COMMIT_SHA: ${{ github.sha }} CHAINLINK_ENV_USER: ${{ github.actor }} TEST_LOG_LEVEL: debug @@ -140,24 +171,27 @@ jobs: client: geth pyroscope_env: ci-ccip-bidirectional-lane-geth chainConfig: "1337=ethereum/client-go:${{ needs.get-latest-available-images.outputs.geth_tag }},2337=ethereum/client-go:${{ needs.get-latest-available-images.outputs.geth_tag }}" + networks: "SIMULATED_1,SIMULATED_2" # TODO: uncomment when nethermind flake reason is addressed # - name: bidirectional-lane-nethermind # test: TestSmokeCCIPForBidirectionalLane # client: nethermind # pyroscope_env: ci-ccip-bidirectional-lane-nethermind # chainConfig: "1337=nethermind/nethermind:${{ needs.get-latest-available-images.outputs.nethermind_tag }},2337=nethermind/nethermind:${{ needs.get-latest-available-images.outputs.nethermind_tag }}" - # TODO: uncomment when 24.4.0 is released with our data/input fix - # - name: bidirectional-lane-besu - # test: TestSmokeCCIPForBidirectionalLane - # client: besu - # pyroscope_env: ci-ccip-bidirectional-lane-besu - # chainConfig: "1337=hyperledger/besu:${{ needs.get-latest-available-images.outputs.besu_tag }},2337=hyperledger/besu:${{ needs.get-latest-available-images.outputs.besu_tag }}" + # networks: "SIMULATED_1,SIMULATED_2" + - name: bidirectional-lane-besu + test: TestSmokeCCIPForBidirectionalLane + client: besu + pyroscope_env: ci-ccip-bidirectional-lane-besu + chainConfig: "1337=hyperledger/besu:${{ needs.get-latest-available-images.outputs.besu_tag }},2337=hyperledger/besu:${{ needs.get-latest-available-images.outputs.besu_tag }}" + networks: "SIMULATED_BESU_NONDEV_1,SIMULATED_BESU_NONDEV_2" # TODO: Waiting for CCIP-2255 to be resolved # - name: bidirectional-lane-erigon # test: TestSmokeCCIPForBidirectionalLane # client: erigon # pyroscope_env: ci-ccip-bidirectional-lane-erigon # chainConfig: "1337=thorax/erigon:${{ needs.get-latest-available-images.outputs.erigon_tag }},2337=thorax/erigon:${{ needs.get-latest-available-images.outputs.erigon_tag }}" + # networks: "SIMULATED_1,SIMULATED_2" runs-on: ubuntu-latest name: CCIP Latest EVM Node Compatibility Test with ${{ matrix.client }} steps: @@ -190,7 +224,7 @@ jobs: with: runId: ${{ github.run_id }} testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - selectedNetworks: ${{ env.SELECTED_NETWORKS }} + selectedNetworks: ${{ matrix.networks }} chainlinkImage: ${{ env.CHAINLINK_IMAGE }} chainlinkVersion: ${{ github.sha }} pyroscopeServer: ${{ matrix.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 @@ -207,7 +241,7 @@ jobs: with: runId: ${{ github.run_id }} testLogCollect: ${{ vars.TEST_LOG_COLLECT }} - selectedNetworks: SIMULATED_1,SIMULATED_2 + selectedNetworks: ${{ matrix.networks }} chainlinkImage: ${{ env.CHAINLINK_IMAGE }} chainlinkVersion: ${{ github.sha }} lokiEndpoint: ${{ secrets.LOKI_URL_CI }} diff --git a/integration-tests/ccip-tests/testconfig/ccip.go b/integration-tests/ccip-tests/testconfig/ccip.go index b55bf2148f..6e12c807b6 100644 --- a/integration-tests/ccip-tests/testconfig/ccip.go +++ b/integration-tests/ccip-tests/testconfig/ccip.go @@ -9,14 +9,12 @@ import ( "github.com/pelletier/go-toml/v2" "github.com/rs/zerolog" - ctfK8config "github.com/smartcontractkit/chainlink-testing-framework/k8s/config" - - testutils "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/utils" - "github.com/smartcontractkit/chainlink-common/pkg/config" ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/config" + ctfK8config "github.com/smartcontractkit/chainlink-testing-framework/k8s/config" ccipcontracts "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts" + testutils "github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/utils" "github.com/smartcontractkit/chainlink/integration-tests/contracts" ) @@ -403,6 +401,5 @@ func (c *CCIP) ApplyOverrides(fromCfg *CCIP) error { if err != nil { return err } - lggr := zerolog.Logger{} - return ctfconfig.BytesToAnyTomlStruct(lggr, "", "", c, logBytes) + return ctfconfig.BytesToAnyTomlStruct(zerolog.Logger{}, "", "", c, logBytes) } diff --git a/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml b/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml index c442fabf50..d3094b5280 100644 --- a/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml +++ b/integration-tests/ccip-tests/testconfig/tomls/ccip-default.toml @@ -27,7 +27,7 @@ ethereum_version = "eth1" # geth, besu, erigon or nethermind execution_layer = "geth" # eth2-only, if set to true environment startup will wait until at least 1 epoch has been finalised -#wait_for_finalization=false +wait_for_finalization=false [CCIP.Env.PrivateEthereumNetworks.SIMULATED_1.EthereumChainConfig] # eth2-only, the lower the value the faster the block production (3 is minimum) @@ -49,11 +49,11 @@ addresses_to_fund = [ # eth2-only, epoch at which chain will upgrade do Dencun or Deneb/Cancun (1 is minimum) Deneb = 500 -# [PrivateEthereumNetwork.CustomDockerImages] +#[CCIP.Env.PrivateEthereumNetworks.SIMULATED_1.CustomDockerImages] # custom docker image that will be used for execution layer client. It has to be one of: hyperledger/besu, nethermind/nethermind, thorax/erigon or ethereum/client-go. # instead of using a specific tag you can also use "latest_available" to use latest published tag in Github or "latest_stable" to use latest stable release from Github # (if corresponding Docker image on Docker Hub has not been published environment creation will fail). -# execution_layer="hyperledger/besu:24.2.0-RC2" +#execution_layer="hyperledger/besu:latest_stable" [CCIP.Env.PrivateEthereumNetworks.SIMULATED_2] ethereum_version = "eth1" diff --git a/integration-tests/chaos/ocr_chaos_test.go b/integration-tests/chaos/ocr_chaos_test.go index d2e7c540db..494da0bd79 100644 --- a/integration-tests/chaos/ocr_chaos_test.go +++ b/integration-tests/chaos/ocr_chaos_test.go @@ -21,13 +21,13 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/logging" "github.com/smartcontractkit/chainlink-testing-framework/networks" "github.com/smartcontractkit/chainlink-testing-framework/utils/ptr" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" - actions_seth "github.com/smartcontractkit/chainlink/integration-tests/actions/seth" - "github.com/smartcontractkit/chainlink/integration-tests/contracts" - "github.com/smartcontractkit/chainlink/integration-tests/utils" "github.com/smartcontractkit/chainlink/integration-tests/actions" + actions_seth "github.com/smartcontractkit/chainlink/integration-tests/actions/seth" "github.com/smartcontractkit/chainlink/integration-tests/client" + "github.com/smartcontractkit/chainlink/integration-tests/contracts" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" ) @@ -169,11 +169,11 @@ func TestOCRChaos(t *testing.T) { require.NotNil(t, readSethCfg, "Seth config shouldn't be nil") network := networks.MustGetSelectedNetworkConfig(cfg.GetNetworkConfig())[0] - network = utils.MustReplaceSimulatedNetworkUrlWithK8(l, network, *testEnvironment) + network = seth_utils.MustReplaceSimulatedNetworkUrlWithK8(l, network, *testEnvironment) - sethCfg, err := utils.MergeSethAndEvmNetworkConfigs(network, *readSethCfg) + sethCfg, err := seth_utils.MergeSethAndEvmNetworkConfigs(network, *readSethCfg) require.NoError(t, err, "Error merging seth and evm network configs") - err = utils.ValidateSethNetworkConfig(sethCfg.Network) + err = seth_utils.ValidateSethNetworkConfig(sethCfg.Network) require.NoError(t, err, "Error validating seth network config") seth, err := seth.NewClientWithConfig(&sethCfg) require.NoError(t, err, "Error creating seth client") diff --git a/integration-tests/docker/test_env/test_env_builder.go b/integration-tests/docker/test_env/test_env_builder.go index 701eca427c..a1805ac779 100644 --- a/integration-tests/docker/test_env/test_env_builder.go +++ b/integration-tests/docker/test_env/test_env_builder.go @@ -18,6 +18,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/logstream" "github.com/smartcontractkit/chainlink-testing-framework/networks" "github.com/smartcontractkit/chainlink-testing-framework/utils/osutil" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" evmcfg "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config/toml" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" @@ -25,7 +26,6 @@ import ( actions_seth "github.com/smartcontractkit/chainlink/integration-tests/actions/seth" "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/types/config/node" - "github.com/smartcontractkit/chainlink/integration-tests/utils" ) type CleanUpType string @@ -327,11 +327,11 @@ func (b *CLTestEnvBuilder) Build() (*CLClusterTestEnv, error) { if b.hasSeth { readSethCfg := b.testConfig.GetSethConfig() - sethCfg, err := utils.MergeSethAndEvmNetworkConfigs(networkConfig, *readSethCfg) + sethCfg, err := seth_utils.MergeSethAndEvmNetworkConfigs(networkConfig, *readSethCfg) if err != nil { return nil, err } - err = utils.ValidateSethNetworkConfig(sethCfg.Network) + err = seth_utils.ValidateSethNetworkConfig(sethCfg.Network) if err != nil { return nil, err } @@ -428,11 +428,11 @@ func (b *CLTestEnvBuilder) Build() (*CLClusterTestEnv, error) { if b.hasSeth { b.te.sethClients = make(map[int64]*seth.Client) readSethCfg := b.testConfig.GetSethConfig() - sethCfg, err := utils.MergeSethAndEvmNetworkConfigs(networkConfig, *readSethCfg) + sethCfg, err := seth_utils.MergeSethAndEvmNetworkConfigs(networkConfig, *readSethCfg) if err != nil { return nil, err } - err = utils.ValidateSethNetworkConfig(sethCfg.Network) + err = seth_utils.ValidateSethNetworkConfig(sethCfg.Network) if err != nil { return nil, err } diff --git a/integration-tests/experiments/gas_test.go b/integration-tests/experiments/gas_test.go index ba096b69db..261b9f75a3 100644 --- a/integration-tests/experiments/gas_test.go +++ b/integration-tests/experiments/gas_test.go @@ -10,10 +10,11 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/logging" "github.com/smartcontractkit/chainlink-testing-framework/networks" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" + actions_seth "github.com/smartcontractkit/chainlink/integration-tests/actions/seth" "github.com/smartcontractkit/chainlink/integration-tests/contracts" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" - "github.com/smartcontractkit/chainlink/integration-tests/utils" ) func TestGasExperiment(t *testing.T) { @@ -25,9 +26,9 @@ func TestGasExperiment(t *testing.T) { readSethCfg := config.GetSethConfig() require.NotNil(t, readSethCfg, "Seth config shouldn't be nil") - sethCfg, err := utils.MergeSethAndEvmNetworkConfigs(network, *readSethCfg) + sethCfg, err := seth_utils.MergeSethAndEvmNetworkConfigs(network, *readSethCfg) require.NoError(t, err, "Error merging seth and evm network configs") - err = utils.ValidateSethNetworkConfig(sethCfg.Network) + err = seth_utils.ValidateSethNetworkConfig(sethCfg.Network) require.NoError(t, err, "Error validating seth network config") seth, err := seth.NewClientWithConfig(&sethCfg) diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 2f6bc7246a..42089d7ffa 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -20,7 +20,7 @@ require ( github.com/manifoldco/promptui v0.9.0 github.com/montanaflynn/stats v0.7.1 github.com/onsi/gomega v1.30.0 - github.com/pelletier/go-toml/v2 v2.1.1 + github.com/pelletier/go-toml/v2 v2.2.2 github.com/pkg/errors v0.9.1 github.com/prometheus/common v0.45.0 github.com/rs/zerolog v1.30.0 @@ -31,12 +31,12 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.16 github.com/smartcontractkit/chainlink-automation v1.0.3 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607202129-4cef984f109f - github.com/smartcontractkit/chainlink-testing-framework v1.28.13 + github.com/smartcontractkit/chainlink-testing-framework v1.29.1 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/integration-tests v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c - github.com/smartcontractkit/seth v0.1.6-0.20240429143720-cacb8160ecec + github.com/smartcontractkit/seth v1.0.11 github.com/smartcontractkit/wasp v0.4.5 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 92532d198f..c162462e8c 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1355,8 +1355,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= @@ -1525,8 +1525,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240422172640-59d47c73ba5 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240422172640-59d47c73ba58/go.mod h1:oV5gIuSKrPEcjQ6uB6smBsm5kXHxyydVLNyAs4V9CoQ= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240325075535-0f7eb05ee595 h1:y6ks0HsSOhPUueOmTcoxDQ50RCS1XINlRDTemZyHjFw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240325075535-0f7eb05ee595/go.mod h1:vV6WfnVIbK5Q1JsIru4YcTG0T1uRpLJm6t2BgCnCSsg= -github.com/smartcontractkit/chainlink-testing-framework v1.28.13 h1:aVAmEmunmBfJQd76SBjr44nx/5WDt423tkRRsjnBKpA= -github.com/smartcontractkit/chainlink-testing-framework v1.28.13/go.mod h1:x1zDOz8zcLjEvs9fNA9y/DMguLam/2+CJdpxX0+rM8A= +github.com/smartcontractkit/chainlink-testing-framework v1.29.1 h1:PbcWaSFd9i2Co9ketZ+1NbCkCgeuHC/nrb08mGlRT3k= +github.com/smartcontractkit/chainlink-testing-framework v1.29.1/go.mod h1:oEIggLGWyWfLkjWvuXLol8inUT4YbBb06fJx/S60gQ4= github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 h1:FFdvEzlYwcuVHkdZ8YnZR/XomeMGbz5E2F2HZI3I3w8= github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868/go.mod h1:Kn1Hape05UzFZ7bOUnm3GVsHzP0TNrVmpfXYNHdqGGs= github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16 h1:TFe+FvzxClblt6qRfqEhUfa4kFQx5UobuoFGO2W4mMo= @@ -1535,8 +1535,8 @@ github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJ github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c h1:lIyMbTaF2H0Q71vkwZHX/Ew4KF2BxiKhqEXwF8rn+KI= github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= -github.com/smartcontractkit/seth v0.1.6-0.20240429143720-cacb8160ecec h1:BT1loU6TT2YqMenD7XE+aw7IeeTiC25+r1TLKAySVIg= -github.com/smartcontractkit/seth v0.1.6-0.20240429143720-cacb8160ecec/go.mod h1:2TMOZQ8WTAw7rR1YBbXpnad6VmT/+xDd/nXLmB7Eero= +github.com/smartcontractkit/seth v1.0.11 h1:Ct8wSifW2ZXnyHtYRKaawBnpW7Ef0m8zItUcqYPallM= +github.com/smartcontractkit/seth v1.0.11/go.mod h1:fVCE+8LD6AbU7d8BHZ1uS/ceJ+8JO0iVTUcDdQmGPAc= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 h1:yiKnypAqP8l0OX0P3klzZ7SCcBUxy5KqTAKZmQOvSQE= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:q6f4fe39oZPdsh1i57WznEZgxd8siidMaSFq3wdPmVg= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 h1:Dai1bn+Q5cpeGMQwRdjOdVjG8mmFFROVkSKuUgBErRQ= diff --git a/integration-tests/load/functions/setup.go b/integration-tests/load/functions/setup.go index 190dbbd869..b41f3a093c 100644 --- a/integration-tests/load/functions/setup.go +++ b/integration-tests/load/functions/setup.go @@ -14,12 +14,12 @@ import ( "github.com/smartcontractkit/seth" "github.com/smartcontractkit/tdh2/go/tdh2/tdh2easy" + ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" "github.com/smartcontractkit/chainlink-testing-framework/networks" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" "github.com/smartcontractkit/chainlink/integration-tests/contracts" "github.com/smartcontractkit/chainlink/integration-tests/types" - "github.com/smartcontractkit/chainlink/integration-tests/utils" chainlinkutils "github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils" ) @@ -53,11 +53,11 @@ type S4SecretsCfg struct { func SetupLocalLoadTestEnv(globalConfig ctf_config.GlobalTestConfig, functionsConfig types.FunctionsTestConfig) (*FunctionsTest, error) { selectedNetwork := networks.MustGetSelectedNetworkConfig(globalConfig.GetNetworkConfig())[0] readSethCfg := globalConfig.GetSethConfig() - sethCfg, err := utils.MergeSethAndEvmNetworkConfigs(selectedNetwork, *readSethCfg) + sethCfg, err := seth_utils.MergeSethAndEvmNetworkConfigs(selectedNetwork, *readSethCfg) if err != nil { return nil, err } - err = utils.ValidateSethNetworkConfig(sethCfg.Network) + err = seth_utils.ValidateSethNetworkConfig(sethCfg.Network) if err != nil { return nil, err } diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index d03e07cbb0..2642b0eaba 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -11,17 +11,17 @@ require ( github.com/K-Phoen/grabana v0.22.1 github.com/ethereum/go-ethereum v1.13.8 github.com/go-resty/resty/v2 v2.11.0 - github.com/pelletier/go-toml/v2 v2.1.1 + github.com/pelletier/go-toml/v2 v2.2.2 github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.30.0 github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.3 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607202129-4cef984f109f - github.com/smartcontractkit/chainlink-testing-framework v1.28.13 + github.com/smartcontractkit/chainlink-testing-framework v1.29.1 github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240214231432-4ad5eb95178c github.com/smartcontractkit/chainlink/v2 v2.9.0-beta0.0.20240216210048-da02459ddad8 github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c - github.com/smartcontractkit/seth v0.1.6-0.20240429143720-cacb8160ecec + github.com/smartcontractkit/seth v1.0.11 github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 github.com/smartcontractkit/wasp v0.4.6 github.com/stretchr/testify v1.9.0 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 831f27a464..fe814de0d4 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1338,8 +1338,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= @@ -1508,8 +1508,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240422172640-59d47c73ba5 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240422172640-59d47c73ba58/go.mod h1:oV5gIuSKrPEcjQ6uB6smBsm5kXHxyydVLNyAs4V9CoQ= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240325075535-0f7eb05ee595 h1:y6ks0HsSOhPUueOmTcoxDQ50RCS1XINlRDTemZyHjFw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240325075535-0f7eb05ee595/go.mod h1:vV6WfnVIbK5Q1JsIru4YcTG0T1uRpLJm6t2BgCnCSsg= -github.com/smartcontractkit/chainlink-testing-framework v1.28.13 h1:aVAmEmunmBfJQd76SBjr44nx/5WDt423tkRRsjnBKpA= -github.com/smartcontractkit/chainlink-testing-framework v1.28.13/go.mod h1:x1zDOz8zcLjEvs9fNA9y/DMguLam/2+CJdpxX0+rM8A= +github.com/smartcontractkit/chainlink-testing-framework v1.29.1 h1:PbcWaSFd9i2Co9ketZ+1NbCkCgeuHC/nrb08mGlRT3k= +github.com/smartcontractkit/chainlink-testing-framework v1.29.1/go.mod h1:oEIggLGWyWfLkjWvuXLol8inUT4YbBb06fJx/S60gQ4= github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240227164431-18a7065e23ea h1:ZdLmNAfKRjH8AYUvjiiDGUgiWQfq/7iNpxyTkvjx/ko= github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240227164431-18a7065e23ea/go.mod h1:gCKC9w6XpNk6jm+XIk2psrkkfxhi421N9NSiFceXW88= github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 h1:FFdvEzlYwcuVHkdZ8YnZR/XomeMGbz5E2F2HZI3I3w8= @@ -1520,8 +1520,8 @@ github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJ github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c h1:lIyMbTaF2H0Q71vkwZHX/Ew4KF2BxiKhqEXwF8rn+KI= github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= -github.com/smartcontractkit/seth v0.1.6-0.20240429143720-cacb8160ecec h1:BT1loU6TT2YqMenD7XE+aw7IeeTiC25+r1TLKAySVIg= -github.com/smartcontractkit/seth v0.1.6-0.20240429143720-cacb8160ecec/go.mod h1:2TMOZQ8WTAw7rR1YBbXpnad6VmT/+xDd/nXLmB7Eero= +github.com/smartcontractkit/seth v1.0.11 h1:Ct8wSifW2ZXnyHtYRKaawBnpW7Ef0m8zItUcqYPallM= +github.com/smartcontractkit/seth v1.0.11/go.mod h1:fVCE+8LD6AbU7d8BHZ1uS/ceJ+8JO0iVTUcDdQmGPAc= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 h1:yiKnypAqP8l0OX0P3klzZ7SCcBUxy5KqTAKZmQOvSQE= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1/go.mod h1:q6f4fe39oZPdsh1i57WznEZgxd8siidMaSFq3wdPmVg= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 h1:Dai1bn+Q5cpeGMQwRdjOdVjG8mmFFROVkSKuUgBErRQ= diff --git a/integration-tests/load/ocr/ocr_test.go b/integration-tests/load/ocr/ocr_test.go index a1388280e5..0093a8f5f6 100644 --- a/integration-tests/load/ocr/ocr_test.go +++ b/integration-tests/load/ocr/ocr_test.go @@ -9,10 +9,10 @@ import ( "github.com/smartcontractkit/wasp" "github.com/smartcontractkit/chainlink-testing-framework/logging" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" "github.com/smartcontractkit/chainlink/integration-tests/k8s" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" - "github.com/smartcontractkit/chainlink/integration-tests/utils" ) var ( @@ -34,7 +34,7 @@ func TestOCRLoad(t *testing.T) { readSethCfg := config.GetSethConfig() require.NotNil(t, readSethCfg, "Seth config shouldn't be nil") - sethCfg, err := utils.MergeSethAndEvmNetworkConfigs(*evmNetwork, *readSethCfg) + sethCfg, err := seth_utils.MergeSethAndEvmNetworkConfigs(*evmNetwork, *readSethCfg) require.NoError(t, err, "Error merging seth and evm network configs") seth, err := seth.NewClientWithConfig(&sethCfg) @@ -76,7 +76,7 @@ func TestOCRVolume(t *testing.T) { readSethCfg := config.GetSethConfig() require.NotNil(t, readSethCfg, "Seth config shouldn't be nil") - sethCfg, err := utils.MergeSethAndEvmNetworkConfigs(*evmNetwork, *readSethCfg) + sethCfg, err := seth_utils.MergeSethAndEvmNetworkConfigs(*evmNetwork, *readSethCfg) require.NoError(t, err, "Error merging seth and evm network configs") seth, err := seth.NewClientWithConfig(&sethCfg) diff --git a/integration-tests/soak/ocr_test.go b/integration-tests/soak/ocr_test.go index 100bc6f7ef..377cb9873a 100644 --- a/integration-tests/soak/ocr_test.go +++ b/integration-tests/soak/ocr_test.go @@ -8,11 +8,11 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/logging" "github.com/smartcontractkit/chainlink-testing-framework/networks" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" actions_seth "github.com/smartcontractkit/chainlink/integration-tests/actions/seth" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" "github.com/smartcontractkit/chainlink/integration-tests/testsetups" - "github.com/smartcontractkit/chainlink/integration-tests/utils" ) func TestOCRSoak(t *testing.T) { @@ -33,9 +33,9 @@ func TestOCRSoak(t *testing.T) { require.NotNil(t, readSethCfg, "Seth config shouldn't be nil") network := networks.MustGetSelectedNetworkConfig(config.GetNetworkConfig())[0] - sethCfg, err := utils.MergeSethAndEvmNetworkConfigs(network, *readSethCfg) + sethCfg, err := seth_utils.MergeSethAndEvmNetworkConfigs(network, *readSethCfg) require.NoError(t, err, "Error merging seth and evm network configs") - err = utils.ValidateSethNetworkConfig(sethCfg.Network) + err = seth_utils.ValidateSethNetworkConfig(sethCfg.Network) require.NoError(t, err, "Error validating seth network config") _, err = seth.NewClientWithConfig(&sethCfg) diff --git a/integration-tests/testsetups/ocr.go b/integration-tests/testsetups/ocr.go index caf9da48e2..30fac52692 100644 --- a/integration-tests/testsetups/ocr.go +++ b/integration-tests/testsetups/ocr.go @@ -37,6 +37,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/logging" "github.com/smartcontractkit/chainlink-testing-framework/networks" reportModel "github.com/smartcontractkit/chainlink-testing-framework/testreporters" + seth_utils "github.com/smartcontractkit/chainlink-testing-framework/utils/seth" "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" "github.com/smartcontractkit/chainlink/integration-tests/actions" @@ -44,11 +45,9 @@ import ( "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/config" "github.com/smartcontractkit/chainlink/integration-tests/contracts" + tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" "github.com/smartcontractkit/chainlink/integration-tests/testreporters" tt "github.com/smartcontractkit/chainlink/integration-tests/types" - "github.com/smartcontractkit/chainlink/integration-tests/utils" - - tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" ) const ( @@ -167,13 +166,13 @@ func (o *OCRSoakTest) Setup(ocrTestConfig tt.OcrTestConfig) { network = networks.MustGetSelectedNetworkConfig(ocrTestConfig.GetNetworkConfig())[0] ) - network = utils.MustReplaceSimulatedNetworkUrlWithK8(o.log, network, *o.testEnvironment) + network = seth_utils.MustReplaceSimulatedNetworkUrlWithK8(o.log, network, *o.testEnvironment) readSethCfg := ocrTestConfig.GetSethConfig() require.NotNil(o.t, readSethCfg, "Seth config shouldn't be nil") - sethCfg, err := utils.MergeSethAndEvmNetworkConfigs(network, *readSethCfg) + sethCfg, err := seth_utils.MergeSethAndEvmNetworkConfigs(network, *readSethCfg) require.NoError(o.t, err, "Error merging seth and evm network configs") - err = utils.ValidateSethNetworkConfig(sethCfg.Network) + err = seth_utils.ValidateSethNetworkConfig(sethCfg.Network) require.NoError(o.t, err, "Error validating seth network config") seth, err := seth.NewClientWithConfig(&sethCfg) diff --git a/integration-tests/utils/seth.go b/integration-tests/utils/seth.go deleted file mode 100644 index ef9b331a44..0000000000 --- a/integration-tests/utils/seth.go +++ /dev/null @@ -1,122 +0,0 @@ -package utils - -import ( - "fmt" - "strconv" - - "github.com/rs/zerolog" - "github.com/smartcontractkit/seth" - - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" - "github.com/smartcontractkit/chainlink-testing-framework/k8s/environment" -) - -// MergeSethAndEvmNetworkConfigs merges EVMNetwork to Seth config. If Seth config already has Network settings, -// it will return unchanged Seth config that was passed to it. If the network is simulated, it will -// use Geth-specific settings. Otherwise it will use the chain ID to find the correct network settings. -// If no match is found it will return error. -func MergeSethAndEvmNetworkConfigs(evmNetwork blockchain.EVMNetwork, sethConfig seth.Config) (seth.Config, error) { - if sethConfig.Network != nil { - return sethConfig, nil - } - - var sethNetwork *seth.Network - - for _, conf := range sethConfig.Networks { - if evmNetwork.Simulated { - if conf.Name == seth.GETH { - conf.PrivateKeys = evmNetwork.PrivateKeys - if len(conf.URLs) == 0 { - conf.URLs = evmNetwork.URLs - } - // important since Besu doesn't support EIP-1559, but other EVM clients do - conf.EIP1559DynamicFees = evmNetwork.SupportsEIP1559 - - // might be needed for cases, when node is incapable of estimating gas limit (e.g. Geth < v1.10.0) - if evmNetwork.DefaultGasLimit != 0 { - conf.GasLimit = evmNetwork.DefaultGasLimit - } - - sethNetwork = conf - break - } - } else if conf.ChainID == fmt.Sprint(evmNetwork.ChainID) { - conf.PrivateKeys = evmNetwork.PrivateKeys - if len(conf.URLs) == 0 { - conf.URLs = evmNetwork.URLs - } - - sethNetwork = conf - break - } - } - - if sethNetwork == nil { - return seth.Config{}, fmt.Errorf("No matching EVM network found for chain ID %d. If it's a new network please define it as [Network.EVMNetworks.NETWORK_NAME] in TOML", evmNetwork.ChainID) - } - - sethConfig.Network = sethNetwork - - return sethConfig, nil -} - -// MustReplaceSimulatedNetworkUrlWithK8 replaces the simulated network URL with the K8 URL and returns the network. -// If the network is not simulated, it will return the network unchanged. -func MustReplaceSimulatedNetworkUrlWithK8(l zerolog.Logger, network blockchain.EVMNetwork, testEnvironment environment.Environment) blockchain.EVMNetwork { - if !network.Simulated { - return network - } - - if _, ok := testEnvironment.URLs["Simulated Geth"]; !ok { - for k := range testEnvironment.URLs { - l.Info().Str("Network", k).Msg("Available networks") - } - panic("no network settings for Simulated Geth") - } - network.URLs = testEnvironment.URLs["Simulated Geth"] - - return network -} - -// ValidateSethNetworkConfig validates the Seth network config -func ValidateSethNetworkConfig(cfg *seth.Network) error { - if cfg == nil { - return fmt.Errorf("Network cannot be nil") - } - if cfg.ChainID == "" { - return fmt.Errorf("ChainID is required") - } - _, err := strconv.Atoi(cfg.ChainID) - if err != nil { - return fmt.Errorf("ChainID needs to be a number") - } - if cfg.URLs == nil || len(cfg.URLs) == 0 { - return fmt.Errorf("URLs are required") - } - if cfg.PrivateKeys == nil || len(cfg.PrivateKeys) == 0 { - return fmt.Errorf("PrivateKeys are required") - } - if cfg.TransferGasFee == 0 { - return fmt.Errorf("TransferGasFee needs to be above 0. It's the gas fee for a simple transfer transaction") - } - if cfg.TxnTimeout.Duration() == 0 { - return fmt.Errorf("TxnTimeout needs to be above 0. It's the timeout for a transaction") - } - if cfg.EIP1559DynamicFees { - if cfg.GasFeeCap == 0 { - return fmt.Errorf("GasFeeCap needs to be above 0. It's the maximum fee per gas for a transaction (including tip)") - } - if cfg.GasTipCap == 0 { - return fmt.Errorf("GasTipCap needs to be above 0. It's the maximum tip per gas for a transaction") - } - if cfg.GasFeeCap <= cfg.GasTipCap { - return fmt.Errorf("GasFeeCap needs to be above GasTipCap (as it is base fee + tip cap)") - } - } else { - if cfg.GasPrice == 0 { - return fmt.Errorf("GasPrice needs to be above 0. It's the price of gas for a transaction") - } - } - - return nil -}