docs: settle the storage engine and proof retention window - #17
Merged
Conversation
verity-db was specified only as "an embedded key-value store" with no engine named and no retention policy, which left the largest single storage decision open right before implementation starts. Measuring leanSpec's fixtures-prod-scheme.tar.gz shows the store holds two workloads with opposite shapes: an aggregate block proof is 155-236 KB (median 190 KB) against ~100-800 B for blocks, states and indices. At 4 s slots that is ~4.1 GB/day of proofs versus ~5 MB/day of everything else. Continuously writing six-figure-byte values and dropping them en masse a day later is an LSM workload, so RocksDB, behind a backend trait with an in-memory sibling so the engine stays replaceable. Retention is 21,600 slots (~1 day) in a table keyed slot||root, making pruning a slot-ordered range delete. leanSpec fixes the floor at MIN_SLOTS_FOR_BLOCK_REQUESTS = 3600 (4 hours) for BlocksByRange responders; one day is an operational choice above it, sized by how far a peer can fall behind and still catch up over P2P rather than needing a checkpoint. Also names both signature suppliers where the docs named only one: leanSig for per-validator XMSS sign/verify, leanMultisig for aggregation and aggregate-proof verification, both behind verity-crypto's single capability contract.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
verity-dbwas specified only as "an embedded key-value store" — no engine named, no retention policy. That is the largest storage decision still open, and implementation starts on top of it.What decides it
Measured from leanSpec's
fixtures-prod-scheme.tar.gzrelease asset (latest, 2026-07-30). The store holds two workloads with opposite shapes:MultiMessageAggregate)Writing six-figure-byte values continuously and dropping them en masse a day later is what an LSM tree with range tombstones is built for. RocksDB, behind a backend trait with an in-memory sibling (ethlambda's
StorageBackendsplit) so the engine stays replaceable. Same family as ethlambda, zeam, qlean-mini; gean uses Pebble.Note the devnet-scheme fixtures in the leanSpec source tree are much smaller and will mislead — XMSS signature is 424 B there versus 2,536 B in the production scheme.
Retention: 21,600 slots (~1 day)
Proofs get their own table keyed
slot ‖ root, so pruning is a slot-ordered range delete rather than a scan, and only belowtip_slot − 21,600once that cutoff is finalized.The floor is not ours to pick: leanSpec sets
MIN_SLOTS_FOR_BLOCK_REQUESTS = 3600(4 hours) and aBlocksByRangeresponder MUST serve that window. One day is an operational choice 6× above it — how far a peer can fall behind and still catch up over P2P instead of needing a checkpoint. leanSpec's own reference node meets the requirement in memory and persists no proofs at all; Verity persists them so the guarantee survives a restart.Also
Names both signature suppliers where the docs named only one:
leanSigfor per-validator XMSS sign/verify,leanMultisigfor aggregation and aggregate-proof verification, both behindverity-crypto's single capability contract.Verification
mdbook buildclean;#storage-engine-and-retentionanchor generated in the rendered page.docs/src/reference/architecture.mdre-synced with the canonical rootARCHITECTURE.md; the only remaining differences are the pre-existing relative-vs-GitHub link forms the mirror header describes.