feat(dbtool): add proof domain for proofs and remote-prover bookkeeping - #4
Open
vladb-ai wants to merge 4 commits into
Open
feat(dbtool): add proof domain for proofs and remote-prover bookkeeping#4vladb-ai wants to merge 4 commits into
vladb-ai wants to merge 4 commits into
Conversation
…edProofDb SledProofDb exposed only the async storage traits, and kept its trees private, so an offline consumer had no way to enumerate or remove individual entries, or to read without an async runtime. Add synchronous inherent accessors covering all five trees — get/store/ prune plus list/delete for the ASM and Moho proofs, and get/list(/delete) for the remote mapping and status bookkeeping. The async trait impls now delegate to these, mirroring the sync-variant convention already used in strata-asm-moho-storage, so there is a single source of truth. This lets the dbtool drive the proof DB synchronously.
dbtool only covered the storage DB's `asm` domain. Add a `proof` domain over the proof DB so the prover's on-disk data can be inspected and maintained offline: ASM step proofs, Moho recursive proofs, the local↔ remote id mapping, the in-flight job status, and a height prune. Proof values are borsh-encoded, so records carry a lossless `borsh_hex` blob rather than the `ssz_hex` the `asm` records use. Ranges, proof ids, and remote ids each render in the exact string form their verbs parse, so a printed record feeds straight back into the next command. Mutating verbs stay behind the `--write` gate. dbtool stays fully synchronous by driving SledProofDb's sync accessors.
Drives the prover env until ASM and Moho proofs land, stops the runner, then exercises the proof domain against the real proof DB: proof list/get round-trips, latest, missing lookups, the empty remote mapping/status the native backend leaves behind, the --write gate, and a delete on a DB snapshot.
🔒 AI Security ReviewI reviewed the diff ( No exploitable vulnerabilities found. Notes on why the usual risk areas don't apply here:
Nothing else in the diff (Cargo.toml/Cargo.lock dependency additions, README updates, |
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.
Description
Extends
dbtoolwith aproofdomain so the runner's proof DB can be inspected and maintained offline, the same way the existingasmdomain covers the storage DB. Previously there was no offline tooling for any of the prover's on-disk data.The domain, all in the proof DB:
proof asm— ASM step proofs, keyed by L1 range.get <range>·list·delete <range>.proof moho— Moho recursive proofs, keyed by commitment.get·latest·list·delete.proof mapping— the local↔remote proof-id mapping.get-remote <proof_id>·get-local <remote_id>·list.proof status— in-flight remote job status.get·list·in-progress·delete.proof prune --before <h>— drops ASM and Moho proofs below a height (leaves the mapping/status bookkeeping untouched).Proof values are borsh-encoded (each wraps a
ProofReceiptWithMetadata), so records carry a losslessborsh_hexblob rather than thessz_hextheasmrecords use. Ranges (<commitment>..<commitment>), proof ids (asm:<range>/moho:<commitment>) and remote ids (hex) each render in the exact string a verb parses, so a printed record feeds straight back into the next command. Mutating verbs stay behind the--writegate.To keep
dbtoolfully synchronous (no tokio runtime, matching theasmcommands),SledProofDbgains synchronous inherent accessors across all five trees — get/store/prune plus the previously-missing list/delete — with the async storage-trait impls delegating to them, mirroring the sync-variant convention already used instrata-asm-moho-storage.Independent of the Moho
dbtoolPR (alpenlabs#171); both branch offmain, so whichever merges second rebases the shareddbtoolfiles.Type of Change
Notes to Reviewers
SledProofDb's async trait impls now delegate to the new sync methods; the existing storage-crate proptests (unchanged behaviour) plus new list/delete tests cover them.Verified end-to-end against a real proof DB through the built binary for the read/empty/write-gate paths; the functional test (
fn_asm_dbtool_proof_test.py) drives theproverenv until proofs land and then exercises list/get round-trips, latest, missing lookups, the empty remote bookkeeping the native backend leaves behind, the--writegate, and a delete on a snapshot.Checklist