refactor(storage): rename BlockSignatures to BlockProof - #553
Conversation
Greptile SummaryThis PR consistently renames block-signature storage concepts to block proofs across the API, pruning helpers, documentation, and RocksDB schema.
Confidence Score: 4/5The legacy proof records must be migrated or read through a fallback before this PR is safe to merge. Existing databases open both column families, but all signed-block reads target only the newly created Files Needing Attention: crates/storage/src/backend/rocksdb.rs, crates/storage/src/api/tables.rs, crates/storage/src/store.rs
|
| Filename | Overview |
|---|---|
| crates/storage/src/backend/rocksdb.rs | Adds legacy-CF opening compatibility, but leaves all records in that family inaccessible after upgrading. |
| crates/storage/src/api/tables.rs | Renames the public table variant and physical column-family label, creating the need for a real data migration or fallback. |
| crates/storage/src/store.rs | Consistently adopts the new naming, but reads only the new table and therefore cannot reconstruct blocks backed by legacy proof records. |
| docs/data_storage.md | Updates the storage documentation and table count consistently with the renamed table. |
| docs/infographics/ethlambda_architecture.html | Updates the architecture table label without changing executable behavior. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Existing RocksDB] --> B[legacy block_signatures CF]
A --> C[RocksDBBackend::open]
C --> D[Open legacy CF descriptor]
C --> E[Create/open block_proof CF]
F[Store reads Table::BlockProof] --> E
B -. no migration or fallback .-> F
E --> G[Missing legacy proofs]
Prompt To Fix All With AI
### Issue 1
crates/storage/src/backend/rocksdb.rs:62-72
**Legacy proofs become inaccessible**
When a node upgrades with an existing `block_signatures` column family, this code opens that family but neither migrates its records nor makes reads fall back to it. All non-genesis proofs are instead read from the newly created, empty `block_proof` family, causing previously stored signed blocks to return `None`, disappear from block responses, or trigger callers that require the persisted block to panic.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "refactor(storage): rename BlockSignature..." | Re-trigger Greptile
MegaRedHand
left a comment
There was a problem hiding this comment.
Looks good. However, please drop the BlockSignatures -> BlockProof migration logic, since we don't want backwards compatibility during devnets
The merge with main resolved the BlockSignatures -> BlockProof rename by keeping the pre-lambdaclass#548 body: a full-table scan collecting keys below the cutoff plus a delete_batch. That scan's cost tracks chain height instead of the handful of keys leaving the retention window, since every pass re-seeks past the tombstones the previous passes left behind, which is what lambdaclass#548 removed. Reapply the range delete on the renamed table: the delete_range plumbing survived the merge, only its caller was lost. Prune again returns the exclusive slot it pruned below (0 = nothing pruned), which a range delete can report without reading the table back, and returns early when the cutoff saturates to 0 so a young chain writes no empty tombstone.
🗒️ Description / Motivation
This PR renames the storage table previously called
BlockSignaturestoBlockProof.The table stores the merged block proof (
MultiMessageAggregate), not individual block signatures, so the old name was misleading. This makes the storage API, RocksDB column-family name, pruning helpers, tests, and docs match the data that is actually stored.What Changed
Updated
crates/storage/src/api/tables.rsTable::BlockSignaturestoTable::BlockProof.block_signaturestoblock_proof.Updated
crates/storage/src/store.rsTable::BlockSignaturesusages withTable::BlockProof.Updated
crates/storage/src/backend/rocksdb.rsblock_signaturescolumn family.Updated docs and comments
BlockProof.Correctness / Behavior Guarantees
slot || rootkey format.get_signed_blockstill synthesizes an empty proof only for slot 0.prune_old_block_proofs.Tests Added / Run
Related Issues / PRs
BlockSignaturestoBlockProof#527✅ Verification Checklist
make fmt— cleanmake lint(clippy with-D warnings) — cleanmake test(cargo test --workspace --profile release-fast) — all passing