Skip to content

Conversation

@sporicle
Copy link
Contributor

@sporicle sporicle commented Nov 18, 2025

Summary by CodeRabbit

  • Chores

    • Version bumped to 0.2.1 across SDK packages
  • Refactor

    • Updated SDK type system with feature-based configuration for improved cross-framework compatibility and cleaner import organization

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 18, 2025

Walkthrough

The pull request introduces conditional compilation to abstract Pubkey type handling across the SDK, enabling it to resolve to either anchor_lang::prelude::Pubkey or solana_program::pubkey::Pubkey based on feature flags. It refactors imports to use a unified internal module, updates public API return types accordingly, and bumps the workspace version to 0.2.1.

Changes

Cohort / File(s) Change Summary
Pubkey type abstraction with feature-gating
sdk/src/lib.rs
Introduces conditional compilation with a private solana module that re-exports Pubkey and system_program based on the anchor feature flag. Exposes pub use solana::Pubkey and updates the id() function signature to return Pubkey (the alias) instead of the direct solana_program::pubkey::Pubkey type.
Pubkey type signature updates
sdk/src/anchor.rs
Updates the Id::id() method return type from ::solana_program::pubkey::Pubkey to anchor_lang::prelude::Pubkey for the VrfProgram implementation. Function body remains unchanged.
Import refactoring
sdk/src/instructions.rs
Adds imports of system_program and Pubkey from crate::solana. Replaces hardcoded solana_program::system_program::ID path with system_program::ID in AccountMeta construction.
Version bump
Cargo.toml, .github/packages/npm-package/package.json.tmpl
Increments workspace and package versions from 0.2.0 to 0.2.1. Updates three internal dependencies (ephemeral-vrf, ephemeral-vrf-api, ephemeral-vrf-sdk-vrf-macro) to 0.2.1 while preserving their path specifications.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • sdk/src/lib.rs: Requires careful verification of the conditional compilation logic and feature gate correctness; ensure both code paths (with and without the anchor feature) are sound and properly re-export the intended types.
  • sdk/src/anchor.rs and sdk/src/instructions.rs: Verify that the return type changes and import refactoring maintain type compatibility with the feature-gated alias defined in lib.rs.
  • Dependency chain: Confirm that the version bumps across Cargo.toml and package.json.tmpl are aligned and that path dependencies correctly reference the updated versions.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: support for anchor 0.32.1' accurately describes the main objective of the pull request, which is to add compatibility support for anchor framework version 0.32.1.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch anchor-0.32.1

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f85e0cb and eeb6c2b.

📒 Files selected for processing (2)
  • .github/packages/npm-package/package.json.tmpl (1 hunks)
  • Cargo.toml (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: lint
🔇 Additional comments (3)
.github/packages/npm-package/package.json.tmpl (1)

4-4: Version bump is consistent with the workspace.

The npm package version bump aligns with the workspace version update in Cargo.toml. However, please ensure this follows semantic versioning conventions based on the scope of changes (see comments on Cargo.toml).

Cargo.toml (2)

6-6: Unable to verify the code changes described in the review comment because the repository appears to contain only configuration files (Cargo.toml) with no Rust source code accessible for analysis.

The review comment claims the PR introduces "conditional compilation to abstract Pubkey type handling" and "updates public API return types accordingly," which would require examining the actual Rust source code changes. Without access to:

  • The actual modified .rs files
  • Public function/type signature changes
  • Conditional compilation directives
  • The specific API changes referenced

I cannot verify whether a patch version bump (0.2.0 → 0.2.1) is semantically appropriate or confirm if breaking changes are present.

Action needed: Provide access to the source code changes or additional context about which files were modified in this PR, or clarify if the review comment is based on external documentation (commit message, AI summary, etc.) rather than repository analysis.


17-17: Clarify the Anchor version strategy for this PR.

The PR title states "fix: support for anchor 0.32.1", but the current version constraint >=0.28.0 already permits Anchor 0.32.1. Since 0.32.1 is a patch release with bug fixes (race condition in anchor deploy, deprecation warnings), determine whether this PR:

  • Requires these specific 0.32.1 fixes, in which case update the minimum version to >=0.32.1
  • Simply targets 0.32.1 testing, in which case the title is misleading and should clarify the intent
  • Has compatibility concerns with future versions, in which case add an upper bound like <0.33.0

Document in the PR description what specific Anchor 0.32.1 issues or fixes this PR addresses.


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 and usage tips.

Copy link

@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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 933683f and 98664aa.

📒 Files selected for processing (1)
  • sdk/Cargo.toml (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Run Tests
sdk/Cargo.toml

[error] 1-1: Cargo workspace manifest parse error: feature 'anchor' includes 'anchor-lang', but 'anchor-lang' is not an optional dependency. A non-optional dependency of the same name is defined; consider adding 'optional = true' to its definition.

Copy link

@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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 98664aa and 1cd77ec.

📒 Files selected for processing (1)
  • sdk/Cargo.toml (1 hunks)

Copy link

@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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 726e6f4 and 1eb5846.

📒 Files selected for processing (1)
  • .github/workflows/run-tests.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: lint

Comment on lines 91 to 98
- name: run integration tests
working-directory: program/tests/integration/use-randomness
run: |
export PATH="${{ needs.setup.outputs.solana_path }}:$PATH"
npm install -g @magicblock-labs/bolt-cli
cd program/tests/integration/use-randomness
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
cargo install --locked --version ${{ env.anchor_version }} anchor-cli
anchor --version
npm install
bolt test
anchor test
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Inconsistent PATH setup: use needs.setup.outputs.solana_path for consistency.

Line 94 hardcodes the Solana binary path instead of using needs.setup.outputs.solana_path like other steps (lines 81, 87, 102). Hardcoded paths are fragile and break if the runner environment changes. This also makes maintenance harder.

Apply this diff to use the setup job's output consistently:

       - name: run integration tests
         working-directory: program/tests/integration/use-randomness
         run: |
-          export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
+          export PATH="${{ needs.setup.outputs.solana_path }}:$PATH"
           cargo install --locked --version ${{ env.anchor_version }} anchor-cli
           anchor --version
           npm install
           anchor test
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: run integration tests
working-directory: program/tests/integration/use-randomness
run: |
export PATH="${{ needs.setup.outputs.solana_path }}:$PATH"
npm install -g @magicblock-labs/bolt-cli
cd program/tests/integration/use-randomness
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
cargo install --locked --version ${{ env.anchor_version }} anchor-cli
anchor --version
npm install
bolt test
anchor test
- name: run integration tests
working-directory: program/tests/integration/use-randomness
run: |
export PATH="${{ needs.setup.outputs.solana_path }}:$PATH"
cargo install --locked --version ${{ env.anchor_version }} anchor-cli
anchor --version
npm install
anchor test
🤖 Prompt for AI Agents
.github/workflows/run-tests.yml around lines 91 to 98: the step for running
integration tests hardcodes the Solana binary path (export
PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH") which
is inconsistent with other steps; update this line to prepend the path from the
setup job output (needs.setup.outputs.solana_path) so the PATH uses the shared
setup output (e.g., export PATH="${{ needs.setup.outputs.solana_path }}:$PATH"),
keeping the rest of the step unchanged to ensure consistent, robust environment
configuration.

@sporicle sporicle merged commit 404a909 into main Dec 1, 2025
4 checks passed
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