Skip to content

Commit a3ee155

Browse files
lupin012claude
andauthored
ci: add --commitment-history flag to rpc test scripts (#20981)
As requested by Mike, qa-sync-from-scratch runs RPC integration tests without commitment-history tests enabled Tests that require commitment history (tagged erigon.request-commitment-history=true in rpc-tests) are disabled by default. To enable them, pass --commitment-history to run_rpc_tests_local.sh. This flag requires the node to have been started with --prune.experimental.include-commitment-history. Workflow behavior: - qa-rpc-integration-tests: commitment-history tests enabled (runner has the required data): valid for mainnet/gnosis historical - qa-rpc-integration-tests-remote enable tests with commitment history - qa-sync-from-scratch: commitment-history tests disabled (sync is done from scratch, data not available) Adds opt-in --commitment-history flag to run_rpc_tests_local.sh and propagates it via RPC_COMMITMENT_HISTORY env var through run_rpc_tests.sh (--erigon.commitment-history). The remote Ethereum workflow always enables it since erigon starts with --prune.experimental.include-commitment-history there. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f4fbe40 commit a3ee155

5 files changed

Lines changed: 28 additions & 19 deletions

File tree

.github/workflows/qa-rpc-integration-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ jobs:
9393
--chain "$CHAIN" \
9494
--workspace "${{ runner.workspace }}" \
9595
--result-dir "$TEST_RESULT_DIR" \
96-
--backup-dir "$ERIGON_TESTBED_AREA/chaindata-prev"
96+
--backup-dir "$ERIGON_TESTBED_AREA/chaindata-prev" \
97+
--commitment-history
9798
test_exit_status=$? # Capture test runner script exit status
9899
set -e # Re-enable exit on error after test run
99100
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
RPC_VERSION=v2.8.3
1+
RPC_VERSION=v2.9.0

.github/workflows/scripts/run_rpc_tests.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ if [ -n "$TRANSPORT_TYPES" ]; then
6565
OPTIONAL_FLAGS+=" --transport-type $TRANSPORT_TYPES"
6666
fi
6767

68+
if [ "${RPC_COMMITMENT_HISTORY:-false}" = "true" ]; then
69+
OPTIONAL_FLAGS+=" --erigon.commitment-history"
70+
fi
71+
6872
echo "Setup the test execution environment..."
6973

7074
# Clone rpc-tests repository at specific tag/branch, reusing existing clone if already at the right version

.github/workflows/scripts/run_rpc_tests_local.sh

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44
# then restores chaindata on exit. Used by both CI and local developers.
55
#
66
# Usage:
7-
# run_rpc_tests_local.sh [--datadir DIR] [--chain CHAIN] [--workspace DIR] [--result-dir DIR] [--backup-dir DIR] [--skip-backup]
7+
# run_rpc_tests_local.sh [--datadir DIR] [--chain CHAIN] [--workspace DIR] [--result-dir DIR] [--backup-dir DIR] [--skip-backup] [--commitment-history]
88
#
99
# Options:
10-
# --datadir DIR Path to synced Erigon datadir (or set ERIGON_REFERENCE_DATA_DIR)
11-
# --chain CHAIN mainnet (default) or gnosis
12-
# --workspace DIR Directory for rpc-tests clone (default: auto temp dir, deleted on exit)
13-
# --result-dir DIR Directory to save test results (default: auto temp dir, kept on failure)
14-
# --backup-dir DIR Directory for chaindata backup (default: auto temp dir, deleted on exit)
15-
# --skip-backup Skip chaindata backup/restore (use when datadir is ephemeral/disposable)
10+
# --datadir DIR Path to synced Erigon datadir (or set ERIGON_REFERENCE_DATA_DIR)
11+
# --chain CHAIN mainnet (default) or gnosis
12+
# --workspace DIR Directory for rpc-tests clone (default: auto temp dir, deleted on exit)
13+
# --result-dir DIR Directory to save test results (default: auto temp dir, kept on failure)
14+
# --backup-dir DIR Directory for chaindata backup (default: auto temp dir, deleted on exit)
15+
# --skip-backup Skip chaindata backup/restore (use when datadir is ephemeral/disposable)
16+
# --commitment-history Include tests requiring commitment history (erigon.request-commitment-history=true)
1617
set -e
1718

1819
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -25,16 +26,18 @@ WORKSPACE=""
2526
RESULT_DIR=""
2627
BACKUP_DIR_OPT=""
2728
SKIP_BACKUP=false
29+
RPC_COMMITMENT_HISTORY=false
2830

2931
usage() {
30-
echo "Usage: $0 [--datadir DIR] [--chain CHAIN] [--workspace DIR] [--result-dir DIR] [--backup-dir DIR] [--skip-backup]"
32+
echo "Usage: $0 [--datadir DIR] [--chain CHAIN] [--workspace DIR] [--result-dir DIR] [--backup-dir DIR] [--skip-backup] [--commitment-history]"
3133
echo
32-
echo " --datadir DIR Path to synced Erigon datadir (or set ERIGON_REFERENCE_DATA_DIR)"
33-
echo " --chain CHAIN mainnet (default) or gnosis"
34-
echo " --workspace DIR Directory for rpc-tests clone (default: auto temp dir)"
35-
echo " --result-dir DIR Directory to save test results (default: auto temp dir)"
36-
echo " --backup-dir DIR Directory for chaindata backup (default: auto temp dir)"
37-
echo " --skip-backup Skip chaindata backup/restore (use when datadir is ephemeral/disposable)"
34+
echo " --datadir DIR Path to synced Erigon datadir (or set ERIGON_REFERENCE_DATA_DIR)"
35+
echo " --chain CHAIN mainnet (default) or gnosis"
36+
echo " --workspace DIR Directory for rpc-tests clone (default: auto temp dir)"
37+
echo " --result-dir DIR Directory to save test results (default: auto temp dir)"
38+
echo " --backup-dir DIR Directory for chaindata backup (default: auto temp dir)"
39+
echo " --skip-backup Skip chaindata backup/restore (use when datadir is ephemeral/disposable)"
40+
echo " --commitment-history Include tests requiring commitment history (erigon.request-commitment-history=true)"
3841
exit 1
3942
}
4043

@@ -45,7 +48,8 @@ while [[ $# -gt 0 ]]; do
4548
--workspace) WORKSPACE="$2"; shift 2 ;;
4649
--result-dir) RESULT_DIR="$2"; shift 2 ;;
4750
--backup-dir) BACKUP_DIR_OPT="$2"; shift 2 ;;
48-
--skip-backup) SKIP_BACKUP=true; shift ;;
51+
--skip-backup) SKIP_BACKUP=true; shift ;;
52+
--commitment-history) RPC_COMMITMENT_HISTORY=true; shift ;;
4953
*) echo "Unknown argument: $1"; usage ;;
5054
esac
5155
done
@@ -151,7 +155,7 @@ fi
151155

152156
echo "Running RPC integration tests (chain=$CHAIN)..."
153157
set +e
154-
"$TEST_SCRIPT" "$WORKSPACE" "$RESULT_DIR"
158+
RPC_COMMITMENT_HISTORY=$RPC_COMMITMENT_HISTORY "$TEST_SCRIPT" "$WORKSPACE" "$RESULT_DIR"
155159
TEST_EXIT=$?
156160
set -e
157161

.github/workflows/scripts/run_rpc_tests_remote_ethereum.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ DISABLED_TEST_LIST=(
3737
DISABLED_TESTS=$(IFS=,; echo "${DISABLED_TEST_LIST[*]}")
3838

3939
# Call the main test runner script with the required and optional parameters
40-
"$(dirname "$0")/run_rpc_tests.sh" mainnet "$RPC_VERSION" "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR"
40+
RPC_COMMITMENT_HISTORY=true "$(dirname "$0")/run_rpc_tests.sh" mainnet "$RPC_VERSION" "$DISABLED_TESTS" "$WORKSPACE" "$RESULT_DIR"

0 commit comments

Comments
 (0)