Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crank-counter/anchor/Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ resolution = true
skip-lint = false

[programs.devnet]
crank_counter = "HetkBSVTbemvzJzcmnTS6Ge6LP9KVVXkbtdL6qguG2g9"
crank_counter = "6avjV8kWVhVf2NX6ZeE7SaqyqjRnCD6JDwhiUH6yFymz"

[programs.localnet]
Comment on lines 8 to 11

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
cat crank-counter/anchor/Anchor.toml

Repository: 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 -S

Repository: 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 -S

Repository: 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.ts

Repository: 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 -S

Repository: 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].

crank_counter = "FW2QPnTK9WwYLNG29GhH7PGYdp7Jwq3pGQrUuNdUnK44"
Expand Down
125 changes: 89 additions & 36 deletions crank-counter/anchor/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions crank-counter/anchor/programs/crank-counter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ custom-panic = []

[dependencies]
anchor-lang = { version = "1.0.2", features = ["init-if-needed"] }
ephemeral-rollups-sdk = { version = "0.16.2", features = ["anchor"] }
# 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 = "0fc4604157de51df28693e02e5a1a6a4a08c8a03", features = [
"anchor",
"crank",
] }
sha2 = "0.10"
magicblock-magic-program-api = { version = "0.10.1", default-features = false }
bincode = "^1.3"
Comment on lines +25 to 31

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 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.rs

Repository: 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-counter

Repository: 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-counter

Repository: 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-counter

Repository: 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.



[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(target_os, values("solana"))',
] }
Loading
Loading