From 824199ac1644f11ffa84c960d46eeaf743a8744d Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 12:57:59 +0100 Subject: [PATCH 01/59] add workflow that verifies compatibility with different versions of evm nodes --- .../setup-create-base64-config/action.yml | 28 ++ .../evm-version-compatibility-tests.yml | 337 ++++++++++++++++++ integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 +- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 +- .../scripts/buildEvmClientTestMatrixList.sh | 65 ++++ .../evm_node_compatibility_test_list.json | 32 ++ 8 files changed, 468 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/evm-version-compatibility-tests.yml create mode 100755 integration-tests/scripts/buildEvmClientTestMatrixList.sh create mode 100644 integration-tests/smoke/evm_node_compatibility_test_list.json diff --git a/.github/actions/setup-create-base64-config/action.yml b/.github/actions/setup-create-base64-config/action.yml index d68d4f7b12f..aed4a78db8c 100644 --- a/.github/actions/setup-create-base64-config/action.yml +++ b/.github/actions/setup-create-base64-config/action.yml @@ -35,6 +35,10 @@ inputs: description: Grafana URL grafanaDashboardUrl: description: Grafana dashboard URL + ethExecutionClient: + description: Ethereum execution client to use (geth, besu, nethermind or erigon) + customDockerImages: + description: key-value pairs of custom docker images to use (e.g. besu=hyperledger/besu:21.10.0,geth=ethereum/client-go:1.10.8) runs: using: composite @@ -58,6 +62,8 @@ runs: LOGSTREAM_LOG_TARGETS: ${{ inputs.logstreamLogTargets }} GRAFANA_URL: ${{ inputs.grafanaUrl }} GRAFANA_DASHBOARD_URL: ${{ inputs.grafanaDashboardUrl }} + ETH_EXECUTION_CLIENT: ${{ inputs.ethExecutionClient }} + CUSTOM_DOCKER_IMAGES: ${{ inputs.customDockerImages }} run: | echo ::add-mask::$CHAINLINK_IMAGE function convert_to_toml_array() { @@ -88,6 +94,23 @@ runs: test_log_collect=false fi + custom_images="" + + if [ -n "$CUSTOM_DOCKER_IMAGES" ]; then + custom_images+="[PrivateEthereumNetwork.CustomDockerImages]" + IFS=',' read -r -a array <<< "$CUSTOM_DOCKER_IMAGES" + + for element in "${array[@]}"; do + custom_images+=$'\n'"$element" + done + fi + + if [ -n "$ETH_EXECUTION_CLIENT" ]; then + execution_layer="$ETH_EXECUTION_CLIENT" + else + execution_layer="geth" + fi + cat << EOF > config.toml [Network] selected_networks=$selected_networks @@ -118,6 +141,11 @@ runs: [Logging.Grafana] base_url="$GRAFANA_URL" dashboard_url="$GRAFANA_DASHBOARD_URL" + + [PrivateEthereumNetwork] + execution_layer="$execution_layer" + + $custom_images EOF BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml new file mode 100644 index 00000000000..8764a4dded9 --- /dev/null +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -0,0 +1,337 @@ +name: EVM Node Version Compatibility Tests +on: + merge_group: + pull_request: + push: + tags: + - "*" + workflow_dispatch: + inputs: + base64_test_list: + description: Base64 encoded test list (same format as ./integration-tests/evm_node_compatibility_test_list.json) + required: false + type: string + +env: + CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink + INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com + MOD_CACHE_VERSION: 2 + +jobs: + # Check if go.mod has changed + + check-dependency-bump: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 2 # Fetches the commit history to compare changes + + - name: Check for go.mod changes + id: go_mod_changed + run: | + git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep go.mod && echo "::set-output name=changed::true" || echo "::set-output name=changed::false" + + - name: Fetch previous go.mod for comparison (if changed) + if: steps.go_mod_changed.outputs.changed == 'true' + run: | + git show ${{ github.event.before }}:./go.mod > go.mod.before + echo "Comparing go-ethereum dependency versions..." + # Extract the specific dependency version from the current go.mod + CURRENT_VERSION=$(grep "ethereum/go-ethereum" go.mod | awk '{print $2}') + # Extract the specific dependency version from the previous go.mod + PREVIOUS_VERSION=$(grep "ethereum/go-ethereum" go.mod.before | awk '{print $2}') + # Check if the current version matches the target version + if [ "$PREVIOUS_VERSION" != "$CURRENT_VERSION" ]; then + echo "Dependency ethereum/go-ethereum was changed to $CURRENT_VERSION" + echo "dependency_bumped=true" >> $GITHUB_ENV + else + echo "No relevant dependency bump detected." + echo "dependency_bumped=false" >> $GITHUB_ENV + fi + + # Build Test Dependencies + + build-chainlink: + if: env.dependency_bumped == 'true' + environment: integration + permissions: + id-token: write + contents: read + name: Build Chainlink Image + runs-on: ubuntu-latest + steps: + - name: Collect Metrics + id: collect-gha-metrics + uses: smartcontractkit/push-gha-metrics-action@0281b09807758be1dcc41651e44e62b353808c47 # v2.1.0 + with: + org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} + this-job-name: Build Chainlink Image + continue-on-error: true + - name: Checkout the repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + - name: Build Chainlink Image + uses: ./.github/actions/build-chainlink-image + with: + tag_suffix: "" + dockerfile: core/chainlink.Dockerfile + git_commit_sha: ${{ github.sha }} + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + + build-tests: + if: env.dependency_bumped == 'true' + environment: integration + permissions: + id-token: write + contents: read + name: Build Tests Binary + runs-on: ubuntu-latest + steps: + - name: Collect Metrics + id: collect-gha-metrics + uses: smartcontractkit/push-gha-metrics-action@0281b09807758be1dcc41651e44e62b353808c47 # v2.1.0 + with: + org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} + this-job-name: Build Tests Binary + continue-on-error: true + - name: Checkout the repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + - name: Build Tests + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-tests@c67a09566412d153ff7640d99f96b43aa03abc04 # v2.3.6 + with: + test_download_vendor_packages_command: cd ./integration-tests && go mod download + token: ${{ secrets.GITHUB_TOKEN }} + go_mod_path: ./integration-tests/go.mod + go_tags: embed + cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} + cache_restore_only: "true" + binary_name: tests + + build-test-matrix: + needs: [check-dependency-bump] + runs-on: ubuntu-latest + name: Build Test Matrix + outputs: + matrix: ${{ env.JOB_MATRIX_JSON }} + steps: + - name: Checkout the repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Setup environment variables + run: | + echo "BASE64_TEST_LIST=${{ github.event.inputs.base64_test_list }}" >> $GITHUB_ENV + + - name: Decode Base64 Test List Input if Set + id: decode-base64-test-list + if: env.BASE64_TEST_LIST != '' + run: | + echo "Decoding test_input..." + DECODED_BASE64_TEST_LIST=$(echo $BASE64_TEST_LIST | base64 -d) + cd ./integration-tests + echo $DECODED_BASE64_TEST_LIST >> ./evm_node_compatibility_test_list.json + + - name: Copy Saved Test List if Not Set + if: env.BASE64_TEST_LIST == '' + id: build-test-matrix-list + run: | + cd ./integration-tests + cp ./smoke/evm_node_compatibility_test_list.json . + + - name: Set Matrix from Decoded Input + id: build-test-matrix-list + run: | + cd ./integration-tests + JOB_MATRIX_JSON=$(./scripts/buildEvmClientTestMatrixList.sh ./evm_node_compatibility_test_list.json ubuntu-latest) + echo "JOB_MATRIX_JSON=${JOB_MATRIX_JSON}" >> $GITHUB_ENV + + + # End Build Test Dependencies + + evm-node-compatiblity-matrix: + environment: integration + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + needs: + [check-dependency-bump-tests, build-chainlink, build-tests, build-test-matrix] + env: + SELECTED_NETWORKS: SIMULATED + CHAINLINK_COMMIT_SHA: ${{ github.sha }} + CHAINLINK_ENV_USER: ${{ github.actor }} + TEST_LOG_LEVEL: debug + strategy: + fail-fast: false + matrix: + evm_node: ${{fromJson(needs.build-test-matrix.outputs.matrix)}} + runs-on: ${{ matrix.evm_node.os }} + name: EVM node compatibility test for ${{ matrix.evm_node.eth_client }} (${{ matrix.evm_node.docker_image }}) + steps: + - name: Collect Metrics + if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' + id: collect-gha-metrics + uses: smartcontractkit/push-gha-metrics-action@0281b09807758be1dcc41651e44e62b353808c47 # v2.1.0 + with: + basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} + hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} + org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} + this-job-name: EVM node compatibility test ${{ matrix.evm_node.docker_image }} + test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}' + continue-on-error: true + - name: Checkout the repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + - name: Build Go Test Command + id: build-go-test-command + run: | + # if the matrix.evm_node.run is set, use it for a different command + if [ "${{ matrix.evm_node.run }}" != "" ]; then + echo "run_command=${{ matrix.evm_node.run }} ./smoke/${{ matrix.evm_node.product }}_test.go" >> "$GITHUB_OUTPUT" + else + echo "run_command=./smoke/${{ matrix.evm_node.product }}_test.go" >> "$GITHUB_OUTPUT" + fi + - name: Prepare Base64 TOML override + uses: ./.github/actions/setup-create-base64-config + with: + runId: ${{ github.run_id }} + testLogCollect: ${{ vars.TEST_LOG_COLLECT }} + selectedNetworks: ${{ env.SELECTED_NETWORKS }} + chainlinkImage: ${{ env.CHAINLINK_IMAGE }} + chainlinkVersion: ${{ github.sha }} + pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 + pyroscopeEnvironment: ${{ matrix.product.pyroscope_env }} + pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} + lokiEndpoint: ${{ secrets.LOKI_URL }} + lokiTenantId: ${{ vars.LOKI_TENANT_ID }} + lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} + logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }} + grafanaUrl: ${{ vars.GRAFANA_URL }} + grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" + ethExecutionClient: ${{ matrix.evm_node.eth_client }} + customDockerImages: ${{ matrix.evm_node.eth_client }}=${{ matrix.evm_node.docker_image }} + + ## Run this step when changes that require tests to be run are made + - name: Run Tests + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@c67a09566412d153ff7640d99f96b43aa03abc04 # v2.3.6 + with: + test_command_to_run: cd ./integration-tests && go test -timeout 45m -count=1 -json -test.parallel=2 ${{ steps.build-go-test-command.outputs.run_command }} 2>&1 | tee /tmp/gotest.log | gotestfmt + test_download_vendor_packages_command: cd ./integration-tests && go mod download + cl_repo: ${{ env.CHAINLINK_IMAGE }} + cl_image_tag: ${{ github.sha }} + aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} + artifacts_location: ./integration-tests/smoke/logs/ + publish_check_name: ${{ matrix.evm_node.product }}-compatibility-${{ matrix.evm_node.eth_client }}-${{ matrix.evm_node.docker_image }} + token: ${{ secrets.GITHUB_TOKEN }} + go_mod_path: ./integration-tests/go.mod + cache_key_id: core-e2e-${{ env.MOD_CACHE_VERSION }} + cache_restore_only: "true" + QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} + QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + QA_KUBECONFIG: "" + should_tidy: "false" + - name: Print failed test summary + if: always() + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/show-test-summary@c67a09566412d153ff7640d99f96b43aa03abc04 # v2.3.6 + + start-slack-thread: + name: Start Slack Thread + if: ${{ always() && needs.*.result != 'skipped' && needs.*.result != 'cancelled' }} + environment: integration + outputs: + thread_ts: ${{ steps.slack.outputs.thread_ts }} + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + runs-on: ubuntu-latest + needs: [ evm-node-compatiblity-matrix] + steps: + - name: Debug Result + run: echo ${{ join(needs.*.result, ',') }} + - name: Main Slack Notification + uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 + id: slack + with: + channel-id: ${{ secrets.QA_SLACK_CHANNEL }} + payload: | + { + "attachments": [ + { + "color": "${{ contains(join(needs.*.result, ','), 'failure') && '#C62828' || '#2E7D32' }}", + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "text": "EVM Node Compatability Test Results ${{ contains(join(needs.*.result, ','), 'failure') && ':x:' || ':white_check_mark:'}}", + "emoji": true + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "${{ contains(join(needs.*.result, ','), 'failure') && 'Some tests failed, notifying <@U060CGGPY8H>' || 'All Good!' }}" + } + }, + { + "type": "divider" + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "<${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|${{ github.ref_name }}> | <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}> | <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Run>" + } + } + ] + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} + + post-test-results-to-slack: + name: Post Test Results for ${{matrix.evm_node.eth_client}} to Slack + if: ${{ always() && needs.*.result != 'skipped' && needs.*.result != 'cancelled' }} + environment: integration + permissions: + checks: write + pull-requests: write + id-token: write + contents: read + runs-on: ubuntu-latest + needs: start-slack-thread + strategy: + fail-fast: false + matrix: + product: ["geth", "besu", "nethermind", "erigon"] + steps: + - name: Checkout the repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + - name: Post Test Results to Slack + uses: ./.github/actions/notify-slack-jobs-result + with: + github_token: ${{ github.token }} + github_repository: ${{ github.repository }} + workflow_run_id: ${{ github.run_id }} + github_job_name_regex: ^Client Compatibility Test ${{ matrix.product }}-(?.*?)$ + message_title: ${{ matrix.product }} + slack_channel_id: ${{ secrets.QA_SLACK_CHANNEL }} + slack_bot_token: ${{ secrets.QA_SLACK_API_KEY }} + slack_thread_ts: ${{ needs.start-slack-thread.outputs.thread_ts }} diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 30241cdc28d..012f2d1b6af 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -24,7 +24,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240118014648-1ab6a88c9429 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240306173252-5cbf83ca3a69 - github.com/smartcontractkit/chainlink-testing-framework v1.25.1 + github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307113134-32c4cbfae66f github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20240229181116-bfb2432a7a66 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 7d1c024a761..a0b6f37ff8e 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1528,8 +1528,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.25.1 h1:SEpP7yvsShsAHTVhbxS2srOWi5StrslM4niAWJC9o4E= -github.com/smartcontractkit/chainlink-testing-framework v1.25.1/go.mod h1:gkmsafC85u6hIqWbxKjynKf4NuFuFJDRcgxIEFsSq6E= +github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307113134-32c4cbfae66f h1:MRth3Tiu4JNqjV0YUYY8+HglzJQBgGdbNtq8j1g/WRc= +github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307113134-32c4cbfae66f/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 01ec14c9839..86fd0c4316f 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -16,7 +16,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240118014648-1ab6a88c9429 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240306173252-5cbf83ca3a69 - github.com/smartcontractkit/chainlink-testing-framework v1.25.1 + github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307113134-32c4cbfae66f 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-20240229181116-bfb2432a7a66 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index ac58e4c2b48..5c7eca9f441 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1511,8 +1511,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.25.1 h1:SEpP7yvsShsAHTVhbxS2srOWi5StrslM4niAWJC9o4E= -github.com/smartcontractkit/chainlink-testing-framework v1.25.1/go.mod h1:gkmsafC85u6hIqWbxKjynKf4NuFuFJDRcgxIEFsSq6E= +github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307113134-32c4cbfae66f h1:MRth3Tiu4JNqjV0YUYY8+HglzJQBgGdbNtq8j1g/WRc= +github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307113134-32c4cbfae66f/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= diff --git a/integration-tests/scripts/buildEvmClientTestMatrixList.sh b/integration-tests/scripts/buildEvmClientTestMatrixList.sh new file mode 100755 index 00000000000..2a6d4728efe --- /dev/null +++ b/integration-tests/scripts/buildEvmClientTestMatrixList.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash + +# requires a path to a test file to compare the test list against +# requires a matrix job name to be passed in, for example "automation" +# requires a node label to be passed in, for example "ubuntu-latest" + +set -e + +# get this script's directory +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) + +cd "$SCRIPT_DIR"/../ || exit 1 + +JSONFILE=$1 +NODE_LABEL=$2 + +COUNTER=1 + +# Build a JSON object in the format expected by our integration-tests workflow matrix +matrix_output() { + local counter=$1 + local job_name=$2 + local test_name=$3 + local node_label=$4 + local eth_client=$5 + local docker_image=$6 + local product=$7 + local counter_out=$(printf "%02d\n" $counter) + echo -n "{\"name\": \"${job_name}-${counter_out}\", \"os\": \"${node_label}\", \"eth_client\": \"${eth_client}\", \"docker_image\": \"${docker_image}\", \"run\": \"-run '^${test_name}$'\"}" +} + +# Read the JSON file and loop through 'tests' and 'run' +jq -c '.tests[]' ${JSONFILE} | while read -r test; do + testName=$(echo ${test} | jq -r '.name') + label=$(echo ${test} | jq -r '.label // empty') + effective_node_label=${label:-$NODE_LABEL} + eth_client=$(echo ${test} | jq -r '.eth_client') + docker_image=$(echo ${test} | jq -r '.docker_image') + subTests=$(echo ${test} | jq -r '.run[]?.name // empty') + product=$(echo ${test} | jq -r '.product') + output="" + + if [ $COUNTER -ne 1 ]; then + echo -n "," + fi + + # Loop through subtests, if any, and print in the desired format + if [ -n "$subTests" ]; then + subTestString="" + subTestCounter=1 + for subTest in $subTests; do + if [ $subTestCounter -ne 1 ]; then + subTestString+="|" + fi + subTestString+="${testName}\/${subTest}" + ((subTestCounter++)) + done + testName="${subTestString}" + fi + matrix_output $COUNTER "emv-node-version-compatibility-test" "${testName}" ${effective_node_label} "${eth_client}" "${docker_image}" "${product}" + ((COUNTER++)) +done > "./tmpout.json" +OUTPUT=$(cat ./tmpout.json) +echo "[${OUTPUT}]" +rm ./tmpout.json \ No newline at end of file diff --git a/integration-tests/smoke/evm_node_compatibility_test_list.json b/integration-tests/smoke/evm_node_compatibility_test_list.json new file mode 100644 index 00000000000..dde06b5833a --- /dev/null +++ b/integration-tests/smoke/evm_node_compatibility_test_list.json @@ -0,0 +1,32 @@ +{ + "tests": [ + { + "product": "ocr", + "name": "TestOCRBasic", + "eth_client": "geth", + "docker_image": "ethereum/client-go:latest_stable", + "label": "ubuntu-latest" + }, + { + "product": "ocr", + "name": "TestOCRBasic", + "eth_client": "besu", + "docker_image": "hyperledger/besu:latest_stable", + "label": "ubuntu-latest" + }, + { + "product": "ocr", + "name": "TestOCRBasic", + "eth_client": "nethermind", + "docker_image": "nethermind/nethermind:latest_stable", + "label": "ubuntu-latest" + }, + { + "product": "ocr", + "name": "TestOCRBasic", + "eth_client": "besu", + "docker_image": "thorax/erigon:latest_stable", + "label": "ubuntu-latest" + } + ] +} \ No newline at end of file From 788b2c46730876404d8957d1a2a772da365eeffd Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 13:10:52 +0100 Subject: [PATCH 02/59] fix lints --- integration-tests/actions/private_network.go | 2 +- integration-tests/docker/test_env/test_env_builder.go | 2 +- integration-tests/universal/log_poller/helpers.go | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/integration-tests/actions/private_network.go b/integration-tests/actions/private_network.go index 7f8bfe8bb2c..01a084b66d8 100644 --- a/integration-tests/actions/private_network.go +++ b/integration-tests/actions/private_network.go @@ -12,7 +12,7 @@ func EthereumNetworkConfigFromConfig(l zerolog.Logger, config tc.GlobalTestConfi l.Warn().Msg("No TOML private ethereum network config found, will use old geth") ethBuilder := ctf_test_env.NewEthereumNetworkBuilder() network, err = ethBuilder. - WithConsensusType(ctf_test_env.ConsensusType_PoW). + WithEthereumVersion(ctf_test_env.EthereumVersion_Eth1). WithExecutionLayer(ctf_test_env.ExecutionLayer_Geth). Build() diff --git a/integration-tests/docker/test_env/test_env_builder.go b/integration-tests/docker/test_env/test_env_builder.go index cfe10d1f783..57499d3dac0 100644 --- a/integration-tests/docker/test_env/test_env_builder.go +++ b/integration-tests/docker/test_env/test_env_builder.go @@ -147,7 +147,7 @@ func (b *CLTestEnvBuilder) WithFunding(eth *big.Float) *CLTestEnvBuilder { func (b *CLTestEnvBuilder) WithGeth() *CLTestEnvBuilder { ethBuilder := test_env.NewEthereumNetworkBuilder() cfg, err := ethBuilder. - WithConsensusType(test_env.ConsensusType_PoW). + WithEthereumVersion(test_env.EthereumVersion_Eth1). WithExecutionLayer(test_env.ExecutionLayer_Geth). WithTest(b.t). Build() diff --git a/integration-tests/universal/log_poller/helpers.go b/integration-tests/universal/log_poller/helpers.go index b6e62cff2f6..09e0343cf39 100644 --- a/integration-tests/universal/log_poller/helpers.go +++ b/integration-tests/universal/log_poller/helpers.go @@ -1134,8 +1134,7 @@ func SetupLogPollerTestDocker( ethBuilder := ctf_test_env.NewEthereumNetworkBuilder() cfg, err := ethBuilder. - WithConsensusType(ctf_test_env.ConsensusType_PoS). - WithConsensusLayer(ctf_test_env.ConsensusLayer_Prysm). + WithEthereumVersion(ctf_test_env.EthereumVersion_Eth2). WithExecutionLayer(ctf_test_env.ExecutionLayer_Geth). WithEthereumChainConfig(ctf_test_env.EthereumChainConfig{ SecondsPerSlot: 4, From 50bef2ba074d3e434fa044fdfec8552e3bc4bf7c Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 14:19:26 +0100 Subject: [PATCH 03/59] fix worklow definion --- .../workflows/evm-version-compatibility-tests.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 8764a4dded9..7311e13a065 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -22,6 +22,8 @@ jobs: check-dependency-bump: runs-on: ubuntu-latest + outputs: + dependency_bumped: ${{ steps.dependency-check.outputs.dependency_bumped }} steps: - name: Checkout code uses: actions/checkout@v2 @@ -35,6 +37,7 @@ jobs: - name: Fetch previous go.mod for comparison (if changed) if: steps.go_mod_changed.outputs.changed == 'true' + id: dependency-check run: | git show ${{ github.event.before }}:./go.mod > go.mod.before echo "Comparing go-ethereum dependency versions..." @@ -45,16 +48,17 @@ jobs: # Check if the current version matches the target version if [ "$PREVIOUS_VERSION" != "$CURRENT_VERSION" ]; then echo "Dependency ethereum/go-ethereum was changed to $CURRENT_VERSION" - echo "dependency_bumped=true" >> $GITHUB_ENV + echo "dependency_bumped=true" >> $GITHUB_OUTPUT else echo "No relevant dependency bump detected." - echo "dependency_bumped=false" >> $GITHUB_ENV + echo "dependency_bumped=false" >> $GITHUB_OUTPUT fi # Build Test Dependencies build-chainlink: - if: env.dependency_bumped == 'true' + if: needs.check-dependency-bump.outputs.dependency_bumped == 'true' + needs: [check-dependency-bump] environment: integration permissions: id-token: write @@ -85,7 +89,8 @@ jobs: AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} build-tests: - if: env.dependency_bumped == 'true' + if: needs.check-dependency-bump.outputs.dependency_bumped == 'true' + needs: [check-dependency-bump] environment: integration permissions: id-token: write @@ -118,6 +123,7 @@ jobs: binary_name: tests build-test-matrix: + if: needs.check-dependency-bump.outputs.dependency_bumped == 'true' needs: [check-dependency-bump] runs-on: ubuntu-latest name: Build Test Matrix From 401149e8b5c2b896ea00ccd585490249b6cb1d20 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 14:20:38 +0100 Subject: [PATCH 04/59] another workflow fix --- .github/workflows/evm-version-compatibility-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 7311e13a065..8772c2581c2 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -154,7 +154,7 @@ jobs: cp ./smoke/evm_node_compatibility_test_list.json . - name: Set Matrix from Decoded Input - id: build-test-matrix-list + id: set-test-matrix-list run: | cd ./integration-tests JOB_MATRIX_JSON=$(./scripts/buildEvmClientTestMatrixList.sh ./evm_node_compatibility_test_list.json ubuntu-latest) From e2687980fd6865752bdc314312d29185a79ce84b Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 14:21:46 +0100 Subject: [PATCH 05/59] another fix --- .github/workflows/evm-version-compatibility-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 8772c2581c2..5ad17113895 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -171,7 +171,7 @@ jobs: id-token: write contents: read needs: - [check-dependency-bump-tests, build-chainlink, build-tests, build-test-matrix] + [check-dependency-bump, build-chainlink, build-tests, build-test-matrix] env: SELECTED_NETWORKS: SIMULATED CHAINLINK_COMMIT_SHA: ${{ github.sha }} From f2b056d9ec39d251da2ce9978d343d5d50067589 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 14:28:08 +0100 Subject: [PATCH 06/59] send slack notifications only if go-ethereum dep was modified --- .github/workflows/evm-version-compatibility-tests.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 5ad17113895..fc16ede22ef 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -33,7 +33,7 @@ jobs: - name: Check for go.mod changes id: go_mod_changed run: | - git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep go.mod && echo "::set-output name=changed::true" || echo "::set-output name=changed::false" + git diff --name-only 401149e8b5c2b896ea00ccd585490249b6cb1d20 7d6d818f4dca1b69133fcb168c5c2b4421545fc1 | grep go.mod && echo "changed=true" >> $GITHUB_OUTPUT || echo "changed=false" >> $GITHUB_OUTPUT - name: Fetch previous go.mod for comparison (if changed) if: steps.go_mod_changed.outputs.changed == 'true' @@ -160,7 +160,6 @@ jobs: JOB_MATRIX_JSON=$(./scripts/buildEvmClientTestMatrixList.sh ./evm_node_compatibility_test_list.json ubuntu-latest) echo "JOB_MATRIX_JSON=${JOB_MATRIX_JSON}" >> $GITHUB_ENV - # End Build Test Dependencies evm-node-compatiblity-matrix: @@ -253,7 +252,7 @@ jobs: start-slack-thread: name: Start Slack Thread - if: ${{ always() && needs.*.result != 'skipped' && needs.*.result != 'cancelled' }} + if: ${{ needs.check-dependency-bump.outputs.dependency_bumped == 'true' && needs.*.result != 'skipped' && needs.*.result != 'cancelled' }} environment: integration outputs: thread_ts: ${{ steps.slack.outputs.thread_ts }} @@ -312,7 +311,7 @@ jobs: post-test-results-to-slack: name: Post Test Results for ${{matrix.evm_node.eth_client}} to Slack - if: ${{ always() && needs.*.result != 'skipped' && needs.*.result != 'cancelled' }} + if: ${{ needs.check-dependency-bump.outputs.dependency_bumped == 'true' && needs.*.result != 'skipped' && needs.*.result != 'cancelled' }} environment: integration permissions: checks: write @@ -320,7 +319,7 @@ jobs: id-token: write contents: read runs-on: ubuntu-latest - needs: start-slack-thread + needs: [start-slack-thread] strategy: fail-fast: false matrix: From 1db27e4143c0318ca63048dcde0e0829f9e9b0d2 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 14:29:09 +0100 Subject: [PATCH 07/59] bump go-ethereum to v1.13.9 to test the workflow --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 15a721dc380..27277a303ea 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -8,7 +8,7 @@ replace github.com/smartcontractkit/chainlink/v2 => ../../ require ( github.com/docker/docker v24.0.7+incompatible github.com/docker/go-connections v0.4.0 - github.com/ethereum/go-ethereum v1.13.8 + github.com/ethereum/go-ethereum v1.13.9 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.4.0 github.com/jmoiron/sqlx v1.3.5 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 4be489ecedc..e4c745d6e57 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -387,8 +387,8 @@ github.com/esote/minmaxheap v1.0.0/go.mod h1:Ln8+i7fS1k3PLgZI2JAo0iA1as95QnIYiGC github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= -github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= +github.com/ethereum/go-ethereum v1.13.9 h1:ed4e4c7NWPrO2VX2wsMhWs5+6Lf2D591DmdE8RgmtcU= +github.com/ethereum/go-ethereum v1.13.9/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= diff --git a/go.mod b/go.mod index cf20ecf9ca7..f8c1f7ca001 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/cosmos/cosmos-sdk v0.47.4 github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e github.com/esote/minmaxheap v1.0.0 - github.com/ethereum/go-ethereum v1.13.8 + github.com/ethereum/go-ethereum v1.13.9 github.com/fatih/color v1.16.0 github.com/fxamacker/cbor/v2 v2.5.0 github.com/gagliardetto/solana-go v1.4.1-0.20220428092759-5250b4abbb27 diff --git a/go.sum b/go.sum index 733b0e4b2d8..a2295f4bb46 100644 --- a/go.sum +++ b/go.sum @@ -370,8 +370,8 @@ github.com/esote/minmaxheap v1.0.0/go.mod h1:Ln8+i7fS1k3PLgZI2JAo0iA1as95QnIYiGC github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= -github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= +github.com/ethereum/go-ethereum v1.13.9 h1:ed4e4c7NWPrO2VX2wsMhWs5+6Lf2D591DmdE8RgmtcU= +github.com/ethereum/go-ethereum v1.13.9/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 012f2d1b6af..71a1dc4d9d3 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -8,7 +8,7 @@ replace github.com/smartcontractkit/chainlink/v2 => ../ require ( github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df github.com/cli/go-gh/v2 v2.0.0 - github.com/ethereum/go-ethereum v1.13.8 + github.com/ethereum/go-ethereum v1.13.9 github.com/go-resty/resty/v2 v2.7.0 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index a0b6f37ff8e..29584f1e6ab 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -475,8 +475,8 @@ github.com/esote/minmaxheap v1.0.0/go.mod h1:Ln8+i7fS1k3PLgZI2JAo0iA1as95QnIYiGC github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= -github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= +github.com/ethereum/go-ethereum v1.13.9 h1:ed4e4c7NWPrO2VX2wsMhWs5+6Lf2D591DmdE8RgmtcU= +github.com/ethereum/go-ethereum v1.13.9/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 86fd0c4316f..fe61a10df87 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -9,7 +9,7 @@ replace github.com/smartcontractkit/chainlink/integration-tests => ../ require ( github.com/K-Phoen/grabana v0.22.1 - github.com/ethereum/go-ethereum v1.13.8 + github.com/ethereum/go-ethereum v1.13.9 github.com/go-resty/resty/v2 v2.11.0 github.com/pelletier/go-toml/v2 v2.1.1 github.com/rs/zerolog v1.30.0 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 5c7eca9f441..84721f96f19 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -465,8 +465,8 @@ github.com/esote/minmaxheap v1.0.0/go.mod h1:Ln8+i7fS1k3PLgZI2JAo0iA1as95QnIYiGC github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= -github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= +github.com/ethereum/go-ethereum v1.13.9 h1:ed4e4c7NWPrO2VX2wsMhWs5+6Lf2D591DmdE8RgmtcU= +github.com/ethereum/go-ethereum v1.13.9/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= From ab60633d61e66bb6766883957b72c29a225c75d1 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 14:31:40 +0100 Subject: [PATCH 08/59] remove hardcoded commit hashes... --- .github/workflows/evm-version-compatibility-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index fc16ede22ef..eaeacb16f64 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -33,7 +33,7 @@ jobs: - name: Check for go.mod changes id: go_mod_changed run: | - git diff --name-only 401149e8b5c2b896ea00ccd585490249b6cb1d20 7d6d818f4dca1b69133fcb168c5c2b4421545fc1 | grep go.mod && echo "changed=true" >> $GITHUB_OUTPUT || echo "changed=false" >> $GITHUB_OUTPUT + git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep go.mod && echo "changed=true" >> $GITHUB_OUTPUT || echo "changed=false" >> $GITHUB_OUTPUT - name: Fetch previous go.mod for comparison (if changed) if: steps.go_mod_changed.outputs.changed == 'true' From bbdf624fcebcce0411465753ebf92ddeb0f1d62c Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 14:36:09 +0100 Subject: [PATCH 09/59] fix comparison --- .../evm-version-compatibility-tests.yml | 19 ++----------------- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index eaeacb16f64..be97fcc1134 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -27,27 +27,12 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 - with: - fetch-depth: 2 # Fetches the commit history to compare changes - name: Check for go.mod changes id: go_mod_changed run: | - git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep go.mod && echo "changed=true" >> $GITHUB_OUTPUT || echo "changed=false" >> $GITHUB_OUTPUT - - - name: Fetch previous go.mod for comparison (if changed) - if: steps.go_mod_changed.outputs.changed == 'true' - id: dependency-check - run: | - git show ${{ github.event.before }}:./go.mod > go.mod.before - echo "Comparing go-ethereum dependency versions..." - # Extract the specific dependency version from the current go.mod - CURRENT_VERSION=$(grep "ethereum/go-ethereum" go.mod | awk '{print $2}') - # Extract the specific dependency version from the previous go.mod - PREVIOUS_VERSION=$(grep "ethereum/go-ethereum" go.mod.before | awk '{print $2}') - # Check if the current version matches the target version - if [ "$PREVIOUS_VERSION" != "$CURRENT_VERSION" ]; then - echo "Dependency ethereum/go-ethereum was changed to $CURRENT_VERSION" + if git diff HEAD^ HEAD -- go.mod | grep -q 'go-ethereum'; then + echo "Dependency ethereum/go-ethereum was changed" echo "dependency_bumped=true" >> $GITHUB_OUTPUT else echo "No relevant dependency bump detected." diff --git a/go.mod b/go.mod index f8c1f7ca001..cf20ecf9ca7 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/cosmos/cosmos-sdk v0.47.4 github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e github.com/esote/minmaxheap v1.0.0 - github.com/ethereum/go-ethereum v1.13.9 + github.com/ethereum/go-ethereum v1.13.8 github.com/fatih/color v1.16.0 github.com/fxamacker/cbor/v2 v2.5.0 github.com/gagliardetto/solana-go v1.4.1-0.20220428092759-5250b4abbb27 diff --git a/go.sum b/go.sum index a2295f4bb46..733b0e4b2d8 100644 --- a/go.sum +++ b/go.sum @@ -370,8 +370,8 @@ github.com/esote/minmaxheap v1.0.0/go.mod h1:Ln8+i7fS1k3PLgZI2JAo0iA1as95QnIYiGC github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.9 h1:ed4e4c7NWPrO2VX2wsMhWs5+6Lf2D591DmdE8RgmtcU= -github.com/ethereum/go-ethereum v1.13.9/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= +github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= +github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= From 7d90c8656e09f4bbeeb7be15c82f9c240be43c31 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 14:40:01 +0100 Subject: [PATCH 10/59] bump --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index cf20ecf9ca7..f8c1f7ca001 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/cosmos/cosmos-sdk v0.47.4 github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e github.com/esote/minmaxheap v1.0.0 - github.com/ethereum/go-ethereum v1.13.8 + github.com/ethereum/go-ethereum v1.13.9 github.com/fatih/color v1.16.0 github.com/fxamacker/cbor/v2 v2.5.0 github.com/gagliardetto/solana-go v1.4.1-0.20220428092759-5250b4abbb27 diff --git a/go.sum b/go.sum index 733b0e4b2d8..1207e829db2 100644 --- a/go.sum +++ b/go.sum @@ -372,6 +372,8 @@ github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= +github.com/ethereum/go-ethereum v1.13.9 h1:ed4e4c7NWPrO2VX2wsMhWs5+6Lf2D591DmdE8RgmtcU= +github.com/ethereum/go-ethereum v1.13.9/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= From 3d6ec9917fba3ca123b6f56d7fa3fe0e75061597 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 14:47:03 +0100 Subject: [PATCH 11/59] use correctly git diff --- .github/workflows/evm-version-compatibility-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index be97fcc1134..e2750b27672 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -31,7 +31,7 @@ jobs: - name: Check for go.mod changes id: go_mod_changed run: | - if git diff HEAD^ HEAD -- go.mod | grep -q 'go-ethereum'; then + if git diff origin/develop -- go.mod | grep -q 'github.com/ethereum/go-ethereum'; then echo "Dependency ethereum/go-ethereum was changed" echo "dependency_bumped=true" >> $GITHUB_OUTPUT else From 8cc5045157bc6a3a31c1b69b88631ca9165eb71f Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 14:51:12 +0100 Subject: [PATCH 12/59] fetch develop before comparing --- .github/workflows/evm-version-compatibility-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index e2750b27672..b7b1031b714 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -28,6 +28,9 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - name: Fetch develop branch + run: git fetch --depth=1 origin develop:develop + - name: Check for go.mod changes id: go_mod_changed run: | From 6bc7ee9bd0e0de854c3a401ee305d0788d2c4446 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 14:57:53 +0100 Subject: [PATCH 13/59] remove unnecesary outputs declaration --- .github/workflows/evm-version-compatibility-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index b7b1031b714..783efcacde2 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -22,8 +22,6 @@ jobs: check-dependency-bump: runs-on: ubuntu-latest - outputs: - dependency_bumped: ${{ steps.dependency-check.outputs.dependency_bumped }} steps: - name: Checkout code uses: actions/checkout@v2 From c4853ab61ddeb641d29a884baa406f426e25be3c Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 15:30:55 +0100 Subject: [PATCH 14/59] add outputs debug --- .github/workflows/evm-version-compatibility-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 783efcacde2..d3b89701d30 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -18,8 +18,8 @@ env: MOD_CACHE_VERSION: 2 jobs: - # Check if go.mod has changed + # Check if go.mod has changed check-dependency-bump: runs-on: ubuntu-latest steps: @@ -39,6 +39,8 @@ jobs: echo "No relevant dependency bump detected." echo "dependency_bumped=false" >> $GITHUB_OUTPUT fi + - name: Confirm output + run: cat $GITHUB_OUTPUT # Build Test Dependencies From f01f78923c6b1347f3d139f0c4aaf84925a4374d Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 15:47:28 +0100 Subject: [PATCH 15/59] remove step id --- .github/workflows/evm-version-compatibility-tests.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index d3b89701d30..4f29251feab 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -30,17 +30,16 @@ jobs: run: git fetch --depth=1 origin develop:develop - name: Check for go.mod changes - id: go_mod_changed run: | if git diff origin/develop -- go.mod | grep -q 'github.com/ethereum/go-ethereum'; then echo "Dependency ethereum/go-ethereum was changed" - echo "dependency_bumped=true" >> $GITHUB_OUTPUT + echo "dependency_bumped=true" >> "$GITHUB_OUTPUT" else echo "No relevant dependency bump detected." - echo "dependency_bumped=false" >> $GITHUB_OUTPUT + echo "dependency_bumped=false" >> "$GITHUB_OUTPUT" fi - name: Confirm output - run: cat $GITHUB_OUTPUT + run: cat "$GITHUB_OUTPUT" # Build Test Dependencies From a15337a7c201f2bca19f284df7eee8d6fa1e96d1 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 15:56:07 +0100 Subject: [PATCH 16/59] use explicit outputs --- .github/workflows/evm-version-compatibility-tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 4f29251feab..5391aa21b44 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -22,14 +22,15 @@ jobs: # Check if go.mod has changed check-dependency-bump: runs-on: ubuntu-latest + outputs: + sha: ${{ steps.changes.outputs.dependency_bumped }} steps: - name: Checkout code uses: actions/checkout@v2 - - name: Fetch develop branch run: git fetch --depth=1 origin develop:develop - - name: Check for go.mod changes + id: changes run: | if git diff origin/develop -- go.mod | grep -q 'github.com/ethereum/go-ethereum'; then echo "Dependency ethereum/go-ethereum was changed" @@ -38,6 +39,7 @@ jobs: echo "No relevant dependency bump detected." echo "dependency_bumped=false" >> "$GITHUB_OUTPUT" fi + cat "$GITHUB_OUTPUT" - name: Confirm output run: cat "$GITHUB_OUTPUT" From d2cf886ca75cae74111f0143e3d731eb082d7459 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 16:01:00 +0100 Subject: [PATCH 17/59] execute workflow also on dispatch if go-ethereum version did not change --- .github/workflows/evm-version-compatibility-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 5391aa21b44..846d5a48f59 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -23,7 +23,7 @@ jobs: check-dependency-bump: runs-on: ubuntu-latest outputs: - sha: ${{ steps.changes.outputs.dependency_bumped }} + dependency_bumped: ${{ steps.changes.outputs.dependency_bumped }} steps: - name: Checkout code uses: actions/checkout@v2 @@ -46,7 +46,7 @@ jobs: # Build Test Dependencies build-chainlink: - if: needs.check-dependency-bump.outputs.dependency_bumped == 'true' + if: needs.check-dependency-bump.outputs.dependency_bumped == 'true' || github.event_name == 'workflow_dispatch' needs: [check-dependency-bump] environment: integration permissions: @@ -78,7 +78,7 @@ jobs: AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} build-tests: - if: needs.check-dependency-bump.outputs.dependency_bumped == 'true' + if: needs.check-dependency-bump.outputs.dependency_bumped == 'true' || github.event_name == 'workflow_dispatch' needs: [check-dependency-bump] environment: integration permissions: @@ -112,7 +112,7 @@ jobs: binary_name: tests build-test-matrix: - if: needs.check-dependency-bump.outputs.dependency_bumped == 'true' + if: needs.check-dependency-bump.outputs.dependency_bumped == 'true' || github.event_name == 'workflow_dispatch' needs: [check-dependency-bump] runs-on: ubuntu-latest name: Build Test Matrix From afc0b4adecf260591d723a9160dd22e3038b6da2 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 16:12:21 +0100 Subject: [PATCH 18/59] fix script output --- .github/workflows/evm-version-compatibility-tests.yml | 10 ++++------ .../scripts/buildEvmClientTestMatrixList.sh | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 846d5a48f59..1df981babba 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -39,9 +39,6 @@ jobs: echo "No relevant dependency bump detected." echo "dependency_bumped=false" >> "$GITHUB_OUTPUT" fi - cat "$GITHUB_OUTPUT" - - name: Confirm output - run: cat "$GITHUB_OUTPUT" # Build Test Dependencies @@ -130,8 +127,9 @@ jobs: id: decode-base64-test-list if: env.BASE64_TEST_LIST != '' run: | - echo "Decoding test_input..." + echo "Decoding base64 test list..." DECODED_BASE64_TEST_LIST=$(echo $BASE64_TEST_LIST | base64 -d) + echo $DECODED_BASE64_TEST_LIST cd ./integration-tests echo $DECODED_BASE64_TEST_LIST >> ./evm_node_compatibility_test_list.json @@ -142,8 +140,8 @@ jobs: cd ./integration-tests cp ./smoke/evm_node_compatibility_test_list.json . - - name: Set Matrix from Decoded Input - id: set-test-matrix-list + - name: Create Test Matrix + id: create-test-matrix-list run: | cd ./integration-tests JOB_MATRIX_JSON=$(./scripts/buildEvmClientTestMatrixList.sh ./evm_node_compatibility_test_list.json ubuntu-latest) diff --git a/integration-tests/scripts/buildEvmClientTestMatrixList.sh b/integration-tests/scripts/buildEvmClientTestMatrixList.sh index 2a6d4728efe..e6b3e818763 100755 --- a/integration-tests/scripts/buildEvmClientTestMatrixList.sh +++ b/integration-tests/scripts/buildEvmClientTestMatrixList.sh @@ -26,7 +26,7 @@ matrix_output() { local docker_image=$6 local product=$7 local counter_out=$(printf "%02d\n" $counter) - echo -n "{\"name\": \"${job_name}-${counter_out}\", \"os\": \"${node_label}\", \"eth_client\": \"${eth_client}\", \"docker_image\": \"${docker_image}\", \"run\": \"-run '^${test_name}$'\"}" + echo -n "{\"name\": \"${job_name}-${counter_out}\", \"os\": \"${node_label}\", \"product\": \"${product}\", \"eth_client\": \"${eth_client}\", \"docker_image\": \"${docker_image}\", \"run\": \"-run '^${test_name}$'\"}" } # Read the JSON file and loop through 'tests' and 'run' @@ -36,8 +36,8 @@ jq -c '.tests[]' ${JSONFILE} | while read -r test; do effective_node_label=${label:-$NODE_LABEL} eth_client=$(echo ${test} | jq -r '.eth_client') docker_image=$(echo ${test} | jq -r '.docker_image') - subTests=$(echo ${test} | jq -r '.run[]?.name // empty') product=$(echo ${test} | jq -r '.product') + subTests=$(echo ${test} | jq -r '.run[]?.name // empty') output="" if [ $COUNTER -ne 1 ]; then From d26ee15e9f3c71a238997c785a6b6d8185daabdc Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 16:29:35 +0100 Subject: [PATCH 19/59] fix quoting of custom images in TOML, echo test compatibility matrix --- .github/actions/setup-create-base64-config/action.yml | 11 ++++++----- .github/workflows/evm-version-compatibility-tests.yml | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/actions/setup-create-base64-config/action.yml b/.github/actions/setup-create-base64-config/action.yml index aed4a78db8c..3b988730421 100644 --- a/.github/actions/setup-create-base64-config/action.yml +++ b/.github/actions/setup-create-base64-config/action.yml @@ -97,12 +97,13 @@ runs: custom_images="" if [ -n "$CUSTOM_DOCKER_IMAGES" ]; then - custom_images+="[PrivateEthereumNetwork.CustomDockerImages]" - IFS=',' read -r -a array <<< "$CUSTOM_DOCKER_IMAGES" + custom_images+="[PrivateEthereumNetwork.CustomDockerImages]" + IFS=',' read -r -a array <<< "$CUSTOM_DOCKER_IMAGES" - for element in "${array[@]}"; do - custom_images+=$'\n'"$element" - done + for element in "${array[@]}"; do + IFS='=' read -r key value <<< "$element" + custom_images+=$'\n'"$key=\"$value\"" + done fi if [ -n "$ETH_EXECUTION_CLIENT" ]; then diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 1df981babba..fd53dd0692d 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -146,6 +146,7 @@ jobs: cd ./integration-tests JOB_MATRIX_JSON=$(./scripts/buildEvmClientTestMatrixList.sh ./evm_node_compatibility_test_list.json ubuntu-latest) echo "JOB_MATRIX_JSON=${JOB_MATRIX_JSON}" >> $GITHUB_ENV + echo $JOB_MATRIX_JSON | jq . # End Build Test Dependencies From a9e8ae136d2ac7bc8642954aa2338979be8dc63d Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 16:38:47 +0100 Subject: [PATCH 20/59] don't use pyroscope in compatibility tests --- .github/workflows/evm-version-compatibility-tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index fd53dd0692d..097e6a265b2 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -203,9 +203,6 @@ jobs: selectedNetworks: ${{ env.SELECTED_NETWORKS }} chainlinkImage: ${{ env.CHAINLINK_IMAGE }} chainlinkVersion: ${{ github.sha }} - pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 - pyroscopeEnvironment: ${{ matrix.product.pyroscope_env }} - pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }} lokiEndpoint: ${{ secrets.LOKI_URL }} lokiTenantId: ${{ vars.LOKI_TENANT_ID }} lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} From 450c04fb9993781a5992891fd67d480307223986 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 17:45:24 +0100 Subject: [PATCH 21/59] use newer CTF --- go.sum | 2 -- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- integration-tests/testconfig/default.toml | 3 +++ 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/go.sum b/go.sum index 1207e829db2..a2295f4bb46 100644 --- a/go.sum +++ b/go.sum @@ -370,8 +370,6 @@ github.com/esote/minmaxheap v1.0.0/go.mod h1:Ln8+i7fS1k3PLgZI2JAo0iA1as95QnIYiGC github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= -github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= github.com/ethereum/go-ethereum v1.13.9 h1:ed4e4c7NWPrO2VX2wsMhWs5+6Lf2D591DmdE8RgmtcU= github.com/ethereum/go-ethereum v1.13.9/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 71a1dc4d9d3..583c108a3af 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -24,7 +24,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240118014648-1ab6a88c9429 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240306173252-5cbf83ca3a69 - github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307113134-32c4cbfae66f + github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307164310-271b594cd58c github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20240229181116-bfb2432a7a66 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 29584f1e6ab..07a5e51b898 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1528,8 +1528,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307113134-32c4cbfae66f h1:MRth3Tiu4JNqjV0YUYY8+HglzJQBgGdbNtq8j1g/WRc= -github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307113134-32c4cbfae66f/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= +github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307164310-271b594cd58c h1:lpc0JqAqYmVmKXJV9b3GqLVyWZxA8VnCfl8zf9kHihc= +github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307164310-271b594cd58c/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index fe61a10df87..7b120e69440 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -16,7 +16,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240118014648-1ab6a88c9429 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240306173252-5cbf83ca3a69 - github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307113134-32c4cbfae66f + github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307164310-271b594cd58c 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-20240229181116-bfb2432a7a66 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 84721f96f19..4dc1bcede9c 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1511,8 +1511,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307113134-32c4cbfae66f h1:MRth3Tiu4JNqjV0YUYY8+HglzJQBgGdbNtq8j1g/WRc= -github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307113134-32c4cbfae66f/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= +github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307164310-271b594cd58c h1:lpc0JqAqYmVmKXJV9b3GqLVyWZxA8VnCfl8zf9kHihc= +github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307164310-271b594cd58c/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= diff --git a/integration-tests/testconfig/default.toml b/integration-tests/testconfig/default.toml index 34051aff5e8..25d76429d75 100644 --- a/integration-tests/testconfig/default.toml +++ b/integration-tests/testconfig/default.toml @@ -24,6 +24,9 @@ validator_count=4 chain_id=1337 addresses_to_fund=["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"] +[PrivateEthereumNetwork.EthereumChainConfig.HardForkEpochs] +Deneb=500 + [Seth] # enables automatic tracing of all transactions that are decoded via Decode() method tracing_enabled = false From 4c495a448c629c4581c73c43bcd97baab9587590 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 7 Mar 2024 18:17:41 +0100 Subject: [PATCH 22/59] latest ctf, couple of fixes --- .github/actions/setup-create-base64-config/action.yml | 3 +++ integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- integration-tests/smoke/evm_node_compatibility_test_list.json | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup-create-base64-config/action.yml b/.github/actions/setup-create-base64-config/action.yml index 3b988730421..a21f444ba26 100644 --- a/.github/actions/setup-create-base64-config/action.yml +++ b/.github/actions/setup-create-base64-config/action.yml @@ -95,9 +95,11 @@ runs: fi custom_images="" + ethereum_version="" if [ -n "$CUSTOM_DOCKER_IMAGES" ]; then custom_images+="[PrivateEthereumNetwork.CustomDockerImages]" + ethereum_version="ethereum_version=\"auto\"" IFS=',' read -r -a array <<< "$CUSTOM_DOCKER_IMAGES" for element in "${array[@]}"; do @@ -145,6 +147,7 @@ runs: [PrivateEthereumNetwork] execution_layer="$execution_layer" + $ethereum_version $custom_images EOF diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 583c108a3af..57b39f90c67 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -24,7 +24,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240118014648-1ab6a88c9429 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240306173252-5cbf83ca3a69 - github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307164310-271b594cd58c + github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307171616-c250c9153d87 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20240229181116-bfb2432a7a66 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 07a5e51b898..cee9e25ad33 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1528,8 +1528,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307164310-271b594cd58c h1:lpc0JqAqYmVmKXJV9b3GqLVyWZxA8VnCfl8zf9kHihc= -github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307164310-271b594cd58c/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= +github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307171616-c250c9153d87 h1:h+onUE0h9rHq1jpC5a3Z4c6horEyZQqIZwV6SYuWL78= +github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307171616-c250c9153d87/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 7b120e69440..d6369733385 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -16,7 +16,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240118014648-1ab6a88c9429 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240306173252-5cbf83ca3a69 - github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307164310-271b594cd58c + github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307171616-c250c9153d87 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-20240229181116-bfb2432a7a66 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 4dc1bcede9c..8d4212d3cb6 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1511,8 +1511,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307164310-271b594cd58c h1:lpc0JqAqYmVmKXJV9b3GqLVyWZxA8VnCfl8zf9kHihc= -github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307164310-271b594cd58c/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= +github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307171616-c250c9153d87 h1:h+onUE0h9rHq1jpC5a3Z4c6horEyZQqIZwV6SYuWL78= +github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307171616-c250c9153d87/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= diff --git a/integration-tests/smoke/evm_node_compatibility_test_list.json b/integration-tests/smoke/evm_node_compatibility_test_list.json index dde06b5833a..7d01bf89dad 100644 --- a/integration-tests/smoke/evm_node_compatibility_test_list.json +++ b/integration-tests/smoke/evm_node_compatibility_test_list.json @@ -24,7 +24,7 @@ { "product": "ocr", "name": "TestOCRBasic", - "eth_client": "besu", + "eth_client": "erigon", "docker_image": "thorax/erigon:latest_stable", "label": "ubuntu-latest" } From 2f29a8b647ce43684f8486a0c74c098b6ab7dd9e Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Fri, 8 Mar 2024 14:51:27 +0100 Subject: [PATCH 23/59] bump CTF, run compatibility tests only for geth --- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- .../evm_node_compatibility_test_list.json | 19 +++++++++++++------ 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 57b39f90c67..33a6a732358 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -24,7 +24,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240118014648-1ab6a88c9429 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240306173252-5cbf83ca3a69 - github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307171616-c250c9153d87 + github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240308135005-2b181baabe63 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20240229181116-bfb2432a7a66 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index cee9e25ad33..1e7e09eb6d7 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1528,8 +1528,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307171616-c250c9153d87 h1:h+onUE0h9rHq1jpC5a3Z4c6horEyZQqIZwV6SYuWL78= -github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307171616-c250c9153d87/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240308135005-2b181baabe63 h1:CQFOLhJfpNZ944yceTEvlavV7Or8cTtOrujDN/y/Msc= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240308135005-2b181baabe63/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index d6369733385..0cd71a1e3c0 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -16,7 +16,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240118014648-1ab6a88c9429 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240306173252-5cbf83ca3a69 - github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307171616-c250c9153d87 + github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240308135005-2b181baabe63 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-20240229181116-bfb2432a7a66 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 8d4212d3cb6..d8806513ecc 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1511,8 +1511,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307171616-c250c9153d87 h1:h+onUE0h9rHq1jpC5a3Z4c6horEyZQqIZwV6SYuWL78= -github.com/smartcontractkit/chainlink-testing-framework v1.25.3-0.20240307171616-c250c9153d87/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240308135005-2b181baabe63 h1:CQFOLhJfpNZ944yceTEvlavV7Or8cTtOrujDN/y/Msc= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240308135005-2b181baabe63/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= diff --git a/integration-tests/smoke/evm_node_compatibility_test_list.json b/integration-tests/smoke/evm_node_compatibility_test_list.json index 7d01bf89dad..07b67fc33a7 100644 --- a/integration-tests/smoke/evm_node_compatibility_test_list.json +++ b/integration-tests/smoke/evm_node_compatibility_test_list.json @@ -10,22 +10,29 @@ { "product": "ocr", "name": "TestOCRBasic", - "eth_client": "besu", - "docker_image": "hyperledger/besu:latest_stable", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.13.0", "label": "ubuntu-latest" }, { "product": "ocr", "name": "TestOCRBasic", - "eth_client": "nethermind", - "docker_image": "nethermind/nethermind:latest_stable", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.12.0", "label": "ubuntu-latest" }, { "product": "ocr", "name": "TestOCRBasic", - "eth_client": "erigon", - "docker_image": "thorax/erigon:latest_stable", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.11.0", + "label": "ubuntu-latest" + }, + { + "product": "ocr", + "name": "TestOCRBasic", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.10.0", "label": "ubuntu-latest" } ] From ab680607064a6eed57f1f7aee0774e249adb6644 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Fri, 8 Mar 2024 15:02:13 +0100 Subject: [PATCH 24/59] all smoke tests will now use TOML config --- integration-tests/smoke/automation_test.go | 8 +++-- integration-tests/smoke/cron_test.go | 11 ++++-- integration-tests/smoke/flux_test.go | 5 ++- integration-tests/smoke/forwarder_ocr_test.go | 5 ++- .../smoke/forwarders_ocr2_test.go | 4 +++ integration-tests/smoke/keeper_test.go | 34 +++++++++++-------- integration-tests/smoke/ocr2_test.go | 5 ++- integration-tests/smoke/runlog_test.go | 6 +++- integration-tests/smoke/vrf_test.go | 10 ++++-- .../testconfig/log_poller/log_poller.toml | 8 +++++ .../universal/log_poller/helpers.go | 12 ++----- 11 files changed, 73 insertions(+), 35 deletions(-) diff --git a/integration-tests/smoke/automation_test.go b/integration-tests/smoke/automation_test.go index 29bd61b9257..1e45b90a583 100644 --- a/integration-tests/smoke/automation_test.go +++ b/integration-tests/smoke/automation_test.go @@ -1149,11 +1149,15 @@ func setupAutomationTestDocker( require.NoError(t, err) l.Debug().Msgf("Funding amount: %f", *automationTestConfig.GetCommonConfig().ChainlinkNodeFunding) clNodesCount := 5 + + privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, automationTestConfig) + require.NoError(t, err, "Error building ethereum network config") + if isMercuryV02 || isMercuryV03 { env, err = test_env.NewCLTestEnvBuilder(). WithTestInstance(t). WithTestConfig(automationTestConfig). - WithGeth(). + WithPrivateEthereumNetwork(privateNetwork). WithMockAdapter(). WithFunding(big.NewFloat(*automationTestConfig.GetCommonConfig().ChainlinkNodeFunding)). WithStandardCleanup(). @@ -1190,7 +1194,7 @@ func setupAutomationTestDocker( env, err = test_env.NewCLTestEnvBuilder(). WithTestInstance(t). WithTestConfig(automationTestConfig). - WithGeth(). + WithPrivateEthereumNetwork(privateNetwork). WithMockAdapter(). WithCLNodes(clNodesCount). WithCLNodeConfig(clNodeConfig). diff --git a/integration-tests/smoke/cron_test.go b/integration-tests/smoke/cron_test.go index b6e04612aca..15934f48922 100644 --- a/integration-tests/smoke/cron_test.go +++ b/integration-tests/smoke/cron_test.go @@ -11,6 +11,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/logging" + "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" @@ -25,10 +26,13 @@ func TestCronBasic(t *testing.T) { t.Fatal(err) } + privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, &config) + require.NoError(t, err, "Error building ethereum network config") + env, err := test_env.NewCLTestEnvBuilder(). WithTestInstance(t). WithTestConfig(&config). - WithGeth(). + WithPrivateEthereumNetwork(privateNetwork). WithMockAdapter(). WithCLNodes(1). WithStandardCleanup(). @@ -77,10 +81,13 @@ func TestCronJobReplacement(t *testing.T) { t.Fatal(err) } + privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, &config) + require.NoError(t, err, "Error building ethereum network config") + env, err := test_env.NewCLTestEnvBuilder(). WithTestInstance(t). WithTestConfig(&config). - WithGeth(). + WithPrivateEthereumNetwork(privateNetwork). WithMockAdapter(). WithCLNodes(1). WithStandardCleanup(). diff --git a/integration-tests/smoke/flux_test.go b/integration-tests/smoke/flux_test.go index c8cec4e385b..f7a0c94d0c9 100644 --- a/integration-tests/smoke/flux_test.go +++ b/integration-tests/smoke/flux_test.go @@ -31,10 +31,13 @@ func TestFluxBasic(t *testing.T) { t.Fatal(err) } + privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, &config) + require.NoError(t, err, "Error building ethereum network config") + env, err := test_env.NewCLTestEnvBuilder(). WithTestInstance(t). WithTestConfig(&config). - WithGeth(). + WithPrivateEthereumNetwork(privateNetwork). WithMockAdapter(). WithCLNodes(3). WithStandardCleanup(). diff --git a/integration-tests/smoke/forwarder_ocr_test.go b/integration-tests/smoke/forwarder_ocr_test.go index 60fe1db3c25..e3709bc8772 100644 --- a/integration-tests/smoke/forwarder_ocr_test.go +++ b/integration-tests/smoke/forwarder_ocr_test.go @@ -24,10 +24,13 @@ func TestForwarderOCRBasic(t *testing.T) { t.Fatal(err) } + privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, &config) + require.NoError(t, err, "Error building ethereum network config") + env, err := test_env.NewCLTestEnvBuilder(). WithTestInstance(t). WithTestConfig(&config). - WithGeth(). + WithPrivateEthereumNetwork(privateNetwork). WithMockAdapter(). WithForwarders(). WithCLNodes(6). diff --git a/integration-tests/smoke/forwarders_ocr2_test.go b/integration-tests/smoke/forwarders_ocr2_test.go index 7c5b988276b..27b2a4fde94 100644 --- a/integration-tests/smoke/forwarders_ocr2_test.go +++ b/integration-tests/smoke/forwarders_ocr2_test.go @@ -30,9 +30,13 @@ func TestForwarderOCR2Basic(t *testing.T) { t.Fatal(err) } + privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, &config) + require.NoError(t, err, "Error building ethereum network config") + env, err := test_env.NewCLTestEnvBuilder(). WithTestInstance(t). WithTestConfig(&config). + WithPrivateEthereumNetwork(privateNetwork). WithGeth(). WithMockAdapter(). WithCLNodeConfig(node.NewConfig(node.NewBaseConfig(), diff --git a/integration-tests/smoke/keeper_test.go b/integration-tests/smoke/keeper_test.go index 0ebbc1e083d..18f03dd3514 100644 --- a/integration-tests/smoke/keeper_test.go +++ b/integration-tests/smoke/keeper_test.go @@ -9,6 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/onsi/gomega" + "github.com/rs/zerolog" "github.com/stretchr/testify/require" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" @@ -93,7 +94,7 @@ func TestKeeperBasicSmoke(t *testing.T) { t.Fatal(err) } - chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(t, &config) + chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(l, t, &config) registry, _, consumers, upkeepIDs := actions.DeployKeeperContracts( t, registryVersion, @@ -174,7 +175,7 @@ func TestKeeperBlockCountPerTurn(t *testing.T) { t.Fatal(err) } - chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(t, &config) + chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(l, t, &config) registry, _, consumers, upkeepIDs := actions.DeployKeeperContracts( t, registryVersion, @@ -283,7 +284,7 @@ func TestKeeperSimulation(t *testing.T) { t.Fatal(err) } - chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(t, &config) + chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(l, t, &config) registry, _, consumersPerformance, upkeepIDs := actions.DeployPerformanceKeeperContracts( t, registryVersion, @@ -360,7 +361,7 @@ func TestKeeperCheckPerformGasLimit(t *testing.T) { if err != nil { t.Fatal(err) } - chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(t, &config) + chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(l, t, &config) registry, _, consumersPerformance, upkeepIDs := actions.DeployPerformanceKeeperContracts( t, registryVersion, @@ -477,7 +478,7 @@ func TestKeeperRegisterUpkeep(t *testing.T) { if err != nil { t.Fatal(err) } - chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(t, &config) + chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(l, t, &config) registry, registrar, consumers, upkeepIDs := actions.DeployKeeperContracts( t, registryVersion, @@ -570,7 +571,7 @@ func TestKeeperAddFunds(t *testing.T) { if err != nil { t.Fatal(err) } - chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(t, &config) + chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(l, t, &config) registry, _, consumers, upkeepIDs := actions.DeployKeeperContracts( t, registryVersion, @@ -637,7 +638,7 @@ func TestKeeperRemove(t *testing.T) { if err != nil { t.Fatal(err) } - chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(t, &config) + chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(l, t, &config) registry, _, consumers, upkeepIDs := actions.DeployKeeperContracts( t, registryVersion, @@ -719,7 +720,7 @@ func TestKeeperPauseRegistry(t *testing.T) { if err != nil { t.Fatal(err) } - chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(t, &config) + chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(l, t, &config) registry, _, consumers, upkeepIDs := actions.DeployKeeperContracts( t, registryVersion, @@ -784,7 +785,7 @@ func TestKeeperMigrateRegistry(t *testing.T) { if err != nil { t.Fatal(err) } - chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(t, &config) + chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(l, t, &config) registry, _, consumers, upkeepIDs := actions.DeployKeeperContracts( t, ethereum.RegistryVersion_1_2, @@ -880,7 +881,7 @@ func TestKeeperNodeDown(t *testing.T) { if err != nil { t.Fatal(err) } - chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(t, &config) + chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(l, t, &config) registry, _, consumers, upkeepIDs := actions.DeployKeeperContracts( t, registryVersion, @@ -990,7 +991,7 @@ func TestKeeperPauseUnPauseUpkeep(t *testing.T) { if err != nil { t.Fatal(err) } - chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(t, &config) + chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(l, t, &config) registry, _, consumers, upkeepIDs := actions.DeployKeeperContracts( t, ethereum.RegistryVersion_1_3, @@ -1084,7 +1085,7 @@ func TestKeeperUpdateCheckData(t *testing.T) { if err != nil { t.Fatal(err) } - chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(t, &config) + chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(l, t, &config) registry, _, performDataChecker, upkeepIDs := actions.DeployPerformDataCheckerContracts( t, ethereum.RegistryVersion_1_3, @@ -1143,7 +1144,7 @@ func TestKeeperUpdateCheckData(t *testing.T) { }, "3m", "1s").Should(gomega.Succeed()) } -func setupKeeperTest(t *testing.T, config *tc.TestConfig) ( +func setupKeeperTest(l zerolog.Logger, t *testing.T, config *tc.TestConfig) ( blockchain.EVMClient, []*client.ChainlinkClient, contracts.ContractDeployer, @@ -1158,10 +1159,13 @@ func setupKeeperTest(t *testing.T, config *tc.TestConfig) ( clNodeConfig.Keeper.Registry.SyncInterval = &syncInterval clNodeConfig.Keeper.Registry.PerformGasOverhead = &performGasOverhead + privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, config) + require.NoError(t, err, "Error building ethereum network config") + env, err := test_env.NewCLTestEnvBuilder(). WithTestInstance(t). WithTestConfig(config). - WithGeth(). + WithPrivateEthereumNetwork(privateNetwork). WithCLNodes(5). WithCLNodeConfig(clNodeConfig). WithFunding(big.NewFloat(.5)). @@ -1189,7 +1193,7 @@ func TestKeeperJobReplacement(t *testing.T) { t.Fatal(err) } - chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(t, &config) + chainClient, chainlinkNodes, contractDeployer, linkToken, _ := setupKeeperTest(l, t, &config) registry, _, consumers, upkeepIDs := actions.DeployKeeperContracts( t, registryVersion, diff --git a/integration-tests/smoke/ocr2_test.go b/integration-tests/smoke/ocr2_test.go index 33538c1eaa4..b70796c4ab8 100644 --- a/integration-tests/smoke/ocr2_test.go +++ b/integration-tests/smoke/ocr2_test.go @@ -129,10 +129,13 @@ func prepareORCv2SmokeTestEnv(t *testing.T, l zerolog.Logger, firstRoundResult i t.Fatal(err) } + privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, &config) + require.NoError(t, err, "Error building ethereum network config") + env, err := test_env.NewCLTestEnvBuilder(). WithTestInstance(t). WithTestConfig(&config). - WithGeth(). + WithPrivateEthereumNetwork(privateNetwork). WithMockAdapter(). WithCLNodeConfig(node.NewConfig(node.NewBaseConfig(), node.WithOCR2(), diff --git a/integration-tests/smoke/runlog_test.go b/integration-tests/smoke/runlog_test.go index f7f5c54069e..eb687e439b2 100644 --- a/integration-tests/smoke/runlog_test.go +++ b/integration-tests/smoke/runlog_test.go @@ -14,6 +14,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/logging" "github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext" + "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env" @@ -29,10 +30,13 @@ func TestRunLogBasic(t *testing.T) { t.Fatal(err) } + privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, &config) + require.NoError(t, err, "Error building ethereum network config") + env, err := test_env.NewCLTestEnvBuilder(). WithTestInstance(t). WithTestConfig(&config). - WithGeth(). + WithPrivateEthereumNetwork(privateNetwork). WithMockAdapter(). WithCLNodes(1). WithFunding(big.NewFloat(.1)). diff --git a/integration-tests/smoke/vrf_test.go b/integration-tests/smoke/vrf_test.go index f5aeb86173b..8e5ebdb1145 100644 --- a/integration-tests/smoke/vrf_test.go +++ b/integration-tests/smoke/vrf_test.go @@ -29,10 +29,13 @@ func TestVRFBasic(t *testing.T) { t.Fatal(err) } + privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, &config) + require.NoError(t, err, "Error building ethereum network config") + env, err := test_env.NewCLTestEnvBuilder(). WithTestInstance(t). WithTestConfig(&config). - WithGeth(). + WithPrivateEthereumNetwork(privateNetwork). WithCLNodes(1). WithFunding(big.NewFloat(.1)). WithStandardCleanup(). @@ -123,10 +126,13 @@ func TestVRFJobReplacement(t *testing.T) { t.Fatal(err) } + privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, &config) + require.NoError(t, err, "Error building ethereum network config") + env, err := test_env.NewCLTestEnvBuilder(). WithTestInstance(t). WithTestConfig(&config). - WithGeth(). + WithPrivateEthereumNetwork(privateNetwork). WithCLNodes(1). WithFunding(big.NewFloat(.1)). WithStandardCleanup(). diff --git a/integration-tests/testconfig/log_poller/log_poller.toml b/integration-tests/testconfig/log_poller/log_poller.toml index 89d2f07b4e3..5ead6c91e9c 100644 --- a/integration-tests/testconfig/log_poller/log_poller.toml +++ b/integration-tests/testconfig/log_poller/log_poller.toml @@ -1,3 +1,11 @@ +[PrivateEthereumNetwork] +ethereum_version="eth2" +consensus_layer="prysm" + +[PrivateEthereumNetwork.EthereumChainConfig] +seconds_per_slot=4 +slots_per_epoch=2 + # product defaults [LogPoller] [LogPoller.General] diff --git a/integration-tests/universal/log_poller/helpers.go b/integration-tests/universal/log_poller/helpers.go index 09e0343cf39..29a2439ac9a 100644 --- a/integration-tests/universal/log_poller/helpers.go +++ b/integration-tests/universal/log_poller/helpers.go @@ -1132,21 +1132,13 @@ func SetupLogPollerTestDocker( return network } - ethBuilder := ctf_test_env.NewEthereumNetworkBuilder() - cfg, err := ethBuilder. - WithEthereumVersion(ctf_test_env.EthereumVersion_Eth2). - WithExecutionLayer(ctf_test_env.ExecutionLayer_Geth). - WithEthereumChainConfig(ctf_test_env.EthereumChainConfig{ - SecondsPerSlot: 4, - SlotsPerEpoch: 2, - }). - Build() + privateNetwork, err := actions.EthereumNetworkConfigFromConfig(l, testConfig) require.NoError(t, err, "Error building ethereum network config") env, err = test_env.NewCLTestEnvBuilder(). WithTestConfig(testConfig). WithTestInstance(t). - WithPrivateEthereumNetwork(cfg). + WithPrivateEthereumNetwork(privateNetwork). WithCLNodes(clNodesCount). WithCLNodeConfig(clNodeConfig). WithFunding(big.NewFloat(chainlinkNodeFunding)). From f784ce4c46aaa3a0cd896df98e51f4b76c5a13c4 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Fri, 8 Mar 2024 15:17:55 +0100 Subject: [PATCH 25/59] set ethereum version to empty --- .github/actions/setup-create-base64-config/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-create-base64-config/action.yml b/.github/actions/setup-create-base64-config/action.yml index a21f444ba26..7c4899cf9c2 100644 --- a/.github/actions/setup-create-base64-config/action.yml +++ b/.github/actions/setup-create-base64-config/action.yml @@ -99,7 +99,7 @@ runs: if [ -n "$CUSTOM_DOCKER_IMAGES" ]; then custom_images+="[PrivateEthereumNetwork.CustomDockerImages]" - ethereum_version="ethereum_version=\"auto\"" + ethereum_version="ethereum_version=\"\"" IFS=',' read -r -a array <<< "$CUSTOM_DOCKER_IMAGES" for element in "${array[@]}"; do From 862e2cdbe2f7617f0a6a913cfc7605776082b63c Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Fri, 8 Mar 2024 15:33:32 +0100 Subject: [PATCH 26/59] adjust TOML created in CI to latest CTF changes --- .../actions/setup-create-base64-config/action.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup-create-base64-config/action.yml b/.github/actions/setup-create-base64-config/action.yml index 7c4899cf9c2..fceb7a8ce99 100644 --- a/.github/actions/setup-create-base64-config/action.yml +++ b/.github/actions/setup-create-base64-config/action.yml @@ -37,8 +37,8 @@ inputs: description: Grafana dashboard URL ethExecutionClient: description: Ethereum execution client to use (geth, besu, nethermind or erigon) - customDockerImages: - description: key-value pairs of custom docker images to use (e.g. besu=hyperledger/besu:21.10.0,geth=ethereum/client-go:1.10.8) + customEthClientDockerImages: + description: key-value pairs of custom docker images to use (e.g. execution_layer=hyperledger/besu:21.10.0) runs: using: composite @@ -63,7 +63,7 @@ runs: GRAFANA_URL: ${{ inputs.grafanaUrl }} GRAFANA_DASHBOARD_URL: ${{ inputs.grafanaDashboardUrl }} ETH_EXECUTION_CLIENT: ${{ inputs.ethExecutionClient }} - CUSTOM_DOCKER_IMAGES: ${{ inputs.customDockerImages }} + CUSTOM_ETH_CLIENT_DOCKER_IMAGES: ${{ inputs.customEthClientDockerImages }} run: | echo ::add-mask::$CHAINLINK_IMAGE function convert_to_toml_array() { @@ -97,14 +97,13 @@ runs: custom_images="" ethereum_version="" - if [ -n "$CUSTOM_DOCKER_IMAGES" ]; then + if [ -n "$CUSTOM_ETH_CLIENT_DOCKER_IMAGES" ]; then custom_images+="[PrivateEthereumNetwork.CustomDockerImages]" ethereum_version="ethereum_version=\"\"" - IFS=',' read -r -a array <<< "$CUSTOM_DOCKER_IMAGES" + IFS=',' read -r -a array <<< "$CUSTOM_ETH_CLIENT_DOCKER_IMAGES" for element in "${array[@]}"; do - IFS='=' read -r key value <<< "$element" - custom_images+=$'\n'"$key=\"$value\"" + custom_images+=$'\n'"execution_layer=\"$element\"" done fi From 8cb0df2251edf5a3483826a5b704612f9a270402 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Fri, 8 Mar 2024 15:58:00 +0100 Subject: [PATCH 27/59] run also ocr2 test --- .../evm-version-compatibility-tests.yml | 8 ++--- .../evm_node_compatibility_test_list.json | 35 +++++++++++++++++++ 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 097e6a265b2..77781433899 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -304,11 +304,11 @@ jobs: id-token: write contents: read runs-on: ubuntu-latest - needs: [start-slack-thread] + needs: [start-slack-thread, build-test-matrix] strategy: fail-fast: false matrix: - product: ["geth", "besu", "nethermind", "erigon"] + evm_node: ${{fromJson(needs.build-test-matrix.outputs.matrix)}} steps: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -320,8 +320,8 @@ jobs: github_token: ${{ github.token }} github_repository: ${{ github.repository }} workflow_run_id: ${{ github.run_id }} - github_job_name_regex: ^Client Compatibility Test ${{ matrix.product }}-(?.*?)$ - message_title: ${{ matrix.product }} + github_job_name_regex: ^EVM node compatibility test (?.*?)$ + message_title: ${{ matrix.evm_node.docker_image }} slack_channel_id: ${{ secrets.QA_SLACK_CHANNEL }} slack_bot_token: ${{ secrets.QA_SLACK_API_KEY }} slack_thread_ts: ${{ needs.start-slack-thread.outputs.thread_ts }} diff --git a/integration-tests/smoke/evm_node_compatibility_test_list.json b/integration-tests/smoke/evm_node_compatibility_test_list.json index 07b67fc33a7..7ef50045032 100644 --- a/integration-tests/smoke/evm_node_compatibility_test_list.json +++ b/integration-tests/smoke/evm_node_compatibility_test_list.json @@ -34,6 +34,41 @@ "eth_client": "geth", "docker_image": "ethereum/client-go:1.10.0", "label": "ubuntu-latest" + }, + { + "product": "ocr2", + "name": "TestOCRv2Request", + "eth_client": "geth", + "docker_image": "ethereum/client-go:latest_stable", + "label": "ubuntu-latest" + }, + { + "product": "ocr2", + "name": "TestOCRv2Request", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.13.0", + "label": "ubuntu-latest" + }, + { + "product": "ocr2", + "name": "TestOCRv2Request", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.12.0", + "label": "ubuntu-latest" + }, + { + "product": "ocr2", + "name": "TestOCRv2Request", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.11.0", + "label": "ubuntu-latest" + }, + { + "product": "ocr2", + "name": "TestOCRv2Request", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.10.0", + "label": "ubuntu-latest" } ] } \ No newline at end of file From a4c72eec96ca5bb9a35afd1418bc5a7be72ac5d1 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Fri, 8 Mar 2024 16:18:22 +0100 Subject: [PATCH 28/59] adjust regex capture for Slack message --- .github/workflows/evm-version-compatibility-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 77781433899..a3ae53c706e 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -169,7 +169,7 @@ jobs: matrix: evm_node: ${{fromJson(needs.build-test-matrix.outputs.matrix)}} runs-on: ${{ matrix.evm_node.os }} - name: EVM node compatibility test for ${{ matrix.evm_node.eth_client }} (${{ matrix.evm_node.docker_image }}) + name: EVM node compatibility ${{ matrix.evm_node.name }} (${{ matrix.evm_node.docker_image }}) steps: - name: Collect Metrics if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' @@ -179,7 +179,7 @@ jobs: basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} - this-job-name: EVM node compatibility test ${{ matrix.evm_node.docker_image }} + this-job-name: EVM node compatibility ${{ matrix.evm_node.name }} ${{ matrix.evm_node.docker_image }} test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}' continue-on-error: true - name: Checkout the repo @@ -320,7 +320,7 @@ jobs: github_token: ${{ github.token }} github_repository: ${{ github.repository }} workflow_run_id: ${{ github.run_id }} - github_job_name_regex: ^EVM node compatibility test (?.*?)$ + github_job_name_regex: ^EVM node compatibility (?.*?) \(.*$ message_title: ${{ matrix.evm_node.docker_image }} slack_channel_id: ${{ secrets.QA_SLACK_CHANNEL }} slack_bot_token: ${{ secrets.QA_SLACK_API_KEY }} From 89e061b1c13cd111c99760b5df5ed4753a5d629a Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Fri, 8 Mar 2024 16:42:44 +0100 Subject: [PATCH 29/59] try to group compatibilty tests results by product --- .github/workflows/evm-version-compatibility-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index a3ae53c706e..8120a5fdd97 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -169,7 +169,7 @@ jobs: matrix: evm_node: ${{fromJson(needs.build-test-matrix.outputs.matrix)}} runs-on: ${{ matrix.evm_node.os }} - name: EVM node compatibility ${{ matrix.evm_node.name }} (${{ matrix.evm_node.docker_image }}) + name: EVM node compatibility of ${{ matrix.evm_node.product }} with ${{ matrix.evm_node.docker_image }} steps: - name: Collect Metrics if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' @@ -320,8 +320,8 @@ jobs: github_token: ${{ github.token }} github_repository: ${{ github.repository }} workflow_run_id: ${{ github.run_id }} - github_job_name_regex: ^EVM node compatibility (?.*?) \(.*$ - message_title: ${{ matrix.evm_node.docker_image }} + github_job_name_regex: ^EVM node compatibility of ${{ matrix.evm_node.product }} with (?.*?)$ + message_title: ${{ matrix.evm_node.product }} slack_channel_id: ${{ secrets.QA_SLACK_CHANNEL }} slack_bot_token: ${{ secrets.QA_SLACK_API_KEY }} slack_thread_ts: ${{ needs.start-slack-thread.outputs.thread_ts }} From 7d96738791b35064d7442ebea422b7970f1ad4b3 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Fri, 8 Mar 2024 17:02:51 +0100 Subject: [PATCH 30/59] group by product, not full matrix --- .github/workflows/evm-version-compatibility-tests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 8120a5fdd97..7e92b766274 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -308,7 +308,8 @@ jobs: strategy: fail-fast: false matrix: - evm_node: ${{fromJson(needs.build-test-matrix.outputs.matrix)}} + # this basically works as group by in SQL; we should update it when we update the test list JSON file + product: [ocr, ocr2] steps: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -320,8 +321,8 @@ jobs: github_token: ${{ github.token }} github_repository: ${{ github.repository }} workflow_run_id: ${{ github.run_id }} - github_job_name_regex: ^EVM node compatibility of ${{ matrix.evm_node.product }} with (?.*?)$ - message_title: ${{ matrix.evm_node.product }} + github_job_name_regex: ^EVM node compatibility of ${{ matrix.product }} with (?.*?)$ + message_title: ${{ matrix.product }} slack_channel_id: ${{ secrets.QA_SLACK_CHANNEL }} slack_bot_token: ${{ secrets.QA_SLACK_API_KEY }} slack_thread_ts: ${{ needs.start-slack-thread.outputs.thread_ts }} From 165329519e19eaf5041699e3413a08b98e87cf20 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Mon, 11 Mar 2024 11:40:48 +0100 Subject: [PATCH 31/59] run even more product tests to check compatibility --- .../evm-version-compatibility-tests.yml | 2 +- .../evm_node_compatibility_test_list.json | 140 ++++++++++++++++++ 2 files changed, 141 insertions(+), 1 deletion(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 7e92b766274..2dd1d7b4e39 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -309,7 +309,7 @@ jobs: fail-fast: false matrix: # this basically works as group by in SQL; we should update it when we update the test list JSON file - product: [ocr, ocr2] + product: [automation,ocr, ocr2,vrf,vrfv2,vrfv2plus] steps: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 diff --git a/integration-tests/smoke/evm_node_compatibility_test_list.json b/integration-tests/smoke/evm_node_compatibility_test_list.json index 7ef50045032..667dcf32cc0 100644 --- a/integration-tests/smoke/evm_node_compatibility_test_list.json +++ b/integration-tests/smoke/evm_node_compatibility_test_list.json @@ -69,6 +69,146 @@ "eth_client": "geth", "docker_image": "ethereum/client-go:1.10.0", "label": "ubuntu-latest" + }, + { + "product": "vrf", + "name": "TestVRFBasic", + "eth_client": "geth", + "docker_image": "ethereum/client-go:latest_stable", + "label": "ubuntu-latest" + }, + { + "product": "vrf", + "name": "TestVRFBasic", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.13.0", + "label": "ubuntu-latest" + }, + { + "product": "vrf", + "name": "TestVRFBasic", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.12.0", + "label": "ubuntu-latest" + }, + { + "product": "vrf", + "name": "TestVRFBasic", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.11.0", + "label": "ubuntu-latest" + }, + { + "product": "vrf", + "name": "TestVRFBasic", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.10.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2", + "name": "TestVRFv2Basic/Request Randomness", + "eth_client": "geth", + "docker_image": "ethereum/client-go:latest_stable", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2", + "name": "TestVRFv2Basic/Request Randomness", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.13.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2", + "name": "TestVRFv2Basic/Request Randomness", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.12.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2", + "name": "TestVRFv2Basic/Request Randomness", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.11.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2", + "name": "TestVRFv2Basic/Request Randomness", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.10.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2plus", + "name": "TestVRFv2Plus/Link Billing", + "eth_client": "geth", + "docker_image": "ethereum/client-go:latest_stable", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2plus", + "name": "TestVRFv2Plus/Link Billing", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.13.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2plus", + "name": "TestVRFv2Plus/Link Billing", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.12.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2plus", + "name": "TestVRFv2Plus/Link Billing", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.11.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2plus", + "name": "TestVRFv2Plus/Link Billing", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.10.0", + "label": "ubuntu-latest" + }, + { + "product": "automation", + "name": "TestSetUpkeepTriggerConfig", + "eth_client": "geth", + "docker_image": "ethereum/client-go:latest_stable", + "label": "ubuntu-latest" + }, + { + "product": "automation", + "name": "TestSetUpkeepTriggerConfig", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.13.0", + "label": "ubuntu-latest" + }, + { + "product": "automation", + "name": "TestSetUpkeepTriggerConfig", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.12.0", + "label": "ubuntu-latest" + }, + { + "product": "automation", + "name": "TestSetUpkeepTriggerConfig", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.11.0", + "label": "ubuntu-latest" + }, + { + "product": "automation", + "name": "TestSetUpkeepTriggerConfig", + "eth_client": "geth", + "docker_image": "ethereum/client-go:1.10.0", + "label": "ubuntu-latest" } ] } \ No newline at end of file From fa183cccebc431929db822bfc7bad11481c70c0e Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Mon, 11 Mar 2024 12:14:03 +0100 Subject: [PATCH 32/59] fix parameter field name --- .github/workflows/evm-version-compatibility-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 2dd1d7b4e39..0c63d80aaf4 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -210,7 +210,7 @@ jobs: grafanaUrl: ${{ vars.GRAFANA_URL }} grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" ethExecutionClient: ${{ matrix.evm_node.eth_client }} - customDockerImages: ${{ matrix.evm_node.eth_client }}=${{ matrix.evm_node.docker_image }} + customEthClientDockerImages: ${{ matrix.evm_node.eth_client }}=${{ matrix.evm_node.docker_image }} ## Run this step when changes that require tests to be run are made - name: Run Tests @@ -309,7 +309,7 @@ jobs: fail-fast: false matrix: # this basically works as group by in SQL; we should update it when we update the test list JSON file - product: [automation,ocr, ocr2,vrf,vrfv2,vrfv2plus] + product: [automation,ocr,ocr2,vrf,vrfv2,vrfv2plus] steps: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 From 58767bba5c50bae5f82058619734082cf3a26286 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Mon, 11 Mar 2024 13:31:34 +0100 Subject: [PATCH 33/59] log details before starting private ethereum network --- integration-tests/docker/test_env/test_env.go | 7 +++++++ integration-tests/testconfig/default.toml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/integration-tests/docker/test_env/test_env.go b/integration-tests/docker/test_env/test_env.go index e91a3bba6ad..06417a9268e 100644 --- a/integration-tests/docker/test_env/test_env.go +++ b/integration-tests/docker/test_env/test_env.go @@ -142,6 +142,13 @@ func (te *CLClusterTestEnv) StartEthereumNetwork(cfg *test_env.EthereumNetwork) } cfg = &c } + + te.l.Info(). + Str("Execution Layer", string(*cfg.ExecutionLayer)). + Str("Ethereum Version", string(*cfg.EthereumVersion)). + Str("Custom Docker Images", fmt.Sprintf("%v", cfg.CustomDockerImages)). + Msg("Starting Ethereum network") + n, rpc, err := cfg.Start() if err != nil { diff --git a/integration-tests/testconfig/default.toml b/integration-tests/testconfig/default.toml index 25d76429d75..9f70e49d300 100644 --- a/integration-tests/testconfig/default.toml +++ b/integration-tests/testconfig/default.toml @@ -13,7 +13,7 @@ postgres_version="15.6" selected_networks=["simulated"] [PrivateEthereumNetwork] -consensus_type="pow" +ethereum_version="eth1" execution_layer="geth" [PrivateEthereumNetwork.EthereumChainConfig] From ee1db0b74cd9a902c34d66f362aab2dc2af1a207 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Mon, 11 Mar 2024 14:08:50 +0100 Subject: [PATCH 34/59] fix how TOML is build for custom eth client image --- .../setup-create-base64-config/action.yml | 16 ++++++---------- .../evm-version-compatibility-tests.yml | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/actions/setup-create-base64-config/action.yml b/.github/actions/setup-create-base64-config/action.yml index fceb7a8ce99..447f5be42cb 100644 --- a/.github/actions/setup-create-base64-config/action.yml +++ b/.github/actions/setup-create-base64-config/action.yml @@ -37,8 +37,8 @@ inputs: description: Grafana dashboard URL ethExecutionClient: description: Ethereum execution client to use (geth, besu, nethermind or erigon) - customEthClientDockerImages: - description: key-value pairs of custom docker images to use (e.g. execution_layer=hyperledger/besu:21.10.0) + customEthClientDockerImage: + description: custom docker image to use for eth client (e.g. hyperledger/besu:21.10.0) runs: using: composite @@ -63,7 +63,7 @@ runs: GRAFANA_URL: ${{ inputs.grafanaUrl }} GRAFANA_DASHBOARD_URL: ${{ inputs.grafanaDashboardUrl }} ETH_EXECUTION_CLIENT: ${{ inputs.ethExecutionClient }} - CUSTOM_ETH_CLIENT_DOCKER_IMAGES: ${{ inputs.customEthClientDockerImages }} + CUSTOM_ETH_CLIENT_DOCKER_IMAGE: ${{ inputs.customEthClientDockerImage }} run: | echo ::add-mask::$CHAINLINK_IMAGE function convert_to_toml_array() { @@ -97,14 +97,10 @@ runs: custom_images="" ethereum_version="" - if [ -n "$CUSTOM_ETH_CLIENT_DOCKER_IMAGES" ]; then - custom_images+="[PrivateEthereumNetwork.CustomDockerImages]" + if [ -n "$CUSTOM_ETH_CLIENT_DOCKER_IMAGE" ]; then ethereum_version="ethereum_version=\"\"" - IFS=',' read -r -a array <<< "$CUSTOM_ETH_CLIENT_DOCKER_IMAGES" - - for element in "${array[@]}"; do - custom_images+=$'\n'"execution_layer=\"$element\"" - done + custom_images+="[PrivateEthereumNetwork.CustomDockerImages]" + custom_images+=$'\n'"execution_layer=\"$CUSTOM_ETH_CLIENT_DOCKER_IMAGE\"" fi if [ -n "$ETH_EXECUTION_CLIENT" ]; then diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 0c63d80aaf4..935d30b252d 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -210,7 +210,7 @@ jobs: grafanaUrl: ${{ vars.GRAFANA_URL }} grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" ethExecutionClient: ${{ matrix.evm_node.eth_client }} - customEthClientDockerImages: ${{ matrix.evm_node.eth_client }}=${{ matrix.evm_node.docker_image }} + customEthClientDockerImages: ${{ matrix.evm_node.docker_image }} ## Run this step when changes that require tests to be run are made - name: Run Tests From 605fffbbef6134e04db2a2e1e971be9ad4b3d618 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Mon, 11 Mar 2024 14:29:31 +0100 Subject: [PATCH 35/59] fix typo in argument name --- .github/workflows/evm-version-compatibility-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 935d30b252d..123954104ba 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -210,7 +210,7 @@ jobs: grafanaUrl: ${{ vars.GRAFANA_URL }} grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs" ethExecutionClient: ${{ matrix.evm_node.eth_client }} - customEthClientDockerImages: ${{ matrix.evm_node.docker_image }} + customEthClientDockerImage: ${{ matrix.evm_node.docker_image }} ## Run this step when changes that require tests to be run are made - name: Run Tests From b577e0e1a8b2d852c3d5e981a01a658eac84e370 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Mon, 11 Mar 2024 15:05:27 +0100 Subject: [PATCH 36/59] fix versions + always notify slack --- .../evm-version-compatibility-tests.yml | 4 +-- .../evm_node_compatibility_test_list.json | 36 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 123954104ba..c86eee22f28 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -237,7 +237,7 @@ jobs: start-slack-thread: name: Start Slack Thread - if: ${{ needs.check-dependency-bump.outputs.dependency_bumped == 'true' && needs.*.result != 'skipped' && needs.*.result != 'cancelled' }} + if: ${{ always() && needs.check-dependency-bump.outputs.dependency_bumped == 'true' && needs.*.result != 'skipped' && needs.*.result != 'cancelled' }} environment: integration outputs: thread_ts: ${{ steps.slack.outputs.thread_ts }} @@ -296,7 +296,7 @@ jobs: post-test-results-to-slack: name: Post Test Results for ${{matrix.evm_node.eth_client}} to Slack - if: ${{ needs.check-dependency-bump.outputs.dependency_bumped == 'true' && needs.*.result != 'skipped' && needs.*.result != 'cancelled' }} + if: ${{ always() && needs.check-dependency-bump.outputs.dependency_bumped == 'true' && needs.*.result != 'skipped' && needs.*.result != 'cancelled' }} environment: integration permissions: checks: write diff --git a/integration-tests/smoke/evm_node_compatibility_test_list.json b/integration-tests/smoke/evm_node_compatibility_test_list.json index 667dcf32cc0..c14a2b54a3e 100644 --- a/integration-tests/smoke/evm_node_compatibility_test_list.json +++ b/integration-tests/smoke/evm_node_compatibility_test_list.json @@ -18,21 +18,21 @@ "product": "ocr", "name": "TestOCRBasic", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.12.0", + "docker_image": "ethereum/client-go:v1.12.0", "label": "ubuntu-latest" }, { "product": "ocr", "name": "TestOCRBasic", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.11.0", + "docker_image": "ethereum/client-go:v1.11.0", "label": "ubuntu-latest" }, { "product": "ocr", "name": "TestOCRBasic", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.10.0", + "docker_image": "ethereum/client-go:v1.10.0", "label": "ubuntu-latest" }, { @@ -53,21 +53,21 @@ "product": "ocr2", "name": "TestOCRv2Request", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.12.0", + "docker_image": "ethereum/client-go:v1.12.0", "label": "ubuntu-latest" }, { "product": "ocr2", "name": "TestOCRv2Request", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.11.0", + "docker_image": "ethereum/client-go:v1.11.0", "label": "ubuntu-latest" }, { "product": "ocr2", "name": "TestOCRv2Request", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.10.0", + "docker_image": "ethereum/client-go:v1.10.0", "label": "ubuntu-latest" }, { @@ -88,21 +88,21 @@ "product": "vrf", "name": "TestVRFBasic", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.12.0", + "docker_image": "ethereum/client-go:v1.12.0", "label": "ubuntu-latest" }, { "product": "vrf", "name": "TestVRFBasic", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.11.0", + "docker_image": "ethereum/client-go:v1.11.0", "label": "ubuntu-latest" }, { "product": "vrf", "name": "TestVRFBasic", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.10.0", + "docker_image": "ethereum/client-go:v1.10.0", "label": "ubuntu-latest" }, { @@ -123,21 +123,21 @@ "product": "vrfv2", "name": "TestVRFv2Basic/Request Randomness", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.12.0", + "docker_image": "ethereum/client-go:v1.12.0", "label": "ubuntu-latest" }, { "product": "vrfv2", "name": "TestVRFv2Basic/Request Randomness", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.11.0", + "docker_image": "ethereum/client-go:v1.11.0", "label": "ubuntu-latest" }, { "product": "vrfv2", "name": "TestVRFv2Basic/Request Randomness", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.10.0", + "docker_image": "ethereum/client-go:v1.10.0", "label": "ubuntu-latest" }, { @@ -158,21 +158,21 @@ "product": "vrfv2plus", "name": "TestVRFv2Plus/Link Billing", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.12.0", + "docker_image": "ethereum/client-go:v1.12.0", "label": "ubuntu-latest" }, { "product": "vrfv2plus", "name": "TestVRFv2Plus/Link Billing", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.11.0", + "docker_image": "ethereum/client-go:v1.11.0", "label": "ubuntu-latest" }, { "product": "vrfv2plus", "name": "TestVRFv2Plus/Link Billing", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.10.0", + "docker_image": "ethereum/client-go:v1.10.0", "label": "ubuntu-latest" }, { @@ -193,21 +193,21 @@ "product": "automation", "name": "TestSetUpkeepTriggerConfig", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.12.0", + "docker_image": "ethereum/client-go:v1.12.0", "label": "ubuntu-latest" }, { "product": "automation", "name": "TestSetUpkeepTriggerConfig", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.11.0", + "docker_image": "ethereum/client-go:v1.11.0", "label": "ubuntu-latest" }, { "product": "automation", "name": "TestSetUpkeepTriggerConfig", "eth_client": "geth", - "docker_image": "ethereum/client-go:1.10.0", + "docker_image": "ethereum/client-go:v1.10.0", "label": "ubuntu-latest" } ] From a750e00f2cc6436c587f00f819ae3e3e22b64e7f Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Tue, 12 Mar 2024 11:54:35 +0100 Subject: [PATCH 37/59] add a ContractBackend wrapper that is backward-compatible with go-ethereum < 1.11.0 --- .../contracts/contract_deployer.go | 59 +++--- .../contracts/contract_loader.go | 3 +- .../contracts/ethereum_contracts_seth.go | 5 +- .../contracts/ethereum_vrf_contracts.go | 9 +- .../contracts/ethereum_vrfv2_contracts.go | 13 +- .../contracts/ethereum_vrfv2plus_contracts.go | 9 +- integration-tests/docker/test_env/cl_node.go | 2 +- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 +- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 +- integration-tests/smoke/vrfv2_test.go | 9 +- integration-tests/smoke/vrfv2plus_test.go | 8 + integration-tests/wrappers/contract_caller.go | 175 ++++++++++++++++++ 14 files changed, 250 insertions(+), 54 deletions(-) create mode 100644 integration-tests/wrappers/contract_caller.go diff --git a/integration-tests/contracts/contract_deployer.go b/integration-tests/contracts/contract_deployer.go index 8bf720cdb10..e691e553e76 100644 --- a/integration-tests/contracts/contract_deployer.go +++ b/integration-tests/contracts/contract_deployer.go @@ -24,6 +24,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/blockchain" eth_contracts "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" + "github.com/smartcontractkit/chainlink/integration-tests/wrappers" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/functions_load_test_client" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/functions/generated/functions_v1_events_mock" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/arbitrum_module" @@ -531,7 +532,7 @@ func (e *EthereumContractDeployer) DeployLinkTokenContract() (LinkToken, error) auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return link_token_interface.DeployLinkToken(auth, backend) + return link_token_interface.DeployLinkToken(auth, wrappers.MustNewWrappedContractBackend(e.client, nil)) }) if err != nil { return nil, err @@ -707,7 +708,7 @@ func (e *EthereumContractDeployer) DeployMockETHLINKFeed(answer *big.Int) (MockE auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return mock_ethlink_aggregator_wrapper.DeployMockETHLINKAggregator(auth, backend, answer) + return mock_ethlink_aggregator_wrapper.DeployMockETHLINKAggregator(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), answer) }) if err != nil { return nil, err @@ -759,7 +760,7 @@ func (e *EthereumContractDeployer) DeployMockGasFeed(answer *big.Int) (MockGasFe auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return mock_gas_aggregator_wrapper.DeployMockGASAggregator(auth, backend, answer) + return mock_gas_aggregator_wrapper.DeployMockGASAggregator(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), answer) }) if err != nil { return nil, err @@ -794,7 +795,7 @@ func (e *EthereumContractDeployer) DeployUpkeepTranscoder() (UpkeepTranscoder, e opts *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return upkeep_transcoder.DeployUpkeepTranscoder(opts, backend) + return upkeep_transcoder.DeployUpkeepTranscoder(opts, wrappers.MustNewWrappedContractBackend(e.client, nil)) }) if err != nil { @@ -836,7 +837,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistrar(registryVersion eth_con opts *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return keeper_registrar_wrapper2_0.DeployKeeperRegistrar(opts, backend, common.HexToAddress(linkAddr), registrarSettings.AutoApproveConfigType, + return keeper_registrar_wrapper2_0.DeployKeeperRegistrar(opts, wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(linkAddr), registrarSettings.AutoApproveConfigType, registrarSettings.AutoApproveMaxAllowed, common.HexToAddress(registrarSettings.RegistryAddr), registrarSettings.MinLinkJuels) }) @@ -865,7 +866,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistrar(registryVersion eth_con return registrar21.DeployAutomationRegistrar( opts, - backend, + wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(linkAddr), common.HexToAddress(registrarSettings.RegistryAddr), registrarSettings.MinLinkJuels, @@ -978,7 +979,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( ) (common.Address, *types.Transaction, interface{}, error) { return keeper_registry_wrapper1_1.DeployKeeperRegistry( auth, - backend, + wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(opts.LinkAddr), common.HexToAddress(opts.ETHFeedAddr), common.HexToAddress(opts.GasFeedAddr), @@ -1010,7 +1011,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( ) (common.Address, *types.Transaction, interface{}, error) { return keeper_registry_wrapper1_2.DeployKeeperRegistry( auth, - backend, + wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(opts.LinkAddr), common.HexToAddress(opts.ETHFeedAddr), common.HexToAddress(opts.GasFeedAddr), @@ -1048,7 +1049,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( ) (common.Address, *types.Transaction, interface{}, error) { return keeper_registry_logic1_3.DeployKeeperRegistryLogic( auth, - backend, + wrappers.MustNewWrappedContractBackend(e.client, nil), mode, // Default payment model registryGasOverhead, // Registry gas overhead common.HexToAddress(opts.LinkAddr), @@ -1070,7 +1071,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( ) (common.Address, *types.Transaction, interface{}, error) { return keeper_registry_wrapper1_3.DeployKeeperRegistry( auth, - backend, + wrappers.MustNewWrappedContractBackend(e.client, nil), *logicAddress, keeper_registry_wrapper1_3.Config{ PaymentPremiumPPB: opts.Settings.PaymentPremiumPPB, @@ -1106,7 +1107,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( ) (common.Address, *types.Transaction, interface{}, error) { return keeper_registry_logic2_0.DeployKeeperRegistryLogic( auth, - backend, + wrappers.MustNewWrappedContractBackend(e.client, nil), mode, // Default payment model common.HexToAddress(opts.LinkAddr), common.HexToAddress(opts.ETHFeedAddr), @@ -1128,7 +1129,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( return keeper_registry_wrapper2_0.DeployKeeperRegistry( auth, - backend, + wrappers.MustNewWrappedContractBackend(e.client, nil), *logicAddress, ) }) @@ -1155,7 +1156,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( return registrylogicb21.DeployKeeperRegistryLogicB( auth, - backend, + wrappers.MustNewWrappedContractBackend(e.client, nil), mode, common.HexToAddress(opts.LinkAddr), common.HexToAddress(opts.ETHFeedAddr), @@ -1178,7 +1179,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( return registrylogica21.DeployKeeperRegistryLogicA( auth, - backend, + wrappers.MustNewWrappedContractBackend(e.client, nil), *registryLogicBAddr, ) }) @@ -1195,7 +1196,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( ) (common.Address, *types.Transaction, interface{}, error) { return registry21.DeployKeeperRegistry( auth, - backend, + wrappers.MustNewWrappedContractBackend(e.client, nil), *registryLogicAAddr, ) }) @@ -1208,7 +1209,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( registryMaster, err := iregistry21.NewIKeeperRegistryMaster( *address, - e.client.Backend(), + wrappers.MustNewWrappedContractBackend(e.client, nil), ) if err != nil { return nil, err @@ -1229,28 +1230,28 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return scroll_module.DeployScrollModule(auth, backend) + return scroll_module.DeployScrollModule(auth, wrappers.MustNewWrappedContractBackend(e.client, nil)) }) } else if chainId == networks.ArbitrumMainnet.ChainID || chainId == networks.ArbitrumSepolia.ChainID { chainModuleAddr, _, _, err = e.client.DeployContract("ArbitrumModule", func( auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return arbitrum_module.DeployArbitrumModule(auth, backend) + return arbitrum_module.DeployArbitrumModule(auth, wrappers.MustNewWrappedContractBackend(e.client, nil)) }) } else if chainId == networks.OptimismMainnet.ChainID || chainId == networks.OptimismSepolia.ChainID { chainModuleAddr, _, _, err = e.client.DeployContract("OptimismModule", func( auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return optimism_module.DeployOptimismModule(auth, backend) + return optimism_module.DeployOptimismModule(auth, wrappers.MustNewWrappedContractBackend(e.client, nil)) }) } else { chainModuleAddr, _, _, err = e.client.DeployContract("ChainModuleBase", func( auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return chain_module_base.DeployChainModuleBase(auth, backend) + return chain_module_base.DeployChainModuleBase(auth, wrappers.MustNewWrappedContractBackend(e.client, nil)) }) } if err != nil { @@ -1278,7 +1279,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( return registrylogicb22.DeployAutomationRegistryLogicB( auth, - backend, + wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(opts.LinkAddr), common.HexToAddress(opts.ETHFeedAddr), common.HexToAddress(opts.GasFeedAddr), @@ -1301,7 +1302,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( return registrylogica22.DeployAutomationRegistryLogicA( auth, - backend, + wrappers.MustNewWrappedContractBackend(e.client, nil), *registryLogicBAddr, ) }) @@ -1318,7 +1319,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( ) (common.Address, *types.Transaction, interface{}, error) { return registry22.DeployAutomationRegistry( auth, - backend, + wrappers.MustNewWrappedContractBackend(e.client, nil), *registryLogicAAddr, ) }) @@ -1331,7 +1332,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( registryMaster, err := iregistry22.NewIAutomationRegistryMaster( *address, - e.client.Backend(), + wrappers.MustNewWrappedContractBackend(e.client, nil), ) if err != nil { return nil, err @@ -1339,7 +1340,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry( chainModule, err := i_chain_module.NewIChainModule( *chainModuleAddr, - e.client.Backend(), + wrappers.MustNewWrappedContractBackend(e.client, nil), ) if err != nil { return nil, err @@ -1502,7 +1503,7 @@ func (e *EthereumContractDeployer) DeployAutomationLogTriggerConsumer(testInterv backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { return log_upkeep_counter_wrapper.DeployLogUpkeepCounter( - auth, backend, testInterval, + auth, wrappers.MustNewWrappedContractBackend(e.client, nil), testInterval, ) }) if err != nil { @@ -1540,7 +1541,7 @@ func (e *EthereumContractDeployer) DeployAutomationStreamsLookupUpkeepConsumer(t backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { return streams_lookup_upkeep_wrapper.DeployStreamsLookupUpkeep( - auth, backend, testRange, interval, useArbBlock, staging, verify, + auth, wrappers.MustNewWrappedContractBackend(e.client, nil), testRange, interval, useArbBlock, staging, verify, ) }) if err != nil { @@ -1559,7 +1560,7 @@ func (e *EthereumContractDeployer) DeployAutomationLogTriggeredStreamsLookupUpke backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { return log_triggered_streams_lookup_wrapper.DeployLogTriggeredStreamsLookup( - auth, backend, false, false, false, + auth, wrappers.MustNewWrappedContractBackend(e.client, nil), false, false, false, ) }) if err != nil { @@ -1577,7 +1578,7 @@ func (e *EthereumContractDeployer) DeployUpkeepCounter(testRange *big.Int, inter auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return upkeep_counter_wrapper.DeployUpkeepCounter(auth, backend, testRange, interval) + return upkeep_counter_wrapper.DeployUpkeepCounter(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), testRange, interval) }) if err != nil { return nil, err diff --git a/integration-tests/contracts/contract_loader.go b/integration-tests/contracts/contract_loader.go index a2a4fb60be5..9c26a671194 100644 --- a/integration-tests/contracts/contract_loader.go +++ b/integration-tests/contracts/contract_loader.go @@ -3,6 +3,7 @@ package contracts import ( "errors" + "github.com/smartcontractkit/chainlink/integration-tests/wrappers" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics" @@ -409,7 +410,7 @@ func (e *EthereumContractLoader) LoadVRFCoordinatorV2(addr string) (VRFCoordinat address common.Address, backend bind.ContractBackend, ) (interface{}, error) { - return vrf_coordinator_v2.NewVRFCoordinatorV2(address, backend) + return vrf_coordinator_v2.NewVRFCoordinatorV2(address, wrappers.MustNewWrappedContractBackend(e.client, nil)) }) if err != nil { return nil, err diff --git a/integration-tests/contracts/ethereum_contracts_seth.go b/integration-tests/contracts/ethereum_contracts_seth.go index 237d6896234..a2703a0e019 100644 --- a/integration-tests/contracts/ethereum_contracts_seth.go +++ b/integration-tests/contracts/ethereum_contracts_seth.go @@ -18,6 +18,7 @@ import ( ocrConfigHelper "github.com/smartcontractkit/libocr/offchainreporting/confighelper" ocrTypes "github.com/smartcontractkit/libocr/offchainreporting/types" + "github.com/smartcontractkit/chainlink/integration-tests/wrappers" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/authorized_forwarder" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/operator_factory" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/operator_wrapper" @@ -80,7 +81,7 @@ func DeployOffchainAggregator(l zerolog.Logger, seth *seth.Client, linkTokenAddr return EthereumOffchainAggregator{}, fmt.Errorf("OCR instance deployment have failed: %w", err) } - ocr, err := offchainaggregator.NewOffchainAggregator(ocrDeploymentData.Address, seth.Client) + ocr, err := offchainaggregator.NewOffchainAggregator(ocrDeploymentData.Address, wrappers.MustNewWrappedContractBackend(nil, seth)) if err != nil { return EthereumOffchainAggregator{}, fmt.Errorf("failed to instantiate OCR instance: %w", err) } @@ -458,7 +459,7 @@ func DeployOffchainAggregatorV2(l zerolog.Logger, seth *seth.Client, linkTokenAd return EthereumOffchainAggregatorV2{}, fmt.Errorf("OCR instance deployment have failed: %w", err) } - ocr2, err := ocr2aggregator.NewOCR2Aggregator(ocrDeploymentData2.Address, seth.Client) + ocr2, err := ocr2aggregator.NewOCR2Aggregator(ocrDeploymentData2.Address, wrappers.MustNewWrappedContractBackend(nil, seth)) if err != nil { return EthereumOffchainAggregatorV2{}, fmt.Errorf("failed to instantiate OCR instance: %w", err) } diff --git a/integration-tests/contracts/ethereum_vrf_contracts.go b/integration-tests/contracts/ethereum_vrf_contracts.go index ea8a4f94817..a67d30bd201 100644 --- a/integration-tests/contracts/ethereum_vrf_contracts.go +++ b/integration-tests/contracts/ethereum_vrf_contracts.go @@ -13,6 +13,7 @@ import ( "github.com/rs/zerolog/log" "github.com/smartcontractkit/chainlink-testing-framework/blockchain" + "github.com/smartcontractkit/chainlink/integration-tests/wrappers" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/batch_blockhash_store" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/blockhash_store" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/solidity_vrf_consumer_interface" @@ -64,7 +65,7 @@ func (e *EthereumContractDeployer) DeployVRFContract() (VRF, error) { auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return solidity_vrf_wrapper.DeployVRF(auth, backend) + return solidity_vrf_wrapper.DeployVRF(auth, wrappers.MustNewWrappedContractBackend(e.client, nil)) }) if err != nil { return nil, err @@ -82,7 +83,7 @@ func (e *EthereumContractDeployer) DeployBlockhashStore() (BlockHashStore, error auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return blockhash_store.DeployBlockhashStore(auth, backend) + return blockhash_store.DeployBlockhashStore(auth, wrappers.MustNewWrappedContractBackend(e.client, nil)) }) if err != nil { return nil, err @@ -100,7 +101,7 @@ func (e *EthereumContractDeployer) DeployVRFCoordinator(linkAddr string, bhsAddr auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return solidity_vrf_coordinator_interface.DeployVRFCoordinator(auth, backend, common.HexToAddress(linkAddr), common.HexToAddress(bhsAddr)) + return solidity_vrf_coordinator_interface.DeployVRFCoordinator(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(linkAddr), common.HexToAddress(bhsAddr)) }) if err != nil { return nil, err @@ -118,7 +119,7 @@ func (e *EthereumContractDeployer) DeployVRFConsumer(linkAddr string, coordinato auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return solidity_vrf_consumer_interface.DeployVRFConsumer(auth, backend, common.HexToAddress(coordinatorAddr), common.HexToAddress(linkAddr)) + return solidity_vrf_consumer_interface.DeployVRFConsumer(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(coordinatorAddr), common.HexToAddress(linkAddr)) }) if err != nil { return nil, err diff --git a/integration-tests/contracts/ethereum_vrfv2_contracts.go b/integration-tests/contracts/ethereum_vrfv2_contracts.go index fc7a5a7a138..5ff12e81d57 100644 --- a/integration-tests/contracts/ethereum_vrfv2_contracts.go +++ b/integration-tests/contracts/ethereum_vrfv2_contracts.go @@ -14,6 +14,7 @@ import ( "github.com/rs/zerolog/log" "github.com/smartcontractkit/chainlink-testing-framework/blockchain" + "github.com/smartcontractkit/chainlink/integration-tests/wrappers" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_test_v2" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_mock_ethlink_aggregator" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_owner" @@ -97,7 +98,7 @@ func (e *EthereumContractDeployer) DeployVRFCoordinatorV2(linkAddr string, bhsAd auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return vrf_coordinator_v2.DeployVRFCoordinatorV2(auth, backend, common.HexToAddress(linkAddr), common.HexToAddress(bhsAddr), common.HexToAddress(linkEthFeedAddr)) + return vrf_coordinator_v2.DeployVRFCoordinatorV2(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(linkAddr), common.HexToAddress(bhsAddr), common.HexToAddress(linkEthFeedAddr)) }) if err != nil { return nil, err @@ -114,7 +115,7 @@ func (e *EthereumContractDeployer) DeployVRFOwner(coordinatorAddr string) (VRFOw auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return vrf_owner.DeployVRFOwner(auth, backend, common.HexToAddress(coordinatorAddr)) + return vrf_owner.DeployVRFOwner(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(coordinatorAddr)) }) if err != nil { return nil, err @@ -131,7 +132,7 @@ func (e *EthereumContractDeployer) DeployVRFCoordinatorTestV2(linkAddr string, b auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return vrf_coordinator_test_v2.DeployVRFCoordinatorTestV2(auth, backend, common.HexToAddress(linkAddr), common.HexToAddress(bhsAddr), common.HexToAddress(linkEthFeedAddr)) + return vrf_coordinator_test_v2.DeployVRFCoordinatorTestV2(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(linkAddr), common.HexToAddress(bhsAddr), common.HexToAddress(linkEthFeedAddr)) }) if err != nil { return nil, err @@ -184,7 +185,7 @@ func (e *EthereumContractDeployer) DeployVRFv2LoadTestConsumer(coordinatorAddr s auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return vrf_load_test_with_metrics.DeployVRFV2LoadTestWithMetrics(auth, backend, common.HexToAddress(coordinatorAddr)) + return vrf_load_test_with_metrics.DeployVRFV2LoadTestWithMetrics(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(coordinatorAddr)) }) if err != nil { return nil, err @@ -201,7 +202,7 @@ func (e *EthereumContractDeployer) DeployVRFV2Wrapper(linkAddr string, linkEthFe auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return vrfv2_wrapper.DeployVRFV2Wrapper(auth, backend, common.HexToAddress(linkAddr), common.HexToAddress(linkEthFeedAddr), common.HexToAddress(coordinatorAddr)) + return vrfv2_wrapper.DeployVRFV2Wrapper(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(linkAddr), common.HexToAddress(linkEthFeedAddr), common.HexToAddress(coordinatorAddr)) }) if err != nil { return nil, err @@ -218,7 +219,7 @@ func (e *EthereumContractDeployer) DeployVRFV2WrapperLoadTestConsumer(linkAddr s auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return vrfv2_wrapper_load_test_consumer.DeployVRFV2WrapperLoadTestConsumer(auth, backend, common.HexToAddress(linkAddr), common.HexToAddress(vrfV2WrapperAddr)) + return vrfv2_wrapper_load_test_consumer.DeployVRFV2WrapperLoadTestConsumer(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(linkAddr), common.HexToAddress(vrfV2WrapperAddr)) }) if err != nil { return nil, err diff --git a/integration-tests/contracts/ethereum_vrfv2plus_contracts.go b/integration-tests/contracts/ethereum_vrfv2plus_contracts.go index 64afb4c466d..d3492b30bf4 100644 --- a/integration-tests/contracts/ethereum_vrfv2plus_contracts.go +++ b/integration-tests/contracts/ethereum_vrfv2plus_contracts.go @@ -12,6 +12,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/smartcontractkit/chainlink-testing-framework/blockchain" + "github.com/smartcontractkit/chainlink/integration-tests/wrappers" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_coordinator_v2_5" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_load_test_with_metrics" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/vrf_v2plus_upgraded_version" @@ -119,7 +120,7 @@ func (e *EthereumContractDeployer) DeployVRFCoordinatorV2_5(bhsAddr string) (VRF auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return vrf_coordinator_v2_5.DeployVRFCoordinatorV25(auth, backend, common.HexToAddress(bhsAddr)) + return vrf_coordinator_v2_5.DeployVRFCoordinatorV25(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(bhsAddr)) }) if err != nil { return nil, err @@ -935,7 +936,7 @@ func (e *EthereumContractDeployer) DeployVRFv2PlusLoadTestConsumer(coordinatorAd auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return vrf_v2plus_load_test_with_metrics.DeployVRFV2PlusLoadTestWithMetrics(auth, backend, common.HexToAddress(coordinatorAddr)) + return vrf_v2plus_load_test_with_metrics.DeployVRFV2PlusLoadTestWithMetrics(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(coordinatorAddr)) }) if err != nil { return nil, err @@ -952,7 +953,7 @@ func (e *EthereumContractDeployer) DeployVRFV2PlusWrapper(linkAddr string, linkE auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return vrfv2plus_wrapper.DeployVRFV2PlusWrapper(auth, backend, common.HexToAddress(linkAddr), common.HexToAddress(linkEthFeedAddr), common.HexToAddress(coordinatorAddr)) + return vrfv2plus_wrapper.DeployVRFV2PlusWrapper(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(linkAddr), common.HexToAddress(linkEthFeedAddr), common.HexToAddress(coordinatorAddr)) }) if err != nil { return nil, err @@ -969,7 +970,7 @@ func (e *EthereumContractDeployer) DeployVRFV2PlusWrapperLoadTestConsumer(linkAd auth *bind.TransactOpts, backend bind.ContractBackend, ) (common.Address, *types.Transaction, interface{}, error) { - return vrfv2plus_wrapper_load_test_consumer.DeployVRFV2PlusWrapperLoadTestConsumer(auth, backend, common.HexToAddress(linkAddr), common.HexToAddress(vrfV2PlusWrapperAddr)) + return vrfv2plus_wrapper_load_test_consumer.DeployVRFV2PlusWrapperLoadTestConsumer(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), common.HexToAddress(linkAddr), common.HexToAddress(vrfV2PlusWrapperAddr)) }) if err != nil { return nil, err diff --git a/integration-tests/docker/test_env/cl_node.go b/integration-tests/docker/test_env/cl_node.go index a575768d62f..aa501dfa6b5 100644 --- a/integration-tests/docker/test_env/cl_node.go +++ b/integration-tests/docker/test_env/cl_node.go @@ -286,7 +286,7 @@ func (n *ClNode) Fund(evmClient blockchain.EVMClient, amount *big.Float) error { } func (n *ClNode) StartContainer() error { - err := n.PostgresDb.StartContainer() + err := n.PostgresDb.RestartContainer() if err != nil { return err } diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 0879d44e5f0..105532e7e43 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -24,7 +24,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240311111125-22812a072c35 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240306173252-5cbf83ca3a69 - github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240308135005-2b181baabe63 + github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240312104727-70d115f53be7 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20240229181116-bfb2432a7a66 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index ab807621424..5a4f01e6942 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1528,8 +1528,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240308135005-2b181baabe63 h1:CQFOLhJfpNZ944yceTEvlavV7Or8cTtOrujDN/y/Msc= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240308135005-2b181baabe63/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240312104727-70d115f53be7 h1:OiMZR5j56QR6wgkX+asnRJDcQb5U/IAzt87SkAQh+aQ= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240312104727-70d115f53be7/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index f74ed5e07ca..edc87858a8e 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -16,7 +16,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240311111125-22812a072c35 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240306173252-5cbf83ca3a69 - github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240308135005-2b181baabe63 + github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240312104727-70d115f53be7 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-20240229181116-bfb2432a7a66 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index c8621a43106..44757b02ddb 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1511,8 +1511,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240308135005-2b181baabe63 h1:CQFOLhJfpNZ944yceTEvlavV7Or8cTtOrujDN/y/Msc= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240308135005-2b181baabe63/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240312104727-70d115f53be7 h1:OiMZR5j56QR6wgkX+asnRJDcQb5U/IAzt87SkAQh+aQ= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240312104727-70d115f53be7/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= diff --git a/integration-tests/smoke/vrfv2_test.go b/integration-tests/smoke/vrfv2_test.go index 18a28c6ecbb..57f88346614 100644 --- a/integration-tests/smoke/vrfv2_test.go +++ b/integration-tests/smoke/vrfv2_test.go @@ -296,11 +296,14 @@ func TestVRFv2Basic(t *testing.T) { subscriptionCanceledEvent, err := vrfv2Contracts.CoordinatorV2.WaitForSubscriptionCanceledEvent([]uint64{subIDForCancelling}, time.Second*30) require.NoError(t, err, "error waiting for subscription canceled event") - cancellationTxReceipt, err := env.EVMClient.GetTxReceipt(tx.Hash()) require.NoError(t, err, "error getting tx cancellation Tx Receipt") txGasUsed := new(big.Int).SetUint64(cancellationTxReceipt.GasUsed) + // we don't have that information for older Geth versions + if cancellationTxReceipt.EffectiveGasPrice == nil { + cancellationTxReceipt.EffectiveGasPrice = new(big.Int).SetUint64(0) + } cancellationTxFeeWei := new(big.Int).Mul(txGasUsed, cancellationTxReceipt.EffectiveGasPrice) l.Info(). @@ -408,6 +411,10 @@ func TestVRFv2Basic(t *testing.T) { require.NoError(t, err, "error getting tx cancellation Tx Receipt") txGasUsed := new(big.Int).SetUint64(cancellationTxReceipt.GasUsed) + // we don't have that information for older Geth versions + if cancellationTxReceipt.EffectiveGasPrice == nil { + cancellationTxReceipt.EffectiveGasPrice = new(big.Int).SetUint64(0) + } cancellationTxFeeWei := new(big.Int).Mul(txGasUsed, cancellationTxReceipt.EffectiveGasPrice) l.Info(). diff --git a/integration-tests/smoke/vrfv2plus_test.go b/integration-tests/smoke/vrfv2plus_test.go index 4241ec67d8c..d3c8e75fd5a 100644 --- a/integration-tests/smoke/vrfv2plus_test.go +++ b/integration-tests/smoke/vrfv2plus_test.go @@ -347,6 +347,10 @@ func TestVRFv2Plus(t *testing.T) { require.NoError(t, err, "error getting tx cancellation Tx Receipt") txGasUsed := new(big.Int).SetUint64(cancellationTxReceipt.GasUsed) + // we don't have that information for older Geth versions + if cancellationTxReceipt.EffectiveGasPrice == nil { + cancellationTxReceipt.EffectiveGasPrice = new(big.Int).SetUint64(0) + } cancellationTxFeeWei := new(big.Int).Mul(txGasUsed, cancellationTxReceipt.EffectiveGasPrice) l.Info(). @@ -497,6 +501,10 @@ func TestVRFv2Plus(t *testing.T) { require.NoError(t, err, "error getting tx cancellation Tx Receipt") txGasUsed := new(big.Int).SetUint64(cancellationTxReceipt.GasUsed) + // we don't have that information for older Geth versions + if cancellationTxReceipt.EffectiveGasPrice == nil { + cancellationTxReceipt.EffectiveGasPrice = new(big.Int).SetUint64(0) + } cancellationTxFeeWei := new(big.Int).Mul(txGasUsed, cancellationTxReceipt.EffectiveGasPrice) l.Info(). diff --git a/integration-tests/wrappers/contract_caller.go b/integration-tests/wrappers/contract_caller.go new file mode 100644 index 00000000000..b587550a6ae --- /dev/null +++ b/integration-tests/wrappers/contract_caller.go @@ -0,0 +1,175 @@ +package wrappers + +import ( + "context" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/rpc" + "github.com/smartcontractkit/seth" + + "github.com/smartcontractkit/chainlink-testing-framework/blockchain" +) + +// WrappedContractBackend is a wrapper around the go-ethereum ContractBackend interface. It's a thin wrapper +// around the go-ethereum/ethclient.Client, which replaces only CallContract and PendingCallContract calls with +// methods that send data both in "input" and "data" field for backwards compatibility with older clients. Other methods +// are passed through to the underlying client. +type WrappedContractBackend struct { + evmClient blockchain.EVMClient + sethClient *seth.Client +} + +// MustNewWrappedContractBackend creates a new WrappedContractBackend with the given clients +func MustNewWrappedContractBackend(evmClient blockchain.EVMClient, sethClient *seth.Client) *WrappedContractBackend { + if evmClient == nil && sethClient == nil { + panic("Must provide at least one client") + } + + return &WrappedContractBackend{ + evmClient: evmClient, + sethClient: sethClient, + } +} + +func (w *WrappedContractBackend) getGethClient() *ethclient.Client { + if w.sethClient != nil { + return w.sethClient.Client + } + + if w.evmClient != nil { + return w.evmClient.GetEthClient() + } + + panic("No client found") +} + +func (w *WrappedContractBackend) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error) { + client := w.getGethClient() + return client.CodeAt(ctx, contract, blockNumber) +} + +func (w *WrappedContractBackend) PendingCodeAt(ctx context.Context, contract common.Address) ([]byte, error) { + client := w.getGethClient() + return client.PendingCodeAt(ctx, contract) +} + +func (w *WrappedContractBackend) CodeAtHash(ctx context.Context, contract common.Address, blockHash common.Hash) ([]byte, error) { + client := w.getGethClient() + return client.CodeAtHash(ctx, contract, blockHash) +} + +func (w *WrappedContractBackend) CallContractAtHash(ctx context.Context, call ethereum.CallMsg, blockHash common.Hash) ([]byte, error) { + client := w.getGethClient() + return client.CallContractAtHash(ctx, call, blockHash) +} + +func (w *WrappedContractBackend) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) { + client := w.getGethClient() + return client.HeaderByNumber(ctx, number) +} + +func (w *WrappedContractBackend) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) { + client := w.getGethClient() + return client.PendingNonceAt(ctx, account) +} + +func (w *WrappedContractBackend) SuggestGasPrice(ctx context.Context) (*big.Int, error) { + client := w.getGethClient() + return client.SuggestGasPrice(ctx) +} + +func (w *WrappedContractBackend) SuggestGasTipCap(ctx context.Context) (*big.Int, error) { + client := w.getGethClient() + return client.SuggestGasTipCap(ctx) +} + +func (w *WrappedContractBackend) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error) { + client := w.getGethClient() + return client.EstimateGas(ctx, call) +} + +func (w *WrappedContractBackend) SendTransaction(ctx context.Context, tx *types.Transaction) error { + client := w.getGethClient() + return client.SendTransaction(ctx, tx) +} + +func (w *WrappedContractBackend) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) { + client := w.getGethClient() + return client.FilterLogs(ctx, query) +} + +func (w *WrappedContractBackend) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) { + client := w.getGethClient() + return client.SubscribeFilterLogs(ctx, query, ch) +} + +func (w *WrappedContractBackend) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { + var hex hexutil.Bytes + client := w.getGethClient() + err := client.Client().CallContext(ctx, &hex, "eth_call", toCallArg(msg), toBlockNumArg(blockNumber)) + if err != nil { + return nil, err + } + return hex, nil +} + +func (w *WrappedContractBackend) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error) { + var hex hexutil.Bytes + client := w.getGethClient() + err := client.Client().CallContext(ctx, &hex, "eth_call", toCallArg(msg), "pending") + if err != nil { + return nil, err + } + return hex, nil +} + +// COPIED FROM go-ethereum/ethclient/gethclient - must be kept up to date! +func toBlockNumArg(number *big.Int) string { + if number == nil { + return "latest" + } + if number.Sign() >= 0 { + return hexutil.EncodeBig(number) + } + // It's negative. + if number.IsInt64() { + return rpc.BlockNumber(number.Int64()).String() + } + // It's negative and large, which is invalid. + return fmt.Sprintf("", number) +} + +// COPIED FROM go-ethereum/ethclient/gethclient - must be kept up to date! +// Modified to include legacy 'data' as well as 'input' in order to support non-compliant servers. +func toCallArg(msg ethereum.CallMsg) interface{} { + arg := map[string]interface{}{ + "from": msg.From, + "to": msg.To, + } + if len(msg.Data) > 0 { + arg["input"] = hexutil.Bytes(msg.Data) + arg["data"] = hexutil.Bytes(msg.Data) // duplicate legacy field for compatibility + } + if msg.Value != nil { + arg["value"] = (*hexutil.Big)(msg.Value) + } + if msg.Gas != 0 { + arg["gas"] = hexutil.Uint64(msg.Gas) + } + if msg.GasPrice != nil { + arg["gasPrice"] = (*hexutil.Big)(msg.GasPrice) + } + if msg.GasFeeCap != nil { + arg["maxFeePerGas"] = (*hexutil.Big)(msg.GasFeeCap) + } + if msg.GasTipCap != nil { + arg["maxPriorityFeePerGas"] = (*hexutil.Big)(msg.GasTipCap) + } + return arg +} From e0a442f7734377a69de2cd45666db21023dbddb5 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Tue, 12 Mar 2024 14:39:30 +0100 Subject: [PATCH 38/59] add comment to contract calelr --- integration-tests/wrappers/contract_caller.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration-tests/wrappers/contract_caller.go b/integration-tests/wrappers/contract_caller.go index b587550a6ae..6682eb3998c 100644 --- a/integration-tests/wrappers/contract_caller.go +++ b/integration-tests/wrappers/contract_caller.go @@ -16,6 +16,8 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/blockchain" ) +// It needs to be kept up do date with `core/chains/evm/client/rpc_client.go` !!!! + // WrappedContractBackend is a wrapper around the go-ethereum ContractBackend interface. It's a thin wrapper // around the go-ethereum/ethclient.Client, which replaces only CallContract and PendingCallContract calls with // methods that send data both in "input" and "data" field for backwards compatibility with older clients. Other methods From fb08ce4674cba5c97d7a5b088e8d2635f4dde37a Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Tue, 12 Mar 2024 14:50:48 +0100 Subject: [PATCH 39/59] try running compatibility fix on broken version --- .../evm-version-compatibility-tests.yml | 28 +-- .../evm_node_compatibility_test_list.json | 175 ------------------ integration-tests/wrappers/contract_caller.go | 2 +- 3 files changed, 15 insertions(+), 190 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index c86eee22f28..a2610ab4d4c 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -61,18 +61,18 @@ jobs: hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} this-job-name: Build Chainlink Image continue-on-error: true - - name: Checkout the repo - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - - name: Build Chainlink Image - uses: ./.github/actions/build-chainlink-image - with: - tag_suffix: "" - dockerfile: core/chainlink.Dockerfile - git_commit_sha: ${{ github.sha }} - AWS_REGION: ${{ secrets.QA_AWS_REGION }} - AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + # - name: Checkout the repo + # uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + # with: + # ref: 958e2c62d6 + # - name: Build Chainlink Image + # uses: ./.github/actions/build-chainlink-image + # with: + # tag_suffix: "" + # dockerfile: core/chainlink.Dockerfile + # git_commit_sha: 958e2c62d6 + # AWS_REGION: ${{ secrets.QA_AWS_REGION }} + # AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} build-tests: if: needs.check-dependency-bump.outputs.dependency_bumped == 'true' || github.event_name == 'workflow_dispatch' @@ -202,7 +202,7 @@ jobs: testLogCollect: ${{ vars.TEST_LOG_COLLECT }} selectedNetworks: ${{ env.SELECTED_NETWORKS }} chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ github.sha }} + chainlinkVersion: 958e2c62d6 lokiEndpoint: ${{ secrets.LOKI_URL }} lokiTenantId: ${{ vars.LOKI_TENANT_ID }} lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} @@ -219,7 +219,7 @@ jobs: test_command_to_run: cd ./integration-tests && go test -timeout 45m -count=1 -json -test.parallel=2 ${{ steps.build-go-test-command.outputs.run_command }} 2>&1 | tee /tmp/gotest.log | gotestfmt test_download_vendor_packages_command: cd ./integration-tests && go mod download cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} + cl_image_tag: 958e2c62d6 aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} artifacts_location: ./integration-tests/smoke/logs/ publish_check_name: ${{ matrix.evm_node.product }}-compatibility-${{ matrix.evm_node.eth_client }}-${{ matrix.evm_node.docker_image }} diff --git a/integration-tests/smoke/evm_node_compatibility_test_list.json b/integration-tests/smoke/evm_node_compatibility_test_list.json index c14a2b54a3e..3c56f0867f1 100644 --- a/integration-tests/smoke/evm_node_compatibility_test_list.json +++ b/integration-tests/smoke/evm_node_compatibility_test_list.json @@ -34,181 +34,6 @@ "eth_client": "geth", "docker_image": "ethereum/client-go:v1.10.0", "label": "ubuntu-latest" - }, - { - "product": "ocr2", - "name": "TestOCRv2Request", - "eth_client": "geth", - "docker_image": "ethereum/client-go:latest_stable", - "label": "ubuntu-latest" - }, - { - "product": "ocr2", - "name": "TestOCRv2Request", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.13.0", - "label": "ubuntu-latest" - }, - { - "product": "ocr2", - "name": "TestOCRv2Request", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.12.0", - "label": "ubuntu-latest" - }, - { - "product": "ocr2", - "name": "TestOCRv2Request", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.11.0", - "label": "ubuntu-latest" - }, - { - "product": "ocr2", - "name": "TestOCRv2Request", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.10.0", - "label": "ubuntu-latest" - }, - { - "product": "vrf", - "name": "TestVRFBasic", - "eth_client": "geth", - "docker_image": "ethereum/client-go:latest_stable", - "label": "ubuntu-latest" - }, - { - "product": "vrf", - "name": "TestVRFBasic", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.13.0", - "label": "ubuntu-latest" - }, - { - "product": "vrf", - "name": "TestVRFBasic", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.12.0", - "label": "ubuntu-latest" - }, - { - "product": "vrf", - "name": "TestVRFBasic", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.11.0", - "label": "ubuntu-latest" - }, - { - "product": "vrf", - "name": "TestVRFBasic", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.10.0", - "label": "ubuntu-latest" - }, - { - "product": "vrfv2", - "name": "TestVRFv2Basic/Request Randomness", - "eth_client": "geth", - "docker_image": "ethereum/client-go:latest_stable", - "label": "ubuntu-latest" - }, - { - "product": "vrfv2", - "name": "TestVRFv2Basic/Request Randomness", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.13.0", - "label": "ubuntu-latest" - }, - { - "product": "vrfv2", - "name": "TestVRFv2Basic/Request Randomness", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.12.0", - "label": "ubuntu-latest" - }, - { - "product": "vrfv2", - "name": "TestVRFv2Basic/Request Randomness", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.11.0", - "label": "ubuntu-latest" - }, - { - "product": "vrfv2", - "name": "TestVRFv2Basic/Request Randomness", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.10.0", - "label": "ubuntu-latest" - }, - { - "product": "vrfv2plus", - "name": "TestVRFv2Plus/Link Billing", - "eth_client": "geth", - "docker_image": "ethereum/client-go:latest_stable", - "label": "ubuntu-latest" - }, - { - "product": "vrfv2plus", - "name": "TestVRFv2Plus/Link Billing", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.13.0", - "label": "ubuntu-latest" - }, - { - "product": "vrfv2plus", - "name": "TestVRFv2Plus/Link Billing", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.12.0", - "label": "ubuntu-latest" - }, - { - "product": "vrfv2plus", - "name": "TestVRFv2Plus/Link Billing", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.11.0", - "label": "ubuntu-latest" - }, - { - "product": "vrfv2plus", - "name": "TestVRFv2Plus/Link Billing", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.10.0", - "label": "ubuntu-latest" - }, - { - "product": "automation", - "name": "TestSetUpkeepTriggerConfig", - "eth_client": "geth", - "docker_image": "ethereum/client-go:latest_stable", - "label": "ubuntu-latest" - }, - { - "product": "automation", - "name": "TestSetUpkeepTriggerConfig", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.13.0", - "label": "ubuntu-latest" - }, - { - "product": "automation", - "name": "TestSetUpkeepTriggerConfig", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.12.0", - "label": "ubuntu-latest" - }, - { - "product": "automation", - "name": "TestSetUpkeepTriggerConfig", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.11.0", - "label": "ubuntu-latest" - }, - { - "product": "automation", - "name": "TestSetUpkeepTriggerConfig", - "eth_client": "geth", - "docker_image": "ethereum/client-go:v1.10.0", - "label": "ubuntu-latest" } ] } \ No newline at end of file diff --git a/integration-tests/wrappers/contract_caller.go b/integration-tests/wrappers/contract_caller.go index 6682eb3998c..204b7d2ae4f 100644 --- a/integration-tests/wrappers/contract_caller.go +++ b/integration-tests/wrappers/contract_caller.go @@ -156,7 +156,7 @@ func toCallArg(msg ethereum.CallMsg) interface{} { } if len(msg.Data) > 0 { arg["input"] = hexutil.Bytes(msg.Data) - arg["data"] = hexutil.Bytes(msg.Data) // duplicate legacy field for compatibility + // arg["data"] = hexutil.Bytes(msg.Data) // duplicate legacy field for compatibility } if msg.Value != nil { arg["value"] = (*hexutil.Big)(msg.Value) From 4fdd3f235f72587b576201dc20aab140a96da085 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Tue, 12 Mar 2024 15:10:03 +0100 Subject: [PATCH 40/59] just trigger --- integration-tests/wrappers/contract_caller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/wrappers/contract_caller.go b/integration-tests/wrappers/contract_caller.go index 204b7d2ae4f..620de5ffa55 100644 --- a/integration-tests/wrappers/contract_caller.go +++ b/integration-tests/wrappers/contract_caller.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/blockchain" ) -// It needs to be kept up do date with `core/chains/evm/client/rpc_client.go` !!!! +// It needs to be kept up do date with `core/chains/evm/client/rpc_client.go` !!!!! // WrappedContractBackend is a wrapper around the go-ethereum ContractBackend interface. It's a thin wrapper // around the go-ethereum/ethclient.Client, which replaces only CallContract and PendingCallContract calls with From c7532e01e0bf49b6e866710bfa790e9c96a3fc95 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Tue, 12 Mar 2024 15:40:39 +0100 Subject: [PATCH 41/59] try to build image in CI --- .../evm-version-compatibility-tests.yml | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index a2610ab4d4c..7d01f3a3c29 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -32,13 +32,14 @@ jobs: - name: Check for go.mod changes id: changes run: | - if git diff origin/develop -- go.mod | grep -q 'github.com/ethereum/go-ethereum'; then - echo "Dependency ethereum/go-ethereum was changed" - echo "dependency_bumped=true" >> "$GITHUB_OUTPUT" - else - echo "No relevant dependency bump detected." - echo "dependency_bumped=false" >> "$GITHUB_OUTPUT" - fi + echo "dependency_bumped=true" >> "$GITHUB_OUTPUT" + # if git diff origin/develop -- go.mod | grep -q 'github.com/ethereum/go-ethereum'; then + # echo "Dependency ethereum/go-ethereum was changed" + # echo "dependency_bumped=true" >> "$GITHUB_OUTPUT" + # else + # echo "No relevant dependency bump detected." + # echo "dependency_bumped=false" >> "$GITHUB_OUTPUT" + # fi # Build Test Dependencies @@ -61,18 +62,18 @@ jobs: hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }} this-job-name: Build Chainlink Image continue-on-error: true - # - name: Checkout the repo - # uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - # with: - # ref: 958e2c62d6 - # - name: Build Chainlink Image - # uses: ./.github/actions/build-chainlink-image - # with: - # tag_suffix: "" - # dockerfile: core/chainlink.Dockerfile - # git_commit_sha: 958e2c62d6 - # AWS_REGION: ${{ secrets.QA_AWS_REGION }} - # AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} + - name: Checkout the repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: develop/958e2c62d6 + - name: Build Chainlink Image + uses: ./.github/actions/build-chainlink-image + with: + tag_suffix: "" + dockerfile: core/chainlink.Dockerfile + git_commit_sha: 958e2c62d6 + AWS_REGION: ${{ secrets.QA_AWS_REGION }} + AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} build-tests: if: needs.check-dependency-bump.outputs.dependency_bumped == 'true' || github.event_name == 'workflow_dispatch' From 6875e6b0b7d6b57469e07e4099f4587e1a6268a6 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Tue, 12 Mar 2024 15:46:58 +0100 Subject: [PATCH 42/59] try to checkout old commit --- .github/workflows/evm-version-compatibility-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 7d01f3a3c29..5e96779e055 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -65,7 +65,9 @@ jobs: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - ref: develop/958e2c62d6 + fetch-depth: 0 + - name: Checkout branch + run: git checkout 958e2c62d6 - name: Build Chainlink Image uses: ./.github/actions/build-chainlink-image with: From a7e6476b009211e49f7ceaed17905a4b10109d07 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Tue, 12 Mar 2024 16:02:34 +0100 Subject: [PATCH 43/59] fix contract caller, and let's see if it fails or not --- integration-tests/wrappers/contract_caller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/wrappers/contract_caller.go b/integration-tests/wrappers/contract_caller.go index 620de5ffa55..3ea983f5ac2 100644 --- a/integration-tests/wrappers/contract_caller.go +++ b/integration-tests/wrappers/contract_caller.go @@ -156,7 +156,7 @@ func toCallArg(msg ethereum.CallMsg) interface{} { } if len(msg.Data) > 0 { arg["input"] = hexutil.Bytes(msg.Data) - // arg["data"] = hexutil.Bytes(msg.Data) // duplicate legacy field for compatibility + arg["data"] = hexutil.Bytes(msg.Data) // duplicate legacy field for compatibility } if msg.Value != nil { arg["value"] = (*hexutil.Big)(msg.Value) From 5008f39e7adb869ac62390167bcd8dec9168c250 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Tue, 12 Mar 2024 17:55:08 +0100 Subject: [PATCH 44/59] remove code used for testing, fix slack reporting --- .../notify-slack-jobs-result/action.yml | 9 +- .../evm-version-compatibility-tests.yml | 25 ++- .../evm_node_compatibility_test_list.json | 175 ++++++++++++++++++ integration-tests/wrappers/contract_caller.go | 4 +- 4 files changed, 193 insertions(+), 20 deletions(-) diff --git a/.github/actions/notify-slack-jobs-result/action.yml b/.github/actions/notify-slack-jobs-result/action.yml index 63840cfa393..c61e07d01d1 100644 --- a/.github/actions/notify-slack-jobs-result/action.yml +++ b/.github/actions/notify-slack-jobs-result/action.yml @@ -36,9 +36,10 @@ runs: # I feel like there's some clever, fully jq way to do this, but I ain't got the motivation to figure it out echo "Querying test results at https://api.github.com/repos/${{inputs.github_repository}}/actions/runs/${{ inputs.workflow_run_id }}/jobs" + # we can get a maximum of 100 jobs per page, after that we need to start using pagination PARSED_RESULTS=$(curl \ -H "Authorization: Bearer ${{ inputs.github_token }}" \ - 'https://api.github.com/repos/${{inputs.github_repository}}/actions/runs/${{ inputs.workflow_run_id }}/jobs' \ + 'https://api.github.com/repos/${{inputs.github_repository}}/actions/runs/${{ inputs.workflow_run_id }}/jobs?per_page=100' \ | jq -r --arg pattern "${{ inputs.github_job_name_regex }}" '.jobs[] | select(.name | test($pattern)) as $job | $job.steps[] @@ -59,9 +60,9 @@ runs: echo all_success=$ALL_SUCCESS >> $GITHUB_OUTPUT - FORMATTED_RESULTS=$(echo $PARSED_RESULTS | jq -s '[.[] - | { - conclusion: .conclusion, + FORMATTED_RESULTS=$(echo $PARSED_RESULTS | jq -s '[.[] + | { + conclusion: .conclusion, cap: .cap, html_url: .html_url } diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 5e96779e055..c86eee22f28 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -32,14 +32,13 @@ jobs: - name: Check for go.mod changes id: changes run: | - echo "dependency_bumped=true" >> "$GITHUB_OUTPUT" - # if git diff origin/develop -- go.mod | grep -q 'github.com/ethereum/go-ethereum'; then - # echo "Dependency ethereum/go-ethereum was changed" - # echo "dependency_bumped=true" >> "$GITHUB_OUTPUT" - # else - # echo "No relevant dependency bump detected." - # echo "dependency_bumped=false" >> "$GITHUB_OUTPUT" - # fi + if git diff origin/develop -- go.mod | grep -q 'github.com/ethereum/go-ethereum'; then + echo "Dependency ethereum/go-ethereum was changed" + echo "dependency_bumped=true" >> "$GITHUB_OUTPUT" + else + echo "No relevant dependency bump detected." + echo "dependency_bumped=false" >> "$GITHUB_OUTPUT" + fi # Build Test Dependencies @@ -65,15 +64,13 @@ jobs: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - fetch-depth: 0 - - name: Checkout branch - run: git checkout 958e2c62d6 + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - name: Build Chainlink Image uses: ./.github/actions/build-chainlink-image with: tag_suffix: "" dockerfile: core/chainlink.Dockerfile - git_commit_sha: 958e2c62d6 + git_commit_sha: ${{ github.sha }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} @@ -205,7 +202,7 @@ jobs: testLogCollect: ${{ vars.TEST_LOG_COLLECT }} selectedNetworks: ${{ env.SELECTED_NETWORKS }} chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: 958e2c62d6 + chainlinkVersion: ${{ github.sha }} lokiEndpoint: ${{ secrets.LOKI_URL }} lokiTenantId: ${{ vars.LOKI_TENANT_ID }} lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} @@ -222,7 +219,7 @@ jobs: test_command_to_run: cd ./integration-tests && go test -timeout 45m -count=1 -json -test.parallel=2 ${{ steps.build-go-test-command.outputs.run_command }} 2>&1 | tee /tmp/gotest.log | gotestfmt test_download_vendor_packages_command: cd ./integration-tests && go mod download cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: 958e2c62d6 + cl_image_tag: ${{ github.sha }} aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} artifacts_location: ./integration-tests/smoke/logs/ publish_check_name: ${{ matrix.evm_node.product }}-compatibility-${{ matrix.evm_node.eth_client }}-${{ matrix.evm_node.docker_image }} diff --git a/integration-tests/smoke/evm_node_compatibility_test_list.json b/integration-tests/smoke/evm_node_compatibility_test_list.json index 3c56f0867f1..c14a2b54a3e 100644 --- a/integration-tests/smoke/evm_node_compatibility_test_list.json +++ b/integration-tests/smoke/evm_node_compatibility_test_list.json @@ -34,6 +34,181 @@ "eth_client": "geth", "docker_image": "ethereum/client-go:v1.10.0", "label": "ubuntu-latest" + }, + { + "product": "ocr2", + "name": "TestOCRv2Request", + "eth_client": "geth", + "docker_image": "ethereum/client-go:latest_stable", + "label": "ubuntu-latest" + }, + { + "product": "ocr2", + "name": "TestOCRv2Request", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.13.0", + "label": "ubuntu-latest" + }, + { + "product": "ocr2", + "name": "TestOCRv2Request", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.12.0", + "label": "ubuntu-latest" + }, + { + "product": "ocr2", + "name": "TestOCRv2Request", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.11.0", + "label": "ubuntu-latest" + }, + { + "product": "ocr2", + "name": "TestOCRv2Request", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.10.0", + "label": "ubuntu-latest" + }, + { + "product": "vrf", + "name": "TestVRFBasic", + "eth_client": "geth", + "docker_image": "ethereum/client-go:latest_stable", + "label": "ubuntu-latest" + }, + { + "product": "vrf", + "name": "TestVRFBasic", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.13.0", + "label": "ubuntu-latest" + }, + { + "product": "vrf", + "name": "TestVRFBasic", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.12.0", + "label": "ubuntu-latest" + }, + { + "product": "vrf", + "name": "TestVRFBasic", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.11.0", + "label": "ubuntu-latest" + }, + { + "product": "vrf", + "name": "TestVRFBasic", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.10.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2", + "name": "TestVRFv2Basic/Request Randomness", + "eth_client": "geth", + "docker_image": "ethereum/client-go:latest_stable", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2", + "name": "TestVRFv2Basic/Request Randomness", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.13.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2", + "name": "TestVRFv2Basic/Request Randomness", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.12.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2", + "name": "TestVRFv2Basic/Request Randomness", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.11.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2", + "name": "TestVRFv2Basic/Request Randomness", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.10.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2plus", + "name": "TestVRFv2Plus/Link Billing", + "eth_client": "geth", + "docker_image": "ethereum/client-go:latest_stable", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2plus", + "name": "TestVRFv2Plus/Link Billing", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.13.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2plus", + "name": "TestVRFv2Plus/Link Billing", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.12.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2plus", + "name": "TestVRFv2Plus/Link Billing", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.11.0", + "label": "ubuntu-latest" + }, + { + "product": "vrfv2plus", + "name": "TestVRFv2Plus/Link Billing", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.10.0", + "label": "ubuntu-latest" + }, + { + "product": "automation", + "name": "TestSetUpkeepTriggerConfig", + "eth_client": "geth", + "docker_image": "ethereum/client-go:latest_stable", + "label": "ubuntu-latest" + }, + { + "product": "automation", + "name": "TestSetUpkeepTriggerConfig", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.13.0", + "label": "ubuntu-latest" + }, + { + "product": "automation", + "name": "TestSetUpkeepTriggerConfig", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.12.0", + "label": "ubuntu-latest" + }, + { + "product": "automation", + "name": "TestSetUpkeepTriggerConfig", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.11.0", + "label": "ubuntu-latest" + }, + { + "product": "automation", + "name": "TestSetUpkeepTriggerConfig", + "eth_client": "geth", + "docker_image": "ethereum/client-go:v1.10.0", + "label": "ubuntu-latest" } ] } \ No newline at end of file diff --git a/integration-tests/wrappers/contract_caller.go b/integration-tests/wrappers/contract_caller.go index 3ea983f5ac2..ef9294fe044 100644 --- a/integration-tests/wrappers/contract_caller.go +++ b/integration-tests/wrappers/contract_caller.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/blockchain" ) -// It needs to be kept up do date with `core/chains/evm/client/rpc_client.go` !!!!! +// It needs to be kept up do date with core/chains/evm/client/rpc_client.go !!!!! // WrappedContractBackend is a wrapper around the go-ethereum ContractBackend interface. It's a thin wrapper // around the go-ethereum/ethclient.Client, which replaces only CallContract and PendingCallContract calls with @@ -156,7 +156,7 @@ func toCallArg(msg ethereum.CallMsg) interface{} { } if len(msg.Data) > 0 { arg["input"] = hexutil.Bytes(msg.Data) - arg["data"] = hexutil.Bytes(msg.Data) // duplicate legacy field for compatibility + arg["data"] = hexutil.Bytes(msg.Data) // duplicate legacy field for compatibility (required by Geth < v1.11.0) } if msg.Value != nil { arg["value"] = (*hexutil.Big)(msg.Value) From 3edf8ea9430ab8a2a653ffece3e3284d8e8bfe79 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Wed, 13 Mar 2024 18:56:12 +0100 Subject: [PATCH 45/59] fix a situation, when we lose transaction timeout setting for networks that are not overwritten --- integration-tests/testconfig/testconfig.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/testconfig/testconfig.go b/integration-tests/testconfig/testconfig.go index c83b67f204b..836beb5ff4e 100644 --- a/integration-tests/testconfig/testconfig.go +++ b/integration-tests/testconfig/testconfig.go @@ -586,7 +586,7 @@ func handleDefaultConfigOverride(logger zerolog.Logger, filename, configurationN for i, old_network := range oldConfig.Seth.Networks { for _, target_network := range target.Seth.Networks { if old_network.ChainID == target_network.ChainID { - oldConfig.Seth.Networks[i].TxnTimeout = old_network.TxnTimeout + oldConfig.Seth.Networks[i].TxnTimeout = target_network.TxnTimeout } } } From c4f0e9f0f6e2c1e3e9293c2653d754d7d92de220 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Wed, 13 Mar 2024 20:31:57 +0100 Subject: [PATCH 46/59] trigger compatibility tests for PR bumping go-ethereum to 1.13.14 --- .github/workflows/evm-version-compatibility-tests.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index c86eee22f28..688fce222b4 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -64,13 +64,15 @@ jobs: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + fetch-depth: 0 + - name: Checkout branch + run: git checkout 38f64e0bc6247ab9e52f2d358a7469d55d1cefab - name: Build Chainlink Image uses: ./.github/actions/build-chainlink-image with: tag_suffix: "" dockerfile: core/chainlink.Dockerfile - git_commit_sha: ${{ github.sha }} + git_commit_sha: 38f64e0bc6247ab9e52f2d358a7469d55d1cefab AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} @@ -202,7 +204,7 @@ jobs: testLogCollect: ${{ vars.TEST_LOG_COLLECT }} selectedNetworks: ${{ env.SELECTED_NETWORKS }} chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: ${{ github.sha }} + chainlinkVersion: 38f64e0bc6247ab9e52f2d358a7469d55d1cefab lokiEndpoint: ${{ secrets.LOKI_URL }} lokiTenantId: ${{ vars.LOKI_TENANT_ID }} lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} @@ -219,7 +221,7 @@ jobs: test_command_to_run: cd ./integration-tests && go test -timeout 45m -count=1 -json -test.parallel=2 ${{ steps.build-go-test-command.outputs.run_command }} 2>&1 | tee /tmp/gotest.log | gotestfmt test_download_vendor_packages_command: cd ./integration-tests && go mod download cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: ${{ github.sha }} + cl_image_tag: 38f64e0bc6247ab9e52f2d358a7469d55d1cefab aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} artifacts_location: ./integration-tests/smoke/logs/ publish_check_name: ${{ matrix.evm_node.product }}-compatibility-${{ matrix.evm_node.eth_client }}-${{ matrix.evm_node.docker_image }} From 31a2bd4368edd00abf7e9bfb188073c009ba9ee1 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 14 Mar 2024 10:22:43 +0100 Subject: [PATCH 47/59] add gas limit for Fiji, fix a situation when new networks were ignored --- integration-tests/testconfig/default.toml | 1 + integration-tests/testconfig/testconfig.go | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/integration-tests/testconfig/default.toml b/integration-tests/testconfig/default.toml index 06c792be882..1bcb4b3350c 100644 --- a/integration-tests/testconfig/default.toml +++ b/integration-tests/testconfig/default.toml @@ -62,6 +62,7 @@ name = "Fuji" chain_id = "43113" transaction_timeout = "3m" transfer_gas_fee = 21_000 +gas_limit = 8_000_000 # legacy transactions gas_price = 30_000_000_000 # EIP-1559 transactions diff --git a/integration-tests/testconfig/testconfig.go b/integration-tests/testconfig/testconfig.go index 836beb5ff4e..e30b209fd55 100644 --- a/integration-tests/testconfig/testconfig.go +++ b/integration-tests/testconfig/testconfig.go @@ -594,14 +594,24 @@ func handleDefaultConfigOverride(logger zerolog.Logger, filename, configurationN // override instead of merging if (newConfig.Seth != nil && len(newConfig.Seth.Networks) > 0) && (oldConfig != nil && oldConfig.Seth != nil && len(oldConfig.Seth.Networks) > 0) { + networksToUse := map[string]*seth.Network{} for i, old_network := range oldConfig.Seth.Networks { for _, new_network := range newConfig.Seth.Networks { if old_network.ChainID == new_network.ChainID { oldConfig.Seth.Networks[i] = new_network + break + } else { + if _, ok := networksToUse[new_network.ChainID]; !ok { + networksToUse[new_network.ChainID] = new_network + } } } + networksToUse[old_network.ChainID] = oldConfig.Seth.Networks[i] + } + target.Seth.Networks = []*seth.Network{} + for _, network := range networksToUse { + target.Seth.Networks = append(target.Seth.Networks, network) } - target.Seth.Networks = oldConfig.Seth.Networks } return nil From b9f9fc5b35812db6b0d32316c65ec810e31a966d Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 14 Mar 2024 10:55:59 +0100 Subject: [PATCH 48/59] fix lints --- integration-tests/testconfig/testconfig.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/integration-tests/testconfig/testconfig.go b/integration-tests/testconfig/testconfig.go index e30b209fd55..ee3ce21d3db 100644 --- a/integration-tests/testconfig/testconfig.go +++ b/integration-tests/testconfig/testconfig.go @@ -600,10 +600,9 @@ func handleDefaultConfigOverride(logger zerolog.Logger, filename, configurationN if old_network.ChainID == new_network.ChainID { oldConfig.Seth.Networks[i] = new_network break - } else { - if _, ok := networksToUse[new_network.ChainID]; !ok { - networksToUse[new_network.ChainID] = new_network - } + } + if _, ok := networksToUse[new_network.ChainID]; !ok { + networksToUse[new_network.ChainID] = new_network } } networksToUse[old_network.ChainID] = oldConfig.Seth.Networks[i] From ed06f10df24ec1c5b4d59fa0782ddbbb0522ad45 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 14 Mar 2024 11:00:54 +0100 Subject: [PATCH 49/59] remove hardcoded github sha --- .github/workflows/evm-version-compatibility-tests.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index 688fce222b4..c86eee22f28 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -64,15 +64,13 @@ jobs: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - fetch-depth: 0 - - name: Checkout branch - run: git checkout 38f64e0bc6247ab9e52f2d358a7469d55d1cefab + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - name: Build Chainlink Image uses: ./.github/actions/build-chainlink-image with: tag_suffix: "" dockerfile: core/chainlink.Dockerfile - git_commit_sha: 38f64e0bc6247ab9e52f2d358a7469d55d1cefab + git_commit_sha: ${{ github.sha }} AWS_REGION: ${{ secrets.QA_AWS_REGION }} AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} @@ -204,7 +202,7 @@ jobs: testLogCollect: ${{ vars.TEST_LOG_COLLECT }} selectedNetworks: ${{ env.SELECTED_NETWORKS }} chainlinkImage: ${{ env.CHAINLINK_IMAGE }} - chainlinkVersion: 38f64e0bc6247ab9e52f2d358a7469d55d1cefab + chainlinkVersion: ${{ github.sha }} lokiEndpoint: ${{ secrets.LOKI_URL }} lokiTenantId: ${{ vars.LOKI_TENANT_ID }} lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }} @@ -221,7 +219,7 @@ jobs: test_command_to_run: cd ./integration-tests && go test -timeout 45m -count=1 -json -test.parallel=2 ${{ steps.build-go-test-command.outputs.run_command }} 2>&1 | tee /tmp/gotest.log | gotestfmt test_download_vendor_packages_command: cd ./integration-tests && go mod download cl_repo: ${{ env.CHAINLINK_IMAGE }} - cl_image_tag: 38f64e0bc6247ab9e52f2d358a7469d55d1cefab + cl_image_tag: ${{ github.sha }} aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }} artifacts_location: ./integration-tests/smoke/logs/ publish_check_name: ${{ matrix.evm_node.product }}-compatibility-${{ matrix.evm_node.eth_client }}-${{ matrix.evm_node.docker_image }} From 7fab08ca2996179fddc42f811c84c3609b23d76c Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 14 Mar 2024 12:15:41 +0100 Subject: [PATCH 50/59] add changeset --- .changeset/moody-ligers-walk.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/moody-ligers-walk.md diff --git a/.changeset/moody-ligers-walk.md b/.changeset/moody-ligers-walk.md new file mode 100644 index 00000000000..c93bf8517ee --- /dev/null +++ b/.changeset/moody-ligers-walk.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Add new pipeline for testing EVM node compatibility on go-ethereum dependency bump From 982f2d83b266072c371e444216fdfd4e54cbc463 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 14 Mar 2024 17:47:13 +0100 Subject: [PATCH 51/59] separate method for restarting CL cluster --- integration-tests/docker/test_env/cl_node.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/integration-tests/docker/test_env/cl_node.go b/integration-tests/docker/test_env/cl_node.go index aa501dfa6b5..8b3ecab463a 100644 --- a/integration-tests/docker/test_env/cl_node.go +++ b/integration-tests/docker/test_env/cl_node.go @@ -158,7 +158,7 @@ func (n *ClNode) Restart(cfg *chainlink.Config) error { return err } n.NodeConfig = cfg - return n.StartContainer() + return n.RestartContainer() } // UpgradeVersion restarts the cl node with new image and version @@ -285,8 +285,13 @@ func (n *ClNode) Fund(evmClient blockchain.EVMClient, amount *big.Float) error { return evmClient.Fund(toAddress, amount, gasEstimates) } -func (n *ClNode) StartContainer() error { - err := n.PostgresDb.RestartContainer() +func (n *ClNode) startContainer(restartDb bool) error { + var err error + if restartDb { + err = n.PostgresDb.RestartContainer() + } else { + err = n.PostgresDb.StartContainer() + } if err != nil { return err } @@ -359,6 +364,14 @@ func (n *ClNode) StartContainer() error { return nil } +func (n *ClNode) RestartContainer() error { + return n.startContainer(true) +} + +func (n *ClNode) StartContainer() error { + return n.startContainer(false) +} + func (n *ClNode) ExecGetVersion() (string, error) { cmd := []string{"chainlink", "--version"} _, output, err := n.Container.Exec(context.Background(), cmd) From 237fc8ac7f2e921642664522e9b30cd1ef09896b Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 14 Mar 2024 19:02:28 +0100 Subject: [PATCH 52/59] update go.mod --- integration-tests/go.mod | 2 +- integration-tests/go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/integration-tests/go.mod b/integration-tests/go.mod index d82d44de6f7..edb37ee1c2b 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -24,7 +24,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240311111125-22812a072c35 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240312193929-9bf02a194958 - github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314115912-624ab34b76a2 + github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314180104-5a270cd96e6f github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20240229181116-bfb2432a7a66 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 37afed58059..7a32f4c6730 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1530,6 +1530,8 @@ github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.202402 github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314115912-624ab34b76a2 h1:nyF94PItQ0+vK+OppDoNEED2NHmWfTBur+6/s9lsrd0= github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314115912-624ab34b76a2/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314180104-5a270cd96e6f h1:w5T9usGQQX3gCwkXFm9dDY1boDkF09Hsmc+U/3SvFXI= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314180104-5a270cd96e6f/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= From 5e30137d6e17deb9ee448d0fde42497af32cc8c1 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 14 Mar 2024 19:05:10 +0100 Subject: [PATCH 53/59] go.mod --- integration-tests/go.sum | 2 -- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 7a32f4c6730..4c289ab96ff 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1528,8 +1528,6 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314115912-624ab34b76a2 h1:nyF94PItQ0+vK+OppDoNEED2NHmWfTBur+6/s9lsrd0= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314115912-624ab34b76a2/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314180104-5a270cd96e6f h1:w5T9usGQQX3gCwkXFm9dDY1boDkF09Hsmc+U/3SvFXI= github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314180104-5a270cd96e6f/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 h1:FFdvEzlYwcuVHkdZ8YnZR/XomeMGbz5E2F2HZI3I3w8= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 7b02ad6b99d..8a4e2b2ec2a 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -16,7 +16,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240311111125-22812a072c35 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240312193929-9bf02a194958 - github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314115912-624ab34b76a2 + github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314180104-5a270cd96e6f 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-20240229181116-bfb2432a7a66 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 73e9330db1c..da8377667d7 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1511,8 +1511,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314115912-624ab34b76a2 h1:nyF94PItQ0+vK+OppDoNEED2NHmWfTBur+6/s9lsrd0= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314115912-624ab34b76a2/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314180104-5a270cd96e6f h1:w5T9usGQQX3gCwkXFm9dDY1boDkF09Hsmc+U/3SvFXI= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314180104-5a270cd96e6f/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= From 9d7baec4500d5ea14a2054258e308cc518624da3 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 14 Mar 2024 19:17:09 +0100 Subject: [PATCH 54/59] lints --- integration-tests/docker/test_env/cl_node.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/integration-tests/docker/test_env/cl_node.go b/integration-tests/docker/test_env/cl_node.go index 8b3ecab463a..6dde5e03f41 100644 --- a/integration-tests/docker/test_env/cl_node.go +++ b/integration-tests/docker/test_env/cl_node.go @@ -285,7 +285,7 @@ func (n *ClNode) Fund(evmClient blockchain.EVMClient, amount *big.Float) error { return evmClient.Fund(toAddress, amount, gasEstimates) } -func (n *ClNode) startContainer(restartDb bool) error { +func (n *ClNode) containerStartOrRestart(restartDb bool) error { var err error if restartDb { err = n.PostgresDb.RestartContainer() @@ -365,11 +365,11 @@ func (n *ClNode) startContainer(restartDb bool) error { } func (n *ClNode) RestartContainer() error { - return n.startContainer(true) + return n.containerStartOrRestart(true) } func (n *ClNode) StartContainer() error { - return n.startContainer(false) + return n.containerStartOrRestart(false) } func (n *ClNode) ExecGetVersion() (string, error) { From 5aa832c4c9822fb6d40522abbdb431cc3d664216 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Fri, 15 Mar 2024 10:12:02 +0100 Subject: [PATCH 55/59] do not bump go-eth --- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 182b6c76dc7..9a51b8e73ef 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/cosmos/cosmos-sdk v0.47.4 github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e github.com/esote/minmaxheap v1.0.0 - github.com/ethereum/go-ethereum v1.13.9 + github.com/ethereum/go-ethereum v1.13.8 github.com/fatih/color v1.16.0 github.com/fxamacker/cbor/v2 v2.5.0 github.com/gagliardetto/solana-go v1.4.1-0.20220428092759-5250b4abbb27 diff --git a/go.sum b/go.sum index 819ca684963..335141568db 100644 --- a/go.sum +++ b/go.sum @@ -370,8 +370,8 @@ github.com/esote/minmaxheap v1.0.0/go.mod h1:Ln8+i7fS1k3PLgZI2JAo0iA1as95QnIYiGC github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.9 h1:ed4e4c7NWPrO2VX2wsMhWs5+6Lf2D591DmdE8RgmtcU= -github.com/ethereum/go-ethereum v1.13.9/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= +github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= +github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index edb37ee1c2b..74c4555ab57 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -24,7 +24,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240311111125-22812a072c35 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240312193929-9bf02a194958 - github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314180104-5a270cd96e6f + github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240315090950-8f6925624d87 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20240229181116-bfb2432a7a66 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 4c289ab96ff..c0fc88fa6f6 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1528,8 +1528,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314180104-5a270cd96e6f h1:w5T9usGQQX3gCwkXFm9dDY1boDkF09Hsmc+U/3SvFXI= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314180104-5a270cd96e6f/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240315090950-8f6925624d87 h1:NrQOeOS5GpmW9cBwsGTFEY/yPypmIfNw6QqgJWgS2EU= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240315090950-8f6925624d87/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 8a4e2b2ec2a..b8a09a77220 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -16,7 +16,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240311111125-22812a072c35 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240312193929-9bf02a194958 - github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314180104-5a270cd96e6f + github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240315090950-8f6925624d87 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-20240229181116-bfb2432a7a66 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index da8377667d7..6bdfadedff9 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1511,8 +1511,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314180104-5a270cd96e6f h1:w5T9usGQQX3gCwkXFm9dDY1boDkF09Hsmc+U/3SvFXI= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240314180104-5a270cd96e6f/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240315090950-8f6925624d87 h1:NrQOeOS5GpmW9cBwsGTFEY/yPypmIfNw6QqgJWgS2EU= +github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240315090950-8f6925624d87/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= From 772a980c2ca684237d711abc1b66ab3bec7cc02d Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Fri, 15 Mar 2024 15:08:34 +0100 Subject: [PATCH 56/59] use latest CTF v1.27.0 --- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 9ff9020111f..7b5ee8d1e3a 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -24,7 +24,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240311111125-22812a072c35 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240314172156-049609b8e1f9 - github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240315090950-8f6925624d87 + github.com/smartcontractkit/chainlink-testing-framework v1.27.0 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 github.com/smartcontractkit/libocr v0.0.0-20240229181116-bfb2432a7a66 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 382a125f94c..68d0fa9f9df 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1528,8 +1528,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240315090950-8f6925624d87 h1:NrQOeOS5GpmW9cBwsGTFEY/yPypmIfNw6QqgJWgS2EU= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240315090950-8f6925624d87/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= +github.com/smartcontractkit/chainlink-testing-framework v1.27.0 h1:fs60anZu4VMPv0E9TtGo9uQ4kJcqChClxgjC9ArvqN4= +github.com/smartcontractkit/chainlink-testing-framework v1.27.0/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index c4c84f624ea..9f04203605c 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -16,7 +16,7 @@ require ( github.com/slack-go/slack v0.12.2 github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240311111125-22812a072c35 github.com/smartcontractkit/chainlink-common v0.1.7-0.20240314172156-049609b8e1f9 - github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240315090950-8f6925624d87 + github.com/smartcontractkit/chainlink-testing-framework v1.27.0 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-20240229181116-bfb2432a7a66 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 8397753fc9d..f467d3773d3 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1511,8 +1511,8 @@ github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19 github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240216142700-c5869534c19e/go.mod h1:JiykN+8W5TA4UD2ClrzQCVvcH3NcyLEVv7RwY0busrw= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0 h1:7m9PVtccb8/pvKTXMaGuyceFno1icRyC2SFH7KG7+70= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240213121419-1272736c2ac0/go.mod h1:SZ899lZYQ0maUulWbZg+SWqabHQ1wTbyk3jT8wJfyo8= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240315090950-8f6925624d87 h1:NrQOeOS5GpmW9cBwsGTFEY/yPypmIfNw6QqgJWgS2EU= -github.com/smartcontractkit/chainlink-testing-framework v1.26.1-0.20240315090950-8f6925624d87/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= +github.com/smartcontractkit/chainlink-testing-framework v1.27.0 h1:fs60anZu4VMPv0E9TtGo9uQ4kJcqChClxgjC9ArvqN4= +github.com/smartcontractkit/chainlink-testing-framework v1.27.0/go.mod h1:jN+HgXbriq6fKRlIqLw9F3I81aYImV6kBJkIfz0mdIA= 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= From 8e7dfc08301a02a2d8298ea9e1dda8007d36be5d Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Fri, 15 Mar 2024 16:42:00 +0100 Subject: [PATCH 57/59] dump down go-ethereum, fix some comments and descriptions --- .github/workflows/evm-version-compatibility-tests.yml | 7 +------ core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- integration-tests/docker/test_env/cl_node.go | 9 +++++++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 ++-- .../scripts/buildEvmClientTestMatrixList.sh | 5 ++--- 9 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/evm-version-compatibility-tests.yml b/.github/workflows/evm-version-compatibility-tests.yml index c86eee22f28..5be5f314392 100644 --- a/.github/workflows/evm-version-compatibility-tests.yml +++ b/.github/workflows/evm-version-compatibility-tests.yml @@ -118,11 +118,9 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Setup environment variables run: | echo "BASE64_TEST_LIST=${{ github.event.inputs.base64_test_list }}" >> $GITHUB_ENV - - name: Decode Base64 Test List Input if Set id: decode-base64-test-list if: env.BASE64_TEST_LIST != '' @@ -132,14 +130,12 @@ jobs: echo $DECODED_BASE64_TEST_LIST cd ./integration-tests echo $DECODED_BASE64_TEST_LIST >> ./evm_node_compatibility_test_list.json - - - name: Copy Saved Test List if Not Set + - name: Override Test List If Present if: env.BASE64_TEST_LIST == '' id: build-test-matrix-list run: | cd ./integration-tests cp ./smoke/evm_node_compatibility_test_list.json . - - name: Create Test Matrix id: create-test-matrix-list run: | @@ -212,7 +208,6 @@ jobs: ethExecutionClient: ${{ matrix.evm_node.eth_client }} customEthClientDockerImage: ${{ matrix.evm_node.docker_image }} - ## Run this step when changes that require tests to be run are made - name: Run Tests uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@c67a09566412d153ff7640d99f96b43aa03abc04 # v2.3.6 with: diff --git a/core/scripts/go.mod b/core/scripts/go.mod index de852a58799..e9f31ae2ed8 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -8,7 +8,7 @@ replace github.com/smartcontractkit/chainlink/v2 => ../../ require ( github.com/docker/docker v24.0.7+incompatible github.com/docker/go-connections v0.4.0 - github.com/ethereum/go-ethereum v1.13.9 + github.com/ethereum/go-ethereum v1.13.8 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.4.0 github.com/jmoiron/sqlx v1.3.5 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index c926b64c5b3..d59e0db8d58 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -387,8 +387,8 @@ github.com/esote/minmaxheap v1.0.0/go.mod h1:Ln8+i7fS1k3PLgZI2JAo0iA1as95QnIYiGC github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.9 h1:ed4e4c7NWPrO2VX2wsMhWs5+6Lf2D591DmdE8RgmtcU= -github.com/ethereum/go-ethereum v1.13.9/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= +github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= +github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= diff --git a/integration-tests/docker/test_env/cl_node.go b/integration-tests/docker/test_env/cl_node.go index 6dde5e03f41..eae3f894db3 100644 --- a/integration-tests/docker/test_env/cl_node.go +++ b/integration-tests/docker/test_env/cl_node.go @@ -43,6 +43,11 @@ var ( ErrStartCLNodeContainer = "failed to start CL node container" ) +const ( + RestartContainer = true + StartNewContainer = false +) + type ClNode struct { test_env.EnvComponent API *client.ChainlinkClient `json:"-"` @@ -365,11 +370,11 @@ func (n *ClNode) containerStartOrRestart(restartDb bool) error { } func (n *ClNode) RestartContainer() error { - return n.containerStartOrRestart(true) + return n.containerStartOrRestart(RestartContainer) } func (n *ClNode) StartContainer() error { - return n.containerStartOrRestart(false) + return n.containerStartOrRestart(StartNewContainer) } func (n *ClNode) ExecGetVersion() (string, error) { diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 7b5ee8d1e3a..5e4d46f2cf2 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -8,7 +8,7 @@ replace github.com/smartcontractkit/chainlink/v2 => ../ require ( github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df github.com/cli/go-gh/v2 v2.0.0 - github.com/ethereum/go-ethereum v1.13.9 + github.com/ethereum/go-ethereum v1.13.8 github.com/go-resty/resty/v2 v2.7.0 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 68d0fa9f9df..34da71eadec 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -475,8 +475,8 @@ github.com/esote/minmaxheap v1.0.0/go.mod h1:Ln8+i7fS1k3PLgZI2JAo0iA1as95QnIYiGC github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.9 h1:ed4e4c7NWPrO2VX2wsMhWs5+6Lf2D591DmdE8RgmtcU= -github.com/ethereum/go-ethereum v1.13.9/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= +github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= +github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 9f04203605c..5667c8a8ce9 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -9,7 +9,7 @@ replace github.com/smartcontractkit/chainlink/integration-tests => ../ require ( github.com/K-Phoen/grabana v0.22.1 - github.com/ethereum/go-ethereum v1.13.9 + 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/rs/zerolog v1.30.0 diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index f467d3773d3..dcfce6ff4fb 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -465,8 +465,8 @@ github.com/esote/minmaxheap v1.0.0/go.mod h1:Ln8+i7fS1k3PLgZI2JAo0iA1as95QnIYiGC github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.9 h1:ed4e4c7NWPrO2VX2wsMhWs5+6Lf2D591DmdE8RgmtcU= -github.com/ethereum/go-ethereum v1.13.9/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= +github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= +github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= diff --git a/integration-tests/scripts/buildEvmClientTestMatrixList.sh b/integration-tests/scripts/buildEvmClientTestMatrixList.sh index e6b3e818763..2f0e27b7fb8 100755 --- a/integration-tests/scripts/buildEvmClientTestMatrixList.sh +++ b/integration-tests/scripts/buildEvmClientTestMatrixList.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash -# requires a path to a test file to compare the test list against -# requires a matrix job name to be passed in, for example "automation" +# requires a path to a json file with all the tests it should run # requires a node label to be passed in, for example "ubuntu-latest" set -e @@ -16,7 +15,7 @@ NODE_LABEL=$2 COUNTER=1 -# Build a JSON object in the format expected by our integration-tests workflow matrix +# Build a JSON object in the format expected by our evm-version-compatibility-tests workflow matrix matrix_output() { local counter=$1 local job_name=$2 From 0791a552a3394392f642f992ed29cd919a8afc75 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Fri, 15 Mar 2024 20:03:17 +0100 Subject: [PATCH 58/59] add helper that exposes legacy methods to use them in test wrapper and rpc client --- .../chains/evm/client/compatibility_helper.go | 57 +++++++++++++++++++ core/chains/evm/client/rpc_client.go | 53 ++--------------- integration-tests/wrappers/contract_caller.go | 53 ++--------------- 3 files changed, 65 insertions(+), 98 deletions(-) create mode 100644 core/chains/evm/client/compatibility_helper.go diff --git a/core/chains/evm/client/compatibility_helper.go b/core/chains/evm/client/compatibility_helper.go new file mode 100644 index 00000000000..c19c66b7442 --- /dev/null +++ b/core/chains/evm/client/compatibility_helper.go @@ -0,0 +1,57 @@ +package client + +import ( + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/rpc" +) + +// Needed to support Geth servers < v1.11.0 + +// COPIED FROM go-ethereum/ethclient/gethclient - must be kept up to date! +func ToBackwardCompatibleBlockNumArg(number *big.Int) string { + if number == nil { + return "latest" + } + if number.Sign() >= 0 { + return hexutil.EncodeBig(number) + } + // It's negative. + if number.IsInt64() { + return rpc.BlockNumber(number.Int64()).String() + } + // It's negative and large, which is invalid. + return fmt.Sprintf("", number) +} + +// COPIED FROM go-ethereum/ethclient/gethclient - must be kept up to date! +// Modified to include legacy 'data' as well as 'input' in order to support non-compliant servers. +func ToBackwardCompatibleCallArg(msg ethereum.CallMsg) interface{} { + arg := map[string]interface{}{ + "from": msg.From, + "to": msg.To, + } + if len(msg.Data) > 0 { + arg["input"] = hexutil.Bytes(msg.Data) + arg["data"] = hexutil.Bytes(msg.Data) // duplicate legacy field for compatibility + } + if msg.Value != nil { + arg["value"] = (*hexutil.Big)(msg.Value) + } + if msg.Gas != 0 { + arg["gas"] = hexutil.Uint64(msg.Gas) + } + if msg.GasPrice != nil { + arg["gasPrice"] = (*hexutil.Big)(msg.GasPrice) + } + if msg.GasFeeCap != nil { + arg["maxFeePerGas"] = (*hexutil.Big)(msg.GasFeeCap) + } + if msg.GasTipCap != nil { + arg["maxPriorityFeePerGas"] = (*hexutil.Big)(msg.GasTipCap) + } + return arg +} diff --git a/core/chains/evm/client/rpc_client.go b/core/chains/evm/client/rpc_client.go index f9745cfda11..255b038037a 100644 --- a/core/chains/evm/client/rpc_client.go +++ b/core/chains/evm/client/rpc_client.go @@ -785,10 +785,10 @@ func (r *rpcClient) CallContract(ctx context.Context, msg interface{}, blockNumb start := time.Now() var hex hexutil.Bytes if http != nil { - err = http.rpc.CallContext(ctx, &hex, "eth_call", toCallArg(message), toBlockNumArg(blockNumber)) + err = http.rpc.CallContext(ctx, &hex, "eth_call", ToBackwardCompatibleCallArg(message), ToBackwardCompatibleBlockNumArg(blockNumber)) err = r.wrapHTTP(err) } else { - err = ws.rpc.CallContext(ctx, &hex, "eth_call", toCallArg(message), toBlockNumArg(blockNumber)) + err = ws.rpc.CallContext(ctx, &hex, "eth_call", ToBackwardCompatibleCallArg(message), ToBackwardCompatibleBlockNumArg(blockNumber)) err = r.wrapWS(err) } if err == nil { @@ -816,10 +816,10 @@ func (r *rpcClient) PendingCallContract(ctx context.Context, msg interface{}) (v start := time.Now() var hex hexutil.Bytes if http != nil { - err = http.rpc.CallContext(ctx, &hex, "eth_call", toCallArg(message), "pending") + err = http.rpc.CallContext(ctx, &hex, "eth_call", ToBackwardCompatibleCallArg(message), "pending") err = r.wrapHTTP(err) } else { - err = ws.rpc.CallContext(ctx, &hex, "eth_call", toCallArg(message), "pending") + err = ws.rpc.CallContext(ctx, &hex, "eth_call", ToBackwardCompatibleCallArg(message), "pending") err = r.wrapWS(err) } if err == nil { @@ -834,51 +834,6 @@ func (r *rpcClient) PendingCallContract(ctx context.Context, msg interface{}) (v return } -// COPIED FROM go-ethereum/ethclient/gethclient - must be kept up to date! -func toBlockNumArg(number *big.Int) string { - if number == nil { - return "latest" - } - if number.Sign() >= 0 { - return hexutil.EncodeBig(number) - } - // It's negative. - if number.IsInt64() { - return rpc.BlockNumber(number.Int64()).String() - } - // It's negative and large, which is invalid. - return fmt.Sprintf("", number) -} - -// COPIED FROM go-ethereum/ethclient/gethclient - must be kept up to date! -// Modified to include legacy 'data' as well as 'input' in order to support non-compliant servers. -func toCallArg(msg ethereum.CallMsg) interface{} { - arg := map[string]interface{}{ - "from": msg.From, - "to": msg.To, - } - if len(msg.Data) > 0 { - arg["input"] = hexutil.Bytes(msg.Data) - arg["data"] = hexutil.Bytes(msg.Data) // duplicate legacy field for compatibility - } - if msg.Value != nil { - arg["value"] = (*hexutil.Big)(msg.Value) - } - if msg.Gas != 0 { - arg["gas"] = hexutil.Uint64(msg.Gas) - } - if msg.GasPrice != nil { - arg["gasPrice"] = (*hexutil.Big)(msg.GasPrice) - } - if msg.GasFeeCap != nil { - arg["maxFeePerGas"] = (*hexutil.Big)(msg.GasFeeCap) - } - if msg.GasTipCap != nil { - arg["maxPriorityFeePerGas"] = (*hexutil.Big)(msg.GasTipCap) - } - return arg -} - func (r *rpcClient) LatestBlockHeight(ctx context.Context) (*big.Int, error) { var height big.Int h, err := r.BlockNumber(ctx) diff --git a/integration-tests/wrappers/contract_caller.go b/integration-tests/wrappers/contract_caller.go index ef9294fe044..11a072e6a1e 100644 --- a/integration-tests/wrappers/contract_caller.go +++ b/integration-tests/wrappers/contract_caller.go @@ -2,7 +2,6 @@ package wrappers import ( "context" - "fmt" "math/big" "github.com/ethereum/go-ethereum" @@ -10,9 +9,10 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/rpc" "github.com/smartcontractkit/seth" + evmClient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink-testing-framework/blockchain" ) @@ -114,7 +114,7 @@ func (w *WrappedContractBackend) SubscribeFilterLogs(ctx context.Context, query func (w *WrappedContractBackend) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) { var hex hexutil.Bytes client := w.getGethClient() - err := client.Client().CallContext(ctx, &hex, "eth_call", toCallArg(msg), toBlockNumArg(blockNumber)) + err := client.Client().CallContext(ctx, &hex, "eth_call", evmClient.ToBackwardCompatibleCallArg(msg), evmClient.ToBackwardCompatibleBlockNumArg(blockNumber)) if err != nil { return nil, err } @@ -124,54 +124,9 @@ func (w *WrappedContractBackend) CallContract(ctx context.Context, msg ethereum. func (w *WrappedContractBackend) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error) { var hex hexutil.Bytes client := w.getGethClient() - err := client.Client().CallContext(ctx, &hex, "eth_call", toCallArg(msg), "pending") + err := client.Client().CallContext(ctx, &hex, "eth_call", evmClient.ToBackwardCompatibleCallArg(msg), "pending") if err != nil { return nil, err } return hex, nil } - -// COPIED FROM go-ethereum/ethclient/gethclient - must be kept up to date! -func toBlockNumArg(number *big.Int) string { - if number == nil { - return "latest" - } - if number.Sign() >= 0 { - return hexutil.EncodeBig(number) - } - // It's negative. - if number.IsInt64() { - return rpc.BlockNumber(number.Int64()).String() - } - // It's negative and large, which is invalid. - return fmt.Sprintf("", number) -} - -// COPIED FROM go-ethereum/ethclient/gethclient - must be kept up to date! -// Modified to include legacy 'data' as well as 'input' in order to support non-compliant servers. -func toCallArg(msg ethereum.CallMsg) interface{} { - arg := map[string]interface{}{ - "from": msg.From, - "to": msg.To, - } - if len(msg.Data) > 0 { - arg["input"] = hexutil.Bytes(msg.Data) - arg["data"] = hexutil.Bytes(msg.Data) // duplicate legacy field for compatibility (required by Geth < v1.11.0) - } - if msg.Value != nil { - arg["value"] = (*hexutil.Big)(msg.Value) - } - if msg.Gas != 0 { - arg["gas"] = hexutil.Uint64(msg.Gas) - } - if msg.GasPrice != nil { - arg["gasPrice"] = (*hexutil.Big)(msg.GasPrice) - } - if msg.GasFeeCap != nil { - arg["maxFeePerGas"] = (*hexutil.Big)(msg.GasFeeCap) - } - if msg.GasTipCap != nil { - arg["maxPriorityFeePerGas"] = (*hexutil.Big)(msg.GasTipCap) - } - return arg -} From 89328674a72118b46231c93b8821e64e75fd41d3 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Fri, 15 Mar 2024 20:10:07 +0100 Subject: [PATCH 59/59] remove stale comment --- integration-tests/wrappers/contract_caller.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/integration-tests/wrappers/contract_caller.go b/integration-tests/wrappers/contract_caller.go index 11a072e6a1e..4be76ee74a1 100644 --- a/integration-tests/wrappers/contract_caller.go +++ b/integration-tests/wrappers/contract_caller.go @@ -16,8 +16,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/blockchain" ) -// It needs to be kept up do date with core/chains/evm/client/rpc_client.go !!!!! - // WrappedContractBackend is a wrapper around the go-ethereum ContractBackend interface. It's a thin wrapper // around the go-ethereum/ethclient.Client, which replaces only CallContract and PendingCallContract calls with // methods that send data both in "input" and "data" field for backwards compatibility with older clients. Other methods