Repository navigation
feat(contracts,core)!: carry each byte slot as one Bytes<32> with one flag - #320
Draft
nicolasLuduena wants to merge 7 commits into
Draft
nicolasLuduena wants to merge 7 commits into
nicolasLuduena wants to merge 7 commits into
Conversation
… flag The attestation module takes <#V, #W, #N, #M>: #W is the byte-slot count, and Claim and Observation carry byteValues: Vector<W, Bytes<32>> with one bytePresent flag per slot. The message signs W, the nullifier hashes each value whole (136 + 9V + 33W bytes), and an absent byte slot must be all zero. A predicate compares o.byteValues[i] to a Bytes<32> directly, so openAndReadBytes no longer reassembles halves. Core's ContractClaim, toContractClaim, nullifierOf and claimToMessage follow. The cross-layout mock moves to V=0, W=3 against V=11, W=0, and the parity properties also run over it.
… cost The README embeds attestation<#V, #W, #N, #M>, compares byteValues[i] directly and drops the unpaired-flags limit. The proving-cost table is regenerated from npm run bench: openAndReadBytes proves at k = 14 (8,626 rows, was 17,236 at k = 15).
ADR 0009's shape note records why a byte slot is one Bytes<32> with one flag, and ADR 0015's status line points to it. The wire layout in DESIGN.md, the glossary's byte slot entry, the kind author guide and the kinds' dApp guides use #W and byteValues; the cross-layout pair is V = 11, W = 0 against V = 0, W = 3.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Name the message's third field W in the numeric mock's layout test.
…e-slots # Conflicts: # packages/contracts/README.md # packages/core/README.md
This branch has not been deployed
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.
Closes #313
Part of #309
PR 5 of 6, stacked on #319.
Summary
A byte slot now travels as one
Bytes<32>with one presence flag. It is no longer twoBytes<16>halves with two flags. A predicate compares the slot directly.What else changes:
@txpipe/thoth-core:ContractClaimandtoContractClaimdrop the halves,nullifierOfhashes each value whole, andclaimToMessagesignsW.byteSlotsdocs now say#W.<3, 0, 2, 3>, the bytes mock<3, 1, 2, 3>and the example app<3, 1, 2, 3>.attestation.compactheader anddocs/DESIGN.md.Evidence
npm run bench(Ryzen 7 5700G, proof server 9.0.0, 3 warm runs). The proof server verified every proof against its verifier key and refused a proof under the wrong verifier key.Both row budgets are met:
openAndReadBytesis at most 16,384 rows, andverifyAttestationis at most 16,384 on both mocks. The bytes mock'sverifyAttestationstill has only about 790 rows to spare, and #314 is what widens it.New simulator checks in
bytes.test.ts:Both acceptance tests pass, for zkFetch and for Cardano. Two pins are regenerated: the core
nullifierOfliteral, taken from the compiled bytes mock, and the two Cardano message strings.No verification skill in this repo.
Merge Danger
Door: two-way
The repo has no deployed layout, so
versionstays1. Revert by reverting the PR.Blast Radius: wire-format
Every message and nullifier for a claim with a byte slot changes. Contracts embedding
attestation<V, B, …>must change to<V, W, …>, and a predicate that reassembled halves must comparebyteValues[i]instead. Kinds and the contract have to move together, which the changesets say.