Add ADR-0005 audit-report wire types for earned reward eligibility#19
Open
grumbach wants to merge 2 commits into
Open
Add ADR-0005 audit-report wire types for earned reward eligibility#19grumbach wants to merge 2 commits into
grumbach wants to merge 2 commits into
Conversation
Introduce the signed audit-report type shared by node and client so a client can decide, at quote collection, whether a quoter has earned the right to be paid (a clean audited week at the quoted size). - audit_report: AuditReport / AuditReportRow / AuditReportDay, the canonical signed payload builder, and verify_audit_report (ML-DSA-65, nonce-bound, size-capped by the caller). - chunk: carry a client report_nonce on both quote-request types and an optional serialized audit_report on the quote response, bound to the nonce so a report cannot be precomputed or replayed. Add a MerkleCandidateQuoteRequest::new constructor mirroring ChunkQuoteRequest. - commitment: correct the ML-DSA-65 signature-size figures in the docs.
The ADR-0005 quote request/response gain required postcard fields (report_nonce, audit_report). Because ChunkMessage is postcard-encoded and non-self-describing, old and new peers cannot interoperate, so bump CHUNK_PROTOCOL_ID to v2 and PROTOCOL_VERSION to 2 to make the cutover explicit, and the crate to 3.0.0 (major: wire change) so consumers pin a distinct version rather than a mutable branch. Also reconcile the AuditReportRow.convicted doc with the node's actual sticky-for-a-dues-period behaviour (it does not clear on the next pass), and fix a broken intra-doc link that failed the Documentation CI check.
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.
What
The shared wire contract for ADR-0005: earned reward eligibility. ADR-0004 left open that a node identity is a free keypair, so "drop in, grab rewards, drop out" costs nothing to repeat. ADR-0005 makes a node earn its place: roughly a week of audited storage at the size it wants to charge for, before a client will pay it. This PR is just the protocol-level types both node and client must agree on; the node-side tally and the client-side gate land in their own PRs.
Changes
payment/audit_report.rs(new) —AuditReport/AuditReportRow/AuditReportDay, the canonical signed-payload builder, andverify_audit_report. Signatures are ML-DSA-65, nonce-bound, and the byte cap is enforced by the caller before decode (documented as a load-bearing precondition on the verifier).chunk.rs— both quote-request types now carry a client-generatedreport_nonce; the quote response carries an optional serializedaudit_reportbound to that nonce, so a report cannot be precomputed or replayed. Adds aMerkleCandidateQuoteRequest::newconstructor mirroringChunkQuoteRequest::new.commitment.rs— corrects the ML-DSA-65 signature-size figures in the docs (3293 to 3309).Wire compatibility
report_nonceand the responseaudit_reportare postcard hard-cutover fields, same as the ADR-0004commitmentfield they sit beside.Testing
cargo test --lib(85 pass),cargo clippy --all-targets --all-features -D warningsclean,cargo fmt --checkclean, all against the publishedevmlib/saorsa-*deps.