Repository navigation
MIP-16: JSON-RPC Query Methods (Review) - #89
typedarray wants to merge 14 commits into
Conversation
|
@typedarray Maybe it should be explicit about how For example: Would seem to have no way to know from the contents of |
|
@DanielVF Yes, it's important to highlight there are two key revert questions for a trace:
I think |
|
@kyscott18 so when the Might need a clearer description that that is what status means in the spec then. And yes, I think it makes sense for ETH transfers to act like logs and not show things that ended up not happening. |
|
I did some more research into trace error fields for geth vs parity. Fields
Observed values (Ethereum mainnet)
|
|
I like the clarity with having |
Remove `status` and `revertReason` from trace and transfer objects and add a boolean `reverted` field. Remove the `isTopLevel` filter and add an `includeReverted` filter to `eth_queryTraces` and `eth_queryTransfers`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27c431f to
d8ab22d
Compare
|
Hey, I'm from Envio. We run HyperSync, which indexes 90+ EVM chains and traces for some of them, including Monad. Some notes after mapping the spec to our data: 1. Transfers include DELEGATECALL "Any call frame whose
Transfers should be CALL, CREATE and CREATE2 with 2. SELFDESTRUCT has no These are Required for all traces. Should be Type-dependent. For SELFDESTRUCT, 3. Precompile calls
4. Missing fields
5. Always return join keys You can request |
|
On Monad, staking is a precompile, and it would fairly useful to have it in both Traces and in Transfers. |
* separate monad fields into appendix * add totalDifficulty to Monad blocks appendix * note totalDifficulty is always 0x0 on Monad * address MIP-16 review comments Simplify the normative-fields sentences, rename the appendix to Appendix 1, move the transactions logs sentence below the table, remove the mainnet timestamp, and move the error/reverted explanation into a Rationale entry. --------- Co-authored-by: Kevin <90073088+typedarray@users.noreply.github.com>
|
By the way, we are very close to releasing the first implementation of the standard at ENVIO. I'm already excited to share it with you 😉 It's an amazing job, and big thanks for making this standard. I believe it'll drive the whole industry forward. 🙏 |
…n, traces scope - Traces and transfers include system transactions and precompile calls - Empty filter arrays and null filter values place no constraint - Reject null entries in filter arrays (except top-level topics positions) - Empty topic position array is a wildcard; drop trailing-null sentence - Require primary key in fields; reject empty fields arrays - Reject unknown request and filter keys with -32602
Makes the BDS eth_query* wire contract conform to Monad MIP-16 (draft, monad-crypto/MIPs#89): protos, JSON-RPC request parsing, JSON-RPC response rendering, error codes and the trace/receipt conversion helpers. Breaking, as MIP-16 requires: - Requests: limit -> target (field 4); cursor removed (reserved 5); the next page is fromBlock = cursorBlock.number +/- 1. Only fromBlock, toBlock, order, target, filter and fields are accepted. - Filters: isTopLevel -> includeReverted; eth_queryBlocks gains miner. - Fields: exact selection, primary key required, "all", per-chain schema (Monad 143/10143 = MIP-16 Appendix 1); unknown keys/names -> -32602. - Schemas: transactions gain status, cumulativeGasUsed, contractAddress, logsBloom, authorizationList and rename gasLimit -> gas; traces and transfers use the MIP-16 trace schema; transfers exclude DELEGATECALL and CALLCODE. Blocks gain requestsHash, lose transactionCount. - Go API: Query*RequestFromJsonRpc(chainID, params), Query*ResponseToJsonRpc(chainID, req, resp), TraceFromGethDebug(item, transactionIndex, ...). - New: QueryErrorCode, ValidateQueryRange, QuerySchemaForChain, PropagateParityReverted, MergeReceipt. The root main.go is package manifesto (it was package main without a func main, so go build ./... failed). Verified: all 236 mip-16-spec fixtures parse and render exactly (the inverted-range ones are checked by servers via ValidateQueryRange); go build/vet/test and cargo build pass; two independent reviews.
…SON-RPC and gRPC JSON-RPC and gRPC eth_query* now share one executor that follows Monad MIP-16 (draft, monad-crypto/MIPs#89) on the BDS manifesto MIP-16 contract (manifesto#23): - Requests: target instead of limit, no cursor (the next page is fromBlock = cursorBlock.number +/- 1), MIP-16 defaults per order, tags resolved once, desc bounds never swapped, strict -32602 validation. - Native QueryService upstreams are tried first, the request piped unchanged; a JSON call takes one page. The upstream's grpc.headers now reach QueryService streams (they never did). - Proto shim otherwise: block-aligned pages ending at toBlock, target or the page budget (queryShim.maxBlocksPerPage / maxPageDuration; -32005 when fromBlock cannot complete); real fromBlock/toBlock/cursorBlock references; relations, receipts and ordering per MIP-16; traces from trace_block or debug_traceBlockByNumber; includeReverted. - Chain consistency: every object is checked against its block header and headers must link by parentHash; an inconsistent tail is re-scanned once without cache, else the page ends at the last consistent block. A page pins its sub-requests to one upstream; a lagging upstream's null or an error moves the pin to an upstream that has the data. - Errors: -32602, -32001 (availability), -32004 (no upstream serves the method), -32005; gRPC INVALID_ARGUMENT / OUT_OF_RANGE / UNIMPLEMENTED / RESOURCE_EXHAUSTED. Breaking: the old eth_query* contract (limit, cursor, isTopLevel, extra identity fields) is gone; queryShim drops concurrency, maxBlockRange, maxLimit and defaultLimit (strict config parsing rejects them) and gains maxBlocksPerPage and maxPageDuration. The old map-based JSON shim in architecture/evm and the gRPC client's JSON eth_query* path are removed. Verified: the mip-16-spec conformance suite passes 236/236 against a local erpc with a Monad archive shim upstream; native path smoke-tested against prism; go test ./erpc ./clients ./common ./architecture/evm pass.
…SON-RPC and gRPC JSON-RPC and gRPC eth_query* now share one executor that follows Monad MIP-16 (draft, monad-crypto/MIPs#89) on the BDS manifesto MIP-16 contract (manifesto#23): - Requests: target instead of limit, no cursor (the next page is fromBlock = cursorBlock.number +/- 1), MIP-16 defaults per order, tags resolved once, desc bounds never swapped, strict -32602 validation. - Native QueryService upstreams are tried first, the request piped unchanged; a JSON call takes one page. The upstream's grpc.headers now reach QueryService streams (they never did). - Proto shim otherwise: block-aligned pages ending at toBlock, target or the page budget (queryShim.maxBlocksPerPage / maxPageDuration; -32005 when fromBlock cannot complete); real fromBlock/toBlock/cursorBlock references; relations, receipts and ordering per MIP-16; traces from trace_block or debug_traceBlockByNumber; includeReverted. - Chain consistency: every object is checked against its block header and headers must link by parentHash; an inconsistent tail is re-scanned once without cache, else the page ends at the last consistent block. A page pins its sub-requests to one upstream; a lagging upstream's null or an error moves the pin to an upstream that has the data. - Errors: -32602, -32001 (availability), -32004 (no upstream serves the method), -32005; gRPC INVALID_ARGUMENT / OUT_OF_RANGE / UNIMPLEMENTED / RESOURCE_EXHAUSTED. Breaking: the old eth_query* contract (limit, cursor, isTopLevel, extra identity fields) is gone; queryShim drops concurrency, maxBlockRange, maxLimit and defaultLimit (strict config parsing rejects them) and gains maxBlocksPerPage and maxPageDuration. The old map-based JSON shim in architecture/evm and the gRPC client's JSON eth_query* path are removed. Verified: the mip-16-spec conformance suite passes 236/236 against a local erpc with a Monad archive shim upstream; native path smoke-tested against prism; go test ./erpc ./clients ./common ./architecture/evm pass.
…SON-RPC and gRPC JSON-RPC and gRPC eth_query* now share one executor that follows Monad MIP-16 (draft, monad-crypto/MIPs#89) on the BDS manifesto MIP-16 contract (manifesto#23): - Requests: target instead of limit, no cursor (the next page is fromBlock = cursorBlock.number +/- 1), MIP-16 defaults per order, tags resolved once, desc bounds never swapped, strict -32602 validation. - Native QueryService upstreams are tried first, the request piped unchanged; a JSON call takes one page. The upstream's grpc.headers now reach QueryService streams (they never did). - Proto shim otherwise: block-aligned pages ending at toBlock, target or the page budget (queryShim.maxBlocksPerPage / maxPageDuration; -32005 when fromBlock cannot complete); real fromBlock/toBlock/cursorBlock references; relations, receipts and ordering per MIP-16; traces from trace_block or debug_traceBlockByNumber; includeReverted. - Chain consistency: every object is checked against its block header and headers must link by parentHash; an inconsistent tail is re-scanned once without cache, else the page ends at the last consistent block. A page pins its sub-requests to one upstream; a lagging upstream's null or an error moves the pin to an upstream that has the data. - Errors: -32602, -32001 (availability), -32004 (no upstream serves the method), -32005; gRPC INVALID_ARGUMENT / OUT_OF_RANGE / UNIMPLEMENTED / RESOURCE_EXHAUSTED. Breaking: the old eth_query* contract (limit, cursor, isTopLevel, extra identity fields) is gone; queryShim drops concurrency, maxBlockRange, maxLimit and defaultLimit (strict config parsing rejects them) and gains maxBlocksPerPage and maxPageDuration. The old map-based JSON shim in architecture/evm and the gRPC client's JSON eth_query* path are removed. Verified: the mip-16-spec conformance suite passes 236/236 against a local erpc with a Monad archive shim upstream; native path smoke-tested against prism; go test ./erpc ./clients ./common ./architecture/evm pass.
…ON-RPC and gRPC JSON-RPC and gRPC eth_query* now share one executor that follows Monad MIP-16 (draft, monad-crypto/MIPs#89) on the BDS manifesto MIP-16 contract (manifesto#23): - Requests: target instead of limit, no cursor (the next page is fromBlock = cursorBlock.number +/- 1), MIP-16 defaults per order, tags resolved once, desc bounds never swapped, strict -32602 validation. - Native QueryService upstreams are tried first, the request piped unchanged; a JSON call takes one page. The upstream's grpc.headers now reach QueryService streams (they never did). - Proto shim otherwise: block-aligned pages ending at toBlock, target or the page budget (queryShim.maxBlocksPerPage / maxPageDuration; -32005 when fromBlock cannot complete); real fromBlock/toBlock/cursorBlock references; relations, receipts and ordering per MIP-16; traces from trace_block or debug_traceBlockByNumber; includeReverted. - Chain consistency: every object is checked against its block header and headers must link by parentHash; an inconsistent tail is re-scanned once without cache, else the page ends at the last consistent block. A page pins its sub-requests to one upstream; a lagging upstream's null or an error moves the pin to an upstream that has the data. - Errors: -32602, -32001 (availability), -32004 (no upstream serves the method), -32005; gRPC INVALID_ARGUMENT / OUT_OF_RANGE / UNIMPLEMENTED / RESOURCE_EXHAUSTED. The old eth_query* contract (limit, cursor, isTopLevel, extra identity fields) is replaced; it had no users. queryShim drops concurrency, maxBlockRange, maxLimit and defaultLimit and gains maxBlocksPerPage and maxPageDuration. The old map-based JSON shim in architecture/evm and the gRPC client's JSON eth_query* path are removed. Verified: the mip-16-spec conformance suite passes 236/236 against a local erpc with a Monad archive shim upstream; native path smoke-tested against prism; go test ./erpc ./clients ./common ./architecture/evm pass.
Continued from #88, this PR moves the MIP from Draft to Review and includes further revisions.