feat: bin/dio generates -w config from on-chain state#113
Open
wjmelements wants to merge 23 commits intomasterfrom
Open
feat: bin/dio generates -w config from on-chain state#113wjmelements wants to merge 23 commits intomasterfrom
wjmelements wants to merge 23 commits intomasterfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ug_traceCall unavailable
- evm -nx: when executing with -n flag, emit JSON-RPC requests on stdout
and read responses from stdin for on-demand account/storage fetching
- evm -x now accepts JSON call object input (detected by leading '{') with
to/from/data fields, enabling txCall instead of txCreate
- src/network.c: network fetch callbacks using JSON-RPC over stdio
- include/network.h: evmSetNetworkFetch() declaration
- include/evm.h: evmSetFetch, evmBlockNumberIsSet, evmGetBlockNumber
- dio: falls back to evm -nx proxy when debug_traceCall is unavailable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…parse flow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ss:// URLs WebSocket connections are kept open for the duration of each run via async with websockets.connect(). The post function is passed through run, run_via_evm, rpc_call, and batch_rpc. HTTP path wraps http_post in an async function for uniform interface. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removes buildAccessList and all associated dead code (storage_key_t, batch_meta_t, jArrayTailN, jStrHex, addAccessKey, stackToAddress, sbFmt) since no public RPC supports the structLog tracer for free. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
Author
|
I also considered having |
- extract JSON helpers to src/json.c / include/json.h - add call_result_t; accumulate all calls into one writeConfig output - pass len to postFn instead of re-running strlen - compute evmPath once in main; drop self param from run/runViaEvm - skip curl cleanup on exit (OS reclaims resources) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- dio: capture gasUsed, logs, status from evm output into generated configs - dio: add jValDup for copying raw JSON values - evm -w: parse logIndex from test JSON logs - evm -w: compare logIndex in LogsEqual (optional: zero means unspecified) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- add fprintCompact256 (trims leading zeros) to uint256 - use fprintCompact256 for log topics and evm -xs status output - use fprint256 for eth_getStorageAt key in network.c - replace no-param printf/fprintf with fputs/fputc/putchar/puts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add jArrayNext for sequential array iteration, then use it in three new helpers — rpcFailed (network failure), rpcError (RPC-level error), checkBatchErrors (per-element batch errors matched by id to method). All RPC call sites now report the method name and error object on failure instead of a generic message, and eth_blockNumber is checked for errors before its result is used, preventing "latest" from leaking into the evm subprocess. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace sequential jArrayGet(line, N) calls in runViaEvm with jArrayNext to avoid restarting the scan from the beginning each time. Add tst/json.c covering jFind, jStr, jUint, jArrayGet, jArrayNext, jStrDup, jValDup, and resultById. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Calls with no `to` field become create entries with `initcode` and `constructTest` instead of a `tests` entry - Split results into separate `creates` and `calls` lists at creation time - Skip the `tests` entry entirely when there are no calls Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract writeConfig, account_t, call_result_t, storage_kv_t and related macros from dio.c into include/config.h + src/config.c - Skip "status" in constructTest output when success (non-"0x0") - Skip "status" in tests output when "0x1" (default success) - Add tst/config.c with 13 unit tests covering accounts, creates, calls - Add tst/tst.h to share assertStderr macro; remove duplicate from tst/evm.c Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Implements #96.
Changes
bin/dio: new tool to generate-wconfig files from on-chain statedio.py: usesdebug_traceCallto build access list and fetch all touched account/storage state; falls back to spawningevm -nxas a JSON-RPC proxy whendebug_traceCallis unavailabledio.py: generated test entries includeoutputfrom execution result; storage keys trimmed of leading zerosevm -nx: new interactive mode where missing account/storage state is fetched on demand via JSON-RPC over stdin/stdoutevm -xnow accepts a JSON call object input (detected by{) withto,from,data— routes totxCallinstead oftxCreatesrc/network.c+include/network.h: network fetch callbacks via JSON-RPC over stdioinclude/evm.h:evmSetFetch,evmBlockNumberIsSet,evmGetBlockNumberAPI.py → bin/build rule