feat: update to legacy SDK - #123
Conversation
|
Warning Review limit reached
Next review available in: 34 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
WalkthroughChangesCrank-counter SDK migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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 `@crank-counter/anchor/Anchor.toml`:
- Around line 8-11: Update the crank_counter value under [programs.localnet] to
6avjV8kWVhVf2NX6ZeE7SaqyqjRnCD6JDwhiUH6yFymz, matching declare_id! and
[programs.devnet].
In `@crank-counter/anchor/programs/crank-counter/Cargo.toml`:
- Around line 25-31: Remove the unused sha2 and bincode dependency entries from
the crank-counter program’s Cargo.toml, leaving the ephemeral-rollups-sdk
configuration and other dependencies unchanged.
🪄 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: 6caf4dc2-0047-47e9-a1c9-b04e723f6e25
⛔ Files ignored due to path filters (1)
crank-counter/anchor/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
crank-counter/anchor/Anchor.tomlcrank-counter/anchor/programs/crank-counter/Cargo.tomlcrank-counter/anchor/programs/crank-counter/src/lib.rscrank-counter/anchor/tests/crank-counter.tsscripts/mAGicPQYBMvcYveUZA5F5UNNwyHvfYh5xkLS2Fr1mev.jsonscripts/test-locally.sh
| [programs.devnet] | ||
| crank_counter = "HetkBSVTbemvzJzcmnTS6Ge6LP9KVVXkbtdL6qguG2g9" | ||
| crank_counter = "6avjV8kWVhVf2NX6ZeE7SaqyqjRnCD6JDwhiUH6yFymz" | ||
|
|
||
| [programs.localnet] |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
cat crank-counter/anchor/Anchor.tomlRepository: magicblock-labs/magicblock-engine-examples
Length of output: 593
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== Anchor.toml ==\n'
cat -n crank-counter/anchor/Anchor.toml
printf '\n== lib.rs ==\n'
cat -n crank-counter/anchor/programs/crank_counter/src/lib.rs
printf '\n== tests ==\n'
rg -n "localnet|devnet|crank_counter|declare_id" crank-counter/anchor/tests crank-counter/anchor/programs/crank_counter/src -SRepository: magicblock-labs/magicblock-engine-examples
Length of output: 860
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== candidate files ==\n'
fd -a 'lib.rs$|Anchor.toml$|crank-counter.ts$' crank-counter/anchor
printf '\n== program source outline ==\n'
ast-grep outline crank-counter/anchor/programs --match 'declare_id!($_)' --view expanded || true
printf '\n== test references ==\n'
rg -n "FW2QPnTK9WwYLNG29GhH7PGYdp7Jwq3pGQrUuNdUnK44|6avjV8kWVhVf2NX6ZeE7SaqyqjRnCD6JDwhiUH6yFymz|declare_id|localnet" crank-counter/anchor -SRepository: magicblock-labs/magicblock-engine-examples
Length of output: 830
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== Anchor.toml ==\n'
cat -n crank-counter/anchor/Anchor.toml
printf '\n== package.json ==\n'
cat -n crank-counter/anchor/package.json
printf '\n== tests/crank-counter.ts ==\n'
cat -n crank-counter/anchor/tests/crank-counter.tsRepository: magicblock-labs/magicblock-engine-examples
Length of output: 8114
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== local-env.sh ==\n'
cat -n scripts/local-env.sh
printf '\n== any Anchor env overrides ==\n'
rg -n "ANCHOR_PROVIDER_URL|ANCHOR_WALLET|ANCHOR_CLUSTER|LOCALNET|devnet|localnet" scripts crank-counter/anchor -SRepository: magicblock-labs/magicblock-engine-examples
Length of output: 4589
Update [programs.localnet] to the new program ID. It still points to FW2QPnTK9WwYLNG29GhH7PGYdp7Jwq3pGQrUuNdUnK44 while declare_id! and [programs.devnet] use 6avjV8kWVhVf2NX6ZeE7SaqyqjRnCD6JDwhiUH6yFymz.
🤖 Prompt for 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.
In `@crank-counter/anchor/Anchor.toml` around lines 8 - 11, Update the
crank_counter value under [programs.localnet] to
6avjV8kWVhVf2NX6ZeE7SaqyqjRnCD6JDwhiUH6yFymz, matching declare_id! and
[programs.devnet].
| # TODO: Remove this once the SDK is published to crates.io | ||
| ephemeral-rollups-sdk = { git = "https://github.com/magicblock-labs/ephemeral-rollups-sdk.git", rev = "086eeaa0e9fcd12d442d78bcd40817a782521cbc", features = [ | ||
| "anchor", | ||
| "crank", | ||
| ] } | ||
| sha2 = "0.10" | ||
| magicblock-magic-program-api = { version = "0.10.1", default-features = false } | ||
| bincode = "^1.3" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔵 Trivial | 💤 Low value
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -n 'magicblock_magic_program_api|bincode::|sha2::|MagicBlockInstruction|invoke_signed' crank-counter/anchor/programs/crank-counter/src/lib.rsRepository: magicblock-labs/magicblock-engine-examples
Length of output: 180
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Cargo.toml =="
nl -ba crank-counter/anchor/programs/crank-counter/Cargo.toml | sed -n '1,120p'
echo
echo "== Search entire crate for relevant symbols =="
rg -n 'magicblock_magic_program_api|bincode::|sha2::|MagicBlockInstruction|invoke_signed|magic_context|MAGIC_CONTEXT_ID' crank-counter/anchor/programs/crank-counter
echo
echo "== File list =="
git ls-files crank-counter/anchor/programs/crank-counterRepository: magicblock-labs/magicblock-engine-examples
Length of output: 237
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Cargo.toml =="
cat -n crank-counter/anchor/programs/crank-counter/Cargo.toml | sed -n '1,120p'
echo
echo "== Search entire crate for relevant symbols =="
rg -n 'magicblock_magic_program_api|bincode::|sha2::|MagicBlockInstruction|invoke_signed|magic_context|MAGIC_CONTEXT_ID' crank-counter/anchor/programs/crank-counter
echo
echo "== File list =="
git ls-files crank-counter/anchor/programs/crank-counterRepository: magicblock-labs/magicblock-engine-examples
Length of output: 1576
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== lib.rs (top section) =="
cat -n crank-counter/anchor/programs/crank-counter/src/lib.rs | sed -n '1,180p'
echo
echo "== Search whole repo for removed crate name =="
rg -n 'magicblock_magic_program_api|magicblock-magic-program-api' .
echo
echo "== Search whole repo for sha2/bincode usage in this crate =="
rg -n '\bsha2\b|\bbincode\b' crank-counter/anchor/programs/crank-counterRepository: magicblock-labs/magicblock-engine-examples
Length of output: 10675
Remove the unused sha2 and bincode dependencies. They no longer appear in crank-counter/anchor/programs/crank-counter/src/lib.rs.
🤖 Prompt for 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.
In `@crank-counter/anchor/programs/crank-counter/Cargo.toml` around lines 25 - 31,
Remove the unused sha2 and bincode dependency entries from the crank-counter
program’s Cargo.toml, leaving the ephemeral-rollups-sdk configuration and other
dependencies unchanged.
The current example manually builds the crank schedule. Uses the SDK instead (legacy cranks, not Hydra)
Summary by CodeRabbit
New Features
Bug Fixes
Tests