Skip to content

feat: hardening action and callback instructions - #130

Merged
jonasXchen merged 6 commits into
mainfrom
feat/hardening-action
Sep 3, 2026
Merged

feat: hardening action and callback instructions#130
jonasXchen merged 6 commits into
mainfrom
feat/hardening-action

Conversation

@jonasXchen

@jonasXchen jonasXchen commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Security
    • Clarified authorization requirements for crank operations and post-delegation actions, including wallet and CPI invocation paths.
    • Documented caller-authentication expectations for leaderboard updates and privileged actions.
    • Strengthened roll-dice randomness callbacks by requiring a valid signer, preventing unauthorized callers from triggering callbacks with only a public address.

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
binary-prediction-demo Ready Ready Preview Sep 3, 2026 8:41am UTC
counter-session-keys Ready Ready Preview Sep 3, 2026 8:41am UTC
er-rolldice Ready Ready Preview Sep 3, 2026 8:41am UTC
magicblock-counter-example Ready Ready Preview Sep 3, 2026 8:41am UTC
magicblock-engine-examples Ready Ready Preview Sep 3, 2026 8:41am UTC
magicblock-rewards-dashboard Ready Ready Preview Sep 3, 2026 8:41am UTC
rps-example Ready Ready Preview Sep 3, 2026 8:41am UTC
spl-tokens Ready Ready Preview Sep 3, 2026 8:41am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

Next included review available in 22 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 3f251f32-3a12-4e3b-ac81-d73e0cb68b00

📥 Commits

Reviewing files that changed from the base of the PR and between 16e8dd2 and 82d98bb.

📒 Files selected for processing (5)
  • crank-counter/anchor/programs/crank-counter/src/lib.rs
  • delegation-actions/anchor/programs/delegation-actions/src/lib.rs
  • magic-actions/anchor/programs/magic-actions/src/lib.rs
  • roll-dice/pinocchio/programs/roll-dice-delegated/src/processor.rs
  • roll-dice/pinocchio/programs/roll-dice/src/processor.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 1bb9336d-1fc6-4ddc-9c33-bb0e8575477b

📥 Commits

Reviewing files that changed from the base of the PR and between 6cd982e and 16e8dd2.

📒 Files selected for processing (5)
  • crank-counter/anchor/programs/crank-counter/src/lib.rs
  • delegation-actions/anchor/programs/delegation-actions/src/lib.rs
  • magic-actions/anchor/programs/magic-actions/src/lib.rs
  • roll-dice/pinocchio/programs/roll-dice-delegated/src/processor.rs
  • roll-dice/pinocchio/programs/roll-dice/src/processor.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The change adds caller-authentication guidance to three Anchor programs. It also requires the VRF program identity to sign callback instructions in both roll-dice processors.

Changes

Caller authentication

Layer / File(s) Summary
Security authentication guidance
crank-counter/anchor/programs/crank-counter/src/lib.rs, delegation-actions/anchor/programs/delegation-actions/src/lib.rs, magic-actions/anchor/programs/magic-actions/src/lib.rs
Comments document public entry points and authentication requirements for privileged crank, delegation, and action handlers.
VRF callback signer enforcement
roll-dice/pinocchio/programs/roll-dice/src/processor.rs, roll-dice/pinocchio/programs/roll-dice-delegated/src/processor.rs
Both callback handlers return ProgramError::MissingRequiredSignature when program_identity is not a signer before randomness processing and player-state updates.

Estimated code review effort: 2 (Simple) | ~15 minutes

Merge Risk: ⚪ Minimal · up to 16e8d

VRF callbacks now reject unsigned program identities before updating player state, while the Anchor changes clarify caller-authentication expectations. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main changes: hardening action and callback instruction authorization.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/hardening-action

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread roll-dice/pinocchio/programs/roll-dice-delegated/src/processor.rs Outdated
Comment thread roll-dice/pinocchio/programs/roll-dice/src/processor.rs Outdated
Comment thread crank-counter/anchor/programs/crank-counter/src/lib.rs Outdated
Comment thread magic-actions/anchor/programs/magic-actions/src/lib.rs Outdated
Comment thread delegation-actions/anchor/programs/delegation-actions/src/lib.rs 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.

2 participants