Skip to content

Differences from reth ​

This page describes the current version

Methods, limits and answers can change between v0.x versions.

The goal is the same answer as reth for the same question. These are the places where Cinder answers in a different way, or does not answer yet. For the parity checks and the speed, read JSON-RPC parity and speed.

We list each difference to be exact. A difference by design is a choice that we made for Cinder, not a fault of reth. We measure Cinder against reth because reth is a strong, carefully engineered client. We respect the work of its engineers and their engineering approach: open code, careful tests and a modular design. Our comparisons run the two clients on the same machine with the same blocks, and they are measurements, not a criticism of reth.

Blocks and state that the API can see ​

The API of the node reads its canonical head: the blocks that the node answered VALID to the consensus client, also before the writer writes them to the database, as in reth. cinder --serve reads the database only (read "cinder --serve" below).

  • Block tags. latest means the head of the last forkchoice update from the consensus client, as in reth. earliest means the first block that the node stored, as in reth (read "Block history" below). It is block 0 only for a node that started from genesis. The call methods (eth_call and the others) name block 0 in their 4444 error for earliest, as reth does.
  • latest after a switch to a written ancestor. An example: the database holds blocks A2 and A3, and the head moves to B2 and then back to A2. latest is A2 at once, also before the writer removes A3, and block 3 is not canonical. v0.9.5 and earlier answered from A3 until the writer removed it. v0.9.6 fixes this (#162).
  • latest when the writer is behind. The writer can commit an older batch while the engine is idle. Then the database can hold blocks above the canonical head. latest is the canonical head, and the request does not read the database blocks above it. 0.9.6 and earlier could answer latest from such a database block (#283). If the request cannot get a chain head that fits the database after 17 tries, 1 ms apart, it gets the error -32603 chain head not readable, try again. Send the request again.
  • safe and finalized. These tags mean the safe block and the finalized block of the last forkchoice update from the consensus client, as in reth. The node also writes them to the database with the blocks. Thus cinder --serve sees them too, and they stay after a restart. After a restart, the node uses the tags in the database until the first forkchoice update. In cinder --serve, if the safe or the finalized block is not in the database yet, the tag means the database head. Before the first forkchoice update, the block methods (eth_getBlockByNumber and others) return null for these tags. The other methods give -32001, block not found: finalized (or safe), as reth.
  • A tag after a reorg. A forkchoice update with a zero hash keeps the tag, as in reth. If a reorg in memory removed the block of the tag, the tag names a block that is not canonical. Until the next update with a hash, the block methods return null for that tag and the other methods give -32001. reth still serves the old block. The consensus clients send a hash in every update after the merge.
  • State at finalized. The state methods (balances, calls, traces) at finalized work while the finalized block is one of the last 128 blocks. Usually it is 64 to 96 blocks below the head. During a period without finality, it can be deeper. The state methods then give the error 4444, pruned history unavailable: requested N, earliest available M. reth answers them.
  • pending. Cinder builds a pending block from its transaction pool, as reth does with its default --rpc.pending-block full (#81). The block comes after the canonical head, as in reth (#33). The rules are those of reth: the pool transactions in the order of their tips, a zero state root, a random mixHash, a new build after 1 second or after a new head. Because the pools are different, the transactions are usually different. The state methods read the state after the pending block. The calls run with the values of the next block on the state of latest, as in reth. eth_getTransactionCount at pending starts from the nonce after the pending block and counts the transactions of the sender in the pool, as reth. cinder --serve has no pool: its pending block comes after the database head and has no transactions, and eth_getTransactionCount gives the account nonce. For a short time in each slot, reth answers pending in a different way: after it executes a new block from the consensus client, and before the forkchoice update makes that block canonical, reth gives that block as the pending block, with its real state root, miner, extra data and transactions. Cinder always gives the block that it builds from its pool.
  • Transaction pool. Cinder and reth each keep their own pool. Each pool gets transactions from its own peers and removes them by its own rules. So txpool_content, txpool_inspect and txpool_status usually show different transactions. The form of each entry is the form of reth: the sender keys are EIP-55 addresses, and the same transaction gives the same entry on the two nodes. The limits of the pool are those of reth: 16 transactions for each sender, a queued part for transactions with a nonce gap, and eviction by the lowest tip. When the pool is full, eth_sendRawTransaction gives -32003 txpool is full, as reth. 0.9.6 and earlier kept the newest 65 536 transactions. Read The transaction pool.
  • The head. With the default --persist-depth 0, the writer thread writes each block soon after the forkchoice update that makes it canonical. The API does not wait for the write. latest, eth_blockNumber, the newHeads and logs subscriptions and the pending block follow the canonical head at once, as in reth (#33). The blocks that are not written yet come from memory: their headers, bodies, receipts, logs and state. After a forkchoice update to a fork below the database head (for example a sibling of the head), latest is the new branch at once, and the replaced block is not canonical any more. This is also true with a --persist-depth above 0 (#144). For the writer, read Writing blocks.
  • Proofs at a head that is not written yet. eth_getProof and eth_getAccount work at the canonical head also before the write. For a proof, the node first waits for the trie nodes of the new blocks. It builds them in the background in a few milliseconds. After a forkchoice update to a fork below the database head, and before the writer writes that fork, the node takes the tries of the database at its head, applies the undo records of the old branch and the changes of the new branch, and checks the state root of the new head. The proof is then at the new head, as in reth 2.7 (#159). Before 0.9.5, this answer was -32603 proof unavailable: the head block is not written yet.
  • cinder --serve. This process reads the database of a node. It does not see the memory of the node. Its latest is the database head, which is behind the chain head of the node while blocks wait to be written.
  • History. Bodies, receipts and transaction lookups exist from the block where the node started. The node does not have the bodies of earlier blocks.
  • State. Balances, nonces, code, storage, calls and traces work at any of the last 128 blocks (eth_getAccount and eth_getProof at the latest block only). For an older block, the node lays the undo records of the later blocks over the state of the head. A block older than the undo window gets the error of reth: 4444, pruned history unavailable: requested N, earliest available M. N is the requested block. M is the oldest block whose state the node serves (the head minus 128). The methods that replay a whole block (trace_block, debug_traceBlock*, trace_filter, eth_simulateV1 and the other trace methods of a block or transaction) give -32603 failed to apply blockhash contract call: ... insufficient changesets ..., as reth.
  • Transactions by sender and nonce. eth_getTransactionBySenderAndNonce finds a transaction that is not in the pool as reth does: a binary search on the nonce of the sender. The search reads the state of block head/2 first. That block is older than the state window of Cinder and of a reth full node. So both nodes give the error 4444 with the same N. M is different, because each node gives the start of its own state window.
  • Block history. The node keeps blocks, receipts and logs from the first block it stored (the earliest tag, as in reth). For a block below it, the block, receipt, log and trace methods give the error 4444, as reth. M in the message is the first block of this node. The node keeps no headers below its first header. For such a block, eth_feeHistory without percentiles and debug_getRawHeader give 4444, and reth answers them. The history from block 0 comes with v1.0.
  • Old receipts. A reth full node can prune old receipts while it keeps the blocks. Then it answers eth_getBlockReceipts with null and eth_getLogs with a bare 4444 pruned history unavailable for those blocks. Cinder keeps the receipts from its first block and answers them. This is by design until v1.0 has the full history.
  • Log ranges below the history. eth_getLogs and eth_getFilterLogs check the range limit of 100 000 blocks before the first block of Cinder (#127). reth checks its first block before the range limit. Thus a range of more than 100 000 blocks that starts below the first block of reth gives 4444 on reth and -32602 query exceeds max block range 100000 on Cinder. A range that starts between the two first blocks gives -32602 on both. This is by design, because the histories of the two nodes start at different blocks.
  • Unknown blocks. The block methods (eth_getBlockByNumber and others) return null for a future number or an unknown hash. The state, call, trace and proof methods give -32001, block not found, with the text of reth.

Calls ​

  • Two precompiles moved to one address. A state override can move two precompiles to the same address with movePrecompileToAddress. reth runs one of them by the order of its internal map, which is not the order of the request (#120). Cinder runs the first one in the request.

Connections ​

  • What the limit counts. --rpc-max-connections (default 500, as in reth) counts the open connections: HTTP keep-alive connections and WebSocket connections. reth counts the HTTP requests in progress and the WebSocket connections, so an idle keep-alive connection does not count in reth. In Cinder each open connection has a thread, so each one counts. But idle connections do not keep new ones out, as in reth: at the limit, a new connection closes the HTTP connection that waited for its next request for the longest time. Only when no connection waits does it close the connection whose request headers are not complete for the longest time. Only when there is no such connection either does a new one get the refusal. The refusal is the same as in reth: HTTP status 429 with the text Too many connections. Please try again later.
  • Timeouts. Cinder closes a new connection that sends no byte in 30 s, an HTTP connection that sends no new request for 120 s, a request whose headers do not arrive in 30 s, a request that stops for 30 s, and a client that does not read its response for 30 s. A request whose body is not complete 60 s after its first byte gets HTTP status 408. A WebSocket client that sends no frame and receives nothing for 120 s gets a ping, and the connection closes when no frame comes in the next 30 s. reth has no such timeouts. A client that keeps a connection open must connect again after an idle time. Most HTTP clients do this.
  • Transfer-Encoding with Content-Length. Cinder gives HTTP status 400 to a request that has both headers, and closes the connection. reth reads the body as chunked and closes the connection after the answer. Other header checks are as in reth: a header line that is not valid gets 400, and Cinder reads chunked bodies.
  • Engine API. The Engine API port has a limit of 64 connections (--authrpc-max-connections changes it). reth has a limit of 500. A consensus client uses one or two. A connection that sends no request with a valid JWT closes 3 s after the server accepts it. At the limit, a new connection first closes the oldest connection that has no valid JWT. Thus such connections never close the connection of the consensus client.

Filters and subscriptions ​

  • Filters. Cinder keeps at most 1 024 filters, at most 256 for one client (--rpc-filters-per-client), and a log filter has at most 1 024 addresses and topic values. reth has no such limits. Read Filters.
  • logs subscriptions. All connections together can have at most 4 096 logs subscriptions (--rpc-max-log-subscriptions), and a logs filter has at most 1 024 addresses and topic values. reth has no such limits.
  • The form of a filter id. A filter id is a random string that a client gives back without a change. Cinder always writes 32 hex digits. reth writes the id without leading zeros, thus about 1 of 16 reth ids has fewer digits. Do not use the length of an id as a check. The project plans to write the id in the form of reth in 0.9.8 (#402).

Compressed answers ​

The HTTP server compresses answers as reth does (read Compressed answers). These parts are different:

  • No br and no zstd. Cinder has gzip and deflate. reth also has br and zstd, and on equal weights it selects zstd first, then br. Thus a request with Accept-Encoding: gzip, deflate, br, zstd gets gzip from Cinder and zstd from reth. A request that asks only for br or only for zstd gets the answer without compression from Cinder. Both answers are valid HTTP, but the bytes on the link are different (#279).
  • No list of encodings. reth's --http.compression gives a shorter list of encodings. Cinder does not have this option. It has only --http-disable-compression.
  • Length of the answer. A compressed answer from Cinder has a Content-Length header. reth sends a compressed answer in chunks (Transfer-Encoding: chunked).
  • Compressed bytes. The two servers use different compressors, so the compressed bytes and their size are different. After decompression, the answer is the same as the answer without compression.

Execution witnesses ​

  • The state root node. debug_executionWitness always has the state root node of the parent block. reth sometimes leaves it out (#16). Then a stateless client cannot run the block from the witness of reth.
  • Order and repeats. In the legacy mode, reth lists the nodes, the codes and the keys in no fixed order, and sometimes lists a code two times. Cinder lists each item one time. Compare the two answers as sets. The headers are in the same order on both nodes. On 1 551 mainnet blocks, the sets of nodes, codes and headers were the same.
  • reth versions. The node set of reth depends on its version. Two rules of reth 2.5.2 and 2.7 are not in reth 2.0. First, when a removal merges a branch into a child under 32 bytes, reth lists that child on its own. The fixtures of reth 2.0 show this difference. Second, reth adds a sibling node for a slot that the block reads and leaves zero, also when the slot does not exist. Cinder follows reth 2.7 (#181).

JavaScript tracers ​

debug_trace* runs a JavaScript tracer as reth does: the same hooks, objects and functions, the same limits (200000 loop iterations in one function call, nested calls), and a hook that throws fails the call frame as in reth. These parts are different by design:

  • Error texts. The JavaScript engine words its errors in its own way. The texts of syntax errors and of exceptions, and their positions (unknown at :L:C), can be different from reth. The text of a thrown value that is not an Error has the same frame lines as reth. A hook that throws makes the call frame fail with this text as its output, so that output can be different too. The error codes are the same.
  • timeout. Cinder stops a JavaScript tracer after the timeout option (a Go duration, for example "10s"), or after 60 s. reth does not use this option. The limit protects a public node.
  • Memory and stack. Each transaction gets an engine with a memory limit of 256 MiB and a stack limit. Deep recursion stops at about 1700 nested calls with reth's text RuntimeLimit: exceeded maximum call stack length. reth stops near 1460 calls for a small function.
  • Worker processes. The engine runs in a worker process. If the worker stops (for example, a crash in the engine), the request gets -32603 JavaScript tracer: the worker process stopped. reth runs its engine in its own process.

What is still missing ​

These parts of the reth API are not in Cinder yet. The method reference shows the status of each method, and #55 tracks the missing ones:

  • debug_intermediateRoots and debug_getBadBlocks.
  • IPC. Cinder serves HTTP and WebSocket only (#9).
  • eth_getProof below the head. Like the default of reth, Cinder proves the head only. reth can raise its window with an option. Cinder serves historical proofs from v1.4 (archive).
  • admin_*.
  • eth_sendRawTransactionSync and eth_capabilities.
  • eth_getBlockAccessList and debug_getRawBlockAccessList. They come with the Amsterdam fork.
  • State older than 128 blocks.
  • BLOCKHASH in a call with a block override, for a block below the first header of the node (#125). reth keeps all headers and gives the hash. Cinder gives the genesis hash for block 0, and the error 4444 pruned history unavailable: requested N, earliest available M for the other blocks. This is by design until v1.0 has the full history.

Cinder does not plan the reth_* methods. They are reth's own extensions, not part of the Ethereum JSON-RPC API.

rpc_modules lists only the served namespaces that have methods in Cinder: eth, net, web3, txpool, debug, trace and rpc. With --http-api all, reth also lists admin, reth and its other namespaces. The namespace options and their default are reth's (read JSON-RPC namespaces).

For the plans, read the Roadmap.