diff --git a/.github/workflows/qa-rpc-integration-tests-clients.yml b/.github/workflows/qa-rpc-integration-tests-clients.yml index 02f3e3e3663..31f138b7910 100644 --- a/.github/workflows/qa-rpc-integration-tests-clients.yml +++ b/.github/workflows/qa-rpc-integration-tests-clients.yml @@ -34,6 +34,11 @@ jobs: - name: Check out repository uses: actions/checkout@v6 + - name: Read RPC version + run: | + source .github/workflows/scripts/rpc_version.env + echo "RPC_VERSION=$RPC_VERSION" >> $GITHUB_ENV + - name: Wait for port 8545 to be available run: | for i in {1..30}; do @@ -53,7 +58,7 @@ jobs: uses: actions/cache@v5 with: path: ${{ runner.workspace }}/rpc-tests - key: rpc-tests-${{ runner.os }}-${{ runner.arch }}-v2.4.0 + key: rpc-tests-${{ runner.os }}-${{ runner.arch }}-${{ env.RPC_VERSION }} - name: Run RPC Integration Tests id: test_step diff --git a/.github/workflows/qa-rpc-integration-tests-gnosis.yml b/.github/workflows/qa-rpc-integration-tests-gnosis.yml index 453311ab5a5..46c11e47262 100644 --- a/.github/workflows/qa-rpc-integration-tests-gnosis.yml +++ b/.github/workflows/qa-rpc-integration-tests-gnosis.yml @@ -41,6 +41,11 @@ jobs: - name: Check out repository uses: actions/checkout@v6 + - name: Read RPC version + run: | + source .github/workflows/scripts/rpc_version.env + echo "RPC_VERSION=$RPC_VERSION" >> $GITHUB_ENV + - name: Set reference data dir based on branch run: | # For pull_request events base_ref is the target branch name; for push/dispatch parse from ref. @@ -73,7 +78,7 @@ jobs: uses: actions/cache@v5 with: path: ${{ runner.workspace }}/rpc-tests - key: rpc-tests-${{ runner.os }}-${{ runner.arch }}-v2.8.1 + key: rpc-tests-${{ runner.os }}-${{ runner.arch }}-${{ env.RPC_VERSION }} - name: Run RPC Integration Tests id: test_step diff --git a/.github/workflows/qa-rpc-integration-tests-latest.yml b/.github/workflows/qa-rpc-integration-tests-latest.yml index 40d3642b2c5..fafc78ed6c6 100644 --- a/.github/workflows/qa-rpc-integration-tests-latest.yml +++ b/.github/workflows/qa-rpc-integration-tests-latest.yml @@ -39,6 +39,11 @@ jobs: - name: Check out repository uses: actions/checkout@v6 + - name: Read RPC version + run: | + source .github/workflows/scripts/rpc_version.env + echo "RPC_VERSION=$RPC_VERSION" >> $GITHUB_ENV + - name: Set reference data dir based on branch run: | # For pull_request events base_ref is the target branch name; for push/dispatch parse from ref. diff --git a/.github/workflows/qa-rpc-integration-tests-remote.yml b/.github/workflows/qa-rpc-integration-tests-remote.yml index ef49fe89ad4..e431f75f4ee 100644 --- a/.github/workflows/qa-rpc-integration-tests-remote.yml +++ b/.github/workflows/qa-rpc-integration-tests-remote.yml @@ -35,6 +35,11 @@ jobs: - name: Check out repository uses: actions/checkout@v6 + - name: Read RPC version + run: | + source .github/workflows/scripts/rpc_version.env + echo "RPC_VERSION=$RPC_VERSION" >> $GITHUB_ENV + - name: Set reference data dir based on branch run: | # For pull_request events base_ref is the target branch name; for push/dispatch parse from ref. @@ -140,7 +145,7 @@ jobs: uses: actions/cache@v5 with: path: ${{ runner.workspace }}/rpc-tests - key: rpc-tests-${{ runner.os }}-${{ runner.arch }}-v1.121.0 + key: rpc-tests-${{ runner.os }}-${{ runner.arch }}-${{ env.RPC_VERSION }} - name: Run RPC Integration Tests id: test_step diff --git a/.github/workflows/qa-rpc-integration-tests.yml b/.github/workflows/qa-rpc-integration-tests.yml index 0f510821537..1bf99c7baf2 100644 --- a/.github/workflows/qa-rpc-integration-tests.yml +++ b/.github/workflows/qa-rpc-integration-tests.yml @@ -41,6 +41,11 @@ jobs: - name: Check out repository uses: actions/checkout@v6 + - name: Read RPC version + run: | + source .github/workflows/scripts/rpc_version.env + echo "RPC_VERSION=$RPC_VERSION" >> $GITHUB_ENV + - name: Set reference data dir based on branch run: | # For pull_request events base_ref is the target branch name; for push/dispatch parse from ref. @@ -73,7 +78,7 @@ jobs: uses: actions/cache@v5 with: path: ${{ runner.workspace }}/rpc-tests - key: rpc-tests-${{ runner.os }}-${{ runner.arch }}-v2.8.1 + key: rpc-tests-${{ runner.os }}-${{ runner.arch }}-${{ env.RPC_VERSION }} - name: Run RPC Integration Tests id: test_step diff --git a/.github/workflows/qa-sync-from-scratch.yml b/.github/workflows/qa-sync-from-scratch.yml index 7d9f4e1b256..267e931a340 100644 --- a/.github/workflows/qa-sync-from-scratch.yml +++ b/.github/workflows/qa-sync-from-scratch.yml @@ -52,6 +52,11 @@ jobs: - name: Check out repository uses: actions/checkout@v6 + - name: Read RPC version + run: | + source .github/workflows/scripts/rpc_version.env + echo "RPC_VERSION=$RPC_VERSION" >> $GITHUB_ENV + - name: Clean Erigon Build & Data Directories run: | make clean @@ -143,7 +148,7 @@ jobs: uses: actions/cache@v5 with: path: ${{ runner.workspace }}/rpc-tests - key: rpc-tests-${{ runner.os }}-${{ runner.arch }}-v2.4.0 + key: rpc-tests-${{ runner.os }}-${{ runner.arch }}-${{ env.RPC_VERSION }} - name: Run RPC Integration Tests id: rpc_test_step diff --git a/.github/workflows/scripts/rpc_version.env b/.github/workflows/scripts/rpc_version.env new file mode 100644 index 00000000000..38288f18c70 --- /dev/null +++ b/.github/workflows/scripts/rpc_version.env @@ -0,0 +1 @@ +RPC_VERSION=v2.8.1 diff --git a/.github/workflows/scripts/run_rpc_tests.sh b/.github/workflows/scripts/run_rpc_tests.sh index 4d2e6176445..05057860b12 100755 --- a/.github/workflows/scripts/run_rpc_tests.sh +++ b/.github/workflows/scripts/run_rpc_tests.sh @@ -64,6 +64,9 @@ echo "Setup the test execution environment..." # Clone rpc-tests repository at specific tag/branch, reusing existing clone if already at the right version if [ -d "$WORKSPACE/rpc-tests/.git" ] && [ "$(git -C "$WORKSPACE/rpc-tests" describe --tags --exact-match 2>/dev/null)" = "$RPC_VERSION" ]; then echo "Using cached rpc-tests at $RPC_VERSION" + # Remove stale untracked test fixtures left by runs using a different branch/version, + # but preserve .venv/ and build/ which are the expensive parts of the cache. + git -C "$WORKSPACE/rpc-tests" clean -fd -e .venv -e build >/dev/null 2>&1 else rm -rf "$WORKSPACE/rpc-tests" >/dev/null 2>&1 git -c advice.detachedHead=false clone --depth 1 --branch "$RPC_VERSION" https://github.com/erigontech/rpc-tests "$WORKSPACE/rpc-tests" >/dev/null 2>&1 diff --git a/.github/workflows/scripts/run_rpc_tests_ethereum.sh b/.github/workflows/scripts/run_rpc_tests_ethereum.sh index 8ef8e6bbd56..4c37e702ed3 100755 --- a/.github/workflows/scripts/run_rpc_tests_ethereum.sh +++ b/.github/workflows/scripts/run_rpc_tests_ethereum.sh @@ -1,6 +1,12 @@ #!/bin/bash set -e # Enable exit on error +source "$(dirname "$0")/rpc_version.env" +if [ -z "$RPC_VERSION" ]; then + echo "Error: RPC_VERSION is not set in rpc_version.env" + exit 1 +fi + # The workspace directory, no default because run_rpc_tests has it WORKSPACE="$1" # The result directory, no default because run_rpc_tests has it @@ -13,9 +19,7 @@ DISABLED_TEST_LIST=( net_listening/test_1.json # Temporary disable required block 24298763 debug_traceBlockByNumber/test_51.json - # Stale fixtures after #20775 (cherry-picked via #20830) fixed prestateTracer - # diff mode to include deleted accounts. rpc-tests fix at erigontech/rpc-tests#554; - # re-enable once a new tag (v2.8.2+) is cut and the version is bumped here. + # Temporary disable after merge #20830, waiting for new rpc-tests tag after merge PR #552 debug_traceBlockByNumber/test_33.tar debug_traceBlockByNumber/test_34.tar # to investigate @@ -48,4 +52,4 @@ DISABLED_TEST_LIST=( DISABLED_TESTS=$(IFS=,; echo "${DISABLED_TEST_LIST[*]}") # Call the main test runner script with the required and optional parameters -"$(dirname "$0")/run_rpc_tests.sh" mainnet v2.8.1 "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" +"$(dirname "$0")/run_rpc_tests.sh" mainnet "$RPC_VERSION" "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" diff --git a/.github/workflows/scripts/run_rpc_tests_ethereum_latest.sh b/.github/workflows/scripts/run_rpc_tests_ethereum_latest.sh index 8bf9f349ba0..d9128441ba4 100755 --- a/.github/workflows/scripts/run_rpc_tests_ethereum_latest.sh +++ b/.github/workflows/scripts/run_rpc_tests_ethereum_latest.sh @@ -1,6 +1,12 @@ #!/bin/bash set -e # Enable exit on error +source "$(dirname "$0")/rpc_version.env" +if [ -z "$RPC_VERSION" ]; then + echo "Error: RPC_VERSION is not set in rpc_version.env" + exit 1 +fi + # The workspace directory, no default because run_rpc_tests has it WORKSPACE="$1" # The result directory, no default because run_rpc_tests has it @@ -34,4 +40,4 @@ DISABLED_TEST_LIST=( DISABLED_TESTS=$(IFS=,; echo "${DISABLED_TEST_LIST[*]}") # Call the main test runner script with the required and optional parameters -"$(dirname "$0")/run_rpc_tests.sh" mainnet v2.8.1 "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" "latest" "$REFERENCE_HOST" "do-not-compare-error-message" "$DUMP_RESPONSE" +"$(dirname "$0")/run_rpc_tests.sh" mainnet "$RPC_VERSION" "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" "latest" "$REFERENCE_HOST" "do-not-compare-error-message" "$DUMP_RESPONSE" diff --git a/.github/workflows/scripts/run_rpc_tests_geth.sh b/.github/workflows/scripts/run_rpc_tests_geth.sh index cb943efc355..db40a3b5be1 100755 --- a/.github/workflows/scripts/run_rpc_tests_geth.sh +++ b/.github/workflows/scripts/run_rpc_tests_geth.sh @@ -1,6 +1,12 @@ #!/bin/bash set -e # Enable exit on error +source "$(dirname "$0")/rpc_version.env" +if [ -z "$RPC_VERSION" ]; then + echo "Error: RPC_VERSION is not set in rpc_version.env" + exit 1 +fi + # The workspace directory, no default because run_rpc_tests has it WORKSPACE="$1" # The result directory, no default because run_rpc_tests has it @@ -36,4 +42,4 @@ DISABLED_TESTS=$(IFS=,; echo "${DISABLED_TEST_LIST[*]}") # Call the main test runner script with the required and optional parameters # Use do-not-compare-error-message since Geth error messages differ from Erigon -"$(dirname "$0")/run_rpc_tests.sh" mainnet v2.4.0 "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" "" "" "do-not-compare-error-message" +"$(dirname "$0")/run_rpc_tests.sh" mainnet "$RPC_VERSION" "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" "" "" "do-not-compare-error-message" diff --git a/.github/workflows/scripts/run_rpc_tests_gnosis.sh b/.github/workflows/scripts/run_rpc_tests_gnosis.sh index f69935ba278..698510c04df 100755 --- a/.github/workflows/scripts/run_rpc_tests_gnosis.sh +++ b/.github/workflows/scripts/run_rpc_tests_gnosis.sh @@ -1,6 +1,12 @@ #!/bin/bash set -e # Enable exit on error +source "$(dirname "$0")/rpc_version.env" +if [ -z "$RPC_VERSION" ]; then + echo "Error: RPC_VERSION is not set in rpc_version.env" + exit 1 +fi + # The workspace directory, no default because run_rpc_tests has it WORKSPACE="$1" # The result directory, no default because run_rpc_tests has it @@ -22,5 +28,5 @@ DISABLED_TEST_LIST=( DISABLED_TESTS=$(IFS=,; echo "${DISABLED_TEST_LIST[*]}") # Call the main test runner script with the required and optional parameters -"$(dirname "$0")/run_rpc_tests.sh" gnosis v2.8.1 "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" +"$(dirname "$0")/run_rpc_tests.sh" gnosis "$RPC_VERSION" "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" diff --git a/.github/workflows/scripts/run_rpc_tests_nethermind.sh b/.github/workflows/scripts/run_rpc_tests_nethermind.sh index 408749805ec..85992bbaea6 100755 --- a/.github/workflows/scripts/run_rpc_tests_nethermind.sh +++ b/.github/workflows/scripts/run_rpc_tests_nethermind.sh @@ -1,6 +1,12 @@ #!/bin/bash set -e # Enable exit on error +source "$(dirname "$0")/rpc_version.env" +if [ -z "$RPC_VERSION" ]; then + echo "Error: RPC_VERSION is not set in rpc_version.env" + exit 1 +fi + # The workspace directory, no default because run_rpc_tests has it WORKSPACE="$1" # The result directory, no default because run_rpc_tests has it @@ -47,4 +53,4 @@ DISABLED_TESTS=$(IFS=,; echo "${DISABLED_TEST_LIST[*]}") # Call the main test runner script with the required and optional parameters # Use do-not-compare-error-message since Nethermind error messages differ from Erigon -"$(dirname "$0")/run_rpc_tests.sh" mainnet v2.4.0 "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" "" "" "do-not-compare-error-message" +"$(dirname "$0")/run_rpc_tests.sh" mainnet "$RPC_VERSION" "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" "" "" "do-not-compare-error-message" diff --git a/.github/workflows/scripts/run_rpc_tests_remote_ethereum.sh b/.github/workflows/scripts/run_rpc_tests_remote_ethereum.sh index 50ca5b08782..3e407b5b280 100755 --- a/.github/workflows/scripts/run_rpc_tests_remote_ethereum.sh +++ b/.github/workflows/scripts/run_rpc_tests_remote_ethereum.sh @@ -1,6 +1,12 @@ #!/bin/bash set -e # Enable exit on error +source "$(dirname "$0")/rpc_version.env" +if [ -z "$RPC_VERSION" ]; then + echo "Error: RPC_VERSION is not set in rpc_version.env" + exit 1 +fi + # The workspace directory, no default because run_rpc_tests has it WORKSPACE="$1" # The result directory, no default because run_rpc_tests has it @@ -14,6 +20,9 @@ DISABLED_TEST_LIST=( # these tests/apis are disabled because some methods are not implmented on grpc eth_getProof eth_simulateV1 + # Temporary disable after merge #20830, waiting for new rpc-tests tag after merge PR #552 + debug_traceBlockByNumber/test_33.tar + debug_traceBlockByNumber/test_34.tar # Temporary disable required block 24298763 debug_traceBlockByNumber/test_51.json # Temporary disable required block 23917742 @@ -31,4 +40,4 @@ DISABLED_TEST_LIST=( DISABLED_TESTS=$(IFS=,; echo "${DISABLED_TEST_LIST[*]}") # Call the main test runner script with the required and optional parameters -"$(dirname "$0")/run_rpc_tests.sh" mainnet v2.8.1 "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR" +"$(dirname "$0")/run_rpc_tests.sh" mainnet "$RPC_VERSION" "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR"