Skip to content

feat(l1): add discv5 session structures and remaining official vector tests #18100

feat(l1): add discv5 session structures and remaining official vector tests

feat(l1): add discv5 session structures and remaining official vector tests #18100

Workflow file for this run

name: L1
on:
push:
branches: ["main"]
merge_group:
pull_request:
branches: ["**"]
permissions:
contents: read
actions: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.finish.outputs.run_tests }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
run_tests:
- '!crates/l2/**'
- name: finish
id: finish
run: |
if [[ "${GITHUB_EVENT_NAME}" != "pull_request" ]]; then
echo "run_tests=true" >> "$GITHUB_OUTPUT"
else
echo "run_tests=${{ steps.filter.outputs.run_tests }}" >> "$GITHUB_OUTPUT"
fi
- name: Print result
run: echo "run_tests=${{ steps.finish.outputs.run_tests }}"
lint:
# "Lint" is a required check, don't change the name
name: Lint
runs-on: ubuntu-latest
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Free Disk Space
uses: ./.github/actions/free-disk
- name: Setup Rust Environment
uses: ./.github/actions/setup-rust
with:
components: rustfmt, clippy
# We don't run with workspace, as members of the workspace require l2. We run it with workspace
# om the l2 lint
- name: Run cargo check
run: cargo check
- name: Run cargo clippy
run: |
cargo clippy -- -D warnings
- name: Run cargo fmt
run: |
cargo fmt --all -- --check
- name: Run tooling cargo check
run: cargo check --workspace --all-targets
working-directory: tooling
- name: Run tooling cargo clippy
run: cargo clippy --workspace --all-targets -- -D warnings
working-directory: tooling
- name: Run tooling cargo fmt
run: cargo fmt --all -- --check
working-directory: tooling
test:
name: Test - ${{ matrix.runner }}
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner: [ubuntu-22.04, ubuntu-22.04-arm, macos-15]
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Free Disk Space
uses: ./.github/actions/free-disk
- name: Setup Rust Environment
uses: ./.github/actions/setup-rust
- name: Run unit tests
run: |
cargo test --workspace --exclude ethrex-l2
- name: Run Blockchain EF tests
if: ${{ github.event_name != 'merge_group' }}
run: |
make -C tooling/ef_tests/blockchain test
docker_build:
name: Build Docker
runs-on: ubuntu-latest
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Free Disk Space
uses: ./.github/actions/free-disk
- id: docker
name: Build Ethrex Docker Image
uses: ./.github/actions/build-docker
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ethrex_image
path: /tmp/ethrex_image.tar
run-assertoor:
name: Assertoor - ${{ matrix.name }}
runs-on: ubuntu-latest
needs: [detect-changes, docker_build]
if: ${{ needs.detect-changes.outputs.run_tests == 'true' && github.event_name != 'merge_group' }}
strategy:
fail-fast: true
matrix:
include:
- name: Transaction Check
enclave_name: "ethrex-assertoor-tx"
ethereum_package_args: "./.github/config/assertoor/network_params_tx.yaml"
- name: Blob & Stability Check
enclave_name: "ethrex-assertoor-blob"
ethereum_package_args: "./.github/config/assertoor/network_params_blob.yaml"
# Flaky, reenable when fixed
# - name: Ethrex Only With Different Consensus Clients Check
# enclave_name: "ethrex-different-consensus-assertoor"
# ethereum_package_args: "./.github/config/assertoor/network_params_ethrex_multiple_cl.yaml"
steps:
- uses: actions/checkout@v4
- name: Download etherex image artifact
uses: actions/download-artifact@v4
with:
name: ethrex_image
path: /tmp
- name: Load image
run: |
docker load --input /tmp/ethrex_image.tar
- name: Run assertoor
uses: ethpandaops/kurtosis-assertoor-github-action@v1
with:
enclave_name: ${{ matrix.enclave_name }}
kurtosis_version: "1.10.2"
ethereum_package_url: "github.com/ethpandaops/ethereum-package"
ethereum_package_branch: "82e5a7178138d892c0c31c3839c89d53ffd42d9a"
ethereum_package_args: ${{ matrix.ethereum_package_args }}
run-hive:
name: Hive - ${{ matrix.name }}
runs-on: ubuntu-latest
needs: [detect-changes, docker_build]
if: ${{ needs.detect-changes.outputs.run_tests == 'true' && github.event_name != 'merge_group' }}
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
include:
- name: "Rpc Compat tests"
simulation: ethereum/rpc-compat
# https://github.com/ethereum/execution-apis/pull/627 changed the simulation to use a pre-merge genesis block, so we need to pin to a commit before that
buildarg: "branch=d08382ae5c808680e976fce4b73f4ba91647199b"
artifact_prefix: rpc_compat
- name: "Devp2p tests"
simulation: devp2p
limit: discv4|eth|snap
artifact_prefix: devp2p
- name: "Engine Auth and EC tests"
simulation: ethereum/engine
limit: engine-(auth|exchange-capabilities)/
artifact_prefix: engine_auth_ec
- name: "Cancun Engine tests"
simulation: ethereum/engine
limit: "engine-cancun"
artifact_prefix: engine_cancun
- name: "Paris Engine tests"
simulation: ethereum/engine
limit: "engine-api"
artifact_prefix: engine_paris
- name: "Engine withdrawal tests"
simulation: ethereum/engine
limit: "engine-withdrawals"
artifact_prefix: engine_withdrawals
# Investigate this test
# - name: "Sync"
# simulation: ethereum/sync
# limit: ""
# artifact_prefix: sync
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Download ethrex image artifact
uses: actions/download-artifact@v4
with:
name: ethrex_image
path: /tmp
- name: Load image
run: |
docker load --input /tmp/ethrex_image.tar
- name: Load hive client config
id: client-config
shell: bash
run: |
{
echo "config<<EOF"
cat .github/config/hive/clients.yaml
echo "EOF"
} >>"$GITHUB_OUTPUT"
- name: Determine hive flags
id: hive-flags
shell: bash
env:
SIM_LIMIT: ${{ matrix.limit }}
SIM_BUILDARG: ${{ matrix.buildarg }}
run: |
FLAGS='--sim.parallelism 4 --sim.loglevel 3'
if [[ -n "$SIM_LIMIT" ]]; then
escaped_limit=${SIM_LIMIT//\'/\'\\\'\'}
FLAGS+=" --sim.limit '$escaped_limit'"
fi
if [[ -n "$SIM_BUILDARG" ]]; then
FLAGS+=" --sim.buildarg $SIM_BUILDARG"
fi
echo "flags=$FLAGS" >> "$GITHUB_OUTPUT"
- name: Log in to the Container registry
if: ${{ env.DOCKERHUB_TOKEN != '' }}
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}
- name: Run Hive Simulation
id: run-hive-action
uses: ethpandaops/hive-github-action@v0.5.0
with:
hive_repository: ethereum/hive
hive_version: 7709e5892146c793307da072e1593f48039a7e4b
simulator: ${{ matrix.simulation }}
client: ethrex
client_config: ${{ steps.client-config.outputs.config }}
extra_flags: ${{ steps.hive-flags.outputs.flags }}
- name: Check Hive Results For Failures
id: verify-hive-results
if: ${{ success() }}
shell: bash
run: ./.github/scripts/check-hive-results.sh src/results
- name: Upload Hive Failure Logs
if: ${{ failure() && steps.verify-hive-results.conclusion == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: hive_failed_logs_${{ matrix.artifact_prefix }}
path: src/results/failed_logs
if-no-files-found: warn
# The purpose of this job is to add it as a required check in GitHub so that we don't have to add every individual job as a required check
unit-tests:
# "Test" is a required check, don't change the name
name: Test
runs-on: ubuntu-latest
needs: [detect-changes, test]
# Make sure this job runs even if the previous jobs failed or were skipped
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
steps:
- name: Check if any job failed
run: |
if [ "${{ needs.test.result }}" != "success" ]; then
echo "Job Assertoor Tx Check failed"
exit 1
fi
# The purpose of this job is to add it as a required check in GitHub so that we don't have to add every individual job as a required check
all-tests:
# "Integration Test" is a required check, don't change the name
name: Integration Test
runs-on: ubuntu-latest
needs: [detect-changes, run-assertoor, run-hive]
# Make sure this job runs even if the previous jobs failed or were skipped
if: ${{ needs.detect-changes.outputs.run_tests == 'true' && always() && needs.run-assertoor.result != 'skipped' && needs.run-hive.result != 'skipped' }}
steps:
- name: Check if any job failed
run: |
if [ "${{ needs.run-assertoor.result }}" != "success" ]; then
echo "Job Assertoor Tx Check failed"
exit 1
fi
if [ "${{ needs.run-hive.result }}" != "success" ]; then
echo "Job Hive failed"
exit 1
fi
reorg-tests:
name: Reorg Tests
runs-on: ubuntu-latest
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' && github.event_name != 'merge_group' }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Free Disk Space
uses: ./.github/actions/free-disk
- name: Setup Rust Environment
uses: ./.github/actions/setup-rust
- name: Compile ethrex binary
run: cargo build --bin ethrex
- name: Run reorg tests
run: cd tooling/reorgs && cargo run