Skip to content

Commit 30e0438

Browse files
committed
Merge tag 'tests-bal@v5.6.1' into projects/zkevm-bal-devnet-3
2 parents e2ff4cc + ab170cb commit 30e0438

316 files changed

Lines changed: 23457 additions & 1094 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/build-fixtures/action.yaml

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ inputs:
44
release_name:
55
description: "Name of the fixture release"
66
required: true
7+
from_fork:
8+
description: "Fill from this fork (inclusive). Empty for unsplit builds."
9+
default: ""
10+
until_fork:
11+
description: "Fill until this fork (inclusive). Empty for unsplit builds."
12+
default: ""
13+
split_label:
14+
description: "Label for this fork-range split. Empty for unsplit builds."
15+
default: ""
716
runs:
817
using: "composite"
918
steps:
@@ -25,28 +34,53 @@ runs:
2534
with:
2635
type: ${{ steps.properties.outputs.evm-type }}
2736
- name: Install pigz for parallel tarball compression
37+
if: inputs.split_label == ''
2838
shell: bash
2939
run: sudo apt-get install -y pigz
3040
- name: Generate fixtures using fill
3141
shell: bash
3242
run: |
43+
IS_SPLIT="${{ inputs.split_label }}"
44+
45+
if [ -n "$IS_SPLIT" ]; then
46+
OUTPUT_ARG="--output=fixtures_${{ inputs.release_name }}"
47+
FORK_ARGS="--generate-all-formats --from=${{ inputs.from_fork }} --until=${{ inputs.until_fork }}"
48+
else
49+
OUTPUT_ARG="--output=fixtures_${{ inputs.release_name }}.tar.gz"
50+
FORK_ARGS=""
51+
fi
52+
53+
# Allow exit code 5 (NO_TESTS_COLLECTED) for fork ranges with no tests.
54+
EXIT_CODE=0
3355
if [ "${{ steps.evm-builder.outputs.impl }}" = "eels" ]; then
34-
uv run fill -n ${{ steps.evm-builder.outputs.x-dist }} ${{ steps.properties.outputs.fill-params }} --output=fixtures_${{ inputs.release_name }}.tar.gz --build-name ${{ inputs.release_name }} --no-html --durations=100 --log-level=DEBUG
56+
uv run fill -n ${{ steps.evm-builder.outputs.x-dist }} ${{ steps.properties.outputs.fill-params }} $FORK_ARGS $OUTPUT_ARG --build-name ${{ inputs.release_name }} --no-html --durations=100 --log-level=DEBUG || EXIT_CODE=$?
3557
else
36-
uv run fill -n ${{ steps.evm-builder.outputs.x-dist }} --evm-bin=${{ steps.evm-builder.outputs.evm-bin }} ${{ steps.properties.outputs.fill-params }} --output=fixtures_${{ inputs.release_name }}.tar.gz --build-name ${{ inputs.release_name }} --no-html --durations=100 --log-level=DEBUG
58+
uv run fill -n ${{ steps.evm-builder.outputs.x-dist }} --evm-bin=${{ steps.evm-builder.outputs.evm-bin }} ${{ steps.properties.outputs.fill-params }} $FORK_ARGS $OUTPUT_ARG --build-name ${{ inputs.release_name }} --no-html --durations=100 --log-level=DEBUG || EXIT_CODE=$?
59+
fi
60+
if [ "$EXIT_CODE" -ne 0 ] && [ "$EXIT_CODE" -ne 5 ]; then
61+
exit "$EXIT_CODE"
3762
fi
3863
- name: Generate Benchmark Genesis Files
39-
if: contains(inputs.release_name, 'benchmark')
64+
if: inputs.split_label == '' && contains(inputs.release_name, 'benchmark')
4065
uses: ./.github/actions/build-benchmark-genesis
4166
with:
4267
fixtures_path: fixtures_${{ inputs.release_name }}.tar.gz
4368
- name: Upload Benchmark Genesis Artifact
44-
if: contains(inputs.release_name, 'benchmark')
69+
if: inputs.split_label == '' && contains(inputs.release_name, 'benchmark')
4570
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
4671
with:
4772
name: benchmark_genesis_${{ inputs.release_name }}
4873
path: benchmark_genesis.tar.gz
49-
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
74+
- name: Upload fixture tarball (unsplit)
75+
if: inputs.split_label == ''
76+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
5077
with:
5178
name: fixtures_${{ inputs.release_name }}
5279
path: fixtures_${{ inputs.release_name }}.tar.gz
80+
- name: Upload fixture directory (split)
81+
if: inputs.split_label != ''
82+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
83+
with:
84+
name: fixtures__${{ inputs.split_label }}
85+
path: fixtures_${{ inputs.release_name }}/
86+
if-no-files-found: ignore

.github/configs/evm.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
stable:
2-
impl: eels
3-
repo: null
4-
ref: null
5-
develop:
1+
eels:
62
impl: eels
73
repo: null
84
ref: null

