Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 8 additions & 33 deletions .github/actions/build-benchmark-genesis/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,43 +39,18 @@ runs:

- name: Start Hive in dev mode
id: start-hive
uses: ./.github/actions/start-hive-dev
with:
clients: besu,go-ethereum,nethermind
client-file: .github/configs/hive/latest.yaml
hive-path: hive

- name: Extract genesis configs
shell: bash
env:
HIVE_SIMULATOR: http://127.0.0.1:3000
HIVE_SIMULATOR: ${{ steps.start-hive.outputs.hive-url }}
run: |
cd hive
./hive --dev \
--client besu,go-ethereum,nethermind \
--client-file ../.github/configs/hive/latest.yaml \
--docker.output &
export HIVE_PID=$!

echo "Waiting for Hive to be ready, pid=$HIVE_PID"
deadline=$((SECONDS + 600))

while :; do
# condition 1: time is up
if (( SECONDS >= deadline )); then
echo "Hive failed to start within timeout"
exit 1
fi

# condition 2: process exited
if ! kill -0 "$HIVE_PID" 2>/dev/null; then
echo "Hive process died"
exit 1
fi

# condition 3: curl succeeded
if curl -s $HIVE_SIMULATOR > /dev/null; then
echo "Hive is ready!"
break
fi
sleep 1
done

echo "Running extract_config for benchmark fixtures..."
cd ..
uv run extract_config \
--fixture fixtures/blockchain_tests_engine_x/pre_alloc/ \
--output genesis/ \
Expand Down
63 changes: 63 additions & 0 deletions .github/actions/start-hive-dev/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Start Hive in Dev Mode
description: Start Hive simulator API in dev mode with robust waiting

inputs:
clients:
description: "Comma-separated list of clients to use"
required: true
client-file:
description: "Path to YAML file with client configurations"
required: true
timeout:
description: "Timeout in seconds waiting for Hive to be ready"
required: false
default: "600"
hive-path:
description: "Path to hive directory (must be checked out and built)"
required: false
default: "hive"

outputs:
hive-url:
description: "URL of the Hive simulator API"
value: ${{ steps.start.outputs.hive-url }}

runs:
using: "composite"
steps:
- name: Start Hive dev mode
id: start
shell: bash
run: |
cd "${{ inputs.hive-path }}"

./hive --dev \
--client "${{ inputs.clients }}" \
--client-file "../${{ inputs.client-file }}" \
--docker.output &
HIVE_PID=$!

HIVE_URL="http://127.0.0.1:3000"
echo "hive-url=$HIVE_URL" >> "$GITHUB_OUTPUT"

echo "Waiting for Hive to be ready (pid=$HIVE_PID, timeout=${{ inputs.timeout }}s)..."
deadline=$((SECONDS + ${{ inputs.timeout }}))

while :; do
if (( SECONDS >= deadline )); then
echo "::error::Hive failed to start within ${{ inputs.timeout }}s timeout"
exit 1
fi

if ! kill -0 "$HIVE_PID" 2>/dev/null; then
echo "::error::Hive process died unexpectedly"
exit 1
fi

if curl -s "$HIVE_URL" > /dev/null; then
echo "Hive is ready at $HIVE_URL"
exit 0
fi

sleep 1
done
43 changes: 19 additions & 24 deletions .github/workflows/hive-consume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ name: Hive Consume Tests
on:
push:
branches:
- 'forks/**'
- "forks/**"
pull_request:
paths:
- '.github/workflows/hive-consume.yaml'
- 'packages/testing/src/execution_testing/cli/pytest_commands/consume.py'
- 'packages/testing/src/execution_testing/cli/pytest_commands/pytest_ini_files/pytest-consume.ini'
- 'packages/testing/src/execution_testing/cli/pytest_commands/plugins/consume/**'
- 'packages/testing/src/execution_testing/cli/pytest_commands/plugins/pytest_hive/**'
- 'packages/testing/src/execution_testing/fixtures/consume.py'
- 'packages/testing/src/execution_testing/rpc/**'
- ".github/workflows/hive-consume.yaml"
- "packages/testing/src/execution_testing/cli/pytest_commands/consume.py"
- "packages/testing/src/execution_testing/cli/pytest_commands/pytest_ini_files/pytest-consume.ini"
- "packages/testing/src/execution_testing/cli/pytest_commands/plugins/consume/**"
- "packages/testing/src/execution_testing/cli/pytest_commands/plugins/pytest_hive/**"
- "packages/testing/src/execution_testing/fixtures/consume.py"
- "packages/testing/src/execution_testing/rpc/**"
workflow_dispatch:

concurrency:
Expand All @@ -26,7 +26,7 @@ env:
jobs:
test-hive:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
runs-on: [self-hosted-ghr, size-l-x64]
strategy:
fail-fast: true
matrix:
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Setup go env and cache
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: '>=1.24'
go-version: ">=1.24"
cache-dependency-path: hive/go.sum

- name: Install uv and python
Expand All @@ -83,31 +83,26 @@ jobs:
./hive --sim '${{ matrix.simulator }}' \
--sim.parallelism=1 \
--client go-ethereum \
--client-file ../execution-specs/.github/configs/hive/master.yaml \
--client-file ../execution-specs/.github/configs/hive/latest.yaml \
--sim.buildarg fixtures=${{ env.FIXTURES_URL }} \
--sim.limit=".*test_block_at_rlp_limit_with_logs.*Osaka.*" \
--docker.output

- name: Start Hive in dev mode
if: matrix.mode == 'dev'
run: |
cd hive
./hive --dev --client go-ethereum --client-file ../execution-specs/.github/configs/hive/master.yaml --docker.output &
echo "Waiting for Hive to be ready..."
for i in {1..30}; do
if curl -s http://127.0.0.1:3000 > /dev/null 2>&1; then
echo "Hive is ready!"
break
fi
echo "Waiting... ($i/30)"
sleep 2
done
id: start-hive
uses: ./execution-specs/.github/actions/start-hive-dev
with:
clients: go-ethereum
client-file: execution-specs/.github/configs/hive/latest.yaml
hive-path: hive
timeout: "120"

- name: Run consume in dev mode
if: matrix.mode == 'dev'
working-directory: execution-specs
env:
HIVE_SIMULATOR: http://127.0.0.1:3000
HIVE_SIMULATOR: ${{ steps.start-hive.outputs.hive-url }}
run: |
uv sync --all-extras
uv run consume ${{ matrix.consume_command }} --input ${{ env.FIXTURES_URL }} -k "Osaka and test_block_at_rlp_limit_with_logs"
Loading