feat(state): stitch tree_aux root serving across the VCT upgrade height#410
Conversation
And two more auto-invalidated findings. Analyzed five files, diff |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e326c5d. Configure here.
0302bc7 to
d708185
Compare
| if: runner.os == 'Linux' | ||
| shell: bash | ||
| run: | | ||
| sudo rm -f /etc/apt/sources.list.d/{microsoft-prod,azure-cli}.{list,sources} |
| /// `serve_block_roots` reads a request that starts at or above the upgrade height `U` straight | ||
| /// from the serving index, without touching the per-height trees. | ||
| #[test] | ||
| fn serve_block_roots_serves_at_or_above_upgrade_from_index() { |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2ed6bc6. Configure here.
Motivation
Split out of the draft #408 so the verified-commitment-trees (VCT) work can land in small, reviewable slices (follows the merged #402). This slice is the producer/serving half of the fast path: how a node derives and serves the per-block commitment-root payload — read-only, no commit-path changes.
Without it, a node that upgrades mid-chain has a
commitment_roots_by_heightserving index that only starts at its upgrade heightU: atree_auxBlockRootsrequest that straddlesUwould return a short index-only prefix and stall the fetch client's minimum-progress check.Solution
commitment_aux.rswith the payload types and producer half:FinalFrontiers+ the length-prefixed byte format (to_bytes/from_bytes) used by the embedded checkpoint-handoff frontier, with fail-closed bounds-checked parsing.produce_block_roots: derive per-block roots, shielded tx-counts, and the ZIP-244 auth-data root from an archive database's per-height trees and stored blocks.serve_block_roots: the serving entry point — stitch the per-height-tree run belowUwith the serving index at/aboveUinto one gap-free batch; both sources stop at the first absent height, and a pre-index database falls back to trees for the whole range.produce_final_frontiers_bytes(exported): derive serialized final-frontier fixtures from a database.tree_auxBlockRootsfinalized read inservice.rsthroughserve_block_rootsinstead of the raw index read.serve_block_roots_serves_at_or_above_upgrade_from_indextest (from feat(state): add VCT docs config and DB storage #402) at the real entry point.