Skip to content

Commit 1ebc77f

Browse files
committed
support external t8n stateless input/output generation
1 parent 8d7e68f commit 1ebc77f

2 files changed

Lines changed: 403 additions & 0 deletions

File tree

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Benchmark Fill Parity
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
inputs:
7+
geth_repo:
8+
description: "Geth repository to build"
9+
required: false
10+
type: string
11+
default: "jsign/go-ethereum"
12+
geth_branch:
13+
description: "Geth branch to build"
14+
required: false
15+
type: string
16+
default: "jsign-master-t8n-fill-executionwitness"
17+
benchmark_file:
18+
description: "Benchmark test file to fill"
19+
required: false
20+
type: string
21+
default: "tests/benchmark/compute/instruction/test_memory.py"
22+
fill_fork:
23+
description: "Fork to fill"
24+
required: false
25+
type: string
26+
default: "Amsterdam"
27+
xdist_workers:
28+
description: "Number of fill workers"
29+
required: false
30+
type: string
31+
default: "auto"
32+
33+
concurrency:
34+
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
35+
cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch }}
36+
37+
env:
38+
GETH_REPO: ${{ inputs.geth_repo || 'jsign/go-ethereum' }}
39+
GETH_BRANCH: ${{ inputs.geth_branch || 'jsign-master-t8n-fill-executionwitness' }}
40+
BENCHMARK_FILE: ${{ inputs.benchmark_file || 'tests/benchmark/compute/instruction/test_memory.py' }}
41+
FILL_FORK: ${{ inputs.fill_fork || 'Amsterdam' }}
42+
XDIST_WORKERS: ${{ inputs.xdist_workers || 'auto' }}
43+
44+
jobs:
45+
compare-fills:
46+
name: Compare Python and Geth fills
47+
runs-on: ubuntu-latest
48+
timeout-minutes: 120
49+
steps:
50+
- name: Checkout repository
51+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
52+
with:
53+
submodules: true
54+
55+
- name: Setup uv
56+
uses: ./.github/actions/setup-uv
57+
with:
58+
enable-cache: "false"
59+
60+
- name: Install dependencies
61+
run: uv sync --no-progress
62+
63+
- name: Build Geth evm
64+
uses: ./.github/actions/build-evm-client/geth
65+
with:
66+
repo: ${{ env.GETH_REPO }}
67+
ref: ${{ env.GETH_BRANCH }}
68+
69+
- name: Validate benchmark file input
70+
shell: bash
71+
run: |
72+
case "$BENCHMARK_FILE" in
73+
./*)
74+
echo "benchmark_file must be relative to the repository root without a leading ./"
75+
exit 1
76+
;;
77+
tests/benchmark/*.py)
78+
;;
79+
*)
80+
echo "benchmark_file must be a Python file under tests/benchmark/"
81+
exit 1
82+
;;
83+
esac
84+
85+
if [ ! -f "$BENCHMARK_FILE" ]; then
86+
echo "benchmark_file does not exist: $BENCHMARK_FILE"
87+
exit 1
88+
fi
89+
90+
- name: Prepare fill directories
91+
run: mkdir -p fill_tmp/python fill_tmp/geth fill_logs/python fill_logs/geth
92+
93+
- name: Fill benchmark with Python spec
94+
run: |
95+
uv run fill \
96+
--clean \
97+
--gas-benchmark-values 1 \
98+
--fork "$FILL_FORK" \
99+
-m blockchain_test \
100+
-n "$XDIST_WORKERS" \
101+
--output=fixtures_python \
102+
--no-html \
103+
--basetemp=fill_tmp/python \
104+
--log-to fill_logs/python \
105+
"$BENCHMARK_FILE"
106+
107+
- name: Fill benchmark with Geth
108+
run: |
109+
uv run fill \
110+
--clean \
111+
--gas-benchmark-values 1 \
112+
--fork "$FILL_FORK" \
113+
--evm-bin=evm \
114+
-m blockchain_test \
115+
-n "$XDIST_WORKERS" \
116+
--output=fixtures_geth \
117+
--no-html \
118+
--basetemp=fill_tmp/geth \
119+
--log-to fill_logs/geth \
120+
"$BENCHMARK_FILE"
121+
122+
- name: Compare fixture hashes
123+
run: uv run hasher compare fixtures_python fixtures_geth
124+
125+
- name: Upload failure artifacts
126+
if: failure()
127+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
128+
with:
129+
name: benchmark-fill-parity-debug
130+
path: |
131+
fixtures_python/
132+
fixtures_geth/
133+
fill_logs/
134+
if-no-files-found: ignore

0 commit comments

Comments
 (0)