ethrex-storage
Persistent storage layer for the ethrex Ethereum client.
For detailed API documentation, see the rustdocs:
Quick Start
use ;
// Create with RocksDB backend
let store = new?;
// Add a block
store.add_block.await?;
// Query account
let info = store.get_account_info?;
Features
rocksdb: Enable RocksDB backend for persistent storage (default is in-memory)
Deep-reorg cap and metrics
By default the maximum reorg depth is physical: how far back the node can reconstruct
state (in-memory layer retention plus the reverse-diff journal's reach). It is bounded
only indirectly by finality, because finality advances prune the journal. To restrict
this further, pass --max-reorg-depth <N> on the CLI; reorgs deeper than N are
rejected with -38006 TooDeepReorg. NOTE: --max-reorg-depth 0 rejects EVERY reorg,
including routine 1-2 block reorgs — it does not restore the old 128-block cap.
The following Prometheus metrics are exposed under ethrex_reorg_* /
ethrex_deep_reorg_*:
| Metric | Type | Description |
|---|---|---|
ethrex_reorg_overlay_entries |
Gauge | Entries in the installed overlay (0 when idle). |
ethrex_reorg_overlay_bytes |
Gauge | Byte size of overlay key+value data (0 when idle). |
ethrex_reorg_journal_length |
Gauge | Span of the STATE_HISTORY column family. |
ethrex_reorg_depth |
Histogram | Distribution of attempted reorg depths. |
ethrex_reorg_reconcile_duration_seconds |
Histogram | First-commit reconciliation latency. |
ethrex_deep_reorg_attempts_total |
Counter | Deep reorgs initiated. |
ethrex_deep_reorg_success_total |
Counter | Deep reorgs completed successfully. |
ethrex_deep_reorg_aborts_total |
Counter | Deep reorgs that aborted. |