Skip to content
Open
123 changes: 123 additions & 0 deletions .github/workflows/hive-consume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Hive Consume Tests

on:
push:
branches:
- '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/**'
workflow_dispatch:

concurrency:
group: hive-consume-${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

jobs:
test-hive:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- name: consume-engine
mode: simulator
simulator: ethereum/eels/consume-engine
- name: consume-rlp
mode: simulator
simulator: ethereum/eels/consume-rlp
- name: consume-sync
mode: simulator
simulator: ethereum/eels/consume-sync
- name: dev-mode
mode: dev
consume_command: engine
steps:
- name: Checkout execution-specs
if: matrix.mode == 'dev'
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
path: execution-specs

- name: Checkout Hive
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
repository: ethereum/hive
ref: master
path: hive

- name: Setup go env and cache
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: '>=1.24'
cache-dependency-path: hive/go.sum

- name: Install uv and python
if: matrix.mode == 'dev'
uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182
with:
enable-cache: true
cache-dependency-glob: "execution-specs/uv.lock"
version: ${{ vars.UV_VERSION }}
python-version: ${{ vars.DEFAULT_PYTHON_VERSION }}

- name: Pre-pull geth docker image
run: docker pull docker.ethquokkaops.io/dh/ethpandaops/geth:master

- name: Create clients.yaml
run: |
cat > hive/clients.yaml << 'EOF'
- client: go-ethereum
nametag: default
build_args:
baseimage: docker.ethquokkaops.io/dh/ethpandaops/geth
tag: master
EOF

- name: Build hive
run: |
cd hive
go build .

- name: Run simulator tests
if: matrix.mode == 'simulator'
run: |
cd hive
./hive --sim '${{ matrix.simulator }}' \
--sim.parallelism=1 \
--client go-ethereum \
--client-file clients.yaml \
--sim.buildarg fixtures=develop@v5.3.0 \
--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 clients.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

- name: Run consume in dev mode
if: matrix.mode == 'dev'
working-directory: execution-specs
env:
HIVE_SIMULATOR: http://127.0.0.1:3000
run: |
uv sync --all-extras
uv run consume ${{ matrix.consume_command }} --input develop@v5.3.0 -k "Osaka and test_block_at_rlp_limit_with_logs"
2 changes: 1 addition & 1 deletion packages/testing/src/execution_testing/cli/eofwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ def _wrap_fixture(

test = BlockchainTest(
genesis_environment=env,
fork=EOFv1,
pre=pre.root,
post=fixture.post_state.root if fixture.post_state else {},
blocks=[],
Expand Down Expand Up @@ -373,7 +374,6 @@ def _wrap_fixture(

result = test.generate(
t8n=t8n,
fork=EOFv1,
fixture_format=BlockchainFixture,
)
assert isinstance(result, BlockchainFixture)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def build_blocktest(
# Generate fixture
fixture = test.generate(
t8n=self.t8n,
fork=fork,
fixture_format=BlockchainFixture,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def blockchain_test_from_fuzzer(

return BlockchainTest(
pre=pre,
fork=fork,
blocks=blocks,
post={}, # Post-state verification can be added later
genesis_environment=genesis_env,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def generate_fixture(self, test_params: Dict[str, Any]) -> Dict[str, Any]:
# Create test
test = BlockchainTest(
genesis_environment=test_params["genesis_environment"],
fork=fork,
pre=test_params["pre"],
post=test_params["post"],
blocks=test_params["blocks"],
Expand All @@ -210,7 +211,6 @@ def generate_fixture(self, test_params: Dict[str, Any]) -> Dict[str, Any]:
# Generate fixture
fixture = test.generate(
t8n=self.t8n,
fork=fork,
fixture_format=BlockchainFixture,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
kwargs["expected_benchmark_gas_used"] = (
request.getfixturevalue("gas_benchmark_value")
)
kwargs["fork"] = fork
kwargs |= {
p: request.getfixturevalue(p)
for p in cls_fixture_parameters
Expand Down Expand Up @@ -436,9 +437,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
[str(eoa) for eoa in pre._funded_eoa]
)

execute = self.execute(
fork=fork, execute_format=execute_format
)
execute = self.execute(execute_format=execute_format)
execute.execute(
fork=fork,
eth_rpc=eth_rpc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
Alloc,
ReferenceSpec,
)
from execution_testing.client_clis import TransitionTool
from execution_testing.client_clis.clis.geth import FixtureConsumerTool
from execution_testing.cli.gen_index import (
generate_fixtures_index,
)
from execution_testing.client_clis import TransitionTool
from execution_testing.client_clis.clis.geth import FixtureConsumerTool
from execution_testing.fixtures import (
BaseFixture,
FixtureCollector,
Expand Down Expand Up @@ -1350,6 +1350,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
kwargs["pre"] = pre
if "expected_benchmark_gas_used" not in kwargs:
kwargs["expected_benchmark_gas_used"] = gas_benchmark_value
kwargs["fork"] = fork
kwargs |= {
p: request.getfixturevalue(p)
for p in cls_fixture_parameters
Expand Down Expand Up @@ -1380,7 +1381,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
# Use the original update_pre_alloc_groups method which
# returns the groups
self.update_pre_alloc_groups(
session.pre_alloc_groups, fork, request.node.nodeid
session.pre_alloc_groups, request.node.nodeid
)
return # Skip fixture generation in phase 1

Expand All @@ -1391,15 +1392,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
FixtureFillingPhase.PRE_ALLOC_GENERATION
in fixture_format.format_phases
):
pre_alloc_hash = self.compute_pre_alloc_group_hash(
fork=fork
)
pre_alloc_hash = self.compute_pre_alloc_group_hash()
group = session.get_pre_alloc_group(pre_alloc_hash)
self.pre = group.pre
try:
fixture = self.generate(
t8n=t8n,
fork=fork,
fixture_format=fixture_format,
)
finally:
Expand Down
Loading
Loading