Repository navigation
feat: add stateful QuickNode bundle simulation - #14
Closed
congtanwkm wants to merge 1 commit into
Closed
congtanwkm wants to merge 1 commit into
congtanwkm wants to merge 1 commit into
Conversation
|
Failed to generate code suggestions for PR |
Author
|
Superseded by #15 after renaming the source branch to feat/stateful-batch-simulation. Same commit and base; the replacement remains a draft. |
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.
Summary
Add ordered shared-state bundle simulation via QuickNode
trace_callMany, including nested VM event decoding and rollback filtering. If VM logs cannot be decoded, replay the entire pinned bundle usingdebug_traceCallManywith callTracer logs and verify execution parity before accepting them. Preserve the existing main-branch simulation paths and add the version endpoint from the local feature base.RPC uses
BASE_BLOCKCHAIN_NODE_URL/{chainId}?provider=quicknode. Bundle v2 never falls back to independent calls or a fork node.API
POST /api/v1/simulate_bundle_v2
Illustrative request (not a live execution claim):
The API key header is required only when API_KEY is configured.
[{"chainId":1,"blockNumber":25936975,"request_id":"call-1","from":"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","to":"0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","data":"0x","value":"0","gasLimit":21000}]Matching illustrative response — HTTP 200 for a successful empty-code call:
[{"request_id":"call-1","simulationId":1,"gasUsed":21000,"blockNumber":25936975,"success":true,"trace":[{"callType":"CALL","from":"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","to":"0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","value":"0x0","functionSignature":"0x00000000"}],"logs":[],"exitReason":"Return","returnData":"0x","stateDiff":null,"error":null,"gasAccounting":"execution_plus_intrinsic"}]Full approve → transferFrom → transferFrom request fixtures and log expectations are included for USDT and BSC97 recovery.
Accepts 1–20 calls on one chain and one block; omitted block is resolved once. Successful calls affect subsequent calls; each reverted call rolls back its own effects. Request IDs and repeated senders are preserved. Limits: 2MiB request, 32MiB RPC response, 30M gas/call (also default), 100M total and 45s deadline. Rejects stateOverrides and allowInsufficientFunds:true. Validation returns 400, oversized body 413, provider/invalid traces 502, missing configuration 503 and deadline 504. Errors use the existing
{ "code": 503, "message": "QUICKNODE_NOT_CONFIGURED" }envelope. Gas includes execution plus intrinsic gas, excluding refunds and gas-floor adjustments.GET /api/v1/version
Request: no body or query; same conditional X-API-KEY header.
Response — HTTP 200:
{"version":2}Validation
cargo test --offline --lib --test apipassed (80 library + 5 API tests); 15 live-RPC tests ignored.