…sync mode
In pruned + checkpoint-sync mode (the minimal fast-validator configuration), the
transparent address index — balances, address→utxo, address→tx — is RPC-only
state that consensus never reads. Skip building it, the way pruned mode already
drops raw-transaction storage.
- `Config::skip_address_index()` = `Pruned && checkpoint_sync` gates the behavior.
- The commit path skips the per-block address-balance reads and the 3 address
index CF writes. The UTXO set (`utxo_by_out_loc`), `tx_loc_by_hash`, nullifiers,
note commitment trees, and value pool are all unchanged.
- Rollback and the block-info/address-received format check tolerate the absent
index — they only touched it to maintain the address CFs.
- The address-lookup RPCs (getaddressbalance/utxos/txids) return an explicit
"index disabled in pruned mode" error rather than wrong (empty) results.
Archive nodes, and pruned nodes with checkpoint sync disabled (full semantic
verification), keep the index unchanged.
Tests: a gate unit test, plus a finalized-state test asserting the 3 address CFs
are empty in pruned+checkpoint and populated in archive, with `utxo_by_out_loc`
still written when skipping. Full zebra-state lib suite passes (205).
Stacked on the checkpoint_sync config mirror (PR A).
Motivation
On a pruned, checkpoint-syncing node (the minimal fast-validator configuration),
the transparent address index — balances, address→utxo, address→tx — is RPC-only
state that consensus never reads. Building it costs per-block address-balance
reads and index writes on the commit path. Pruned mode already drops
raw-transaction storage for the same reason; this extends that to the address
index.
Solution
Config::skip_address_index()=Pruned && checkpoint_syncgates the behavior.index CF writes. The UTXO set (
utxo_by_out_loc),tx_loc_by_hash, nullifiers,note commitment trees, and value pool are unchanged.
index (they only touched it to maintain the address CFs).
getaddressbalance/getaddressutxos/getaddresstxids)return an explicit "index disabled in pruned mode" error rather than wrong
(empty) results.
Archive nodes, and pruned nodes with checkpoint sync disabled (full semantic
verification), keep the index unchanged.
Test evidence
skip_address_index_only_when_pruned_and_checkpoint_syncing).populated in archive, with
utxo_by_out_locstill written when skipping.zebra-statelib suite: 205 passed, 0 failed. Build + clippy + fmt clean.AI disclosure
Implemented with Claude Code (the skip, RPC guards, rollback/format-check
adaptations, and tests).