Skip to content

hive

hive #2

Workflow file for this run

# Runs `ethereum/hive` tests.
name: hive
on:
workflow_dispatch:
schedule:
# every day
- cron: "0 0 * * *"
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
prepare:
if: github.repository == 'paradigmxyz/reth'
timeout-minutes: 45
runs-on:
group: Reth
steps:
- uses: actions/checkout@v4
- run: mkdir artifacts
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export reth image
uses: docker/build-push-action@v5
with:
context: .
tags: ghcr.io/paradigmxyz/reth:latest
build-args: |
BUILD_PROFILE=hivetests
FEATURES=asm-keccak
outputs: type=docker,dest=./artifacts/reth_image.tar
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Checkout hive tests
uses: actions/checkout@v4
with:
repository: ethereum/hive
ref: master
path: hivetests
- uses: actions/setup-go@v5
with:
go-version: "^1.13.1"
- run: go version
- name: Build hive tool
run: |
cd hivetests
go build .
mv ./hive ../artifacts/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
path: ./artifacts
test:
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
# TODO: enable etherem/sync once resolved:
# https://github.com/paradigmxyz/reth/issues/8579
# TODO: enable ethereum/rpc once resolved:
# https://github.com/ethereum/hive/pull/1117
# sim: [ethereum/rpc, smoke/genesis, smoke/network, ethereum/sync]
sim: [smoke/genesis, smoke/network]
include:
- sim: devp2p
limit: discv4
- sim: devp2p
limit: eth
include:
# status
- TestStatus
# get block headers
- TestGetBlockHeaders
- TestSimultaneousRequests
- TestSameRequestID
- TestZeroRequestID
# get block bodies
- TestGetBlockBodies
# malicious handshakes + status
- TestMaliciousHandshake
- TestMaliciousStatus
# test transactions
- TestLargeTxRequest
- TestTransaction
- TestInvalidTxs
- TestNewPooledTxs
- TestBlobViolations
- sim: ethereum/engine
limit: engine-exchange-capabilities
# TODO: enable engine-withdrawals once resolved:
# https://github.com/paradigmxyz/reth/issues/8732
# - sim: ethereum/engine
# limit: engine-withdrawals
- sim: ethereum/engine
limit: engine-auth
- sim: ethereum/engine
limit: engine-transition
# TODO: enable engine-api once resolved:
# https://github.com/paradigmxyz/reth/issues/6217
# https://github.com/paradigmxyz/reth/issues/8305
# - sim: ethereum/engine
# limit: engine-api
# TODO: enable cancun once resolved:
# https://github.com/paradigmxyz/reth/issues/6217
# https://github.com/paradigmxyz/reth/issues/8306
# https://github.com/paradigmxyz/reth/issues/7144
# - sim: ethereum/engine
# limit: cancun
# eth_ rpc methods
- sim: ethereum/rpc-compat
include:
- eth_blockNumber
- eth_call
- eth_chainId
- eth_createAccessList
- eth_estimateGas
- eth_feeHistory
- eth_getBalance
- eth_getBlockBy
- eth_getBlockTransactionCountBy
- eth_getCode
- eth_getProof
- eth_getStorage
- eth_getTransactionBy
- eth_getTransactionCount
- eth_getTransactionReceipt
- eth_sendRawTransaction
- eth_syncing
# TODO: enable debug_ rpc-compat once resolved:
# https://github.com/paradigmxyz/reth/issues/7015
# https://github.com/paradigmxyz/reth/issues/6332
# debug_ rpc methods
# - sim: ethereum/rpc-compat
# include: [debug_]
# Pyspec cancun jobs
- sim: pyspec
include: [cancun/eip4844]
- sim: pyspec
include: [cancun/eip4788]
- sim: pyspec
include: [cancun/eip6780]
- sim: pyspec
include: [cancun/eip5656]
- sim: pyspec
include: [cancun/eip1153]
- sim: pyspec
include: [cancun/eip7516]
# Pyspec shanghai jobs
- sim: pyspec
include: [shanghai/eip3651]
- sim: pyspec
include: [shanghai/eip3855]
- sim: pyspec
include: [shanghai/eip3860]
- sim: pyspec
include: [shanghai/eip4895]
# Pyspec merge and earlier jobs
- sim: pyspec
include: [merge/]
- sim: pyspec
include: [berlin/]
- sim: pyspec
include: [istanbul/]
- sim: pyspec
include: [homestead/]
- sim: pyspec
include: [frontier/]
needs: prepare
name: run
runs-on:
group: Reth
permissions:
issues: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: artifacts
path: /tmp
- name: Load Docker image
run: |
docker load --input /tmp/reth_image.tar
docker image ls -a
- name: Move hive binary
run: |
mv /tmp/hive /usr/local/bin
chmod +x /usr/local/bin/hive
- name: Checkout hive tests
uses: actions/checkout@v4
with:
repository: ethereum/hive
ref: master
path: hivetests
- name: Run ${{ matrix.sim }} simulator
run: |
cd hivetests
hive --sim "${{ matrix.sim }}$" --sim.limit "${{matrix.limit}}/${{join(matrix.include, '|')}}" --client reth
- name: Create github issue if sim failed
env:
GH_TOKEN: ${{ github.token }}
if: ${{ failure() }}
run: |
echo "Simulator failed, creating issue"
# Check if issue already exists
# get all issues with the label C-hivetest, loop over each page and check if the issue already exists
existing_issues=$(gh api /repos/paradigmxyz/reth/issues -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" -F "labels=C-hivetest" --method GET | jq '.[].title')
if [[ $existing_issues == *"Hive Test Failure: ${{ matrix.sim }}"* ]]; then
echo "Issue already exists"
exit 0
fi
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/issues \
-f title='Hive Test Failure: ${{ matrix.sim }}' \
-f body="!!!!!!! This is an automated issue created by the hive test failure !!!!!!!<br /><br />The hive test for ${{ matrix.sim }} failed. Please investigate and fix the issue.<br /><br />[Link to the failed run](https://github.com/paradigmxyz/reth/actions/runs/${{ github.run_id }})" \
-f "labels[]=C-hivetest"
- name: Print simulator output
if: ${{ failure() }}
run: |
cat hivetests/workspace/logs/*simulator*.log
- name: Print reth client logs
if: ${{ failure() }}
run: |
cat hivetests/workspace/logs/reth/client-*.log