Skip to content

Make rewards-delegated-vrf and anchor-rock-paper-scissor work with SDK 'backward-compat` flag#82

Open
snawaz wants to merge 9 commits into
mainfrom
snawaz/sdk-backward-compat
Open

Make rewards-delegated-vrf and anchor-rock-paper-scissor work with SDK 'backward-compat` flag#82
snawaz wants to merge 9 commits into
mainfrom
snawaz/sdk-backward-compat

Conversation

@snawaz
Copy link
Copy Markdown
Contributor

@snawaz snawaz commented May 9, 2026

  • The reviewable changes are mostly in Cargo.toml files,
  • Two new programs have been added (copied and upgraded for Anchor 1.0, 2)
    • rewards-delegated-vrf-1.0 now contains a vendored ephemeral-vrf-sdk at rewards-delegated-vrf-1.0/vendor/ephemeral-vrf-sdk.
    • That implies, we also need to upgrade it in a similar way.
  • Updated Rust version in the CI.

Summary by CodeRabbit

  • New Features
    • Added a full rewards system: VRF-based random requests/consumption, SPL token & programmable NFT rewards, reward CRUD, delegation/undelegation, admin & whitelist management, and automated transfer flows.
    • Added an on-chain Rock‑Paper‑Scissors game with create/join/play/reveal, permission management, and delegation flows.
  • Documentation
    • New READMEs, toolchain configs, and scripts for setup, build, and end‑to‑end testing.
  • Tests
    • Comprehensive integration tests, fixtures, and test helpers for rewards and game flows.
  • Chores
    • Workspace/tooling configs, ignore rules, and local SDK vendoring for development.

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
er-rolldice Ready Ready Preview, Comment May 14, 2026 7:31am
magicblock-counter-example Ready Ready Preview, Comment May 14, 2026 7:31am
magicblock-engine-examples Ready Ready Preview, Comment May 14, 2026 7:31am
magicblock-rewards-dashboard Ready Ready Preview, Comment May 14, 2026 7:31am
spl-tokens Ready Ready Preview, Comment May 14, 2026 7:31am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 9, 2026

Warning

Rate limit exceeded

@snawaz has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 33 minutes and 36 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4c54d2e5-07d0-4c79-b171-b11d59355fc0

📥 Commits

Reviewing files that changed from the base of the PR and between 52353e3 and cb63f6d.

⛔ Files ignored due to path filters (4)
  • anchor-rock-paper-scissor-1.0/Cargo.lock is excluded by !**/*.lock
  • anchor-rock-paper-scissor/Cargo.lock is excluded by !**/*.lock
  • rewards-delegated-vrf-1.0/Cargo.lock is excluded by !**/*.lock
  • rewards-delegated-vrf/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .github/workflows/test-examples.yml
  • anchor-rock-paper-scissor-1.0/programs/anchor-rock-paper-scissor/Cargo.toml
  • anchor-rock-paper-scissor-1.0/programs/anchor-rock-paper-scissor/src/lib.rs
  • anchor-rock-paper-scissor/programs/anchor-rock-paper-scissor/Cargo.toml
  • rewards-delegated-vrf-1.0/programs/rewards-delegated-vrf/Cargo.toml
  • rewards-delegated-vrf/programs/rewards-delegated-vrf/Cargo.toml

Walkthrough

Adds a new rewards-delegated-vrf Anchor program with state, instruction handlers, vendored ephemeral-vrf SDK and proc-macro, tests/helpers/fixtures, workspace/tooling files, and switches ephemeral-rollups-sdk references in two program manifests to a local path with adjusted features.

Changes

Rewards Delegated VRF + workspace + SDK

Layer / File(s) Summary
Complete program + vendored SDK + workspace
rewards-delegated-vrf-1.0/..., rewards-delegated-vrf-1.0/vendor/..., anchor-rock-paper-scissor-1.0/..., anchor-rock-paper-scissor/programs/anchor-rock-paper-scissor/Cargo.toml, rewards-delegated-vrf/programs/rewards-delegated-vrf/Cargo.toml
Adds the rewards-delegated-vrf Anchor program (state, errors, helpers, many instructions, shared transfer logic, lib wiring), vendored ephemeral-vrf SDK and proc-macro, full test harness/helpers/fixtures, workspace and tooling config files (Cargo workspace, Anchor.toml, package.json, tsconfig, rust-toolchain, README, ignore files), and updates two program Cargo.toml entries to use a local path ephemeral-rollups-sdk with changed features.

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • jonasXchen
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch snawaz/sdk-backward-compat

@snawaz snawaz requested a review from jonasXchen May 9, 2026 10:28
Copy link
Copy Markdown
Contributor Author

snawaz commented May 9, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@anchor-rock-paper-scissor/programs/anchor-rock-paper-scissor/Cargo.toml`:
- Line 24: The Cargo.toml entry for the dependency named ephemeral-rollups-sdk
currently uses a machine-specific absolute path; replace this with a portable
solution by removing the path attribute and either specifying a published
version (e.g., ephemeral-rollups-sdk = "x.y.z" with the required features) or
revert to a local override via a project-level .cargo/config.toml
[patch.crates-io] override; update the dependency declaration in
anchor-rock-paper-scissor's Cargo.toml (and the same dependency in
rewards-delegated-vrf's Cargo.toml) so CI and other developers do not rely on an
absolute filesystem path.

In `@rewards-delegated-vrf/programs/rewards-delegated-vrf/Cargo.toml`:
- Line 24: The Cargo.toml currently pins ephemeral-rollups-sdk to a local
absolute path (ephemeral-rollups-sdk = { path = "/Users/..."}), which breaks CI;
change that dependency to a portable reference by replacing the path entry for
ephemeral-rollups-sdk with either a published crate version (e.g.,
ephemeral-rollups-sdk = "x.y.z") or a git-based reference (e.g.,
ephemeral-rollups-sdk = { git = "https://...", tag = "vX.Y.Z" }) and preserve
any needed features like ["anchor","backward-compat"]; make the same change in
the other occurrence for anchor-rock-paper-scissor so both Cargo.toml files use
a portable version/git dependency instead of the local path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 348db2ce-a225-4e7c-8b3c-edf16195a680

📥 Commits

Reviewing files that changed from the base of the PR and between 3d91320 and 0a9ddcd.

⛔ Files ignored due to path filters (1)
  • anchor-rock-paper-scissor/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • anchor-rock-paper-scissor/programs/anchor-rock-paper-scissor/Cargo.toml
  • rewards-delegated-vrf/programs/rewards-delegated-vrf/Cargo.toml

Comment thread anchor-rock-paper-scissor/programs/anchor-rock-paper-scissor/Cargo.toml Outdated
Comment thread rewards-delegated-vrf/programs/rewards-delegated-vrf/Cargo.toml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant