Appearance
debug_executionWitness
served · same as reth
Returns the witness of a block, the data that a stateless client needs to run it (a method of reth).
When to use
Use it to run a block without a full state, for example in a prover, or to make test fixtures. The fixture fetcher of Cinder (tools/fetch/fetch.py) uses it. The node runs the block again on the state of its parent and records what the run reads.
Example
bash
curl -s -X POST -H 'Content-Type: application/json' \
--data '{"jsonrpc": "2.0", "id": 1, "method": "debug_executionWitness", "params": ["0x1901caa"]}' \
http://127.0.0.1:8547json
{
"jsonrpc": "2.0",
"id": 1,
"method": "debug_executionWitness",
"params": [
"0x1901caa"
]
}Response
Live mainnet, block 26221738, 2026-10-18. Checked against reth 2.7: equal.
json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"state": [
"0xf90211a05c3c778d7476ee1ad01d7b19c91530ce447fe1c8a2f63cf9f7b78f6fd09ce325a00c8b3c401ca1db87dc8082ce1a7d657b1380f43b8adb0238a3ce539cf318e07ea0c0f1f7e1cb51fdb709f9081fe548e779fb56c2745673a16e60e22069d95acdbea0463bbf6e0d2e01a1c24e8067c6947ef7a3a3ed9b5b1dd49bb1f6c66ff3516b7ba0444fbe38667c26ee9c5e04276be094a581edd435d413e276c1aadc6ce03b5c73a08c92de6c76d3af3f09b6f5d6e42f0f17f2a64737988b4fb668bbf08a62ae... 666 more characters",
"0xf90211a08ea346c1bf08360fe86cb1fd422ded24341008b1e39b1565518b7537b2e76466a0a98ec7d34eca9b8982067d51a8bcd2fe01284cd766822078104494bf88ccded2a0a9dedc2dd660582bce273b15dfb5671bcfd464516546a5553d35997ddc8b17dda09b1df163b45eac99659e2df556c3015ae2625938904bc76f1f633ae25ff4b77aa0c4294f6c0eb8c00a79cb3b7db396464b9e9640d0a4d1a541577e6eb40b45f51da01a1fcad39a02dbc8b42d00155eed60cd276e396246fe543f8c6a056be11d... 666 more characters",
"0xe99e2089f7fc1307366c9ab55829b9bba6c21328c0815056a1be0181d2dce29389889578f4d63e97fa00",
"... 1 more items"
],
"codes": [
"0x60806040527f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545f9081906001600160a01b0316368280378136915af43d5f803e156048573d5ff35b3d5ffdfea2646970667358221220e42ba8256e195f1b96e9c439a2830c944090ecdbd6d93657bf68f8cfa690664d64736f6c634300081b0033",
"0x608060405273ffffffffffffffffffffffffffffffffffffffff7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54166000808092368280378136915af43d82803e156056573d90f35b3d90fdfea2646970667358221220a7fdb4ae7677f079fd96794a0990a96a51cb790ca4fea496532b5fc35dafd16364736f6c63430008170033",
"0xef0100f4b2569a806c1f4d1be0cebc3f0475a3d17a1c4d",
"... 1 more items"
],
"keys": [
"0xc19df0e2bb2c49ed7045c1cf13b46a0f26537c3f",
"0x097f99768a0a4a0a81babbcb1ea18193ba9d53cc",
"0xda87a28fcd476d42385b07dfc1d4da7af2aa1775",
"... 1 more items"
],
"headers": [
"0xf90278a00c867ebefaa6abf5aa7f5d566f66275b3f8f4195fd17c724048af47b6cfd3867a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794dadb0d80178819f2319190d340ce9a924f783711a05f8000b8c02cb1aeefadc95e129b3edf5eae297394648b5813075b6cfeb5b351a0c9facc88200a12a5a918b914fd9ff2af734d5f5fb3dcd28111ee3dea690dfe8da02218a6f8790d2518f13b8279f36796f3c39ce0edb2b10964f424423177887163b90100f7bfdffb4fffbd... 872 more characters"
]
}
}The witness of a block near the head. Shortened to the first 4 items of each list (the full answer had 9034 state, 311 codes, 1901 keys, 1 headers). Compared with reth as sets: the order of the items is not defined.
Parameters
| Name | Type | Required | Meaning |
|---|---|---|---|
block | block number in hex, a tag, or a block hash, see Block parameter | yes | The block. |
mode | string, legacy or canonical | no | The form of the witness, as reth's ExecutionWitnessMode. legacy is the usual form of reth. canonical is the form of the zkEVM project of the execution specifications. Default: legacy. |
Returns
An object with four lists of hex strings. state has the RLP of each trie node that the block reads, in the account trie and in the storage tries, and of each node that the new state root needs. codes has the contract codes. keys has the addresses (20 bytes) and the storage slots (32 bytes) that the block uses. headers has the RLP of the block headers from the oldest block that BLOCKHASH reads to the parent, oldest first. If the block does not read BLOCKHASH, headers has the parent only.
Notes and limits
- It works for the head and the 127 blocks before it. The node runs the block on the state of its parent.
- For a block below the head, the node first makes the tries of the parent from the tries of the head. A block far below the head can take some seconds and some GB of memory.
- Before it answers, the node computes the new state root with the trie nodes of the witness. It checks that root against the block.
- One witness runs at a time by default (
--rpc-max-witness-requests). Another request waits for its turn, at most 120 s, and the waiting requests get their turns in the order they came. One witness has a time limit of 60 s and a memory limit of 8 GiB. The time limit starts with the first try of the request, before the read of the parent state. A try after a database change gets only the time left. The wait for a turn is not in the time limit. The work checks the limit after the read of the parent state and at each read of the database. It stops at the first check after the limit. - The witness always has the state root node of the parent. reth sometimes leaves it out (issue #16).
- With the default
--persist-depth 0, the newest block stays in memory for about one second before the node writes it. If the parent block is not written yet, the request waits for the write, at most 10 s. - With
--persist-depth Kof 2 or more, the newest blocks stay in memory longer. Then the witness of a block whose parent is still in memory fails after 10 s. - The node set follows reth 2.7. reth also counts a slot that the block reads and leaves zero as a delete, also when the slot does not exist. When such deletes can empty a part of a trie (the state trie or a storage trie), reth adds the sibling of that part. When a delete merges a branch into a child under 32 bytes, reth lists that child on its own. Cinder does the same (issue #181).
legacy: the lists are in no fixed order.codesalso has the codes that the block makes, and the empty code when the block makes an account without code.statehas the empty node (0x80) when an account that the block reads has no storage.canonical: the node sorts the lists in increasing byte order. There is no empty node, no empty code and no code that the block makes.
Errors
| Code | Message | When |
|---|---|---|
| -32001 | block not found: 0x... | The block is above the head. For block 0 the text is block not found: hash 0x00...00, as reth (the parent of block 0 has a zero hash). |
| -32001 | block not found: pending | The block is pending, as in reth. |
| 4444 | pruned history unavailable: requested N, earliest available M | The block is below the first block of the node. |
| -32603 | failed to apply blockhash contract call: database error: Database error: insufficient changesets to revert to block #N. Available changeset range: A..=B | The state of the parent block is gone: it is more than 128 blocks below the head. Below the first block of the node, the error is 4444. |
| -32603 | the node is busy with other execution witness requests, try again later | No turn came within 120 s. |
| -32603 | the witness took longer than its time limit of 60 s | The work took longer than 60 s. |
| -32603 | the witness needs more memory than its limit of 8192 MiB | The work needs more than 8 GiB. |
| -32603 | the parent block is not written yet, try again later | The parent block stayed in memory only for 10 s. |
| -32602 | Invalid params | A parameter is missing or does not parse, or the mode is not legacy or canonical. data has the text of reth, with the position. |
Compared with reth
The answer has the four fields of reth in the same order. On the same block, the nodes, the codes and the headers of Cinder and reth are the same when compared as sets, except that Cinder always has the state root node of the parent (issue #16). reth lists its nodes in no fixed order, and sometimes lists a code two times. Compare the answers of the two nodes as sets. The comparison on 1 551 mainnet blocks, and the live comparison with reth 2.7, are in the results of 2026-10.
The live example above gives the same answer on Cinder and on reth 2.7.
Related methods
debug_executionWitnessByBlockHash, debug_traceBlockByNumber, debug_getRawBlock, debug_getRawHeader.
Schema (OpenRPC)
Parameter block: BlockSelector
json
{
"title": "Block number, tag or block identifier",
"description": "A block number, a tag, or an object with blockHash or blockNumber. Null means latest.",
"oneOf": [
{
"title": "hex encoded unsigned integer",
"type": "string",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$"
},
{
"title": "Block tag",
"type": "string",
"enum": [
"earliest",
"finalized",
"safe",
"latest",
"pending"
],
"description": "latest is the head of the last forkchoice update, as reth. pending is the block that Cinder builds from its transaction pool after latest, as reth. safe and finalized are the blocks of the last forkchoice update, as reth. Before the first update, they name no block. earliest is the first block that the node stored, as reth."
},
{
"type": "object",
"properties": {
"blockHash": {
"title": "32 byte hex value",
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
},
"blockNumber": {
"title": "hex encoded unsigned integer",
"type": "string",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$"
}
},
"additionalProperties": false
},
{
"type": "null"
}
]
}Parameter mode: string
json
{
"type": "string",
"enum": [
"legacy",
"canonical"
]
}Result: ExecutionWitness
json
{
"type": "object",
"required": [
"state",
"codes",
"keys",
"headers"
],
"properties": {
"state": {
"type": "array",
"items": {
"title": "hex encoded bytes",
"type": "string",
"pattern": "^0x[0-9a-f]*$"
},
"description": "The RLP of each trie node."
},
"codes": {
"type": "array",
"items": {
"title": "hex encoded bytes",
"type": "string",
"pattern": "^0x[0-9a-f]*$"
},
"description": "The contract codes."
},
"keys": {
"type": "array",
"items": {
"title": "hex encoded bytes",
"type": "string",
"pattern": "^0x[0-9a-f]*$"
},
"description": "The addresses (20 bytes) and storage slots (32 bytes) that the block uses."
},
"headers": {
"type": "array",
"items": {
"title": "hex encoded bytes",
"type": "string",
"pattern": "^0x[0-9a-f]*$"
},
"description": "The RLP of the headers from the oldest block that BLOCKHASH reads to the parent, oldest first."
}
}
}