Skip to content

feat: add rpc_compat test data generation script#357

Open
ameya-deshmukh wants to merge 1 commit intoseismicfrom
ameya/rpc-compat-gen-script
Open

feat: add rpc_compat test data generation script#357
ameya-deshmukh wants to merge 1 commit intoseismicfrom
ameya/rpc-compat-gen-script

Conversation

@ameya-deshmukh
Copy link
Copy Markdown
Contributor

Summary

  • Adds a TypeScript script to testing/generate-rpc-compat-data/ that regenerates the rpc_compat e2e test data from a running Summit testnet
  • Deploys an ssolc-compiled EventEmitter contract, runs transactions (including CSTORE), captures RPC request/response pairs as .io files, and exports chain.rlp via debug_getRawBlock
  • Uses bun + viem, consistent with the existing testing/viem-tests/ pattern

Usage

cd testing/generate-rpc-compat-data
bun install
bun run generate

See the script header for full prerequisites (building reth, syncing genesis with Summit, etc).

Context

Extracted from the test data regeneration work in #356. This script is needed whenever dev.json genesis changes, since the chain.rlp blocks contain baked-in state roots.

TypeScript script that generates test data for the rpc_compat e2e test
from a running Summit testnet. Deploys an EventEmitter contract, runs
transactions, captures RPC responses as .io files, and exports chain.rlp
via debug_getRawBlock.

Usage:
  cd testing/generate-rpc-compat-data
  bun install && bun run generate
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

Adds TypeScript script to generate RPC compatibility test data from a running Seismic testnet.

Phase 2

  • testing/generate-rpc-compat-data/generate.ts:210 — Hardcoded path ${process.env.HOME}/Desktop/Seismic/summit/testnet/dev.json will fail if the Summit directory structure is different. Consider making this configurable via environment variable.
  • testing/generate-rpc-compat-data/generate.ts:321 — Loop fetching blocks one-by-one could be slow for large chains. The console.log every 50 blocks helps, but consider batching if the RPC supports it.

Phase 3

  • testing/generate-rpc-compat-data/generate.ts:54rawRpc function builds requests manually but then rpc wraps it. Could simplify by having rpc handle the request building directly.

LGTM - the script correctly uses dynamic chain ID detection (avoiding hardcoded Ethereum chain IDs), properly tests CSTORE operations for confidential storage, and generates comprehensive test data for RPC compatibility validation. The contract bytecode is compiled with ssolc for Seismic's confidential features, which is appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant