Skip to content

feat(state): carry and store the per-block ZIP-244 auth-data root#356

Merged
p0mvn merged 5 commits into
feat/pre-release-mainfrom
roman/vct-auth-root-propagation
Jul 1, 2026
Merged

feat(state): carry and store the per-block ZIP-244 auth-data root#356
p0mvn merged 5 commits into
feat/pre-release-mainfrom
roman/vct-auth-root-propagation

Conversation

@p0mvn

@p0mvn p0mvn commented Jul 1, 2026

Copy link
Copy Markdown

Motivation

First, mergeable-on-its-own step toward authenticating verified-commitment-trees (VCT) fast blocks against their successor's header instead of the successor body (which couples the committer to the body-download pipeline and can deadlock at a checkpoint/VCT boundary).

At NU5+ the successor's hashBlockCommitments binds the chain-history (MMR) root together with the successor's own ZIP-244 auth_data_root, so that root is a required co-input for the authentication. This PR carries and stores it everywhere it's needed, without changing how the committer authenticates blocks — so it can land safely first, ahead of the consensus-bearing change.

What changed

  • auth_data_root added to BlockCommitmentRoots (the tree_aux header-sync payload) and to the commitment_roots_by_height serving-index value (64→96 bytes). FromDisk stays backward compatible — pre-release 64-byte rows decode with a zero auth-data root. Consolidated under state DB format 27.3.0 (no version bump).
  • Computed/stored at commit; threaded through the provisional Zakura header-roots store/read, the BlockRoots serve paths, and the CommitHeaderRange plumbing.
  • Zakura header-sync stream format bumped v4→v5 — a breaking wire change (a v4 and a v5 node cannot exchange header ranges; the fleet must run the new format).

Consensus behavior is unchanged: the auth-data root is carried and stored but not yet consumed by the committer (that lands in the follow-up, #355).

Test evidence

  • cargo check --workspace --tests clean; fmt clean.
  • VCT property tests pass, incl. vct_db_produced_payload_round_trips_to_byte_identical_state (96-byte serving-index value round-trips byte-identically) and the original committer deferral/fast-path tests (unchanged behavior).
  • 85 header_sync wire tests + zebra-chain serialization round-trip pass.

Relationship to the feature

This is the network-breaking propagation slice of #355 (the full feature). Merge this first; #355 then rebases down to just the consensus consumption (the header-driven committer/verifier changes).

AI disclosure

Implemented with Claude Code (Opus); the contributor is the responsible author.

Propagate each block's ZIP-244 `auth_data_root` alongside its note-commitment
roots, without changing how the committer authenticates blocks. This is the
data-model / wire / storage half of the verified-commitment-trees
successor-header authentication; a follow-up consumes it in the committer.

- Add `auth_data_root` to `BlockCommitmentRoots` (the `tree_aux` header-sync
  payload) and to the `commitment_roots_by_height` serving-index value
  (64 -> 96 bytes). `FromDisk` stays backward compatible: pre-release 64-byte
  rows decode with a zero auth-data root. Consolidated under state DB format
  version 27.3.0 (no version bump).
- Compute and store the auth-data root at commit, thread it through the
  provisional Zakura header-roots store/read, the `BlockRoots` serve paths,
  and the `CommitHeaderRange` plumbing.
- Bump the Zakura header-sync stream format to version 5. This is a breaking
  wire change: a v4 and a v5 node cannot exchange header ranges.

The auth-data root is carried and stored but not yet consumed by the
committer, so consensus behavior is unchanged.
@v12-auditor

v12-auditor Bot commented Jul 1, 2026

Copy link
Copy Markdown

Note

Complete: Audit complete. V12 did not find any issues that need review.

Open the full results here.

Analyzed 16 files, diff 3d307b0...0ef5a70.

@p0mvn
p0mvn marked this pull request as draft July 1, 2026 02:55
p0mvn and others added 4 commits June 30, 2026 21:14
…-data root

The serving-index value grew 64->96 bytes with the per-height auth-data
root, so the raw-column-family snapshots gain the 32-byte auth-data root
(the all-0xFF ZIP-244 placeholder for these pre-NU5 blocks).
CI's stable clippy advanced to 1.96 since #336/#337 merged, newly flagging
two pre-existing issues that block this PR:
- admission.rs: an `admission_decision` doc comment was orphaned above
  `request_deadline` (empty_line_after_doc_comments); moved it to its function.
- blocksync_fuzz: allow too_many_arguments on the test-harness `spawn_action_driver`.
…ixture

#337 (BBR-lite congestion control) added block-sync config fields
(bbr_*, floor_bypass_slots, floor_rescue_timeout, no_progress_peer_cooldown)
without updating the stored config fixture, so `last_config_is_stored` fails:
the generated config matches no stored config. Regenerate the newest fixture
to include them. Unrelated to this PR's auth-data-root change (which adds no
config fields).
@p0mvn
p0mvn marked this pull request as ready for review July 1, 2026 04:26
Comment on lines 31 to 36
/// The block height these roots are for.
pub height: block::Height,
/// The Sapling note-commitment tree root as of the end of this block.
pub sapling_root: sapling::tree::Root,
/// The Orchard note-commitment tree root as of the end of this block (empty below NU5).
pub orchard_root: orchard::tree::Root,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need all the data to reconstruct the hashLightClientRoot

@p0mvn

p0mvn commented Jul 1, 2026

Copy link
Copy Markdown
Author

@p0mvn
p0mvn merged commit a2315cf into feat/pre-release-main Jul 1, 2026
56 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants