Skip to content
Closed
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
6 changes: 6 additions & 0 deletions .github/actions/build-evm-base/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ runs:
- name: Build the EVM using EthJS action
if: steps.config-evm-reader.outputs.impl == 'ethjs'
uses: ./.github/actions/build-evm-client/ethjs
with:
repo: ${{ steps.config-evm-reader.outputs.repo }}
ref: ${{ steps.config-evm-reader.outputs.ref }}
- name: Build the EVM using revm action
if: steps.config-evm-reader.outputs.impl == 'revm'
uses: ./.github/actions/build-evm-client/revm
with:
repo: ${{ steps.config-evm-reader.outputs.repo }}
ref: ${{ steps.config-evm-reader.outputs.ref }}
59 changes: 59 additions & 0 deletions .github/actions/build-evm-client/revm/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 'Build revm revme'
description: 'Builds the revme t8n binary from bluealloy/revm (or a fork)'
inputs:
repo:
description: 'Source repository to use to build the EVM binary'
required: true
default: 'bluealloy/revm'
ref:
description: 'Reference to branch, commit, or tag to use to build the EVM binary'
required: true
default: 'main'
runs:
using: "composite"
steps:
- name: Get latest revm commit
id: revm-sha
shell: bash
run: |
SHA=$(git ls-remote https://github.com/${{ inputs.repo }}.git refs/heads/${{ inputs.ref }} | cut -f1)
echo "sha=$SHA" >> $GITHUB_OUTPUT
echo "Latest revm commit: $SHA"
- name: Restore build cache
id: cache-restore
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: |
${{ github.workspace }}/revm/target/release/revme
key: revm-revme-build-sha=${{ steps.revm-sha.outputs.sha }}
restore-keys: |
revm-revme-build-
- name: Checkout revm
if: steps.cache-restore.outputs.cache-hit != 'true'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: ${{ inputs.repo }}
ref: ${{ steps.revm-sha.outputs.sha }}
path: revm
- name: Install Rust
if: steps.cache-restore.outputs.cache-hit != 'true'
shell: bash
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get install --yes --force-yes build-essential rustup
rustup update --no-self-update 1.94.0 && rustup default 1.94.0
- name: Build revme
if: steps.cache-restore.outputs.cache-hit != 'true'
shell: bash
run: |
cd $GITHUB_WORKSPACE/revm
cargo build --release -p revme
- name: Add revme to PATH
shell: bash
run: echo $GITHUB_WORKSPACE/revm/target/release >> $GITHUB_PATH
- name: Save build cache
if: steps.cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: |
${{ github.workspace }}/revm/target/release/revme
key: revm-revme-build-sha=${{ steps.revm-sha.outputs.sha }}
3 changes: 3 additions & 0 deletions .github/configs/evm-impl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ besu:
ethjs:
evm-bin: ethereumjs-t8ntool.sh
x-dist: auto
revm:
evm-bin: revme
x-dist: auto
6 changes: 3 additions & 3 deletions .github/configs/evm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ static:
ref: master
targets: ["evmone-t8n"]
benchmark:
impl: geth
repo: ethereum/go-ethereum
ref: master
impl: revm
repo: spencer-tb/revm
ref: t8n-subcommand
7 changes: 1 addition & 6 deletions .github/configs/feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ mainnet:

benchmark:
evm-type: benchmark
fill-params: --fork=Osaka --generate-all-formats --gas-benchmark-values 1,5,10,30,60,100,150 ./tests/benchmark/compute --maxprocesses=30 --dist=worksteal
feature_only: true

benchmark_fast:
evm-type: benchmark
fill-params: --fork=Osaka --generate-all-formats --gas-benchmark-values 100 ./tests/benchmark/compute
fill-params: --fork=Amsterdam --generate-all-formats --gas-benchmark-values 1,5,10,30,60,100,150 ./tests/benchmark/compute --maxprocesses=30 --dist=worksteal
feature_only: true

bal:
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,3 @@ jobs:

# TODO: Add execute remote tests with --gas-benchmark-values
# TODO: Add execute remote tests with --fixed-opcode-count

build-artifact:
name: Build Benchmark Fixture Artifact
needs: [sanity-checks] # TODO: Add execute remote jobs when implemented
if: github.event_name == 'push'
runs-on: [self-hosted-ghr, size-gigachungus-x64]
timeout-minutes: 720
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true

- uses: ./.github/actions/build-fixtures
with:
release_name: benchmark_fast
6 changes: 3 additions & 3 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ bench-gas *args:
--evm-bin="{{ evm_bin }}" \
--gas-benchmark-values 1 \
--generate-all-formats \
--fork Osaka \
--fork {{ latest_fork }} \
-m "not slow" \
-n auto --maxprocesses 10 --dist=loadgroup \
--output="{{ output_dir }}/bench-gas/fixtures" \
Expand All @@ -237,7 +237,7 @@ bench-opcode *args:
uv run fill \
--evm-bin="{{ evm_bin }}" \
--fixed-opcode-count 1 \
--fork Osaka \
--fork {{ latest_fork }} \
-m repricing \
-n auto --maxprocesses 10 --dist=loadgroup \
-k "not test_alt_bn128 and not test_bls12_381 and not test_modexp and not uncachable" \
Expand All @@ -256,7 +256,7 @@ bench-opcode-config *args:
uv run fill \
--evm-bin="{{ evm_bin }}" \
--fixed-opcode-count \
--fork Osaka \
--fork {{ latest_fork }} \
-m repricing \
-n auto --maxprocesses 10 --dist=loadgroup \
-k "not test_alt_bn128 and not test_bls12_381 and not test_modexp and not test_point_evaluation_uncachable" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from .clis.geth import GethFixtureConsumer, GethTransitionTool
from .clis.nethermind import Nethtest, NethtestFixtureConsumer
from .clis.nimbus import NimbusTransitionTool
from .clis.revm import RevmExceptionMapper, RevmTransitionTool
from .ethereum_cli import CLINotFoundInPathError, UnknownCLIError
from .fixture_consumer_tool import FixtureConsumerTool
from .trace_comparators import (
Expand Down Expand Up @@ -62,6 +63,8 @@
"NethtestFixtureConsumer",
"NimbusTransitionTool",
"Result",
"RevmExceptionMapper",
"RevmTransitionTool",
"TraceComparator",
"TraceComparatorType",
"TraceComparisonResult",
Expand Down
95 changes: 44 additions & 51 deletions packages/testing/src/execution_testing/client_clis/clis/reth.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,50 @@
"""Reth execution client transition tool."""
"""
Reth execution client transition tool — exception mapper only.

Reth's EVM is revm, so all the EVM-level error strings reth surfaces
match revm's `Display for InvalidTransaction` output and live in the
shared [`RevmExceptionMapper`] base. This module only contains the
strings that come from layers *above* revm — reth's payload validator,
its consensus engine, its tx pool, and its BAL validator — because
those wrap or replace revm's errors with reth-specific phrasing.
"""

from execution_testing.client_clis.clis.revm import RevmExceptionMapper
from execution_testing.exceptions import (
BlockException,
ExceptionMapper,
TransactionException,
)


class RethExceptionMapper(ExceptionMapper):
"""Reth exception mapper."""
class RethExceptionMapper(RevmExceptionMapper):
"""
Reth-specific overrides on top of the revm base mapper.

Only entries that diverge from revm's `Display for
InvalidTransaction` belong here. Anything matching revm's core
error vocabulary lives in [`RevmExceptionMapper`].
"""

mapping_substring = {
TransactionException.SENDER_NOT_EOA: (
"reject transactions from senders with deployed code"
),
TransactionException.INSUFFICIENT_ACCOUNT_FUNDS: "lack of funds",
TransactionException.INITCODE_SIZE_EXCEEDED: (
"create initcode size limit"
),
TransactionException.INSUFFICIENT_MAX_FEE_PER_GAS: (
"gas price is less than basefee"
**RevmExceptionMapper.mapping_substring,
# Reth's payload validator wording (revm itself says
# "blob versioned hashes not supported" — that's the base).
TransactionException.TYPE_3_TX_PRE_FORK: (
"blob transactions present in pre-cancun payload"
),
TransactionException.PRIORITY_GREATER_THAN_MAX_FEE_PER_GAS: (
"priority fee is greater than max fee"
# Reth's payload validator wording for EIP-7702 pre-Prague.
TransactionException.TYPE_4_TX_PRE_FORK: (
"eip 7702 transactions present in pre-prague payload"
),
TransactionException.GASLIMIT_PRICE_PRODUCT_OVERFLOW: "overflow",
# Reth's RLP decoder catches type-3/type-4 contract-creation
# attempts at decode time and surfaces them as "unexpected
# length" / "unexpected list" — revm never sees them, so these
# are reth-only.
TransactionException.TYPE_3_TX_CONTRACT_CREATION: "unexpected length",
TransactionException.TYPE_3_TX_WITH_FULL_BLOBS: "unexpected list",
TransactionException.TYPE_3_TX_INVALID_BLOB_VERSIONED_HASH: (
"blob version not supported"
),
TransactionException.TYPE_3_TX_ZERO_BLOBS: "empty blobs",
TransactionException.TYPE_4_EMPTY_AUTHORIZATION_LIST: (
"empty authorization list"
),
TransactionException.TYPE_4_TX_CONTRACT_CREATION: "unexpected length",
TransactionException.TYPE_4_TX_PRE_FORK: (
"eip 7702 transactions present in pre-prague payload"
),
# Block-envelope / consensus errors — emitted by reth's
# consensus engine, never by revm.
BlockException.INVALID_REQUESTS: "mismatched block requests hash",
BlockException.INVALID_RECEIPTS_ROOT: "receipt root mismatch",
BlockException.INVALID_STATE_ROOT: "mismatched block state root",
Expand All @@ -48,38 +55,24 @@ class RethExceptionMapper(ExceptionMapper):
BlockException.EXTRA_DATA_TOO_BIG: "invalid payload extra data",
BlockException.INVALID_LOG_BLOOM: "header bloom filter mismatch",
}

mapping_regex = {
TransactionException.NONCE_MISMATCH_TOO_LOW: (
r"nonce \d+ too low, expected \d+"
),
TransactionException.NONCE_MISMATCH_TOO_HIGH: (
r"nonce \d+ too high, expected \d+"
),
TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS: (
r"blob gas price \(\d+\) is greater than "
r"max fee per blob gas \(\d+\)"
),
TransactionException.INTRINSIC_GAS_TOO_LOW: (
r"call gas cost \(\d+\) exceeds the gas limit \(\d+\)"
),
TransactionException.INTRINSIC_GAS_BELOW_FLOOR_GAS_COST: (
r"gas floor \(\d+\) exceeds the gas limit \(\d+\)"
),
**RevmExceptionMapper.mapping_regex,
# Reth's blob-allowance checker phrasing.
TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED: (
r"blob gas used \d+ exceeds maximum allowance \d+"
),
TransactionException.TYPE_3_TX_BLOB_COUNT_EXCEEDED: (
r"too many blobs, have \d+, max \d+"
),
TransactionException.TYPE_3_TX_PRE_FORK: (
r"blob transactions present in pre-cancun payload|empty blobs"
),
# Reth tx-pool phrasing for over-budget tx gas (revm's
# equivalent "caller gas limit exceeds the block gas limit"
# lives in the base).
TransactionException.GAS_ALLOWANCE_EXCEEDED: (
r"transaction gas limit \w+ is more than blocks available gas \w+"
),
# Reth tx-pool phrasing.
TransactionException.GAS_LIMIT_EXCEEDS_MAXIMUM: (
r"transaction gas limit.*is greater than the cap"
),
# Reth consensus / block-execution errors.
BlockException.SYSTEM_CONTRACT_CALL_FAILED: (
r"failed to apply .* requests contract call"
),
Expand Down Expand Up @@ -109,7 +102,7 @@ class RethExceptionMapper(ExceptionMapper):
BlockException.GAS_USED_OVERFLOW: (
r"transaction gas limit \w+ is more than blocks available gas \w+"
),
# BAL Exceptions
# BAL exceptions — reth's BAL validator.
BlockException.INVALID_BAL_HASH: (r"block access list hash mismatch"),
BlockException.INVALID_BLOCK_ACCESS_LIST: (
r"block access list hash mismatch"
Expand All @@ -118,8 +111,8 @@ class RethExceptionMapper(ExceptionMapper):
r"block access list hash mismatch"
),
# Reth does not validate the sizes or offsets of the deposit
# contract logs. As a workaround we have set
# INVALID_DEPOSIT_EVENT_LAYOUT equal to INVALID_REQUESTS.
# contract logs. As a workaround we map INVALID_DEPOSIT_EVENT_LAYOUT
# to the same error pattern as INVALID_REQUESTS.
#
# Although this is out of spec, it is understood that this
# will not cause an issue so long as the mainnet/testnet
Expand Down
Loading
Loading