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
35 changes: 35 additions & 0 deletions config/compare/erigon/MANIFEST-mainnet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Erigon rpc-tests -> json-bench compare (mainnet)

Source: erigontech/rpc-tests (source rpc-tests 214c13799371e832a90d92781f83b0fe2d143d68)

Every test is retargeted to block `latest`, so the whole suite runs on any synced node (no archive dependency).

| config | calls | notes |
|---|---:|---|
| `erigon-mainnet.yaml` | 577 | standard methods, compares cleanly across clients |
| `erigon-mainnet-divergent.yaml` | 337 | informational (noisy cross-client) |

Total runnable: 914

## Dropped (not adaptable to an arbitrary block)

Replay/state addressed only by a fixed hash — no block argument to retarget, and replaying the referenced point needs archive state:

- `debug_getModifiedAccountsByHash` (11)
- `debug_traceBlockByHash` (10)
- `debug_traceTransaction` (81)
- `ots_getInternalOperations` (15)
- `ots_getTransactionError` (15)
- `ots_traceTransaction` (22)
- `trace_replayTransaction` (30)
- `trace_transaction` (47)

## Run

```bash
go run ./runner compare --config config/compare/erigon/erigon-mainnet.yaml \
--clients config/clients/clients.yaml --client-refs nethermind,geth,reth \
--rules config/compare/erigon/erigon-mainnet-rules.yaml
```

For a moving-head node set `--target-block` to a fixed recent number when regenerating (default `latest` is deterministic across nodes parked at the same head).
66 changes: 66 additions & 0 deletions config/compare/erigon/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Erigon rpc-tests → json-bench compare

Ported from [`erigontech/rpc-tests`](https://github.com/erigontech/rpc-tests):
the requests from its `integration/<network>` golden-file suite, converted into
json-bench `compare` configs. json-bench compare is **differential** (each
client's response is diffed against the others, not against a golden file), so
only the requests are ported — the Erigon-captured expected responses are
dropped. What this adds over hand-written configs is coverage (100+ methods)
and that **every ported test is runnable on any synced node**.

## Any-block, no archive dependency

The Erigon tests pin specific historical blocks (e.g. `eth_getBalance` at block
17,000,000), which only an archive node can answer. The importer rewrites every
test's block reference to a runnable target (`latest` by default), so the whole
suite runs against a normal synced node:

- block-number / block-tag arguments → the target (`latest`);
- `eth_getLogs` `fromBlock`/`toBlock` → the target;
- requests that only *fetch* immutable data by hash (`eth_getBlockByHash`,
`eth_getTransactionByHash`, receipts, …) are kept as-is — any full node
retains that data;
- requests that *replay* a fixed point by hash (`trace_transaction`,
`debug_traceTransaction`, `debug_traceBlockByHash`, …) have no block argument
to retarget and need archive state, so they are **dropped** (listed in
`MANIFEST-<network>.md`).

Because compare sends the same request to every client at once, `latest` is
deterministic when the nodes are parked at the same head. For a moving-head or
archive node, regenerate with `--target-block <fixed number>`.

## Files

| config | contents |
|---|---|
| `erigon-<network>.yaml` | core standard `eth_`/`debug_` methods — compares cleanly across clients |
| `erigon-<network>-divergent.yaml` | non-standard namespaces / node-local / gas-price-oracle methods (`erigon_`/`ots_`/`parity_`/`engine_`/`admin_`/`txpool_`/`trace_`) — informational, noisy cross-client |
| `erigon-<network>-rules.yaml` | damps benign cross-client differences (ignore `totalDifficulty`, compare error codes only) — pair with every run |

## Running

```bash
go run ./runner compare \
--config config/compare/erigon/erigon-mainnet.yaml \
--clients config/clients/clients.yaml --client-refs nethermind,geth,reth \
--rules config/compare/erigon/erigon-mainnet-rules.yaml \
--output out/erigon
```

`-divergent.yaml` is for inspection, not pass/fail.

## Regenerating / updating

```bash
# fetch the corpus (gitignored) then rewrite the configs
bash rpc-calls/scripts/generate-erigon-compare/init.sh mainnet
go run ./rpc-calls/scripts/generate-erigon-compare \
--source-ref "$(cat rpc-calls/sources/erigon-rpc-tests/SOURCE_REF)"

# pull a newer corpus
RPC_TESTS_REF=<sha> bash rpc-calls/scripts/generate-erigon-compare/init.sh mainnet
```

See [`rpc-calls/scripts/generate-erigon-compare/`](../../../rpc-calls/scripts/generate-erigon-compare)
for the generator and its flags. The generated files here are checked in so
they're usable without regenerating.
Loading