Skip to content

fix: make pinocchio optional in light-compressible to prevent forester rebuilds#2170

Merged
ananas-block merged 5 commits intomainfrom
sergey/fix-compressible-crate
Jan 16, 2026
Merged

fix: make pinocchio optional in light-compressible to prevent forester rebuilds#2170
ananas-block merged 5 commits intomainfrom
sergey/fix-compressible-crate

Conversation

@sergeytimoshin
Copy link
Contributor

@sergeytimoshin sergeytimoshin commented Jan 16, 2026

  • Make pinocchio feature optional and off by default
  • Update downstream crates to not require pinocchio

Summary by CodeRabbit

  • Refactor

    • Public compression data structures now store keys as fixed-size byte arrays instead of references.
  • Chores

    • Reconfigured dependency feature flags across multiple packages to optimize feature selection and optionality.
    • Updated default feature sets and marked additional dependencies optional to streamline builds.
    • Adjusted platform-specific rent computation logic to select the appropriate runtime implementation.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

This PR reconfigures dependency feature flags across multiple crates, adjusts optional dependency wiring in program-libs/compressible/Cargo.toml, changes two public fields in ClaimAndUpdate from &Pubkey to &[u8; 32], and introduces more granular cfg branches for rent-exemption computation.

Changes

Cohort / File(s) Summary
Top-level dependency feature changes
forester/Cargo.toml, programs/compressed-token/program/Cargo.toml, sdk-libs/token-sdk/Cargo.toml
Updated workspace dependency signatures: forester disables default features and enables solana for light-compressible; compressed-token enables pinocchio for light-compressible; token-sdk adds solana to light-compressed-account features.
Compressible crate manifest
program-libs/compressible/Cargo.toml
Default features updated (from ["pinocchio","solana"]["solana"]); features re-wired to reference additional light-account-checks/* entries; pinocchio dependency made optional = true; several deps marked optional and feature wiring adjusted.
Public API structure change
program-libs/compressible/src/compression_info.rs
ClaimAndUpdate<'a> field types changed: compression_authority and rent_sponsor from &'a Pubkey&'a [u8; 32].
Rent computation cfg branching
program-libs/compressible/src/rent/mod.rs
get_rent_exemption_lamports() now uses granular cfg arms: (target_os="solana" + feature="pinocchio"), (target_os="solana" + feature="solana" && not feature="pinocchio"), and an updated unimplemented fallback with adjusted error text.

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

ai-review

Suggested reviewers

  • SwenSchaeferjohann

Poem

Keys once typed as Pubkey, small and neat,
Now rest as arrays of thirty-two bytes complete.
Features shuffled — Solana leads the tune,
Pinocchio steps in to balance the room,
Crates sing in sync beneath the buildkite light. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective: making pinocchio optional in light-compressible to prevent unnecessary forester rebuilds, which is the primary change reflected across multiple Cargo.toml files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 70.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sergey/fix-compressible-crate


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69b2a17 and 2380fa3.

📒 Files selected for processing (1)
  • program-libs/compressible/Cargo.toml
🧰 Additional context used
🧠 Learnings (26)
📓 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/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/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/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/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/program-examples PR: 0
File: create-and-update/README.md:0-0
Timestamp: 2026-01-10T19:25:28.052Z
Learning: Applies to create-and-update/**/*.rs : Use `LightAccount::new_mut()` to update existing compressed accounts
Learnt from: CR
Repo: Lightprotocol/program-examples PR: 0
File: create-and-update/README.md:0-0
Timestamp: 2026-01-10T19:25:28.052Z
Learning: Applies to create-and-update/**/*.rs : Use `LightAccount::new_init()` to create new compressed accounts
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
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
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
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
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`
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])
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.
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/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
📚 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:

  • 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/config.rs : CompressibleConfig account structure must support multiple serialization features (Anchor, Pinocchio, Borsh) for program compatibility

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-compressed-account crate for compressed account types and utilities

Applied to files:

  • program-libs/compressible/Cargo.toml
📚 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:

  • 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: 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: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:

  • 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-zero-copy crate for zero-copy serialization for efficient account data access

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-account-checks crate for account validation and discriminator checks

Applied to files:

  • program-libs/compressible/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:

  • 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.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: Write SDK-agnostic validation code that works with both solana-program and pinocchio by accepting AccountInfoTrait as a generic type parameter rather than using feature-gated conditional compilation in validation logic

Applied to files:

  • program-libs/compressible/Cargo.toml
📚 Learning: 2025-11-24T17:58:50.237Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/ACCOUNT_CHECKS.md:0-0
Timestamp: 2025-11-24T17:58:50.237Z
Learning: Applies to program-libs/account-checks/docs/program-libs/account-checks/src/checks.rs : Use generic `AccountInfoTrait` parameter for all account validation functions to enable compatibility with both Solana and Pinocchio runtimes

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/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.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/**/src/**/*.rs : Use Poseidon hashing via `light_sdk::account::LightAccount` in Anchor framework implementations

Applied to files:

  • program-libs/compressible/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:

  • program-libs/compressible/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:

  • program-libs/compressible/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:

  • 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-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:

  • 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.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 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 : Use light-merkle-tree-reference crate as dev dependency for reference implementation of indexed Merkle trees and generating constants

Applied to files:

  • program-libs/compressible/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
⏰ 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)
  • GitHub Check: Test batched-merkle-tree-simulate
  • GitHub Check: Test program-libs-fast
  • GitHub Check: programs (account-compression-and-registry, ["cargo-test-sbf -p account-compression-test", "cargo...
  • GitHub Check: programs (compressed-token-and-e2e, ["cargo test -p light-compressed-token", "cargo-test-sbf -p c...
  • GitHub Check: programs (system-cpi-test-v2-functional-account-infos, ["cargo-test-sbf -p system-cpi-v2-test -- ...
  • 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, ["cargo-test-sbf -p system-cpi-test", "cargo test -p light-system-prog...
  • GitHub Check: stateless-js-v2
  • GitHub Check: Forester e2e test
🔇 Additional comments (2)
program-libs/compressible/Cargo.toml (2)

9-12: Nice cleanup: default Solana + explicit SDK wiring looks solid.
This aligns the feature surface with the new “pinocchio optional/off by default” objective and reduces unnecessary rebuilds.


22-22: No action needed — pinocchio is correctly kept optional.

The default features for light-account-checks (default = ["std"]) and light-compressed-account (default = ["alloc"]) do not include pinocchio. Pinocchio remains an explicit opt-in feature in both crates, so transitive defaults won't re-enable it. The existing dependency declarations are sound.

Likely an incorrect or invalid review comment.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 52b1f11 and 69b2a17.

⛔ Files ignored due to path filters (1)
  • Cargo.toml is excluded by none and included by none
📒 Files selected for processing (6)
  • forester/Cargo.toml
  • program-libs/compressible/Cargo.toml
  • program-libs/compressible/src/compression_info.rs
  • program-libs/compressible/src/rent/mod.rs
  • programs/compressed-token/program/Cargo.toml
  • sdk-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.rs
  • program-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.toml
  • forester/Cargo.toml
  • program-libs/compressible/Cargo.toml
  • sdk-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.toml
  • forester/Cargo.toml
  • program-libs/compressible/Cargo.toml
  • sdk-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.toml
  • forester/Cargo.toml
  • program-libs/compressible/Cargo.toml
  • sdk-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.toml
  • forester/Cargo.toml
  • 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-merkle-tree-metadata crate for shared metadata structures

Applied to files:

  • programs/compressed-token/program/Cargo.toml
  • forester/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.toml
  • program-libs/compressible/Cargo.toml
  • 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 : 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.toml
  • 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-zero-copy crate for zero-copy serialization for efficient account data access

Applied to files:

  • programs/compressed-token/program/Cargo.toml
  • program-libs/compressible/Cargo.toml
  • program-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.toml
  • forester/Cargo.toml
  • sdk-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.toml
  • forester/Cargo.toml
  • sdk-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.toml
  • forester/Cargo.toml
  • 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-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.toml
  • program-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.rs
  • 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: 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.rs
  • program-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.rs
  • program-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.toml
  • program-libs/compressible/Cargo.toml
  • program-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.toml
  • program-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.toml
  • program-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.toml
  • sdk-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 solana feature to light-compressed-account aligns 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 = false and explicitly enabling only the solana feature, 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:

  1. target_os = "solana" + pinocchio → uses pinocchio sysvar
  2. target_os = "solana" + solana (without pinocchio) → uses solana_sysvar
  3. 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 ClaimAndUpdate from &'a Pubkey references 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 passes accounts.compression_authority.key() and accounts.rent_sponsor.key(), which return [u8; 32] in both implementations—solana.rs converts via to_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 how CompressionInfo already stores these fields. No conversion overhead on the calling side.

program-libs/compressible/Cargo.toml (1)

22-22: All pinocchio uses are properly cfg-gated. Verified usage in rent/mod.rs (guarded by #[cfg(all(target_os = "solana", feature = "pinocchio"))]) and error conversion in error.rs (guarded by #[cfg(feature = "pinocchio")]). Feature declaration in Cargo.toml correctly uses dep:pinocchio to activate the optional dependency.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@ananas-block ananas-block merged commit 4e423e0 into main Jan 16, 2026
32 checks passed
@ananas-block ananas-block deleted the sergey/fix-compressible-crate branch January 16, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants