Skip to content

Engine mode and shadow mode ​

Cinder starts from a database that cinder-import builds from a synced reth node. It cannot sync from genesis yet. This page tells how blocks come to the node, what a reorg does and what the node writes to disk. To stop the node and start it again, read Upgrading. To build the database, read Install. For every flag, read Configuration.

Two modes ​

Cinder can follow the chain in two modes. Engine mode is the normal mode: the node is the execution client of a consensus client. Shadow mode is an optional check.

ModeCommandWhere the blocks come from
Enginecinder --enginethe Engine API, from a consensus client (or, for a comparison, cinder-replay or cinder-mirror)
Shadowcinder --shadowthe JSON-RPC API of a reth node (eth and debug namespaces)

Shadow mode ​

In shadow mode, Cinder reads each new block from reth with debug_getRawBlock. It executes the block against its own database and checks the state root against the block header. With --receipts, it also compares every receipt with reth's receipts.

Shadow mode stays --confirm K blocks behind reth (default 2). If a block does not connect to the database head, a reorg was deeper than K blocks. The node then prints this line and stops:

block N: parent 0x... is not our head 0x... (reorg deeper than K blocks); stopping

Shadow mode also stops at the first block of the Amsterdam fork, which this version does not implement. Mainnet has no Amsterdam time yet, so this applies only when you give --amsterdam-time T. The node prints this line and stops:

Amsterdam fork at block N is not supported by this version; upgrade

Shadow mode is an optional check after an import. The engine mode is the mode for daily use.

Engine mode ​

In engine mode, Cinder serves the Engine API with JWT authentication, as reth does. It answers engine_newPayload and engine_forkchoiceUpdated. It keeps recent blocks in memory and writes canonical blocks to the database in the background.

There are three ways to send it blocks.

  1. A consensus client of its own. Point the consensus client's execution endpoint at Cinder's Engine API, with the same JWT secret. Cinder is then the execution client of that consensus client. This is the normal setup. Read Run with a consensus client.
  2. cinder-replay (optional, for a comparison). It reads beacon blocks from a consensus client's REST API and does not change it. It sends Cinder the engine_newPayloadV4 and engine_forkchoiceUpdatedV3 calls that a consensus client would send. With --follow, it follows the beacon head. Your consensus client and its execution client do not change.
  3. cinder-mirror (optional, for a comparison). It sits between the consensus client and another execution client, for example reth. reth answers every call, and the consensus client sees only reth's answers. cinder-mirror sends a copy of each newPayload and forkchoiceUpdated call to Cinder and compares the two statuses.
bash
cinder --engine --db DIR --jwt JWT_FILE --p2p --http
cinder-replay --engine CINDER_ENGINE_URL --jwt JWT_FILE --beacon BEACON_URL --follow
bash
cinder-mirror --listen ADDR:PORT --jwt JWT_FILE \
    --primary RETH_ENGINE_URL --secondary CINDER_ENGINE_URL --secondary-jwt CINDER_JWT_FILE

For cinder-mirror, set the consensus client's execution endpoint to the --listen address. A slow or failed Cinder never delays the consensus client. cinder-mirror logs one line for each copied call. A DIFF line shows that reth and Cinder gave different statuses. SYNCING or ACCEPTED from Cinder is not a difference: the node can be behind.

cinder-replay stops with exit status 1 on the first INVALID. It stops with exit status 3 on a block of a fork that the node does not implement (error -38005). The blocks it sends are canonical, so a correct node answers each one VALID, or SYNCING while it is behind.

Which way to choose ​

  • Use a consensus client of its own to run Cinder as your execution client.
  • Use cinder-mirror to compare Cinder with another execution client on every call that the consensus client makes, forks included. The project measures Cinder against reth this way.
  • Use cinder-replay to feed Cinder from the REST API of a consensus client and change nothing else. The recorded latency windows up to 2026-10-05 used this setup.

Missing blocks ​

If the consensus client names a head that Cinder does not have, the node answers SYNCING and gets the missing blocks.

  • With --p2p, Cinder gets them from peers. It checks every body against its header before it executes the block. Open the P2P port for inbound peers. Read No peers.
  • With --backfill-rpc URL, Cinder gets them from a reth node's JSON-RPC API.

Without --p2p or --backfill-rpc, the node cannot get missing blocks. With both flags, the node uses only P2P.

The node gets missing blocks between requests, a few blocks at a time.

After a restart, the node can answer SYNCING for some minutes. Read SYNCING for a long time after a restart.

Reorgs ​

Cinder keeps the recent blocks in memory and writes canonical blocks to the database. A reorg can go to a fork in memory or to a fork below the database head.

  • A fork in memory. The node changes its head to the other branch. The database does not change.
  • A fork below the database head. For each written block, the node keeps an undo record. The node checks the fork over these undo records. An invalid fork leaves the database as it was. A valid fork becomes the head at once, in memory. Then the writer thread removes the blocks above the fork base and writes the new branch, in one transaction. When the fork base is 1 or 2 blocks below the database head (for example a sibling of the head), the node executes the new block at engine_newPayload and answers VALID or INVALID, as reth does. The forkchoice update then executes nothing and writes nothing. JSON-RPC latest and eth_blockNumber give the new branch at once, before the writer commits it. A deeper fork stays pending (ACCEPTED) until a forkchoice update selects it.
  • A fork deeper than 128 blocks below the written head. The undo window is 128 blocks, so the node cannot follow such a fork. It answers SYNCING. Mainnet finality is about 64 blocks.

A forkchoice update to a valid branch in memory that is not on the chain of the batch that the writer is writing (for example a sibling of a block in that batch) does not wait for the write. The branch becomes the head at once. After the write, the node puts the branch on the undo records of the written blocks, and the writer writes the switch in one transaction. In a test with the write held for 10 s, such a forkchoice update went from about 10 s to less than 1 ms. A pending head and a branch on reverse layers still wait: read Reorgs during a write. Up to 0.8.0, a 1-block reorg during a write left the node on the dropped block. Read Troubleshooting.

With --http, WebSocket subscribers receive the reorg as reth sends it: the headers of the new branch again, and the logs of the dropped blocks with removed: true.

What the node writes to disk ​

All files are in the database directory DIR.

  • The database (libmdbx), with Cinder's own schema:
    • the state (hashed flat records) and the trie tables. Leaves and bottom branches are not stored. The node rebuilds them from the flat records and checks each node against its hash.
    • contract code and headers.
    • the undo records of the last 128 written blocks.
    • block history (bodies, receipts, senders, transaction and block-hash lookups) from the block where the node started.
    • the head.
  • DIR/nodekey with --p2p: the node key. The enode stays the same across restarts. The node prints the enode at start.
  • DIR/p2p-nodes with --p2p: the known nodes, their dial backoff and the good peers of before. The node dials these peers first after a restart. Read Configuring.

The mainnet database was 296 GB on 2026-10-01. reth's data on the same machine was 1.1 TB, because reth keeps all history since genesis. At the chain head, Cinder writes about 65.2 MB per block to the disk, and reth 2.7 about 20.4 MB, 3.2 times less (live on mainnet on 2026-10-16, #59). Each block changes a few hundred KB of state, but a commit copies every page that it touches. Read Disk writes.

cinder --serve --db DIR serves the JSON-RPC API from a database that another Cinder process writes. It opens the database read-only. You can run more than one of these processes. Each one needs its own port, and the database allows at most 512 open read transactions over all processes.

Next steps ​