.github/configs/feature.yaml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,45 @@
11
# Unless filling for special features, all features should fill for previous forks (starting from Frontier) too
2-
stable:
3-
evm-type: stable
4-
fill-params: --until=Prague --fill-static-tests --ignore=tests/static/state_tests/stQuadraticComplexityTest
2+
#
3+
# Shared fork ranges for splitting multi-fork releases across parallel runners.
4+
# Features using --until are automatically split using applicable ranges.
5+
# Features using --fork (single fork) are never split.
6+
fork-ranges:
7+
- label: pre-cancun
8+
from: Frontier
9+
until: Shanghai
10+
- label: cancun
11+
from: Cancun
12+
until: Cancun
13+
- label: prague
14+
from: Prague
15+
until: Prague
16+
- label: osaka
17+
from: Osaka
18+
until: Osaka
19+
- label: bpo
20+
from: BPO1
21+
until: BPO2
22+
- label: amsterdam
23+
from: Amsterdam
24+
until: Amsterdam
525

6-
develop:
7-
evm-type: develop
8-
fill-params: --until=BPO4 --fill-static-tests --ignore=tests/static/state_tests/stQuadraticComplexityTest
26+
mainnet:
27+
evm-type: eels
28+
fill-params: --until=BPO2 --fill-static-tests --ignore=tests/static/state_tests/stQuadraticComplexityTest
929

1030
benchmark:
1131
evm-type: benchmark
1232
fill-params: --fork=Osaka --gas-benchmark-values 1,5,10,30,60,100,150 ./tests/benchmark/compute --maxprocesses=30 --dist=worksteal
33+
feature_only: true
1334

1435
benchmark_fast:
1536
evm-type: benchmark
1637
fill-params: --fork=Osaka --gas-benchmark-values 100 ./tests/benchmark/compute
1738
feature_only: true
1839

1940
bal:
20-
evm-type: develop
21-
fill-params: --fork=Amsterdam --fill-static-tests
41+
evm-type: eels
42+
fill-params: --until=Amsterdam -x
2243
feature_only: true
2344

2445
zkevm:
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/usr/bin/env -S uv run --script
2+
#
3+
# /// script
4+
# requires-python = ">=3.12"
5+
# dependencies = []
6+
# ///
7+
"""
8+
Create a release tarball from a merged fixture directory.
9+
10+
Archive all ``.json`` and ``.ini`` files under a ``fixtures/`` prefix,
11+
matching the structure produced by
12+
``execution_testing.cli.pytest_commands.plugins.shared.fixture_output``.
13+
14+
Use ``pigz`` for parallel compression when available, otherwise fall
15+
back to Python's built-in gzip.
16+
"""
17+
18+
import shutil
19+
import subprocess
20+
import sys
21+
import tarfile
22+
import warnings
23+
from pathlib import Path
24+
25+
26+
def create_tarball_with_pigz(source_dir: Path, output_path: Path) -> None:
27+
"""Create tarball using Python tarfile + pigz for parallel compression."""
28+
temp_tar = output_path.with_suffix("") # strip .gz
29+
30+
with tarfile.open(temp_tar, "w") as tar:
31+
for file in sorted(source_dir.rglob("*")):
32+
if file.is_file() and file.suffix in {".json", ".ini"}:
33+
arcname = Path("fixtures") / file.relative_to(source_dir)
34+
tar.add(file, arcname=str(arcname))
35+
36+
subprocess.run(
37+
["pigz", "-f", str(temp_tar)],
38+
check=True,
39+
capture_output=True,
40+
)
41+
42+
43+
def create_tarball_standard(source_dir: Path, output_path: Path) -> None:
44+
"""Create tarball using Python's tarfile module (single-threaded)."""
45+
with tarfile.open(output_path, "w:gz") as tar:
46+
for file in sorted(source_dir.rglob("*")):
47+
if file.is_file() and file.suffix in {".json", ".ini"}:
48+
arcname = Path("fixtures") / file.relative_to(source_dir)
49+
tar.add(file, arcname=str(arcname))
50+
51+
52+
def main() -> None:
53+
"""Entry point."""
54+
if len(sys.argv) != 3:
55+
print(
56+
"Usage: create_release_tarball.py <source_dir> <output.tar.gz>",
57+
file=sys.stderr,
58+
)
59+
sys.exit(1)
60+
61+
source_dir = Path(sys.argv[1])
62+
output_path = Path(sys.argv[2])
63+
64+
if not source_dir.is_dir():
65+
print(f"Error: '{source_dir}' is not a directory.", file=sys.stderr)
66+
sys.exit(1)
67+
68+
if shutil.which("pigz"):
69+
try:
70+
create_tarball_with_pigz(source_dir, output_path)
71+
except (subprocess.CalledProcessError, OSError) as e:
72+
warnings.warn(
73+
f"pigz failed ({type(e).__name__}: {e}), falling back to gzip",
74+
stacklevel=2,
75+
)
76+
create_tarball_standard(source_dir, output_path)
77+
else:
78+
create_tarball_standard(source_dir, output_path)
79+
80+
print(f"Created {output_path}")
81+
82+
83+
if __name__ == "__main__":
84+
main()

0 commit comments

Comments
 (0)