-
Notifications
You must be signed in to change notification settings - Fork 90
chore: refactor macros #2171
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
chore: refactor macros #2171
Changes from all commits
6f25b67
fa0058d
28c2eae
6443a47
e62f7d6
9e16efe
5f62ffc
484965f
ec96f6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ license = "MIT" | |
| [features] | ||
| default = ["solana"] | ||
| solana = ["dep:solana-program-error", "light-compressed-account/solana", "light-account-checks/solana", "solana-sysvar", "solana-msg"] | ||
| anchor = ["anchor-lang", "light-compressed-account/anchor", "light-compressed-account/std", "light-account-checks/solana"] | ||
| anchor = ["anchor-lang", "light-compressed-account/anchor", "light-compressed-account/std", "light-account-checks/solana", "light-sdk-types/anchor"] | ||
| pinocchio = ["dep:pinocchio", "light-compressed-account/pinocchio", "light-account-checks/pinocchio"] | ||
| profile-program = [] | ||
| profile-heap = ["dep:light-heap"] | ||
|
|
@@ -32,6 +32,7 @@ light-program-profiler = { workspace = true } | |
| light-heap = { workspace = true, optional = true } | ||
| light-account-checks = { workspace= true } | ||
| light-compressed-account = { workspace= true } | ||
| light-sdk-types = { workspace = true } | ||
|
Contributor
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🏁 Script executed: # Find workspace root and check members
find . -name "Cargo.toml" -type f | head -3
cat Cargo.toml | grep -A 50 "^\[workspace\]" | head -60Repository: Lightprotocol/light-protocol Length of output: 1777 🏁 Script executed: # Locate light-sdk-types definition
fd "light-sdk-types" --type d
find . -path "*/light-sdk-types/Cargo.toml" -type fRepository: Lightprotocol/light-protocol Length of output: 54 🏁 Script executed: # Check the file under review and surrounding context
cat -n program-libs/compressible/Cargo.toml | sed -n '1,45p'Repository: Lightprotocol/light-protocol Length of output: 2164 🏁 Script executed: # Look for CLAUDE.md files with governance rules
find . -name "CLAUDE.md" -type f | xargs ls -la
cat CLAUDE.md | head -100
cat sdk-libs/CLAUDE.md 2>/dev/null | head -100 || echo "No sdk-libs CLAUDE.md"
cat program-libs/CLAUDE.md 2>/dev/null | head -100 || echo "No program-libs CLAUDE.md"Repository: Lightprotocol/light-protocol Length of output: 6705 🏁 Script executed: # Check light-sdk-types definition and contents
cat -n sdk-libs/sdk-types/Cargo.toml | head -30
echo "---"
cat sdk-libs/sdk-types/src/lib.rs | head -50Repository: Lightprotocol/light-protocol Length of output: 1984 🏁 Script executed: # Check program-libs/compressible CLAUDE.md for context
cat program-libs/compressible/CLAUDE.mdRepository: Lightprotocol/light-protocol Length of output: 2216 🏁 Script executed: # Check what program-libs/compressible actually imports from light-sdk-types
rg "light-sdk-types|light_sdk_types" program-libs/compressible/src/ -A 2 -B 2Repository: Lightprotocol/light-protocol Length of output: 473 🏁 Script executed: # Check if similar types exist in program-libs/token-interface
cat program-libs/token-interface/Cargo.toml | head -30
echo "---"
ls -la program-libs/token-interface/src/Repository: Lightprotocol/light-protocol Length of output: 1776 Move instruction types to Program libs must not depend on SDK libs—this violates the dependency boundary. The
Keeping program-libs dependencies unidirectional (inbound only from sdk-libs) is essential for clean separation of concerns. 🤖 Prompt for AI Agents
Contributor
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🏁 Script executed: #!/bin/bash
# Find light-sdk-types in the workspace
echo "=== Finding light-sdk-types definition ==="
rg -l 'name\s*=\s*"light-sdk-types"' --glob 'Cargo.toml'
# Check the structure of the workspace
echo "=== Checking workspace structure ==="
find . -name "light-sdk-types" -type d | head -5Repository: Lightprotocol/light-protocol Length of output: 200 🏁 Script executed: #!/bin/bash
# Once we find it, get its location and dependencies
CARGO_PATH=$(rg -l 'name\s*=\s*"light-sdk-types"' --glob 'Cargo.toml' | head -1)
if [ -n "$CARGO_PATH" ]; then
echo "=== light-sdk-types Cargo.toml ==="
cat "$CARGO_PATH"
echo ""
echo "=== Directory structure around light-sdk-types ==="
dirname "$CARGO_PATH" | xargs ls -la
fiRepository: Lightprotocol/light-protocol Length of output: 1373 🏁 Script executed: #!/bin/bash
# Check CLAUDE.md files in program-libs for dependency guidance
echo "=== CLAUDE.md files in program-libs ==="
find program-libs -name "CLAUDE.md" -type f | head -10
# Show relevant content from program-libs CLAUDE.md
if [ -f "program-libs/CLAUDE.md" ]; then
echo "=== program-libs/CLAUDE.md content ==="
cat "program-libs/CLAUDE.md" | head -100
fiRepository: Lightprotocol/light-protocol Length of output: 317 🏁 Script executed: #!/bin/bash
# Find the exact path of light-sdk-types
echo "=== Exact location of light-sdk-types ==="
rg -l 'name\s*=\s*"light-sdk-types"' --glob 'Cargo.toml'
# Check what's in program-libs/compressible/CLAUDE.md
echo ""
echo "=== program-libs/compressible/CLAUDE.md ==="
cat program-libs/compressible/CLAUDE.md
# Also check the broader CLAUDE.md or guidelines
echo ""
echo "=== program-libs/compressible/docs/CLAUDE.md ==="
cat program-libs/compressible/docs/CLAUDE.mdRepository: Lightprotocol/light-protocol Length of output: 2383 🏁 Script executed: #!/bin/bash
# Check the current Cargo.toml of compressible to see all dependencies
echo "=== program-libs/compressible/Cargo.toml (full) ==="
cat program-libs/compressible/Cargo.toml | head -80
# Verify: is light-sdk-types in program-libs or sdk-libs?
echo ""
echo "=== Checking if light-sdk-types path ==="
fd -t d 'light-sdk-types' | head -5
</parameter>Repository: Lightprotocol/light-protocol Length of output: 2129 🏁 Script executed: #!/bin/bash
# Find workspace root and list all crates to understand structure
echo "=== Root workspace.members ==="
rg '\[\[workspace\]\]' -A 50 'Cargo.toml' 2>/dev/null | head -60
# More direct: list Cargo.toml files with their package names
echo ""
echo "=== Package locations in workspace (sample) ==="
fd -t f 'Cargo.toml' -x grep -H 'name = "' {} \; | grep -E '(light-sdk-types|program-libs|sdk-libs)' | head -20Repository: Lightprotocol/light-protocol Length of output: 1365 🏁 Script executed: #!/bin/bash
# Verify the dependency direction and check if there are already program-libs crates for types
echo "=== Looking for other program-libs type crates ==="
ls -la program-libs/ | grep -E 'type|interface'
# Check what light-sdk-types is actually used for in program-libs/compressible
echo ""
echo "=== How light-sdk-types is used in compressible ==="
rg 'light-sdk-types|use.*light_sdk_types' program-libs/compressible/src/ | head -20Repository: Lightprotocol/light-protocol Length of output: 335 🏁 Script executed: #!/bin/bash
# Check if light-token-interface (program-libs tier) might be the right place for these types
echo "=== light-token-interface location and purpose ==="
head -50 program-libs/token-interface/src/lib.rs
# See if ValidityProof and PackedAddressTreeInfo mentioned in original review are in light-sdk-types
echo ""
echo "=== Types exported from light-sdk-types ==="
grep -E 'pub struct|pub enum' program-libs/sdk-types/src/lib.rs 2>/dev/null || grep -E 'pub struct|pub enum' sdk-libs/sdk-types/src/lib.rs | head -20Repository: Lightprotocol/light-protocol Length of output: 663 🏁 Script executed: #!/bin/bash
# Check full light-sdk-types/src to see what instruction types are there
echo "=== light-sdk-types/src contents ==="
ls -la sdk-libs/sdk-types/src/
# Check if PackedAddressTreeInfo is defined there
echo ""
echo "=== Looking for PackedAddressTreeInfo definition ==="
rg 'PackedAddressTreeInfo' sdk-libs/sdk-types/src/ -B 2 -A 5 | head -30Repository: Lightprotocol/light-protocol Length of output: 1998 Move instruction types to program-libs tier—program-libs crates cannot depend on sdk-libs. The
Action: Move 🤖 Prompt for AI Agents |
||
| aligned-sized = { workspace= true } | ||
| solana-sysvar = {workspace = true, optional = true} | ||
|
|
||
|
|
||
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.
what does this do?