feat: land the store-free admission composite - #902
Merged
Conversation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 does this PR do?
Rewrite the stamp validator against the callers that exist: a store-free admission composite, the canonical gate a node's reserve runs against an already-loaded batch, shipped where the security core belongs in the proving lane.
Changes
AdmissionValidatorincrates/postage-primitives/src/admission.rs: the admission composite, store-free by design, gating a stamped chunk against a loaded batch in a fixed order: the batch the stamp claims, the usability gate, the expiry gate, the index bounds, the bucket match, the owner signature.AdmissionErrorto the crate error home: one variant per denial,#[non_exhaustive], theStampwrap carrying its#[from]source, andis_context_dependentas the retryability predicate.nectar-postagefacade.Breaking changes
None. Additive. The trait this replaces,
StampValidator, was deleted in M1 with zero implementors.Testing
cargo clippy --all-targets -- -D warningsclean, including thenectar-postage-primitivesserde, parallel and arbitrary feature paths; the reinvention gate, fmt and the doc build under-D rustdoc::broken_intra_doc_linkscleanRelated issues
docs/restructure/m1-trait-redesign-inputs.md) holds the locked decisions this lands: the leaf predicate (D2), the store-level context gates (D3) and the one canonical composite (D4), with the node's standalone admission implementation as the design input.nectar-postage-apicar (api: create the tier-two trait crates with noop implementations #812) moves this surface into the fresh crate.AI assistance disclosure
AI assistance: Claude Code (opencode) used for the design research, the implementation and this body.
Notes for reviewers
UnknownBatchis the caller's own load-miss variant; the store-free composite never yields it, and no store-coupled path ships in this car.Checklist
Closes