Skip to content

Commit 17c5cb1

Browse files
authored
chore(ci): generate genesis files for benchmark releases (#1778)
1 parent c53b619 commit 17c5cb1

File tree

3 files changed

+143
-1
lines changed

3 files changed

+143
-1
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Build Benchmark Genesis Asset
2+
description: Generate benchmark_genesis.tar.gz from benchmark fixtures using Hive
3+
inputs:
4+
fixtures_path:
5+
description: "Path to the benchmark fixtures tarball"
6+
required: true
7+
outputs:
8+
genesis_tarball:
9+
description: "Path to the generated benchmark_genesis.tar.gz"
10+
value: ${{ steps.create-tarball.outputs.path }}
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: Checkout Hive
15+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
16+
with:
17+
repository: ethereum/hive
18+
ref: master
19+
path: hive
20+
21+
- name: Setup Go for Hive
22+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
23+
with:
24+
go-version: ">=1.24"
25+
cache-dependency-path: hive/go.sum
26+
27+
- name: Build Hive
28+
shell: bash
29+
run: |
30+
cd hive
31+
go build .
32+
33+
- name: Extract benchmark fixtures
34+
shell: bash
35+
run: |
36+
echo "Extracting fixtures from ${{ inputs.fixtures_path }}"
37+
tar -xzf "${{ inputs.fixtures_path }}"
38+
echo "Fixtures extracted successfully"
39+
40+
- name: Start Hive in dev mode
41+
shell: bash
42+
run: |
43+
cd hive
44+
./hive --dev \
45+
--client besu,go-ethereum,nethermind \
46+
--client-file ../.github/configs/hive/latest_client_releases.yaml \
47+
--docker.output &
48+
49+
echo "Waiting for Hive to be ready..."
50+
for i in {1..30}; do
51+
if curl -s http://127.0.0.1:3000 > /dev/null 2>&1; then
52+
echo "Hive is ready!"
53+
exit 0
54+
fi
55+
echo "Waiting... ($i/30)"
56+
sleep 2
57+
done
58+
echo "Hive failed to start within timeout"
59+
exit 1
60+
61+
- name: Extract genesis configs from clients
62+
shell: bash
63+
env:
64+
HIVE_SIMULATOR: http://127.0.0.1:3000
65+
run: |
66+
echo "Running extract_config for benchmark fixtures..."
67+
uv run extract_config \
68+
--fixture fixtures/blockchain_tests_engine_x/pre_alloc/ \
69+
--output genesis/ \
70+
--hive-url http://127.0.0.1:3000
71+
72+
echo "Genesis configs extracted successfully"
73+
ls -la genesis/
74+
75+
- name: Create benchmark_genesis.tar.gz
76+
id: create-tarball
77+
shell: bash
78+
run: |
79+
tar czf benchmark_genesis.tar.gz genesis/
80+
echo "Created benchmark_genesis.tar.gz"
81+
ls -lh benchmark_genesis.tar.gz
82+
echo "path=benchmark_genesis.tar.gz" >> "$GITHUB_OUTPUT"

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,18 @@ runs:
3838
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 }}
3939
else
4040
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 }}
41-
fi
41+
fi
42+
- name: Generate Benchmark Genesis Files
43+
if: contains(inputs.release_name, 'benchmark')
44+
uses: ./.github/actions/build-benchmark-genesis
45+
with:
46+
fixtures_path: fixtures_${{ inputs.release_name }}.tar.gz
47+
- name: Upload Benchmark Genesis Artifact
48+
if: contains(inputs.release_name, 'benchmark')
49+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
50+
with:
51+
name: benchmark_genesis_${{ inputs.release_name }}
52+
path: benchmark_genesis.tar.gz
4253
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
4354
with:
4455
name: fixtures_${{ inputs.release_name }}

.github/configs/hive/latest.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Hive client configuration file with latest release images
2+
3+
# Geth (Go-Ethereum)
4+
# Docker Hub: https://hub.docker.com/r/ethereum/client-go
5+
- client: go-ethereum
6+
nametag: ""
7+
build_args:
8+
baseimage: docker.io/ethereum/client-go
9+
tag: latest
10+
11+
# Nethermind
12+
# Docker Hub: https://hub.docker.com/r/nethermind/nethermind
13+
- client: nethermind
14+
nametag: ""
15+
build_args:
16+
baseimage: docker.io/nethermind/nethermind
17+
tag: latest
18+
19+
# Besu (Hyperledger Besu)
20+
# Docker Hub: https://hub.docker.com/r/hyperledger/besu
21+
- client: besu
22+
nametag: ""
23+
build_args:
24+
baseimage: docker.io/hyperledger/besu
25+
tag: latest
26+
27+
# Reth (Paradigm)
28+
# GHCR: https://ghcr.io/paradigmxyz/reth
29+
- client: reth
30+
nametag: ""
31+
build_args:
32+
baseimage: ghcr.io/paradigmxyz/reth
33+
tag: latest
34+
35+
# Erigon
36+
# Docker Hub: https://hub.docker.com/r/erigontech/erigon
37+
- client: erigon
38+
nametag: ""
39+
build_args:
40+
baseimage: docker.io/erigontech/erigon
41+
tag: latest
42+
43+
# Nimbus Execution Layer (nimbus-eth1)
44+
# Docker Hub: https://hub.docker.com/r/statusim/nimbus-eth1
45+
- client: nimbus-el
46+
nametag: "" # latest-release
47+
build_args:
48+
baseimage: docker.io/statusim/nimbus-eth1
49+
tag: linux-amd64-latest

0 commit comments

Comments
 (0)