feat(dlv): the canonical SettlementBundle a quorum transaction binds (5a of 5) - #776
Merged
Merged
Conversation
…(5a of 5)
Rev 15 Def 6.14/6.17/6.19, Req 6.15. The first of the five-part switch to
QuorumBind (5a bundle, 5b resume, 5c cutover, 5d delete, 5e wipe). This lands
the canonical bundle object everything after it binds; NO settle path changes
here, so the frozen protocol object is reviewed alone.
The shipped settle path had no SettlementBundle and no resource keys — it signed
per-vault SettlementSlotClaimV2 envelopes — so the switch has to introduce this
object first.
SettlementBundleV1 mirrors Def 6.14 EXPLICITLY, no normative field hidden inside
another object: version, storage_set_id, q, intent_commitment (I),
route_set_commitment (X), selected_route, the exact trader_parent and
trader_successor, the complete sorted per-vault transitions {T_v}
(vault_id, parent_generation, c_n, parent_reserves_digest, successor_ccb,
reserve_deltas, witnesses), proof_material {P_v}, bundle_signatures, and
recovery_material — everything needed to verify the route and recover the DLV
decision without a fresh constructor signature (Req 6.15). A version field is
present because this object freezes on deploy.
dsm::dlv::settlement_bundle (pure): canon(B) requires transitions strictly
ascending by vault_id and re-encode-to-self; b = H(DSM/settlement-bundle ||
Canon(B)); addr(B) reuses the existing immutable-object construction so it
cannot drift; resource_key k_v = H(DSM/binding-keyset || c_n) (vault_id not
restated — c_n commits it); key_set K(B) is the sorted distinct resource keys,
derived ONLY from the canonical bytes, and refuses two vaults sharing a c_n. Two
new domain tags in the uniqueness registry. The committed TS proto artifact was
regenerated.
Rust 1.98.0: workspace board 4024/0, make lint 0, production_safety_checks 0.
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.
PR 5a of the QuorumBind restoration — the first of the five-part switch to QuorumBind (5a bundle, 5b resume, 5c cutover, 5d delete, 5e wipe). This lands the canonical
SettlementBundleobject (Def 6.14/6.17/6.19) that everything after it binds. No settle path changes here — this is the frozen protocol object, reviewed alone before anything depends on it.What this adds
The bundle
B(Def 6.14). A new canonical protoSettlementBundleV1mirroring the definition explicitly — no normative field hidden inside another object:It carries everything needed to verify the route and recover the DLV decision without a fresh constructor signature (Req 6.15): the exact trader parent (not only the successor),
IandXexplicitly, the complete sorted per-vault transitions, the proofs, the signatures, and the recovery material.versionis present because this object freezes on deploy — a new shape is a new version, never a silent field change.The canonical layer (
dsm::dlv::settlement_bundle, pure, no I/O):canon(B)— the canonical bytes: transitions must be strictly ascending byvault_id, and the message must re-encode to itself (unknown fields, non-minimal encodings, and empties all fail).bundle_digest—b = H(DSM/settlement-bundle ‖ Canon(B))(Def 6.14).bundle_addr—addr(B) = H(DSM/storage-object ‖ DSM/settlement-bundle ‖ b)(Def 6.19), through the existing immutable-object construction so a new address rule cannot drift from the one every other immutable object uses.resource_key(c_n)—k_v = H(DSM/binding-keyset ‖ c_n)(Def 6.17). The vault id is not restated:c_nalready commits it, so supplying both would admit a disagreeing pair.key_set(B)—K(B), the sorted distinct resource keys, derived only from the canonical bundle's committed parent states. Strictly ascending, so it is a valid QuorumBind key set; two vaults sharing ac_nare refused rather than silently collapsing to one key.Two new domain tags,
DSM/binding-keysetandDSM/settlement-bundle, both added to the tag-uniqueness registry.Tests
dsm::dlv::settlement_bundle, 4):Canon(B)round-trips andb/addr(B)match the spec construction, and different bytes give a different identity; a bad version, a mis-width field, or an empty bundle is refused; transitions must be strictly ascending byvault_id(unsorted or duplicate refused);K(B)is the sorted distinct resource keys overc_n, and two vaults sharing ac_nare refused.Verification (Rust 1.98.0)
make lint— exit 0--workspace --exclude dsm_storage_node --release) — 4024 passed, 0 failed (75 suites)production_safety_checks(all-features clippy + TLA+) — exit 0 (TLA+ included)The committed TypeScript proto artifact was regenerated from the schema so the two stay in sync.
Not in this PR (by design)
resume_onereconstruction (resolve the set, fetchBbyaddr, verify/rebuildK(B), resume through the runner without original private state).DlvClose(one-phase fold, Req 6.30) andDlvSettle(full trader-acceptance, §16.2) settle paths torun_fenced; wire the fence gate into successor creation.settlement_slot_claim_local(§22 Create public SDK API boundary for third-party developers #12).