feat: port erigontech/rpc-tests into block-aware compare configs#30
Open
kamilchodola wants to merge 2 commits into
Open
feat: port erigontech/rpc-tests into block-aware compare configs#30kamilchodola wants to merge 2 commits into
kamilchodola wants to merge 2 commits into
Conversation
Adds an importer that converts the erigontech/rpc-tests corpus into json-bench `compare` configs, plus the generated mainnet configs (1399 requests, 100+ methods). compare is differential (client-vs-client, no golden file), so only the requests are ported. The value is coverage and block-awareness: every request is bucketed by what the target node must hold to answer it, so a run picks the subset its node supports — stateless chain-level, any node head latest/pending/safe/finalized, any synced node historical-immutable numeric/hash block, block/tx/receipt/log/header/raw — full node historical-state numeric/hash block, state (balance/code/call/trace) — ARCHIVE only divergent erigon_/ots_/parity_/engine_/admin_/txpool_/trace_ + node-local — informational A generated rules file (ignore totalDifficulty, error_code_only) damps benign cross-client differences. - scripts/import_erigon_tests.py — the converter (block-arg map mirrors the comparator's blockArgIndex + eth_getLogs handling, extended). - scripts/import_erigon_tests.sh — clones rpc-tests at a pinned ref and regenerates. - config/compare/erigon/ — generated mainnet configs + rules + README + MANIFEST. Validated: generated configs load in the compare runner (clients + config + rules parse; run proceeds to the RPC call).
…ndency) Instead of preserving Erigon's pinned historical blocks and bucketing by node capability (which left a large archive-only set), rewrite each test's block reference to a runnable target (default 'latest'): - block-number/tag args -> target; eth_getLogs fromBlock/toBlock -> target; - immutable fetch-by-hash (getBlockByHash/getTransactionByHash/receipts) kept as-is (any full node retains it); - replay-by-hash (trace_transaction, debug_traceTransaction, debug_traceBlockByHash, ots_*Transaction, …) have no block arg to retarget and need archive state -> dropped (231, listed in the manifest). Buckets are now capability-free: erigon-<net>.yaml (core, cross-client-clean) and erigon-<net>-divergent.yaml (informational). 914 runnable requests, all at 'latest'. Verified: zero historical numeric blocks remain in core block args; configs load in the compare runner.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Ports the
erigontech/rpc-testscorpus into json-benchcompareconfigs — an importer plus generated mainnet configs.compareis differential (each client's response is diffed against the others, not a golden file), so only the requests are ported. The value is coverage (100+ methods) and that every ported test is runnable on any synced node — no archive dependency.Any-block normalization (the key)
Erigon's tests pin specific historical blocks (e.g.
eth_getBalance@ block 17,000,000), answerable only by an archive node. The importer rewrites every test's block reference to a runnable target (latestby default):eth_getLogsfromBlock/toBlock→ target;eth_getBlockByHash,eth_getTransactionByHash, receipts, …) kept as-is — any full node retains that data;trace_transaction,debug_traceTransaction,debug_traceBlockByHash,ots_*Transaction, …) have no block arg to retarget and need archive replay → dropped (231, listed in the manifest).Since compare hits all clients with the same request at once,
latestis deterministic when they're parked at the same head; regenerate with--target-block <fixed>for moving-head/archive nodes.Output
erigon-mainnet.yamleth_/debug_— compares cleanly cross-clienterigon-mainnet-divergent.yamlerigon-mainnet-rules.yamltotalDifficulty, error-code-only914 runnable requests, all at
latest.Files
scripts/import_erigon_tests.py— the converter (block-arg map mirrors the comparator'sblockArgIndex+eth_getLogshandling, extended).scripts/import_erigon_tests.sh— clonesrpc-testsat a pinned ref and regenerates.config/compare/erigon/— generated configs + rules +README.md+MANIFEST-mainnet.md.Testing
214c137…): 914 runnable, 231 dropped (all hash-addressed replay, enumerated in the manifest).eth_getBalance→[addr, latest],eth_getBlockByNumber→[latest, false],eth_getLogs→fromBlock/toBlock: latest).Notes
python3+pyyaml(dev-time only).descriptionand the MANIFEST.