-
Notifications
You must be signed in to change notification settings - Fork 1
Bump Rust crate versions to latest #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,7 +18,7 @@ | |||||
| - Grep `declare_id|#\[program\]|entrypoint!|Pubkey|AccountInfo{{EXTRA_GREP}}` across src/ | ||||||
| - Glob `**/*.rs` and `**/Cargo.toml` for project structure | ||||||
| - Identify: program ID, existing instructions, account structs, framework (Anchor or native) | ||||||
| - Read Cargo.toml — note existing dependencies and Solana SDK version | ||||||
| - Task subagent (Grep/Read/WebFetch) if project has multiple crates to scan in parallel | ||||||
|
|
||||||
| ### 2. Read references | ||||||
|
|
@@ -39,7 +39,7 @@ | |||||
| - Present the plan to the user for approval before proceeding | ||||||
|
|
||||||
| ### 5. Implement | ||||||
| - Add deps: Bash `cargo add light-sdk@0.16` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust) | ||||||
| - Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust) | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify whether docs consistently use exact vs floating light-sdk version notation.
rg -n 'cargo add\s+light-sdk@'
rg -n 'light-sdk\s*=\s*"?0\.23(\.0)?'Repository: Lightprotocol/docs-v2 Length of output: 5101 Pin version notation to exact release across all AI prompt instructions for consistency. The Proposed diff-- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
+- Add deps: Bash `cargo add light-sdk@0.23.0` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| - Follow the guide and the approved plan | ||||||
| - Write/Edit to create or modify files | ||||||
| - TaskUpdate to mark each step done | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| <Prompt description="Build a program that reinitializes closed compressed accounts" actions={["copy", "cursor"]}> | ||
| {`--- | ||
| description: Build a program that reinitializes closed compressed accounts | ||
| allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Task, TaskCreate, TaskGet, TaskList, TaskUpdate, TaskOutput, mcp__deepwiki, mcp__zkcompression | ||
|
|
@@ -40,7 +40,7 @@ | |
| - Present the plan to the user for approval before proceeding | ||
|
|
||
| ### 5. Implement | ||
| - Add deps: Bash \`cargo add light-sdk@0.16\` (add \`anchor_lang@0.31\` for Anchor or \`solana-program@2.2\` + \`borsh@0.10\` for Native Rust) | ||
| - Add deps: Bash \`cargo add light-sdk@0.23\` (add \`anchor_lang@0.31\` for Anchor or \`solana-program@2.2\` + \`borsh@0.10\` for Native Rust) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result:
So, for documentation, prefer Use canonical package name Lines 43 and 102 use 🔧 Suggested update-- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)
+- Add deps: Bash `cargo add light-sdk@0.23` (add `anchor-lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust)Also applies to: 102-102 🤖 Prompt for AI Agents |
||
| - Follow the guide and the approved plan | ||
| - Write/Edit to create or modify files | ||
| - TaskUpdate to mark each step done | ||
|
|
@@ -99,7 +99,7 @@ | |
| - Present the plan to the user for approval before proceeding | ||
|
|
||
| ### 5. Implement | ||
| - Add deps: Bash `cargo add light-sdk@0.16` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust) | ||
| - Add deps: Bash `cargo add light-sdk@0.23` (add `anchor_lang@0.31` for Anchor or `solana-program@2.2` + `borsh@0.10` for Native Rust) | ||
| - Follow the guide and the approved plan | ||
| - Write/Edit to create or modify files | ||
| - TaskUpdate to mark each step done | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, let's check the file exists and read the context around lines 43 and 102 fd defi-anchor.mdxRepository: Lightprotocol/docs-v2
Length of output: 157
🏁 Script executed:
Repository: Lightprotocol/docs-v2
Length of output: 1844
🏁 Script executed:
Repository: Lightprotocol/docs-v2
Length of output: 120
🏁 Script executed:
Repository: Lightprotocol/docs-v2
Length of output: 6859
🏁 Script executed:
Repository: Lightprotocol/docs-v2
Length of output: 785
🏁 Script executed:
Repository: Lightprotocol/docs-v2
Length of output: 785
🌐 Web query:
light-sdk 0.23 anchor-lang dependency Anchor integration💡 Result:
To integrate
light-sdk = 0.23.0into an Anchor program, you need to compile Light’s types with Anchor serialization and keepanchor-langaligned to whatlight-sdkexpects.1) Cargo.toml (program)
light-sdk 0.23.0has an optional dependency onanchor-lang ^0.31.1. [1]anchorfeature solight-sdkderivesAnchorSerialize/AnchorDeserialize(instead of Borsh). [1]anchor-lang = "0.31"(same major/minor family). [2]2) Code usage (Anchor)
In your program code, you can use
anchor_langnormally and import Light helpers, e.g. (from the crate docs):use anchor_lang::{prelude::*, Discriminator};use light_sdk::{ ... LightAccount ... LightSystemProgramCpi ... ValidityProof ... }[1]3) Common gotcha: Anchor version mismatch
If your project is on newer Anchor (e.g. Anchor docs show
anchor-lang = "0.32.1"for Rust clients), you may hit Cargo resolution/type mismatch issues becauselight-sdk 0.23.0is pinned to the0.31.xline. In that case, either:anchor-langversion. [1][3]Sources: [1]
light-sdk 0.23.0docs.rs crate page (deps + examples), [2] Light Protocol “Program Integration” page, [3] Anchor Rust client docs showinganchor-lang = "0.32.1".🌐 Web query:
zkcompression.com light-token defi programs dependencies💡 Result:
From the Light Token → For DeFi → Program Integration guide, the Step 1: Dependencies section lists these
Cargo.tomldeps: [1]Sources: [1]
Add
anchor-lang@0.31to the from-scratch dependency command.The prompt supports a "new program from scratch" flow (step 3), but the cargo add command omits
anchor-lang, which is required for Anchor integration withlight-sdk@0.23.0. The official zkcompression.com guide explicitly includesanchor-lang = "0.31"in its dependencies section, andlight-sdk 0.23.0requires it when using theanchorfeature. A fresh project following only this prompt's dependencies will fail at the verify step (anchor build).Suggested fix
Also applies to: 102-102
🤖 Prompt for AI Agents