feat(games/gacha): add pinocchio-simple variant - #680
Draft
amilz wants to merge 4 commits into
Draft
Conversation
A second gacha example with the same draw semantics but no external protocol dependencies. settle_and_distribute selects the tier, mints a Token-2022 prize NFT whose metadata carries the full reveal provenance (pull, client_seed, beta, proof), and closes the pull in one instruction. One reveal per pull is structural: monotonic pull index, once-only mint PDA, and pull close at settle. The entire lifecycle, including the settle-and-mint happy path, is testable in LiteSVM.
Contributor
Greptile SummaryThe PR adds a self-contained Pinocchio gacha variant that stores VRF reveal provenance in Token-2022 prize metadata and combines settlement with prize distribution.
Confidence Score: 4/5The code changes appear sound, but the unverified pull request commits must be corrected before merging. The previously reported provenance issues are resolved by binding the mint’s metadata update authority to the fetched pool address, but every commit in the pull request still lacks a verified signature required by repository policy. Important Files Changed
Reviews (4): Last reviewed commit: "fix(games/gacha): start account discrimi..." | Re-trigger Greptile |
…n path Register the pinocchio-simple crates in .github/.workspace-ignore, exclude its generated IDL from the root prettier check, and format the gacha README with the root config. Document that the prize mint's metadata update authority is the pool PDA: the NFT names its pool, and the pool account supplies the operator key and tier weights that verifyPrizeProvenance takes as inputs.
verifyPrizeAgainstPool takes the mint's metadata update authority, the address the pool account was fetched from, and the decoded pool data, and rejects the reveal unless the authority equals that address — so pool configuration can only come from the pool the mint actually names.
All-zero account data must never carry a valid discriminator, so Pool moves off 0.
amilz
marked this pull request as draft
August 7, 2026 14:31
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.
Summary
games/gacha/pinocchio-simple, a second gacha variant alongsidegames/gacha/pinocchio. Both share the same provably-fair draw semantics (select_tier/derive_alphaare byte-identical, pinned by shared test fixtures); they differ in how reveals are evidenced. The existing variant anchors each reveal in the cc-vrf registry by CPI; this one records the evidence in the prize itself.settle_and_distributemerges settle + claim into one instruction (~82k CU, 11 accounts): selects the tier frombeta, mints a Token-2022 prize NFT straight to the buyer, and closes the pull (rent refunded to the buyer).rarity,pull,client_seed,beta, andproof, so anyone can verify the ECVRF reveal from the mint account alone. The TS client shipsverifyPrizeProvenancefor this.Pullshrinks to 146 bytes (no status byte, no stored beta — the account existing means pending).Test Plan
just test— 13 Rust unit tests, 36 LiteSVM integration tests (including the full settle-and-mint happy path with metadata provenance replay), 10 TS client testsjust check— cargo fmt + clippy-D warnings+ prettier + eslintjust demo— offline operator/verifier ECVRF walkthroughCloses DEV-848