fix: make pinocchio optional in light-compressible to prevent forester rebuilds#2170
fix: make pinocchio optional in light-compressible to prevent forester rebuilds#2170ananas-block merged 5 commits intomainfrom
Conversation
📝 WalkthroughWalkthroughThis PR reconfigures dependency feature flags across multiple crates, adjusts optional dependency wiring in Changes
Sequence Diagram(s)(omitted — changes are configuration, minor API type change, and localized cfg branches; no multi-component new control flow requiring visualization) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (26)📓 Common learnings📚 Learning: 2026-01-14T00:06:00.109ZApplied to files:
📚 Learning: 2026-01-14T00:06:11.915ZApplied to files:
📚 Learning: 2025-11-24T17:56:00.229ZApplied to files:
📚 Learning: 2026-01-11T01:05:03.142ZApplied to files:
📚 Learning: 2026-01-14T00:06:11.915ZApplied to files:
📚 Learning: 2026-01-14T00:05:47.820ZApplied to files:
📚 Learning: 2026-01-14T00:05:32.217ZApplied to files:
📚 Learning: 2025-11-24T17:56:00.229ZApplied to files:
📚 Learning: 2025-11-24T17:56:00.229ZApplied to files:
📚 Learning: 2026-01-14T00:06:46.444ZApplied to files:
📚 Learning: 2025-11-24T17:59:03.485ZApplied to files:
📚 Learning: 2025-11-24T17:59:03.485ZApplied to files:
📚 Learning: 2025-11-24T17:58:50.237ZApplied to files:
📚 Learning: 2025-11-24T17:59:03.485ZApplied to files:
📚 Learning: 2026-01-10T19:26:21.240ZApplied to files:
📚 Learning: 2026-01-10T19:26:01.412ZApplied to files:
📚 Learning: 2026-01-10T19:26:01.412ZApplied to files:
📚 Learning: 2026-01-10T19:26:21.240ZApplied to files:
📚 Learning: 2025-11-24T17:56:00.229ZApplied to files:
📚 Learning: 2026-01-14T00:06:59.264ZApplied to files:
📚 Learning: 2026-01-14T00:06:59.264ZApplied to files:
📚 Learning: 2026-01-05T19:54:29.872ZApplied to files:
📚 Learning: 2026-01-05T19:54:29.872ZApplied to files:
📚 Learning: 2025-11-24T17:56:00.229ZApplied to files:
📚 Learning: 2025-11-24T17:54:07.145ZApplied to files:
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@program-libs/compressible/Cargo.toml`:
- Around line 9-12: The project is missing explicit wiring of the
light-account-checks feature to each SDK feature so the AccountInfo backend
stays aligned; update the Cargo.toml feature list so each SDK feature (solana,
anchor, pinocchio) also enables the corresponding light-account-checks backend
(e.g., add "light-account-checks/solana" to the solana feature,
"light-account-checks/anchor" to the anchor feature, and the appropriate
"light-account-checks/pinocchio" if needed), and ensure the default feature
selection (default = ["solana"]) remains consistent by including the matching
light-account-checks backend for the default SDK.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.tomlis excluded by none and included by none
📒 Files selected for processing (6)
forester/Cargo.tomlprogram-libs/compressible/Cargo.tomlprogram-libs/compressible/src/compression_info.rsprogram-libs/compressible/src/rent/mod.rsprograms/compressed-token/program/Cargo.tomlsdk-libs/token-sdk/Cargo.toml
🧰 Additional context used
📓 Path-based instructions (1)
program-libs/**/*.rs
📄 CodeRabbit inference engine (CLAUDE.md)
program-libs/**/*.rs: Program-libs must depend only on other program-libs or external crates
Run unit tests in program-libs with 'cargo test -p '
Files:
program-libs/compressible/src/rent/mod.rsprogram-libs/compressible/src/compression_info.rs
🧠 Learnings (68)
📓 Common learnings
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: account-comparison/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:01.412Z
Learning: Applies to account-comparison/programs/**/tests/test_compressed_account.rs : Include Light Protocol tests in test_compressed_account.rs to verify compressed account operations using LightAccount primitives
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:11.915Z
Learning: Applies to program-libs/compressible/src/config.rs : CompressibleConfig account structure must support multiple serialization features (Anchor, Pinocchio, Borsh) for program compatibility
Learnt from: CR
Repo: Lightprotocol/distributor PR: 0
File: README.md:0-0
Timestamp: 2026-01-11T01:05:03.142Z
Learning: Applies to programs/merkle-distributor/src/**/*.rs : Use compressed accounts (compressed PDAs) instead of regular PDAs for ClaimStatus accounts in the Solana merkle-distributor program to reduce cost per claim (~0.00005 SOL vs ~0.002 SOL per claim)
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:56:00.229Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/Cargo.toml : Depend on light-compressed-account crate for compressed account types and utilities
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: account-comparison/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:01.412Z
Learning: Applies to account-comparison/programs/**/src/**/*.rs : Use `LightAccount::new_init` for compressed account creation and `LightAccount::new_mut` for updates in Light Protocol implementations
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:00.109Z
Learning: Applies to program-libs/account-checks/**/Cargo.toml : Enable feature flags appropriately: 'solana' for solana-program, 'pinocchio' for pinocchio SDK, 'test-only' for testing utilities
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/ACCOUNT_INFO_TRAIT.md:0-0
Timestamp: 2025-11-24T17:59:03.485Z
Learning: Applies to program-libs/account-checks/docs/program-libs/account-checks/src/account_info/{solana,pinocchio}.rs : Implement AccountInfoTrait with SDK-specific Pubkey types: `solana_pubkey::Pubkey` for solana-program feature and `[u8; 32]` raw bytes for pinocchio feature
Learnt from: CR
Repo: Lightprotocol/distributor PR: 0
File: programs/merkle-distributor/CLAUDE.md:0-0
Timestamp: 2026-01-11T01:05:19.378Z
Learning: Applies to programs/merkle-distributor/**/instructions/{new_claim,claim_locked}.rs : Use Light SDK v2 CPI via `LightSystemProgramCpi::new_cpi` for compressed account interactions
Learnt from: CR
Repo: Lightprotocol/distributor PR: 0
File: programs/merkle-distributor/CLAUDE.md:0-0
Timestamp: 2026-01-11T01:05:19.378Z
Learning: Applies to programs/merkle-distributor/**/state/*.rs : Use `LightDiscriminator` derive for compressed account state structs (e.g., ClaimStatus)
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: airdrop-implementations/simple-claim/README.md:0-0
Timestamp: 2026-01-10T19:24:56.367Z
Learning: Applies to airdrop-implementations/simple-claim/**/*.rs : Tokens must be minted as compressed tokens to PDAs derived from `[claimant, mint, unlock_slot, bump]`
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-libs/macros/src/compressible/README.md:0-0
Timestamp: 2025-11-24T17:55:17.323Z
Learning: Applies to sdk-libs/macros/src/compressible/**/pack_unpack.rs : Pubkey compression logic and `PackedXxx` struct generation with Pack/Unpack trait implementations should be in `pack_unpack.rs`
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/SOLANA_RENT.md:0-0
Timestamp: 2026-01-12T14:27:24.151Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : Subtract Solana rent exemption base (retrieved via `get_rent_exemption_lamports()`) from available balance before calculating Light Protocol rent obligations
Learnt from: CR
Repo: Lightprotocol/distributor PR: 0
File: programs/merkle-distributor/CLAUDE.md:0-0
Timestamp: 2026-01-11T01:05:19.378Z
Learning: Applies to programs/merkle-distributor/**/state/claim_status.rs : ClaimStatus compressed accounts are serialized with 8-byte discriminator + 56 bytes data = 64 bytes total
📚 Learning: 2025-11-24T17:56:00.229Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:56:00.229Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/Cargo.toml : Depend on light-compressed-account crate for compressed account types and utilities
Applied to files:
programs/compressed-token/program/Cargo.tomlforester/Cargo.tomlprogram-libs/compressible/Cargo.tomlsdk-libs/token-sdk/Cargo.toml
📚 Learning: 2026-01-14T00:05:32.217Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/sdk-light-token-test/README.md:0-0
Timestamp: 2026-01-14T00:05:32.217Z
Learning: Applies to sdk-tests/sdk-light-token-test/**/Cargo.toml : Use path dependencies to light-protocol2/sdk-libs for all Light Protocol SDK imports in Cargo.toml
Applied to files:
programs/compressed-token/program/Cargo.tomlforester/Cargo.tomlprogram-libs/compressible/Cargo.tomlsdk-libs/token-sdk/Cargo.toml
📚 Learning: 2026-01-14T00:06:46.444Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:46.444Z
Learning: Applies to programs/compressed-token/program/src/**/*.rs : When calculating rent top-ups for compressible accounts, use utilities from `shared/compressible_top_up.rs`
Applied to files:
programs/compressed-token/program/Cargo.toml
📚 Learning: 2026-01-14T00:06:00.109Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:00.109Z
Learning: Applies to program-libs/account-checks/**/Cargo.toml : Enable feature flags appropriately: 'solana' for solana-program, 'pinocchio' for pinocchio SDK, 'test-only' for testing utilities
Applied to files:
programs/compressed-token/program/Cargo.tomlforester/Cargo.tomlprogram-libs/compressible/Cargo.tomlsdk-libs/token-sdk/Cargo.toml
📚 Learning: 2025-11-24T17:56:00.229Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:56:00.229Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/Cargo.toml : Use light-merkle-tree-reference crate as dev dependency for reference implementation of indexed Merkle trees and generating constants
Applied to files:
programs/compressed-token/program/Cargo.tomlforester/Cargo.tomlprogram-libs/compressible/Cargo.toml
📚 Learning: 2025-11-24T17:56:00.229Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:56:00.229Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/Cargo.toml : Depend on light-merkle-tree-metadata crate for shared metadata structures
Applied to files:
programs/compressed-token/program/Cargo.tomlforester/Cargo.toml
📚 Learning: 2025-11-24T17:56:00.229Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:56:00.229Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/Cargo.toml : Depend on light-account-checks crate for account validation and discriminator checks
Applied to files:
programs/compressed-token/program/Cargo.tomlprogram-libs/compressible/Cargo.tomlsdk-libs/token-sdk/Cargo.toml
📚 Learning: 2026-01-10T19:26:38.625Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: create-and-update/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:38.625Z
Learning: Applies to create-and-update/**/programs/**/src/**/*.rs : Update existing compressed accounts via `LightAccount::new_mut()` which validates input state hash
Applied to files:
programs/compressed-token/program/Cargo.toml
📚 Learning: 2026-01-14T00:06:11.915Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:11.915Z
Learning: Applies to program-libs/compressible/src/config.rs : CompressibleConfig account structure must support multiple serialization features (Anchor, Pinocchio, Borsh) for program compatibility
Applied to files:
programs/compressed-token/program/Cargo.tomlprogram-libs/compressible/Cargo.toml
📚 Learning: 2025-11-24T17:56:00.229Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:56:00.229Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/Cargo.toml : Depend on light-zero-copy crate for zero-copy serialization for efficient account data access
Applied to files:
programs/compressed-token/program/Cargo.tomlprogram-libs/compressible/Cargo.tomlprogram-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-14T00:06:59.264Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:59.264Z
Learning: Applies to sdk-tests/**/client-test/**/*.rs : For Client SDK tests, run 'cargo test-sbf -p client-test' to test the Light RPC client library for querying compressed accounts
Applied to files:
programs/compressed-token/program/Cargo.tomlforester/Cargo.tomlsdk-libs/token-sdk/Cargo.toml
📚 Learning: 2026-01-14T00:06:46.444Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:46.444Z
Learning: Data structures must be isolated in the `light-token-interface` crate (program-libs/token-interface/) so SDKs and clients can import types without pulling in program dependencies
Applied to files:
programs/compressed-token/program/Cargo.tomlforester/Cargo.tomlsdk-libs/token-sdk/Cargo.toml
📚 Learning: 2026-01-14T00:05:47.820Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/CONFIG_ACCOUNT.md:0-0
Timestamp: 2026-01-14T00:05:47.820Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : CompressibleConfig account must be owned by Light Registry Program (Lighton6oQpVkeewmo2mcPTQQp7kYHr4fWpAgJyEmDX)
Applied to files:
programs/compressed-token/program/Cargo.toml
📚 Learning: 2026-01-10T19:26:01.412Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: account-comparison/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:01.412Z
Learning: Applies to account-comparison/programs/**/tests/test_compressed_account.rs : Include Light Protocol tests in test_compressed_account.rs to verify compressed account operations using LightAccount primitives
Applied to files:
programs/compressed-token/program/Cargo.tomlforester/Cargo.tomlsdk-libs/token-sdk/Cargo.toml
📚 Learning: 2026-01-14T00:06:59.264Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:59.264Z
Learning: Applies to sdk-tests/**/sdk-pinocchio-v1-test/**/*.rs : For Pinocchio SDK V1 tests, run 'cargo test-sbf -p sdk-pinocchio-v1-test' to test Light SDK V1 with Pinocchio framework
Applied to files:
programs/compressed-token/program/Cargo.tomlprogram-libs/compressible/Cargo.toml
📚 Learning: 2026-01-10T19:26:38.625Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: create-and-update/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:38.625Z
Learning: Applies to create-and-update/**/programs/**/src/**/*.rs : Define compressed account state structs with 8-byte discriminators derived via `LightDiscriminator` hash of struct name
Applied to files:
programs/compressed-token/program/Cargo.toml
📚 Learning: 2025-11-24T18:00:36.663Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/RENT.md:0-0
Timestamp: 2025-11-24T18:00:36.663Z
Learning: Applies to program-libs/compressible/docs/**/*rent*.rs : Implement `get_rent_exemption_lamports` function to return Solana's rent-exempt balance for a given account size, with error handling for unavailable rent sysvar.
Applied to files:
program-libs/compressible/src/rent/mod.rs
📚 Learning: 2026-01-12T14:27:24.151Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/SOLANA_RENT.md:0-0
Timestamp: 2026-01-12T14:27:24.151Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : Subtract Solana rent exemption base (retrieved via `get_rent_exemption_lamports()`) from available balance before calculating Light Protocol rent obligations
Applied to files:
program-libs/compressible/src/rent/mod.rs
📚 Learning: 2026-01-14T00:06:11.915Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:11.915Z
Learning: Applies to program-libs/compressible/src/rent.rs : Provide compressibility determination function (`calculate_rent_and_balance`) in rent calculation module
Applied to files:
program-libs/compressible/src/rent/mod.rs
📚 Learning: 2026-01-12T14:27:24.151Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/SOLANA_RENT.md:0-0
Timestamp: 2026-01-12T14:27:24.151Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : Access Solana's Rent sysvar using `Rent::get()` to retrieve minimum balance requirements for accounts, ensuring proper error handling with `FailedBorrowRentSysvar`
Applied to files:
program-libs/compressible/src/rent/mod.rs
📚 Learning: 2026-01-14T00:06:11.915Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:11.915Z
Learning: Applies to program-libs/compressible/src/rent.rs : Implement claimable rent calculation function (`claimable_lamports`) in rent calculation module
Applied to files:
program-libs/compressible/src/rent/mod.rsprogram-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-12T14:27:24.151Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/SOLANA_RENT.md:0-0
Timestamp: 2026-01-12T14:27:24.151Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : Provide mock Rent sysvar returns (2,282,880 lamports) in non-Solana runtime test environments when `Rent::get()` cannot be called
Applied to files:
program-libs/compressible/src/rent/mod.rs
📚 Learning: 2025-11-24T18:00:21.501Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/ERRORS.md:0-0
Timestamp: 2025-11-24T18:00:21.501Z
Learning: Applies to program-libs/compressible/docs/program-libs/compressible/src/error.rs : FailedBorrowRentSysvar (Error Code 19001): Ensure the rent sysvar is properly initialized in test environments and verify the sysvar is accessible for on-chain programs. Use `solana_program::rent::Rent::get()` with proper error handling for borrowing rent sysvar.
Applied to files:
program-libs/compressible/src/rent/mod.rs
📚 Learning: 2026-01-14T00:06:11.915Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:11.915Z
Learning: Applies to program-libs/compressible/src/rent.rs : Implement close lamport distribution function (`calculate_close_lamports`) in rent calculation module
Applied to files:
program-libs/compressible/src/rent/mod.rs
📚 Learning: 2025-11-24T18:00:36.663Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/RENT.md:0-0
Timestamp: 2025-11-24T18:00:36.663Z
Learning: Applies to program-libs/compressible/docs/**/*rent*.rs : Implement `calculate_rent_and_balance` function to determine compressibility by checking if account balance covers required rent for epochs since last claim, returning (bool, u64) tuple.
Applied to files:
program-libs/compressible/src/rent/mod.rsprogram-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-14T00:06:11.915Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:11.915Z
Learning: Applies to program-libs/compressible/src/rent.rs : Implement rent curve algorithms (`rent_curve_per_epoch`) in rent calculation module
Applied to files:
program-libs/compressible/src/rent/mod.rs
📚 Learning: 2026-01-12T14:27:24.151Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/SOLANA_RENT.md:0-0
Timestamp: 2026-01-12T14:27:24.151Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : Calculate Light Protocol rent per epoch using the formula: `rent_per_epoch = 1220 + (num_bytes * 10)` lamports for compressible token accounts
Applied to files:
program-libs/compressible/src/rent/mod.rs
📚 Learning: 2025-11-24T18:00:36.663Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/RENT.md:0-0
Timestamp: 2025-11-24T18:00:36.663Z
Learning: Applies to program-libs/compressible/docs/**/*rent*.rs : Implement `claimable_lamports` function to return None if account is compressible, otherwise return Some(amount) for completed epochs only (excluding current ongoing epoch).
Applied to files:
program-libs/compressible/src/rent/mod.rsprogram-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-11T01:05:03.142Z
Learnt from: CR
Repo: Lightprotocol/distributor PR: 0
File: README.md:0-0
Timestamp: 2026-01-11T01:05:03.142Z
Learning: Applies to programs/merkle-distributor/src/**/*.rs : Use compressed accounts (compressed PDAs) instead of regular PDAs for ClaimStatus accounts in the Solana merkle-distributor program to reduce cost per claim (~0.00005 SOL vs ~0.002 SOL per claim)
Applied to files:
forester/Cargo.tomlprogram-libs/compressible/Cargo.tomlprogram-libs/compressible/src/compression_info.rs
📚 Learning: 2025-11-24T17:54:42.219Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/system/README.md:0-0
Timestamp: 2025-11-24T17:54:42.219Z
Learning: Light Protocol system program is usable for ZK Compression on Solana
Applied to files:
forester/Cargo.toml
📚 Learning: 2026-01-15T02:04:14.072Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk/README.md:0-0
Timestamp: 2026-01-15T02:04:14.072Z
Learning: Use Light to store state rent-free in state Merkle trees as compressed accounts, indexed by Solana RPCs
Applied to files:
forester/Cargo.toml
📚 Learning: 2025-11-24T17:54:38.537Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/README.md:0-0
Timestamp: 2025-11-24T17:54:38.537Z
Learning: Implement compressed token program interfaces for third-party token creation and usage on Solana using ZK Compression
Applied to files:
forester/Cargo.toml
📚 Learning: 2026-01-10T19:25:12.548Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/native/README.md:0-0
Timestamp: 2026-01-10T19:25:12.548Z
Learning: Require light cli version 0.24.0+, solana cli version 2.1.16+, and Node.js with npm for testing
Applied to files:
forester/Cargo.toml
📚 Learning: 2026-01-14T00:05:47.820Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/CONFIG_ACCOUNT.md:0-0
Timestamp: 2026-01-14T00:05:47.820Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : CompressibleConfig derives with version parameter to support multiple config versions, with V1 as the most common version used by CToken program
Applied to files:
program-libs/compressible/Cargo.toml
📚 Learning: 2026-01-14T00:06:11.915Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:11.915Z
Learning: Applies to program-libs/compressible/src/error.rs : Implement error type conversions (ProgramError) for Anchor, Pinocchio, and Solana program compatibility
Applied to files:
program-libs/compressible/Cargo.toml
📚 Learning: 2025-11-24T17:59:03.485Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/ACCOUNT_INFO_TRAIT.md:0-0
Timestamp: 2025-11-24T17:59:03.485Z
Learning: Applies to program-libs/account-checks/docs/program-libs/account-checks/src/account_info/{solana,pinocchio}.rs : Implement AccountInfoTrait with SDK-specific Pubkey types: `solana_pubkey::Pubkey` for solana-program feature and `[u8; 32]` raw bytes for pinocchio feature
Applied to files:
program-libs/compressible/Cargo.tomlprogram-libs/compressible/src/compression_info.rs
📚 Learning: 2025-11-24T17:59:03.485Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/ACCOUNT_INFO_TRAIT.md:0-0
Timestamp: 2025-11-24T17:59:03.485Z
Learning: Applies to program-libs/account-checks/docs/program-libs/account-checks/src/account_info/pinocchio.rs : Pinocchio AccountInfo implementations should use native on-chain implementations for PDA functions when available, with fallback to solana_pubkey off-chain
Applied to files:
program-libs/compressible/Cargo.tomlprogram-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-05T19:54:29.872Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-05T19:54:29.872Z
Learning: Applies to programs/**/*.rs : Programs must depend only on program-libs and external crates (except devenv feature)
Applied to files:
program-libs/compressible/Cargo.toml
📚 Learning: 2025-11-24T17:56:00.229Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:56:00.229Z
Learning: Applies to program-libs/batched-merkle-tree/docs/**/Cargo.toml : Depend on light-hasher crate for Poseidon hash implementation in hash chains and tree operations
Applied to files:
program-libs/compressible/Cargo.toml
📚 Learning: 2026-01-14T00:06:59.264Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:59.264Z
Learning: Applies to sdk-tests/**/sdk-pinocchio-v2-test/**/*.rs : For Pinocchio SDK V2 tests, run 'cargo test-sbf -p sdk-pinocchio-v2-test' to test Light SDK V2 with Pinocchio framework
Applied to files:
program-libs/compressible/Cargo.toml
📚 Learning: 2026-01-05T19:54:29.872Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-05T19:54:29.872Z
Learning: Applies to sdk-libs/**/*.rs : SDK libs must depend only on program-libs, light-prover-client, and external crates
Applied to files:
program-libs/compressible/Cargo.tomlsdk-libs/token-sdk/Cargo.toml
📚 Learning: 2025-11-24T17:54:07.145Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/macros/README.md:0-0
Timestamp: 2025-11-24T17:54:07.145Z
Learning: This is a proc-macros crate for the Light Protocol - focus on maintaining macro correctness and performance
Applied to files:
program-libs/compressible/Cargo.toml
📚 Learning: 2026-01-14T00:05:47.820Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/CONFIG_ACCOUNT.md:0-0
Timestamp: 2026-01-14T00:05:47.820Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : CompressibleConfig account state layout must follow the defined structure with version (u16), state (u8), bump (u8), update_authority (Pubkey), withdrawal_authority (Pubkey), rent_sponsor (Pubkey), compression_authority (Pubkey), rent_sponsor_bump (u8), compression_authority_bump (u8), rent_config (RentConfig), address_space ([Pubkey; 4]), and _place_holder ([u8; 32]) fields
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2025-11-24T17:55:17.323Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-libs/macros/src/compressible/README.md:0-0
Timestamp: 2025-11-24T17:55:17.323Z
Learning: Applies to sdk-libs/macros/src/compressible/**/pack_unpack.rs : Pubkey compression logic and `PackedXxx` struct generation with Pack/Unpack trait implementations should be in `pack_unpack.rs`
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-11T01:05:19.378Z
Learnt from: CR
Repo: Lightprotocol/distributor PR: 0
File: programs/merkle-distributor/CLAUDE.md:0-0
Timestamp: 2026-01-11T01:05:19.378Z
Learning: Applies to programs/merkle-distributor/**/state/claim_status.rs : ClaimStatus compressed accounts are serialized with 8-byte discriminator + 56 bytes data = 64 bytes total
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-14T00:05:47.820Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/CONFIG_ACCOUNT.md:0-0
Timestamp: 2026-01-14T00:05:47.820Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : CompressibleConfig RentConfig must have a fixed size of 8 bytes (base_rent: u16, compression_cost: u16, lamports_per_byte_per_epoch: u8, _place_holder_bytes: [u8; 3])
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-14T00:06:46.444Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:46.444Z
Learning: Applies to programs/compressed-token/program/src/compressible/*.rs : Rent authority can compress accounts only when `is_compressible()` returns true, as documented in program-libs/compressible/docs/RENT.md
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2025-11-24T18:00:36.663Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/RENT.md:0-0
Timestamp: 2025-11-24T18:00:36.663Z
Learning: Applies to program-libs/compressible/docs/**/*rent*.rs : RentConfig struct must be exactly 8 bytes and contain: base_rent (u16), compression_cost (u16), lamports_per_byte_per_epoch (u8), and 3 bytes of padding.
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-14T00:05:47.820Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/CONFIG_ACCOUNT.md:0-0
Timestamp: 2026-01-14T00:05:47.820Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : CompressibleConfig update_authority can modify config state but cannot withdraw funds from the rent_sponsor pool
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-11T01:05:19.378Z
Learnt from: CR
Repo: Lightprotocol/distributor PR: 0
File: programs/merkle-distributor/CLAUDE.md:0-0
Timestamp: 2026-01-11T01:05:19.378Z
Learning: Applies to programs/merkle-distributor/**/instructions/{new_claim,claim_locked}.rs : ClaimStatus compressed account address is derived via `light_sdk::address::v2::derive_address` with `ADDRESS_TREE_V2` using seeds: `["ClaimStatus", claimant.key(), distributor.key()]`
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2025-08-14T00:36:53.191Z
Learnt from: ananas-block
Repo: Lightprotocol/light-protocol PR: 1909
File: program-libs/zero-copy/src/init_mut.rs:241-249
Timestamp: 2025-08-14T00:36:53.191Z
Learning: In the light-protocol zero-copy crate, performance is prioritized over safety checks for edge cases like Vec lengths exceeding u32::MAX, even when there might be wire format inconsistencies.
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2025-11-24T17:54:20.982Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/zero-copy-derive/README.md:0-0
Timestamp: 2025-11-24T17:54:20.982Z
Learning: Applies to program-libs/zero-copy-derive/**/*.rs : Option<u64>, Option<u32>, and Option<u16> are optimized in zero-copy structs; other Option<T> types delegate to T's ZeroCopyAt implementation
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2025-11-24T17:54:20.982Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/zero-copy-derive/README.md:0-0
Timestamp: 2025-11-24T17:54:20.982Z
Learning: Applies to program-libs/zero-copy-derive/**/*.rs : Use Option<T> for optional values in zero-copy structs; Option<u16>, Option<u32>, and Option<u64> are optimized
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2025-11-24T17:54:20.982Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/zero-copy-derive/README.md:0-0
Timestamp: 2025-11-24T17:54:20.982Z
Learning: Applies to program-libs/zero-copy-derive/**/*.rs : Use only supported primitive types: u8, u16, u32, u64, i8, i16, i32, i64, and bool in structs with ZeroCopy macros
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-15T02:04:37.090Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk/zk-id/README.md:0-0
Timestamp: 2026-01-15T02:04:37.090Z
Learning: Applies to zk/zk-id/src/lib.rs : Use poseidon::LightAccount for accounts with fixed-size fields (uses Poseidon hashing)
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2025-11-24T17:54:20.982Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/zero-copy-derive/README.md:0-0
Timestamp: 2025-11-24T17:54:20.982Z
Learning: Applies to program-libs/zero-copy-derive/**/*.rs : Vec<u8> uses optimized slice operations in zero-copy structs; other Vec<T> types use ZeroCopySlice
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2025-11-24T17:54:20.982Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/zero-copy-derive/README.md:0-0
Timestamp: 2025-11-24T17:54:20.982Z
Learning: Applies to program-libs/zero-copy-derive/**/*.rs : Apply #[derive(ZeroCopy)] macro to structs to derive ZeroCopyAt trait for zero-copy serialization
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-10T19:26:10.578Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: airdrop-implementations/simple-claim/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:10.578Z
Learning: Applies to airdrop-implementations/simple-claim/program/src/instruction.rs : Define ClaimAccounts structure with 16 account fields in order: claimant, fee_payer, associated_airdrop_pda, ctoken_cpi_authority_pda, light_system_program, registered_program_pda, noop_program, account_compression_authority, account_compression_program, ctoken_program, spl_interface_pda, decompress_destination, token_program, system_program, state_tree, and queue
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-12T14:27:24.151Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/SOLANA_RENT.md:0-0
Timestamp: 2026-01-12T14:27:24.151Z
Learning: Implement compressibility window states with three distinct account statuses: Funded (rent for current epoch + 1), Compressible (lacks rent for current epoch + 1), and Claimable (past epochs unclaimed)
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-10T19:24:56.367Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: airdrop-implementations/simple-claim/README.md:0-0
Timestamp: 2026-01-10T19:24:56.367Z
Learning: Applies to airdrop-implementations/simple-claim/**/*.rs : Tokens must be minted as compressed tokens to PDAs derived from `[claimant, mint, unlock_slot, bump]`
Applied to files:
program-libs/compressible/src/compression_info.rs
📚 Learning: 2026-01-15T02:04:37.090Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: zk/zk-id/README.md:0-0
Timestamp: 2026-01-15T02:04:37.090Z
Learning: Applies to zk/zk-id/**/Cargo.toml : Use Light SDK v0.17+ with V2 accounts layout
Applied to files:
sdk-libs/token-sdk/Cargo.toml
📚 Learning: 2026-01-14T00:06:59.264Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:59.264Z
Learning: Applies to sdk-tests/**/sdk-token-test/**/*.rs : For Token SDK tests, run 'cargo test-sbf -p sdk-token-test' to test compressed token SDK operations (mint, transfer, burn, etc.)
Applied to files:
sdk-libs/token-sdk/Cargo.toml
📚 Learning: 2026-01-14T00:06:59.264Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/CLAUDE.md:0-0
Timestamp: 2026-01-14T00:06:59.264Z
Learning: Applies to sdk-tests/**/sdk-libs/**/src/**/*.rs : Run unit tests for supporting libraries using 'cargo test' for light-program-test, light-client, light-sparse-merkle-tree, light-token-types, and light-token-sdk packages
Applied to files:
sdk-libs/token-sdk/Cargo.toml
📚 Learning: 2026-01-10T19:26:01.412Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: account-comparison/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:01.412Z
Learning: Applies to account-comparison/programs/**/src/**/*.rs : Use `LightAccount::new_init` for compressed account creation and `LightAccount::new_mut` for updates in Light Protocol implementations
Applied to files:
sdk-libs/token-sdk/Cargo.toml
📚 Learning: 2026-01-10T19:25:12.548Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/native/README.md:0-0
Timestamp: 2026-01-10T19:25:12.548Z
Learning: Applies to basic-operations/native/**/*.ts : TypeScript client code must use `lightprotocol/stateless.js` and `lightprotocol/zk-compression-cli` libraries for compressed account interactions
Applied to files:
sdk-libs/token-sdk/Cargo.toml
📚 Learning: 2026-01-10T19:26:38.625Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: create-and-update/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:38.625Z
Learning: Applies to create-and-update/**/programs/**/src/**/*.rs : Create compressed accounts with derived addresses using `LightAccount::new_init()` method
Applied to files:
sdk-libs/token-sdk/Cargo.toml
📚 Learning: 2026-01-10T19:26:21.240Z
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: basic-operations/CLAUDE.md:0-0
Timestamp: 2026-01-10T19:26:21.240Z
Learning: Applies to basic-operations/**/{anchor,native}/**/src/**/*.rs : Use `LightDiscriminator` derive macro for compressed account type identification
Applied to files:
sdk-libs/token-sdk/Cargo.toml
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: stateless-js-v2
- GitHub Check: Test program-libs-slow
- GitHub Check: Test program-libs-fast
- GitHub Check: Test batched-merkle-tree-simulate
- GitHub Check: Forester e2e test
- GitHub Check: programs (system-cpi-test, ["cargo-test-sbf -p system-cpi-test", "cargo test -p light-system-prog...
- GitHub Check: programs (system-cpi-test-v2-functional-read-only, ["cargo-test-sbf -p system-cpi-v2-test -- func...
- GitHub Check: programs (system-cpi-test-v2-functional-account-infos, ["cargo-test-sbf -p system-cpi-v2-test -- ...
- GitHub Check: programs (compressed-token-and-e2e, ["cargo test -p light-compressed-token", "cargo-test-sbf -p c...
- GitHub Check: programs (account-compression-and-registry, ["cargo-test-sbf -p account-compression-test", "cargo...
🔇 Additional comments (6)
sdk-libs/token-sdk/Cargo.toml (1)
30-30: LGTM!Adding the
solanafeature tolight-compressed-accountaligns with the PR's goal of enabling solana-specific paths across the workspace. This ensures the token SDK has access to solana-specific functionality from the compressed account crate.programs/compressed-token/program/Cargo.toml (1)
56-56: LGTM!Since pinocchio is now optional in
light-compressible, explicitly enabling it here ensures the compressed-token program continues to use the pinocchio-based rent sysvar access. This is consistent with the program's existing pinocchio dependencies (line 60).forester/Cargo.toml (1)
29-29: LGTM!This is the key change that achieves the PR's objective. By using
default-features = falseand explicitly enabling only thesolanafeature, the forester avoids pulling in pinocchio dependencies it doesn't need. This decoupling should eliminate unnecessary rebuilds when pinocchio-related changes occur in the compressible crate.program-libs/compressible/src/rent/mod.rs (1)
10-31: LGTM! The cfg logic correctly handles feature precedence.The three branches are mutually exclusive:
target_os = "solana"+pinocchio→ uses pinocchio sysvartarget_os = "solana"+solana(without pinocchio) → uses solana_sysvar- Everything else → unimplemented
When both features are enabled, pinocchio takes precedence, which aligns with how on-chain programs typically operate. The updated error message clearly communicates the required configuration.
program-libs/compressible/src/compression_info.rs (1)
164-171: SDK-agnostic design: This change correctly abstracts away SDK-specific Pubkey types.Switching
ClaimAndUpdatefrom&'a Pubkeyreferences to&'a [u8; 32]raw bytes aligns the struct with the AccountInfoTrait pattern used across both solana-program and pinocchio SDKs. The single caller (compressed-token claim.rs) correctly passesaccounts.compression_authority.key()andaccounts.rent_sponsor.key(), which return[u8; 32]in both implementations—solana.rs converts viato_bytes()while pinocchio.rs returns bytes natively.The comparisons at lines 217 and 222 remain type-consistent (
[u8; 32]vs[u8; 32]), and this pattern mirrors howCompressionInfoalready stores these fields. No conversion overhead on the calling side.program-libs/compressible/Cargo.toml (1)
22-22: Allpinocchiouses are properlycfg-gated. Verified usage inrent/mod.rs(guarded by#[cfg(all(target_os = "solana", feature = "pinocchio"))]) and error conversion inerror.rs(guarded by#[cfg(feature = "pinocchio")]). Feature declaration in Cargo.toml correctly usesdep:pinocchioto activate the optional dependency.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Summary by CodeRabbit
Refactor
Chores
✏️ Tip: You can customize this high-level summary in your review settings.