-
Notifications
You must be signed in to change notification settings - Fork 85
feat: add batched merkle tree documentation #2046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add CLAUDE.md with AI assistant documentation - Add QUEUE_ACCOUNT.md with queue account structure docs - Add TREE_ACCOUNT.md with tree account structure docs
Add INITIALIZE_STATE_TREE.md with detailed documentation for state tree initialization process and parameters.
Add INITIALIZE_ADDRESS_TREE.md with detailed documentation for address tree initialization process and parameters.
Add INSERT_OUTPUT_QUEUE.md with detailed documentation for inserting elements into the output queue.
Add INSERT_INPUT_QUEUE.md with detailed documentation for inserting nullifiers into the input queue.
Add INSERT_ADDRESS_QUEUE.md with detailed documentation for inserting addresses into the address queue.
Add UPDATE_FROM_OUTPUT_QUEUE.md with detailed documentation for updating the merkle tree from the output queue.
Add UPDATE_FROM_INPUT_QUEUE.md with detailed documentation for updating the merkle tree from the input queue.
WalkthroughAdds comprehensive documentation for the Batched Merkle Tree library (account models, queue behaviors, ZKP workflows, initialization and update flows), a CodeRabbit auto-review config, and new docs describing address/state tree initialization, queue inserts/updates, and one new public method plus related error variants; no runtime code changes beyond documented API additions. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Program
participant TreeAcc as BatchedMerkleTreeAccount
participant QueueAcc as BatchedQueueAccount
participant Verifier as ZKP_Verifier
rect rgb(240,248,255)
Client->>Program: submit insert (address/nullifier/output)
Program->>TreeAcc: validate owner, tree type, capacity
Program->>QueueAcc: read/write batch vectors, bloom, hash-chains
Program-->>Client: return success / error
end
rect rgb(245,255,240)
Client->>Program: submit update tx + proof
Program->>Verifier: verify proof (old_root,new_root,leaves_hash_chain[,start_index])
alt verification success
Program->>TreeAcc: append new_root, update sequence/root_history
Program->>QueueAcc: advance pending/processing batches, maybe zero bloom
Program-->>Client: success + event
else verification failure
Program-->>Client: error (verification/public_input)
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (3)
program-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.md (1)
53-53: Remove redundant phrase in line 53.The phrase "still being filled or Full (completely filled)" contains redundancy. "Completely filled" is implied by "Full" state.
Suggested fix:
- - If batch state is `Fill` (still being filled) or `Full` (completely filled) state + - If batch state is `Fill` (being filled) or `Full` stateAlso applies to: 53-53
program-libs/batched-merkle-tree/docs/INSERT_OUTPUT_QUEUE.md (1)
36-39: Clarify wording in queue index description.Line 38 uses awkward phrasing: "is the leaf index of the value up on Merkle tree insertion" should be "is the leaf index assigned when the value is inserted into the tree."
Suggested fix:
- - This index is used for proof-by-index when spending compressed accounts - - Is the leaf index of the value up on Merkle tree insertion. + - This index is used for proof-by-index when spending compressed accounts + - Assigned at insertion time and determines the leaf position in the treeprogram-libs/batched-merkle-tree/docs/INSERT_ADDRESS_QUEUE.md (1)
42-67: Document the two-batch system state transitions with sufficient detail.The documentation of state transitions (lines 42-67) correctly describes the Fill/Full/Inserted cycle, but could benefit from a visual state diagram or a simplified table showing which transitions are valid at each step. This would reduce cognitive load for developers integrating this operation.
For example, a table like:
Current State | Condition | Next State | Action Fill | Accepting insertions | Full | When batch_size reached Inserted | Batch reused | Fill | After bloom filter zeroed Full | Not accepting new data | Error | BatchNotReadyBased on learnings: Keep component documentation up to date with visual aids where appropriate.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
program-libs/batched-merkle-tree/docs/CLAUDE.md(1 hunks)program-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.md(1 hunks)program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md(1 hunks)program-libs/batched-merkle-tree/docs/INSERT_ADDRESS_QUEUE.md(1 hunks)program-libs/batched-merkle-tree/docs/INSERT_INPUT_QUEUE.md(1 hunks)program-libs/batched-merkle-tree/docs/INSERT_OUTPUT_QUEUE.md(1 hunks)program-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.md(1 hunks)program-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md(1 hunks)program-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.md(1 hunks)program-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.md(1 hunks)
🧰 Additional context used
🧠 Learnings (27)
📓 Common learnings
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:25.222Z
Learning: Applies to program-libs/account-checks/docs/{CLAUDE.md,ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,ERRORS.md,DISCRIMINATOR.md,PACKED_ACCOUNTS.md} : Keep component documentation up to date in the corresponding docs/*.md files listed
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Applies to programs/compressed-token/program/docs/instructions/**/CLAUDE.md : Maintain CLAUDE.md (this file) as the documentation structure guide for the compressed token program docs
Applied to files:
program-libs/batched-merkle-tree/docs/CLAUDE.md
📚 Learning: 2025-10-11T21:59:25.222Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:25.222Z
Learning: Applies to program-libs/account-checks/docs/{CLAUDE.md,ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,ERRORS.md,DISCRIMINATOR.md,PACKED_ACCOUNTS.md} : Keep component documentation up to date in the corresponding docs/*.md files listed
Applied to files:
program-libs/batched-merkle-tree/docs/CLAUDE.mdprogram-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.mdprogram-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.mdprogram-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.mdprogram-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md
📚 Learning: 2025-10-15T03:45:40.038Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:45:40.038Z
Learning: Applies to programs/compressed-token/program/docs/**/CLAUDE.md : Include a CLAUDE.md in each relevant documentation directory that serves as the documentation structure guide for that directory
Applied to files:
program-libs/batched-merkle-tree/docs/CLAUDE.md
📚 Learning: 2025-10-15T03:45:40.038Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:45:40.038Z
Learning: Applies to programs/compressed-token/program/docs/**/CLAUDE.md : Ensure the parent-level CLAUDE.md acts as the main entry point containing a summary and instruction index
Applied to files:
program-libs/batched-merkle-tree/docs/CLAUDE.md
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Use ../CLAUDE.md as the main entry point with summary and instruction index
Applied to files:
program-libs/batched-merkle-tree/docs/CLAUDE.md
📚 Learning: 2025-10-11T21:59:52.712Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/{ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,DISCRIMINATOR.md,ERRORS.md,PACKED_ACCOUNTS.md} : Each document should focus on a single module or concept
Applied to files:
program-libs/batched-merkle-tree/docs/CLAUDE.mdprogram-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.mdprogram-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Start with ../../CLAUDE.md for the instruction index and overview
Applied to files:
program-libs/batched-merkle-tree/docs/CLAUDE.md
📚 Learning: 2025-10-15T03:46:26.767Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/registry/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:26.767Z
Learning: Applies to programs/registry/src/lib.rs : Load accounts according to type before check_forester: batched via BatchedMerkleTreeAccount::type_from_account_info(); regular via ctx.accounts.account.load()?.metadata; use custom deserialization when required.
Applied to files:
program-libs/batched-merkle-tree/docs/CLAUDE.mdprogram-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.mdprogram-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.mdprogram-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.mdprogram-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md
📚 Learning: 2025-10-16T06:33:55.362Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:55.362Z
Learning: Applies to programs/compressed-token/program/docs/ACCOUNTS.md : Account documentation must include: description, discriminator, state layout, serialization example, hashing (only for compressed accounts), derivation (only for PDAs), and associated instructions
Applied to files:
program-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.mdprogram-libs/batched-merkle-tree/docs/INSERT_OUTPUT_QUEUE.mdprogram-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.mdprogram-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.mdprogram-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md
📚 Learning: 2025-10-11T21:59:52.712Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/DISCRIMINATOR.md : DISCRIMINATOR.md must document 8-byte discriminators, the Discriminator trait, constant arrays for compile-time checks, and integration with account initialization
Applied to files:
program-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.mdprogram-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.mdprogram-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.mdprogram-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Applies to programs/compressed-token/program/docs/instructions/**/ACCOUNTS.md : Provide complete account layouts and data structures in ACCOUNTS.md
Applied to files:
program-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.mdprogram-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.mdprogram-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.mdprogram-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md
📚 Learning: 2025-10-11T21:59:52.712Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/ACCOUNT_ITERATOR.md : ACCOUNT_ITERATOR.md must document the enhanced account iterator, including sequential processing, automatic validation, and location-based error reporting for debugging
Applied to files:
program-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.mdprogram-libs/batched-merkle-tree/docs/INSERT_OUTPUT_QUEUE.mdprogram-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.mdprogram-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.mdprogram-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.mdprogram-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md
📚 Learning: 2025-10-15T03:45:40.038Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:45:40.038Z
Learning: Applies to programs/compressed-token/program/docs/**/instructions/CREATE_TOKEN_ACCOUNT.md : Provide CREATE_TOKEN_ACCOUNT.md in the instructions/ directory documenting create token account and associated token account instructions
Applied to files:
program-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.mdprogram-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md
📚 Learning: 2025-10-11T21:59:52.712Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/PACKED_ACCOUNTS.md : PACKED_ACCOUNTS.md must document index-based dynamic account access, including accessing mint, owner, and delegate accounts by index with bounds checking
Applied to files:
program-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.mdprogram-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.mdprogram-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.mdprogram-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md
📚 Learning: 2025-10-15T03:45:40.038Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:45:40.038Z
Learning: Applies to programs/compressed-token/program/docs/**/ACCOUNTS.md : Maintain ACCOUNTS.md with complete account layouts and data structures
Applied to files:
program-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.mdprogram-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.mdprogram-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.mdprogram-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Applies to programs/compressed-token/program/docs/instructions/instructions/CREATE_TOKEN_ACCOUNT.md : Document Create Token Account & Associated Token Account instructions in instructions/CREATE_TOKEN_ACCOUNT.md
Applied to files:
program-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.mdprogram-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md
📚 Learning: 2025-10-16T06:33:19.426Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:19.426Z
Learning: Applies to program-libs/compressible/docs/CONFIG_ACCOUNT.md : Document the CompressibleConfig account structure and methods in docs/CONFIG_ACCOUNT.md
Applied to files:
program-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.mdprogram-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.mdprogram-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.mdprogram-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md
📚 Learning: 2025-10-11T21:59:25.222Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:25.222Z
Learning: Applies to program-libs/account-checks/src/**/*.rs : On account initialization, call account_info_init to set the 8-byte discriminator
Applied to files:
program-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.mdprogram-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md
📚 Learning: 2025-10-15T03:46:26.767Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/registry/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:26.767Z
Learning: Applies to programs/registry/src/lib.rs : Wrapper instruction handlers must: (1) load the target account metadata; (2) call check_forester with correct authority, target, forester PDA (optional), and computed work_units; (3) delegate via a CPI using a PDA signer.
Applied to files:
program-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.mdprogram-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Refer to ../ACCOUNTS.md for account structure reference from instruction docs
Applied to files:
program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md
📚 Learning: 2025-10-16T06:33:55.362Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:55.362Z
Learning: Applies to programs/compressed-token/program/src/create_associated_token_account.rs : Create Associated Token Account instruction must validate that the config state is ACTIVE only
Applied to files:
program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md
📚 Learning: 2025-10-16T06:33:55.362Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:55.362Z
Learning: Applies to programs/compressed-token/program/src/create_token_account.rs : Create Token Account instruction must validate that the config state is ACTIVE only
Applied to files:
program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md
📚 Learning: 2025-10-11T21:59:52.712Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/ACCOUNT_INFO_TRAIT.md : ACCOUNT_INFO_TRAIT.md must document the AccountInfoTrait abstraction, including trait definition, implementations, and runtime-agnostic usage across Solana and Pinocchio
Applied to files:
program-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.mdprogram-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md
📚 Learning: 2025-10-16T06:33:19.426Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:19.426Z
Learning: Applies to program-libs/compressible/src/config.rs : Ensure serialization compatibility across Anchor, Pinocchio, and Borsh for core account types used by dependent programs
Applied to files:
program-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.mdprogram-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md
📚 Learning: 2025-10-11T21:59:25.222Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:25.222Z
Learning: Applies to program-libs/account-checks/src/**/*.rs : Validate account type with 8-byte discriminators using check_discriminator before deserialization
Applied to files:
program-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.md
📚 Learning: 2025-10-15T03:46:26.767Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/registry/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:26.767Z
Learning: Applies to programs/registry/src/account_compression_cpi/*.rs : Context structs for wrapper instructions must include standard accounts: optional registered_forester_pda (mut), authority Signer, cpi_authority with seeds/bump for CPI_AUTHORITY_PDA_SEED, registered_program_pda, target program handle, log_wrapper, and mutable target_account.
Applied to files:
program-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md
🪛 LanguageTool
program-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.md
[grammar] ~22-~22: Ensure spelling is correct
Context: ...trees: increments nullifier_next_index (offchain indexer tracking only) 6. Marks ZKP bat...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~85-~85: Ensure spelling is correct
Context: ...e proof verifies old_leaf value against onchain root, ensuring correct position - If ol...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~199-~199: Ensure spelling is correct
Context: ...nullifier_next_index by zkp_batch_size (offchain indexer tracking) - Address: Increme...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~235-~235: Ensure spelling is correct
Context: ..._index: Incremented by zkp_batch_size (offchain indexer tracking) - sequence_number`: ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
program-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.md
[style] ~53-~53: This phrase is redundant. Consider writing “filled”.
Context: ... Fill (still being filled) or Full (completely filled) state 3. **Create public inputs hash:...
(COMPLETELY_ANNIHILATE)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
- GitHub Check: Forester e2e test
- GitHub Check: system-programs (native, ["cargo-test-sbf -p sdk-native-test", "cargo-test-sbf -p sdk-v1-native-t...
- GitHub Check: system-programs (token test, ["cargo-test-sbf -p sdk-token-test"])
- GitHub Check: system-programs (sdk-libs, light-sdk-macros light-sdk light-program-test light-client light-compr...
- GitHub Check: system-programs (anchor & pinocchio, ["cargo-test-sbf -p sdk-anchor-test", "cargo-test-sbf -p sdk...
- GitHub Check: programs (system-cpi-test-v2-functional-account-infos, ["cargo-test-sbf -p system-cpi-v2-test -- ...
- GitHub Check: lint
- GitHub Check: programs (light-system-program-compression, ["cargo-test-sbf -p system-test -- test_with_compress...
- GitHub Check: programs (compressed-token-batched-tree, ["cargo-test-sbf -p compressed-token-test -- test_transf...
- GitHub Check: programs (account-compression-and-registry, ["cargo-test-sbf -p account-compression-test", "cargo...
- GitHub Check: programs (compressed-token-and-e2e, ["cargo-test-sbf -p compressed-token-test --test v1", "cargo-...
- 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: programs (light-system-program-address, ["cargo-test-sbf -p system-test -- test_with_address", "c...
- GitHub Check: stateless-js-v1
- GitHub Check: Test program-libs-fast
- GitHub Check: Test program-libs-slow
- GitHub Check: Test batched-merkle-tree-simulate
- GitHub Check: cli-v2
- GitHub Check: stateless-js-v2
- GitHub Check: cli-v1
🔇 Additional comments (14)
program-libs/batched-merkle-tree/docs/CLAUDE.md (1)
1-148: Excellent main entry point documentation.CLAUDE.md serves as a well-structured guide to the Batched Merkle Tree Library with clear account hierarchy, operation flow, and cross-references to detailed documentation. The organization follows established documentation patterns with summary + index structure. All critical concepts are introduced with context.
program-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.md (1)
1-101: Comprehensive address tree initialization documentation.The documentation clearly differentiates address tree initialization (single account with integrated queue) from state tree initialization. Account layout, discriminator, and initialization sequence are well-documented with appropriate cross-references to source files and related documentation.
program-libs/batched-merkle-tree/docs/INSERT_INPUT_QUEUE.md (1)
1-97: Solid documentation of nullifier insertion with double-spend prevention.The documentation clearly explains the two-batch bloom filter system for preventing double-spending. The nullifier creation logic and non-inclusion checks are well-explained. The note on line 43 appropriately clarifies the flexibility of nullifier values while maintaining the key requirement of preventing inclusion proofs.
program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md (1)
1-133: Well-structured state tree initialization documentation.The documentation clearly explains the two-account structure (tree + output queue) with comprehensive initialization steps. Configuration validation rules are well-documented, particularly the root_history_capacity requirement accounting for both input and output queue operations. Discriminators and account types are properly specified.
program-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.md (1)
1-100: Complete queue account documentation with validation and serialization examples.The documentation covers account structure, validation checks, serialization patterns for both on-chain and client code, and supporting data structures. The explanation of hashed pubkeys and bn254 field compatibility adds important context for understanding the zero-copy layout.
program-libs/batched-merkle-tree/docs/TREE_ACCOUNT.md (6)
122-150: Batch state machine documentation is clear, but verify against Batch struct implementation.The state transitions (Fill → Full → Inserted → Fill) and the key insight about incremental ZKP processing (line 139) are well-explained. However, these should be verified to match the actual
Batchstruct and its methods to ensure forward compatibility.
60-84: Fixget_root_by_indexusage in documentation example—method returnsOption, notResult.The method signature at line 858 shows
get_root_by_index(&self, index: usize) -> Option<&[u8; 32]>, which returns anOptiontype. However, the documentation example at line 78 incorrectly uses the?operator:let root = tree.get_root_by_index(index)?;The
?operator is forResulttypes, notOption. Update the example to handle theOptionproperly:let root = tree.get_root_by_index(index); // Returns Option<&[u8; 32]>All other method signatures (
state_from_account_info,address_from_account_info,state_from_bytes,address_from_bytes) are correctly documented and match their implementations.⛔ Skipped due to learnings
Learnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/docs/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:52.712Z Learning: Applies to program-libs/account-checks/docs/**/{ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,DISCRIMINATOR.md,ERRORS.md,PACKED_ACCOUNTS.md} : Code examples should demonstrate both Solana and Pinocchio usage where applicableLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/registry/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:46:26.767Z Learning: Applies to programs/registry/src/lib.rs : Load accounts according to type before check_forester: batched via BatchedMerkleTreeAccount::type_from_account_info(); regular via ctx.accounts.account.load()?.metadata; use custom deserialization when required.Learnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:25.222Z Learning: Applies to program-libs/account-checks/src/account_info/{solana.rs,pinocchio.rs,test_account_info.rs} : Gate SDK-specific implementations with #[cfg(feature = "solana"|"pinocchio"|"test-only")]Learnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:25.222Z Learning: Applies to program-libs/account-checks/src/account_info/{solana.rs,pinocchio.rs,test_account_info.rs} : Provide SDK-specific AccountInfoTrait implementations in account_info/{solana.rs,pinocchio.rs,test_account_info.rs}Learnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:25.222Z Learning: Applies to program-libs/account-checks/src/!(account_info)/**/*.rs : Use AccountInfoTrait for runtime-agnostic account handling; avoid direct solana-program or pinocchio AccountInfo in general logicLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/compressible/CLAUDE.md:0-0 Timestamp: 2025-10-16T06:33:19.426Z Learning: Applies to program-libs/compressible/src/config.rs : Ensure serialization compatibility across Anchor, Pinocchio, and Borsh for core account types used by dependent programsLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:25.222Z Learning: Applies to program-libs/account-checks/src/packed_accounts.rs : For dynamic account sets, use PackedAccounts for index-based access with bounds checks instead of manual indexingLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:25.222Z Learning: Applies to program-libs/account-checks/src/checks.rs : Expose and maintain account validation helpers (check_owner, check_program, check_mut/non_mut, check_signer, check_discriminator, set_discriminator, check_pda_seeds, check_account_balance_is_rent_exempt, account_info_init) in checks.rsLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:25.222Z Learning: Applies to program-libs/account-checks/src/**/*.rs : Validate account type with 8-byte discriminators using check_discriminator before deserializationLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:25.222Z Learning: Applies to program-libs/account-checks/src/account_iterator.rs : Use AccountIterator for sequential account retrieval to get precise file:line:column error locations; avoid manual index handling
50-54: No action required. The review comment is based on an incorrect assumption about documentation scope.The code initialization is correct and already properly documented:
ADDRESS_TREE_INIT_ROOT_40andnext_index = 1are correctly implemented in the code (merkle_tree.rs:298, merkle_tree_metadata.rs:104)- These initialization details are documented in INITIALIZE_ADDRESS_TREE.md: "Initial root:
ADDRESS_TREE_INIT_ROOT_40" and "Starts at next_index: 1"- The TREE_ACCOUNT.md file (under review) accurately documents these same details
The review request for "consistency across INITIALIZE_ADDRESS_TREE.md and INSERT_ADDRESS_QUEUE.md" is based on a scope misunderstanding. INSERT_ADDRESS_QUEUE.md documents the queue insertion operation, not initialization. It should not duplicate initialization details—that belongs in INITIALIZE_ADDRESS_TREE.md, where it already exists correctly documented.
Likely an incorrect or invalid review comment.
24-40: Remove inaccurate bloom filter zeroing condition from documentation.The phrase "and at least one batch update occured since batch completion" in line 29 is not enforced by the code. The actual condition is: previous batch fully inserted + bloom filter not yet zeroed + current batch reaches 50% capacity. This matches INSERT_ADDRESS_QUEUE.md, which correctly describes the zeroing as occurring "after the batch is fully inserted into the tree AND the next batch reaches 50% capacity" without the additional "batch update" requirement. Align TREE_ACCOUNT.md Section 3 with the accurate behavior.
Likely an incorrect or invalid review comment.
106-110: Correct error code mappings in TREE_ACCOUNT.md. The listed codes don't match AccountError definitions.
AccountError::AccountOwnedByWrongProgrammaps to 20001, not 12012AccountError::InvalidAccountSizemaps to 20004, not 12006AccountError::InvalidDiscriminatormaps to 20000, not 12007MerkleTreeMetadataError::InvalidTreeTypemaps to 14007 (currently unlisted)Update lines 106-110 to reflect actual error code mappings from
account-checks/src/error.rsandmerkle-tree-metadata/src/errors.rs:**Error codes:** - `AccountError::AccountOwnedByWrongProgram` (20001) - Account not owned by compression program - `AccountError::InvalidAccountSize` (20004) - Account size less than 8 bytes - `AccountError::InvalidDiscriminator` (20000) - Discriminator mismatch - `MerkleTreeMetadataError::InvalidTreeType` (14007) - Tree type mismatch (state vs address)⛔ Skipped due to learnings
Learnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:25.222Z Learning: Applies to program-libs/account-checks/src/error.rs : Maintain stable mapping of AccountError to ProgramError, including Pinocchio code mapping (1–11), in error.rsLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:25.222Z Learning: Applies to program-libs/account-checks/src/**/*.rs : Return AccountError variants (codes 12006–12021) and rely on automatic ProgramError conversions; avoid returning raw ProgramError directlyLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/docs/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:52.712Z Learning: Applies to program-libs/account-checks/docs/**/ERRORS.md : ERRORS.md must document error types with numeric codes in the 12006–12021 range, common causes, resolution strategies, and conversion mappings for Solana and PinocchioLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/docs/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:52.712Z Learning: Applies to program-libs/account-checks/docs/**/ERRORS.md : Error codes should reference the actual values that appear in transaction logsLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/compressible/CLAUDE.md:0-0 Timestamp: 2025-10-16T06:33:19.426Z Learning: Applies to program-libs/compressible/src/error.rs : Define error types with numeric codes in the 19xxx range and propagate hasher errors in the 7xxx range; include ProgramError conversions (Anchor, Pinocchio, Solana) in src/error.rsLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:25.222Z Learning: Applies to program-libs/account-checks/docs/{CLAUDE.md,ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,ERRORS.md,DISCRIMINATOR.md,PACKED_ACCOUNTS.md} : Keep component documentation up to date in the corresponding docs/*.md files listedLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/docs/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:45:40.038Z Learning: Applies to programs/compressed-token/program/docs/**/ACCOUNTS.md : Maintain ACCOUNTS.md with complete account layouts and data structuresLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:46:03.556Z Learning: Applies to programs/compressed-token/program/docs/instructions/**/ACCOUNTS.md : Provide complete account layouts and data structures in ACCOUNTS.mdLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/docs/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:52.712Z Learning: Applies to program-libs/account-checks/docs/**/{ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,DISCRIMINATOR.md,ERRORS.md,PACKED_ACCOUNTS.md} : Code examples should demonstrate both Solana and Pinocchio usage where applicableLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:25.222Z Learning: Applies to program-libs/account-checks/src/**/*.rs : Validate account type with 8-byte discriminators using check_discriminator before deserializationLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/CLAUDE.md:0-0 Timestamp: 2025-10-16T06:33:55.362Z Learning: Applies to programs/compressed-token/program/docs/ACCOUNTS.md : Account documentation must include: description, discriminator, state layout, serialization example, hashing (only for compressed accounts), derivation (only for PDAs), and associated instructionsLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/registry/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:46:26.767Z Learning: Applies to programs/registry/src/account_compression_cpi/*.rs : Context structs for wrapper instructions must include standard accounts: optional registered_forester_pda (mut), authority Signer, cpi_authority with seeds/bump for CPI_AUTHORITY_PDA_SEED, registered_program_pda, target program handle, log_wrapper, and mutable target_account.Learnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:46:03.556Z Learning: Refer to ../ACCOUNTS.md for account structure reference from instruction docsLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/registry/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:46:26.767Z Learning: Use specific error variants for authorization and fee failures: InvalidSigner, InvalidNetworkFee, ForesterDefined/Undefined.
1-84: Fix incorrect tree type values and error codes in Account Validation section.The Account Validation section contains two critical errors:
Tree type values are incorrect (lines 100-102):
- Document states:
STATE_MERKLE_TREE_TYPE_V2(4),ADDRESS_MERKLE_TREE_TYPE_V2(5)- Actual values:
STATE_MERKLE_TREE_TYPE_V2= 3,ADDRESS_MERKLE_TREE_TYPE_V2= 4Error codes are wrong (lines 107-109):
- Document states: 12012, 12006, 12007
- Actual values:
AccountError::AccountOwnedByWrongProgram= 20001,InvalidAccountSize= 20004,InvalidDiscriminator= 20000Update lines 100-102 to use correct numeric values (3 and 4), and lines 107-109 to use correct error codes (20001, 20004, 20000).
⛔ Skipped due to learnings
Learnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/CLAUDE.md:0-0 Timestamp: 2025-10-16T06:33:55.362Z Learning: Applies to programs/compressed-token/program/docs/ACCOUNTS.md : Account documentation must include: description, discriminator, state layout, serialization example, hashing (only for compressed accounts), derivation (only for PDAs), and associated instructionsLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/docs/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:52.712Z Learning: Applies to program-libs/account-checks/docs/**/DISCRIMINATOR.md : DISCRIMINATOR.md must document 8-byte discriminators, the Discriminator trait, constant arrays for compile-time checks, and integration with account initializationLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:46:03.556Z Learning: Applies to programs/compressed-token/program/docs/instructions/**/ACCOUNTS.md : Provide complete account layouts and data structures in ACCOUNTS.mdLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/docs/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:52.712Z Learning: Applies to program-libs/account-checks/docs/**/ERRORS.md : ERRORS.md must document error types with numeric codes in the 12006–12021 range, common causes, resolution strategies, and conversion mappings for Solana and PinocchioLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/docs/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:45:40.038Z Learning: Applies to programs/compressed-token/program/docs/**/ACCOUNTS.md : Maintain ACCOUNTS.md with complete account layouts and data structuresLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/docs/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:52.712Z Learning: Applies to program-libs/account-checks/docs/**/ACCOUNT_ITERATOR.md : ACCOUNT_ITERATOR.md must document the enhanced account iterator, including sequential processing, automatic validation, and location-based error reporting for debuggingLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/docs/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:52.712Z Learning: Applies to program-libs/account-checks/docs/**/PACKED_ACCOUNTS.md : PACKED_ACCOUNTS.md must document index-based dynamic account access, including accessing mint, owner, and delegate accounts by index with bounds checkingLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/docs/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:52.712Z Learning: Applies to program-libs/account-checks/docs/**/ERRORS.md : Error codes should reference the actual values that appear in transaction logsLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:25.222Z Learning: Applies to program-libs/account-checks/docs/{CLAUDE.md,ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,ERRORS.md,DISCRIMINATOR.md,PACKED_ACCOUNTS.md} : Keep component documentation up to date in the corresponding docs/*.md files listedLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/docs/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:52.712Z Learning: Applies to program-libs/account-checks/docs/**/ACCOUNT_CHECKS.md : ACCOUNT_CHECKS.md must document all validation functions in the checks module, including ownership validation, permission checks, discriminator handling, and PDA verification with code examplesLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/registry/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:46:26.767Z Learning: Applies to programs/registry/src/lib.rs : Load accounts according to type before check_forester: batched via BatchedMerkleTreeAccount::type_from_account_info(); regular via ctx.accounts.account.load()?.metadata; use custom deserialization when required.Learnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/compressible/CLAUDE.md:0-0 Timestamp: 2025-10-16T06:33:19.426Z Learning: Applies to program-libs/compressible/src/config.rs : Ensure serialization compatibility across Anchor, Pinocchio, and Borsh for core account types used by dependent programsLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:25.222Z Learning: Applies to program-libs/account-checks/src/**/*.rs : Validate account type with 8-byte discriminators using check_discriminator before deserializationLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:46:03.556Z Learning: Refer to ../ACCOUNTS.md for account structure reference from instruction docsprogram-libs/batched-merkle-tree/docs/INSERT_ADDRESS_QUEUE.md (3)
72-96: No issues found—error codes and variants are accurate.Verification confirms all referenced error codes match the
BatchedMerkleTreeErrorenum mapping:
TreeIsFull→ 14310 ✓BatchNotReady→ 14301 ✓BloomFilterNotZeroed→ 14312 ✓NonInclusionCheckFailed→ 14311 ✓The documentation accurately reflects the actual implementation.
1-30: Method signature verified as accurate.The implementation in
src/merkle_tree.rsconfirms the documented method signature is correct:
- Method name:
insert_address_into_queue✓- Parameter 1:
address: &[u8; 32]✓- Parameter 2:
current_slot: &u64✓The documentation correctly reflects the actual implementation.
31-67: Documentation accurately describes the implementation.The detailed operation logic described in lines 31-67 has been verified against the actual implementation:
- Tree type validation, capacity check, and batch state management (Fill/Inserted/Full) all match
- Bloom filter insertion and non-inclusion check (verifies value not in OTHER bloom filter) are correctly implemented
- Hash chain updates use Poseidon as documented:
Poseidon::hashv(&[last_hash_chain, value.as_slice()])- Element counter increments properly within the batch's internal state management
- Batch full detection correctly triggers state transition via the zkp batch structure
- Batch index advancement occurs via
increment_currently_processing_batch_index_if_full()
program-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.md
Outdated
Show resolved
Hide resolved
program-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.md
Outdated
Show resolved
Hide resolved
- Add comprehensive review instructions for batched Merkle tree documentation consistency - Ensure documentation accuracy matches implementation in program-libs/batched-merkle-tree/ - Include specific path instructions for critical components (account-compression, Cargo.toml) - Enable automated tools (clippy, eslint, ruff, gitleaks) for code quality - Configure sensitive file patterns for comprehensive reviews - Add cross-verification requirements between code and documentation changes This configuration helps maintain documentation accuracy and prevents drift between documented API/behavior and actual implementation, especially for the batched Merkle tree functionality that has undergone recent critical bug fixes.
…rategy - Remove incorrect develop/staging branches (Light Protocol uses main + release branches) - Add dependabot exclusions to prevent unnecessary reviews of dependency updates - Extend documentation consistency checks to all program-libs crates with docs/ - Add comprehensive path instructions for account-checks and compressible crates - Include CLAUDE.md files in documentation consistency verification - Add pre-merge checks for documentation consistency - Configure chat integrations and enhanced knowledge base features - Add sensitive file patterns for comprehensive review coverage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.coderabbit.yaml(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:55.362Z
Learning: Applies to programs/compressed-token/program/docs/ACCOUNTS.md : Account documentation must include: description, discriminator, state layout, serialization example, hashing (only for compressed accounts), derivation (only for PDAs), and associated instructions
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:25.222Z
Learning: Applies to program-libs/account-checks/docs/{CLAUDE.md,ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,ERRORS.md,DISCRIMINATOR.md,PACKED_ACCOUNTS.md} : Keep component documentation up to date in the corresponding docs/*.md files listed
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/{ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,DISCRIMINATOR.md,ERRORS.md,PACKED_ACCOUNTS.md} : Code examples should demonstrate both Solana and Pinocchio usage where applicable
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/ACCOUNT_ITERATOR.md : ACCOUNT_ITERATOR.md must document the enhanced account iterator, including sequential processing, automatic validation, and location-based error reporting for debugging
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/ACCOUNT_CHECKS.md : ACCOUNT_CHECKS.md must document all validation functions in the checks module, including ownership validation, permission checks, discriminator handling, and PDA verification with code examples
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:19.426Z
Learning: Applies to program-libs/compressible/docs/CONFIG_ACCOUNT.md : Document the CompressibleConfig account structure and methods in docs/CONFIG_ACCOUNT.md
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Applies to programs/compressed-token/program/docs/instructions/**/ACCOUNTS.md : Provide complete account layouts and data structures in ACCOUNTS.md
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/DISCRIMINATOR.md : DISCRIMINATOR.md must document 8-byte discriminators, the Discriminator trait, constant arrays for compile-time checks, and integration with account initialization
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/{ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,DISCRIMINATOR.md,ERRORS.md,PACKED_ACCOUNTS.md} : Each document should focus on a single module or concept
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/ACCOUNT_INFO_TRAIT.md : ACCOUNT_INFO_TRAIT.md must document the AccountInfoTrait abstraction, including trait definition, implementations, and runtime-agnostic usage across Solana and Pinocchio
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
- GitHub Check: Test batched-merkle-tree-simulate
- GitHub Check: Test program-libs-slow
- GitHub Check: Test program-libs-fast
- GitHub Check: Forester e2e test
- GitHub Check: system-programs (sdk-libs, light-sdk-macros light-sdk light-program-test light-client light-compr...
- GitHub Check: system-programs (token test, ["cargo-test-sbf -p sdk-token-test"])
- GitHub Check: system-programs (native, ["cargo-test-sbf -p sdk-native-test", "cargo-test-sbf -p sdk-v1-native-t...
- GitHub Check: system-programs (anchor & pinocchio, ["cargo-test-sbf -p sdk-anchor-test", "cargo-test-sbf -p sdk...
- GitHub Check: programs (compressed-token-and-e2e, ["cargo-test-sbf -p compressed-token-test --test v1", "cargo-...
- 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 (system-cpi-test, ["cargo-test-sbf -p system-cpi-test", "cargo test -p light-system-prog...
- GitHub Check: programs (compressed-token-batched-tree, ["cargo-test-sbf -p compressed-token-test -- test_transf...
- GitHub Check: programs (light-system-program-address, ["cargo-test-sbf -p system-test -- test_with_address", "c...
- GitHub Check: programs (account-compression-and-registry, ["cargo-test-sbf -p account-compression-test", "cargo...
- GitHub Check: programs (light-system-program-compression, ["cargo-test-sbf -p system-test -- test_with_compress...
- GitHub Check: stateless-js-v2
- GitHub Check: cli-v2
- GitHub Check: stateless-js-v1
- GitHub Check: lint
- GitHub Check: cli-v1
🔇 Additional comments (2)
.coderabbit.yaml (2)
1-241: Configuration structure aligns well with documentation consistency goals.The overall structure is well-designed for enforcing documentation/code cross-verification, with targeted path instructions for:
- Batched Merkle Tree (lines 25-46): strong focus on docs-to-code accuracy
- Account Checks (lines 49-63): validation function and security pattern consistency
- Compressible (lines 66-80): compression API and trait alignment
- General library documentation (lines 108-126): cross-verification patterns
The pre-merge checks (lines 150-169) and path-specific instructions align with learnings about maintaining documentation consistency. The configuration supports the PR's documentation update goals. Once the two structural issues above are resolved, this configuration should work effectively. Based on learnings
Once the
early_accessfield is corrected to a boolean, please verify thatsensitive_filesis either removed or confirmed to be a supported extension before merging.
247-257: Remove the unsupportedsensitive_filessection; usepath_filtersinstead to control review scope.The CodeRabbit configuration reference (last updated November 4, 2025) does not include a
sensitive_filesfield. Path-based instructions within the configuration provide specific additional guidelines for code review based on file paths, and path-based instructions are configured in the .coderabbit.yaml file under the reviews.path_instructions section. The file already usespath_filters(lines 8-20) which is the official way to control which files CodeRabbit reviews. Remove thesensitive_filesblock (lines 247-257) as it will be ignored by CodeRabbit and serves no purpose.
…tive paths in circuit implementation references - Changed absolute paths like /Users/ananas/dev/light-protocol/ to relative paths - Improves documentation portability across development environments - Addresses CodeRabbit comment about absolute file path references
…ive path and remove redundant phrase - Changed absolute path /Users/ananas/dev/light-protocol/ to relative path for portability - Removed redundant phrase 'completely filled' as it's implied by 'Full' state - Addresses CodeRabbit comments about absolute file paths and redundant wording
…a validation error - Changed early_access from object with 'enabled: true' to boolean 'true' - Fixes critical schema validation error in CodeRabbit configuration - Addresses CodeRabbit comment about YAML schema compliance
…escription - Improved awkward phrasing from 'is the leaf index of the value up on Merkle tree insertion' - Changed to clearer description: 'Assigned at insertion time and determines the leaf position in the tree' - Addresses CodeRabbit comment about unclear documentation wording
…es section - Removed sensitive_files section as it's not supported in CodeRabbit schema - Path-based review control is already handled by path_filters section - Addresses CodeRabbit comment about unsupported configuration fields
…bloom filter zeroing - Added missing condition 'at least one batch update has occurred since batch completion' - Makes INSERT_ADDRESS_QUEUE.md consistent with TREE_ACCOUNT.md and UPDATE_FROM_OUTPUT_QUEUE.md - Addresses CodeRabbit comment about incomplete bloom filter zeroing documentation - Corrects previous assessment - this was a valid documentation inconsistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
.coderabbit.yamlis excluded by none and included by none
📒 Files selected for processing (4)
program-libs/batched-merkle-tree/docs/INSERT_ADDRESS_QUEUE.md(1 hunks)program-libs/batched-merkle-tree/docs/INSERT_OUTPUT_QUEUE.md(1 hunks)program-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.md(1 hunks)program-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
program-libs/batched-merkle-tree/docs/**/*.md
⚙️ CodeRabbit configuration file
program-libs/batched-merkle-tree/docs/**/*.md: When reviewing batched Merkle tree documentation changes:
- Critical: Verify that all function signatures, struct definitions, and behavior described in the documentation accurately match the actual implementation in
program-libs/batched-merkle-tree/src/- Cross-reference any mentioned function names, parameters, return types, and error conditions with the source code
- Check that code examples and usage patterns reflect the current API in the crate
- Validate that any referenced constants, enums, or type definitions exist and have correct values
- Ensure documentation describes the actual behavior, not outdated or planned behavior
- Flag any references to deprecated functions, renamed structs, or changed interfaces
- Verify that error handling and edge cases mentioned in docs match the implementation
- Check that performance characteristics and complexity claims are accurate
Files:
program-libs/batched-merkle-tree/docs/INSERT_OUTPUT_QUEUE.mdprogram-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.mdprogram-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.mdprogram-libs/batched-merkle-tree/docs/INSERT_ADDRESS_QUEUE.md
program-libs/**/docs/**/*.md
⚙️ CodeRabbit configuration file
program-libs/**/docs/**/*.md: When reviewing program library documentation:
- Cross-verification: Always verify documented APIs against actual implementation in the corresponding
src/directory- Check that function signatures, struct definitions, and trait implementations match documentation
- Validate that error types, constants, and enums referenced in docs exist and have correct values
- Ensure that usage examples compile and work as described
- Flag any references to deprecated or renamed items
- Verify that performance claims and complexity analysis are accurate
Files:
program-libs/batched-merkle-tree/docs/INSERT_OUTPUT_QUEUE.mdprogram-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.mdprogram-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.mdprogram-libs/batched-merkle-tree/docs/INSERT_ADDRESS_QUEUE.md
**/*.md
⚙️ CodeRabbit configuration file
**/*.md: When reviewing general documentation changes:
- Verify that all source code references exist and are accurate
- Check that code examples compile and work as described
- Validate that GitHub URLs and file paths are correct and accessible
- Ensure consistency with the overall documentation structure
- Check for broken internal links and references
Files:
program-libs/batched-merkle-tree/docs/INSERT_OUTPUT_QUEUE.mdprogram-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.mdprogram-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.mdprogram-libs/batched-merkle-tree/docs/INSERT_ADDRESS_QUEUE.md
🧠 Learnings (4)
📚 Learning: 2025-10-11T21:59:25.222Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:25.222Z
Learning: Applies to program-libs/account-checks/docs/{CLAUDE.md,ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,ERRORS.md,DISCRIMINATOR.md,PACKED_ACCOUNTS.md} : Keep component documentation up to date in the corresponding docs/*.md files listed
Applied to files:
program-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.md
📚 Learning: 2025-10-11T21:59:52.712Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/PACKED_ACCOUNTS.md : PACKED_ACCOUNTS.md must document index-based dynamic account access, including accessing mint, owner, and delegate accounts by index with bounds checking
Applied to files:
program-libs/batched-merkle-tree/docs/INSERT_ADDRESS_QUEUE.md
📚 Learning: 2025-10-15T03:45:40.038Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:45:40.038Z
Learning: Applies to programs/compressed-token/program/docs/**/ACCOUNTS.md : Maintain ACCOUNTS.md with complete account layouts and data structures
Applied to files:
program-libs/batched-merkle-tree/docs/INSERT_ADDRESS_QUEUE.md
📚 Learning: 2025-10-16T06:33:55.362Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:55.362Z
Learning: Applies to programs/compressed-token/program/docs/ACCOUNTS.md : Account documentation must include: description, discriminator, state layout, serialization example, hashing (only for compressed accounts), derivation (only for PDAs), and associated instructions
Applied to files:
program-libs/batched-merkle-tree/docs/INSERT_ADDRESS_QUEUE.md
🪛 LanguageTool
program-libs/batched-merkle-tree/docs/INSERT_OUTPUT_QUEUE.md
[duplication] ~77-~77: Possible typo: you repeated a word.
Context: ...: Updates running Poseidon hash for ZKP batch - Batch metadata: - num_inserted_elements: ...
(ENGLISH_WORD_REPEAT_RULE)
[grammar] ~81-~81: Use the plural noun, or add a word such as ‘the’ or ‘some’ in front of ‘other’.
Context: ..._processing_batch_index: May switch to other batch - pending_batch_index`: Updated when...
(OTHER_NN)
program-libs/batched-merkle-tree/docs/UPDATE_FROM_INPUT_QUEUE.md
[grammar] ~22-~22: Ensure spelling is correct
Context: ...trees: increments nullifier_next_index (offchain indexer tracking only) 6. Marks ZKP bat...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~85-~85: Ensure spelling is correct
Context: ...e proof verifies old_leaf value against onchain root, ensuring correct position - If ol...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~199-~199: Ensure spelling is correct
Context: ...nullifier_next_index by zkp_batch_size (offchain indexer tracking) - Address: Increme...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~235-~235: Ensure spelling is correct
Context: ..._index: Incremented by zkp_batch_size (offchain indexer tracking) - sequence_number`: ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
- GitHub Check: programs (system-cpi-test-v2-functional-read-only, ["cargo-test-sbf -p system-cpi-v2-test -- func...
- GitHub Check: programs (compressed-token-batched-tree, ["cargo-test-sbf -p compressed-token-test -- test_transf...
- GitHub Check: programs (system-cpi-test-v2-functional-account-infos, ["cargo-test-sbf -p system-cpi-v2-test -- ...
- GitHub Check: programs (system-cpi-test, ["cargo-test-sbf -p system-cpi-test", "cargo test -p light-system-prog...
- GitHub Check: programs (light-system-program-address, ["cargo-test-sbf -p system-test -- test_with_address", "c...
- GitHub Check: programs (account-compression-and-registry, ["cargo-test-sbf -p account-compression-test", "cargo...
- GitHub Check: programs (compressed-token-and-e2e, ["cargo-test-sbf -p compressed-token-test --test v1", "cargo-...
- GitHub Check: programs (light-system-program-compression, ["cargo-test-sbf -p system-test -- test_with_compress...
- GitHub Check: Test program-libs-slow
- GitHub Check: Test batched-merkle-tree-simulate
- GitHub Check: Test program-libs-fast
- GitHub Check: Forester e2e test
- GitHub Check: cli-v1
- GitHub Check: stateless-js-v1
🔇 Additional comments (3)
program-libs/batched-merkle-tree/docs/UPDATE_FROM_OUTPUT_QUEUE.md (1)
1-191: Comprehensive documentation with past issue fixed.The documentation correctly uses relative paths for circuit implementations (line 8) and provides detailed explanation of the bloom filter zeroing logic. The file demonstrates good cross-references to related documentation files and consistent error code patterns.
program-libs/batched-merkle-tree/docs/INSERT_ADDRESS_QUEUE.md (2)
5-7: Bloom filter zeroing condition comprehensively documented.The documentation now correctly includes all three required conditions for bloom filter zeroing: batch fully inserted, next batch at 50% capacity, and at least one batch update since completion. This properly addresses the previous review feedback and maintains consistency with related documentation.
17-17: All documented APIs and error codes verified successfully.All items have been confirmed to exist in the implementation:
BatchedMerkleTreeAccount::insert_address_into_queue✓ public method inmerkle_tree.rsMerkleTreeMetadataError::InvalidTreeType✓ variant definedBatchedMerkleTreeError::TreeIsFull✓ variant with code 14310BatchedMerkleTreeError::BatchNotReady✓ variant with code 14301BatchedMerkleTreeError::BloomFilterNotZeroed✓ variant with code 14312BatchedMerkleTreeError::NonInclusionCheckFailed✓ variant with code 14311All error variants are properly mapped in the
From<BatchedMerkleTreeError> for u32implementation inerrors.rs, and all variants are actively used throughout the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
CLAUDE.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/CLAUDE.md
⚙️ CodeRabbit configuration file
**/CLAUDE.md: When reviewing CLAUDE.md files:
- Verify that all documented APIs, functions, and structures exist in the corresponding crate
- Check that AI assistant guidance reflects current implementation patterns
- Ensure that documented workflows and examples are up-to-date
- Validate that referenced file paths and module structures are correct
- Cross-reference any code snippets with actual implementation
Files:
CLAUDE.md
**/*.md
⚙️ CodeRabbit configuration file
**/*.md: When reviewing general documentation changes:
- Verify that all source code references exist and are accurate
- Check that code examples compile and work as described
- Validate that GitHub URLs and file paths are correct and accessible
- Ensure consistency with the overall documentation structure
- Check for broken internal links and references
Files:
CLAUDE.md
🧠 Learnings (16)
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Applies to programs/compressed-token/program/docs/instructions/**/CLAUDE.md : Maintain CLAUDE.md (this file) as the documentation structure guide for the compressed token program docs
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-15T03:45:40.038Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:45:40.038Z
Learning: Applies to programs/compressed-token/program/docs/**/CLAUDE.md : Include a CLAUDE.md in each relevant documentation directory that serves as the documentation structure guide for that directory
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-15T03:45:40.038Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:45:40.038Z
Learning: Applies to programs/compressed-token/program/docs/**/CLAUDE.md : Ensure the parent-level CLAUDE.md acts as the main entry point containing a summary and instruction index
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Use ../CLAUDE.md as the main entry point with summary and instruction index
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-11T21:59:25.222Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:25.222Z
Learning: Applies to program-libs/account-checks/docs/{CLAUDE.md,ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,ERRORS.md,DISCRIMINATOR.md,PACKED_ACCOUNTS.md} : Keep component documentation up to date in the corresponding docs/*.md files listed
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Start with ../../CLAUDE.md for the instruction index and overview
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-15T03:45:40.038Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:45:40.038Z
Learning: Start navigation at the parent CLAUDE.md for the instruction index and overview
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-16T06:33:19.426Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:19.426Z
Learning: Applies to program-libs/compressible/docs/SOLANA_RENT.md : Maintain a comparison of Solana vs Light Protocol rent systems in docs/SOLANA_RENT.md
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-11T21:59:52.712Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/{ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,DISCRIMINATOR.md,ERRORS.md,PACKED_ACCOUNTS.md} : Code examples should demonstrate both Solana and Pinocchio usage where applicable
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-16T06:33:55.362Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:55.362Z
Learning: Applies to programs/compressed-token/program/program-libs/ctoken-types/** : Define all state and instruction data structures in the light-ctoken-types crate (program-libs/ctoken-types), including state/, instructions/, and state/extensions/
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-15T03:45:40.038Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:45:40.038Z
Learning: Applies to programs/compressed-token/program/docs/**/ACCOUNTS.md : Maintain ACCOUNTS.md with complete account layouts and data structures
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Applies to programs/compressed-token/program/docs/instructions/**/ACCOUNTS.md : Provide complete account layouts and data structures in ACCOUNTS.md
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-16T06:33:55.362Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:55.362Z
Learning: Applies to programs/compressed-token/program/docs/ACCOUNTS.md : Account documentation must include: description, discriminator, state layout, serialization example, hashing (only for compressed accounts), derivation (only for PDAs), and associated instructions
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-16T06:33:55.362Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:55.362Z
Learning: When working with ctoken accounts that have the Compressible extension, consult the rent system documentation (RENT.md, CONFIG_ACCOUNT.md, SOLANA_RENT.md) to follow rent authority, compression, and lamport distribution rules
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-16T06:33:55.362Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:55.362Z
Learning: Read this file and all referenced Markdown files in full before working on the compressed-token program
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-11T21:59:25.222Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:25.222Z
Learning: Applies to program-libs/account-checks/src/account_info/{solana.rs,pinocchio.rs,test_account_info.rs} : Gate SDK-specific implementations with #[cfg(feature = "solana"|"pinocchio"|"test-only")]
Applied to files:
CLAUDE.md
🪛 LanguageTool
CLAUDE.md
[duplication] ~67-~67: Possible typo: you repeated a word.
Context: ...lient** creates compressed accounts via SDK 2. SDK builds instructions using program-lib...
(ENGLISH_WORD_REPEAT_RULE)
🪛 markdownlint-cli2 (0.18.1)
CLAUDE.md
12-12: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
50-50: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
76-76: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
77-77: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
91-91: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
92-92: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
111-111: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
118-118: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
124-124: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
132-132: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
137-137: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
145-145: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
151-151: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
156-156: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
- GitHub Check: stateless-js-v1
- GitHub Check: system-programs (anchor & pinocchio, ["cargo-test-sbf -p sdk-anchor-test", "cargo-test-sbf -p sdk...
- GitHub Check: system-programs (sdk-libs, light-sdk-macros light-sdk light-program-test light-client light-compr...
- GitHub Check: system-programs (token test, ["cargo-test-sbf -p sdk-token-test"])
- GitHub Check: system-programs (native, ["cargo-test-sbf -p sdk-native-test", "cargo-test-sbf -p sdk-v1-native-t...
- GitHub Check: Test batched-merkle-tree-simulate
- GitHub Check: Test program-libs-slow
- GitHub Check: Test program-libs-fast
- GitHub Check: stateless-js-v2
- GitHub Check: cli-v2
- GitHub Check: Forester e2e test
- 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: programs (account-compression-and-registry, ["cargo-test-sbf -p account-compression-test", "cargo...
- GitHub Check: programs (compressed-token-and-e2e, ["cargo-test-sbf -p compressed-token-test --test v1", "cargo-...
- GitHub Check: programs (light-system-program-compression, ["cargo-test-sbf -p system-test -- test_with_compress...
- GitHub Check: programs (light-system-program-address, ["cargo-test-sbf -p system-test -- test_with_address", "c...
- GitHub Check: programs (compressed-token-batched-tree, ["cargo-test-sbf -p compressed-token-test -- test_transf...
- GitHub Check: cli-v1
- GitHub Check: lint
🔇 Additional comments (2)
CLAUDE.md (2)
124-141: All referenced file paths, crate names, and error code ranges in the CLAUDE.md snippet have been verified as accurate:
- ✓
program-libs/batched-merkle-tree/src/merkle_tree.rs- ✓
program-libs/verifier/src/lib.rs- ✓
programs/system/src/lib.rs- ✓
programs/account-compression/src/processor/- ✓
sdk-libs/sdk/src/lib.rs- ✓
sdk-libs/client/src/rpc/mod.rs- ✓ Crate names:
light-account-checks,light-verifier,light-batched-merkle-tree,light-zero-copy- ✓ Error code ranges (14301-14312) properly documented in
program-libs/batched-merkle-tree/src/errors.rsThe documentation accurately reflects the current repository structure and is consistent with the CLAUDE.md guidelines.
156-161: All commands and tool references are accurate.Verification confirms that the quick reference section correctly documents the testing tools and commands:
light test-validatoris a real command from the globally-installed Light CLI (documented incli/README.md)light-program-testis the correct package name (located atsdk-libs/program-test, version 0.16.0)- LiteSVM is accurately referenced as the testing framework used by the package
The documentation in CLAUDE.md lines 156-161 is accurate and up-to-date.
- Repository overview with core technologies and architecture - Complete directory structure with component purposes - Component relationship diagram and data flow - Development workflow with build, test, and code generation commands - AI assistant guidelines with code patterns and navigation - Key files for understanding subsystems and debugging - Quick reference for frequently modified files and configuration - Links to detailed component documentation Provides AI assistants with essential context about Light Protocol codebase structure, enabling efficient navigation and development assistance across the ZK compression protocol implementation.
705e8ff to
44c9cf0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
♻️ Duplicate comments (2)
CLAUDE.md (2)
74-98: Add blank lines around headings per markdown standards.Multiple headings in the Development Workflow section lack required blank lines (MD022). Apply this pattern to "### Build Commands" and other subsections:
## Development Workflow ### Build Commands + ```bashApply the same fix to:
- Line 82: "### Testing Patterns"
- Line 88: "#### 1. Unit Tests (program-libs/)"
- Lines 104, 122, 135, 153, 172, and 184 for other section headings
13-55: Add language specifier to directory structure code fence.The fenced code block lacks a language identifier. Since this is a directory tree (text content), add
textto enable proper syntax highlighting and comply with markdown standards.-``` +```text light-protocol/
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (3)
.coderabbit.yamlis excluded by none and included by noneprogram-tests/CLAUDE.mdis excluded by none and included by nonesdk-tests/CLAUDE.mdis excluded by none and included by none
📒 Files selected for processing (2)
CLAUDE.md(1 hunks)DOCS.md(1 hunks)
🧰 Additional context used
🧠 Learnings (28)
📓 Common learnings
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:55.362Z
Learning: Applies to programs/compressed-token/program/docs/ACCOUNTS.md : Account documentation must include: description, discriminator, state layout, serialization example, hashing (only for compressed accounts), derivation (only for PDAs), and associated instructions
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/ACCOUNT_ITERATOR.md : ACCOUNT_ITERATOR.md must document the enhanced account iterator, including sequential processing, automatic validation, and location-based error reporting for debugging
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:25.222Z
Learning: Applies to program-libs/account-checks/docs/{CLAUDE.md,ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,ERRORS.md,DISCRIMINATOR.md,PACKED_ACCOUNTS.md} : Keep component documentation up to date in the corresponding docs/*.md files listed
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/PACKED_ACCOUNTS.md : PACKED_ACCOUNTS.md must document index-based dynamic account access, including accessing mint, owner, and delegate accounts by index with bounds checking
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:19.426Z
Learning: Applies to program-libs/compressible/docs/CONFIG_ACCOUNT.md : Document the CompressibleConfig account structure and methods in docs/CONFIG_ACCOUNT.md
📚 Learning: 2025-10-15T03:45:40.038Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:45:40.038Z
Learning: Applies to programs/compressed-token/program/docs/**/CLAUDE.md : Include a CLAUDE.md in each relevant documentation directory that serves as the documentation structure guide for that directory
Applied to files:
DOCS.mdCLAUDE.md
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Applies to programs/compressed-token/program/docs/instructions/**/CLAUDE.md : Maintain CLAUDE.md (this file) as the documentation structure guide for the compressed token program docs
Applied to files:
DOCS.mdCLAUDE.md
📚 Learning: 2025-10-11T21:59:25.222Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:25.222Z
Learning: Applies to program-libs/account-checks/docs/{CLAUDE.md,ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,ERRORS.md,DISCRIMINATOR.md,PACKED_ACCOUNTS.md} : Keep component documentation up to date in the corresponding docs/*.md files listed
Applied to files:
DOCS.mdCLAUDE.md
📚 Learning: 2025-10-15T03:45:40.038Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:45:40.038Z
Learning: Applies to programs/compressed-token/program/docs/**/CLAUDE.md : Ensure the parent-level CLAUDE.md acts as the main entry point containing a summary and instruction index
Applied to files:
DOCS.mdCLAUDE.md
📚 Learning: 2025-10-11T21:59:52.712Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/{ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,DISCRIMINATOR.md,ERRORS.md,PACKED_ACCOUNTS.md} : Each document should focus on a single module or concept
Applied to files:
DOCS.mdCLAUDE.md
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Use ../CLAUDE.md as the main entry point with summary and instruction index
Applied to files:
DOCS.mdCLAUDE.md
📚 Learning: 2025-10-11T21:59:52.712Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/DISCRIMINATOR.md : DISCRIMINATOR.md must document 8-byte discriminators, the Discriminator trait, constant arrays for compile-time checks, and integration with account initialization
Applied to files:
DOCS.md
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Start with ../../CLAUDE.md for the instruction index and overview
Applied to files:
DOCS.mdCLAUDE.md
📚 Learning: 2025-10-11T21:59:52.712Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/{ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,DISCRIMINATOR.md,ERRORS.md,PACKED_ACCOUNTS.md} : Include cross-references that link related concepts across documents
Applied to files:
DOCS.mdCLAUDE.md
📚 Learning: 2025-10-11T21:59:52.712Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/ACCOUNT_CHECKS.md : ACCOUNT_CHECKS.md must document all validation functions in the checks module, including ownership validation, permission checks, discriminator handling, and PDA verification with code examples
Applied to files:
DOCS.md
📚 Learning: 2025-10-11T21:59:52.712Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/{ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,DISCRIMINATOR.md,ERRORS.md,PACKED_ACCOUNTS.md} : Code examples should demonstrate both Solana and Pinocchio usage where applicable
Applied to files:
DOCS.mdCLAUDE.md
📚 Learning: 2025-10-16T06:33:55.362Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:55.362Z
Learning: Applies to programs/compressed-token/program/docs/ACCOUNTS.md : Account documentation must include: description, discriminator, state layout, serialization example, hashing (only for compressed accounts), derivation (only for PDAs), and associated instructions
Applied to files:
DOCS.md
📚 Learning: 2025-10-16T06:33:55.362Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:55.362Z
Learning: Applies to programs/compressed-token/program/docs/instructions/*.md : Every instruction description must include: path, description, instruction_data (code paths), Accounts (order and checks), instruction logic and checks, and Errors (with causes)
Applied to files:
DOCS.md
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Applies to programs/compressed-token/program/docs/instructions/**/ACCOUNTS.md : Provide complete account layouts and data structures in ACCOUNTS.md
Applied to files:
DOCS.md
📚 Learning: 2025-10-15T03:46:03.556Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:03.556Z
Learning: Applies to programs/compressed-token/program/docs/instructions/instructions/{CREATE_TOKEN_ACCOUNT,MINT_ACTION,TRANSFER2,CLAIM,CLOSE_TOKEN_ACCOUNT,DECOMPRESSED_TRANSFER,WITHDRAW_FUNDING_POOL}.md : Every instruction description must include sections: path, description, instruction_data, Accounts, instruction logic and checks, Errors
Applied to files:
DOCS.md
📚 Learning: 2025-10-11T21:59:52.712Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:52.712Z
Learning: Applies to program-libs/account-checks/docs/**/ERRORS.md : ERRORS.md must document error types with numeric codes in the 12006–12021 range, common causes, resolution strategies, and conversion mappings for Solana and Pinocchio
Applied to files:
DOCS.md
📚 Learning: 2025-10-15T03:45:40.038Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:45:40.038Z
Learning: Start navigation at the parent CLAUDE.md for the instruction index and overview
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-15T03:45:40.038Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/docs/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:45:40.038Z
Learning: Applies to programs/compressed-token/program/docs/**/ACCOUNTS.md : Maintain ACCOUNTS.md with complete account layouts and data structures
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-11T21:59:25.222Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:25.222Z
Learning: Applies to program-libs/account-checks/src/account_info/{solana.rs,pinocchio.rs,test_account_info.rs} : Gate SDK-specific implementations with #[cfg(feature = "solana"|"pinocchio"|"test-only")]
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-15T03:46:43.242Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/sdk-token-test/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:43.242Z
Learning: Applies to sdk-tests/sdk-token-test/**/tests/**/*.rs : Every test should only contain functional integration tests
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-11T21:59:25.222Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:25.222Z
Learning: Applies to program-libs/account-checks/**/Cargo.toml : Define features solana, pinocchio, and test-only in Cargo.toml; default build should enable none
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-16T06:33:55.362Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:55.362Z
Learning: Applies to programs/compressed-token/program/program-libs/ctoken-types/** : Define all state and instruction data structures in the light-ctoken-types crate (program-libs/ctoken-types), including state/, instructions/, and state/extensions/
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-16T06:33:19.426Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:19.426Z
Learning: Applies to program-libs/compressible/docs/SOLANA_RENT.md : Maintain a comparison of Solana vs Light Protocol rent systems in docs/SOLANA_RENT.md
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-11T21:59:25.222Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:25.222Z
Learning: Applies to program-libs/account-checks/src/account_info/{solana.rs,pinocchio.rs,test_account_info.rs} : Provide SDK-specific AccountInfoTrait implementations in account_info/{solana.rs,pinocchio.rs,test_account_info.rs}
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-15T03:46:43.242Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/sdk-token-test/CLAUDE.md:0-0
Timestamp: 2025-10-15T03:46:43.242Z
Learning: Run tests with: cargo test-sbf -p sdk-token-test --test <test-file-name>
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-11T21:59:25.222Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-10-11T21:59:25.222Z
Learning: Applies to program-libs/account-checks/src/!(account_info)/**/*.rs : Use AccountInfoTrait for runtime-agnostic account handling; avoid direct solana-program or pinocchio AccountInfo in general logic
Applied to files:
CLAUDE.md
📚 Learning: 2025-10-16T06:33:19.426Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2025-10-16T06:33:19.426Z
Learning: Applies to program-libs/compressible/src/config.rs : Ensure serialization compatibility across Anchor, Pinocchio, and Borsh for core account types used by dependent programs
Applied to files:
CLAUDE.md
🪛 LanguageTool
DOCS.md
[uncategorized] ~38-~38: Possible missing comma found.
Context: ...es** - Shared data structures For each module include: - File/directory name - Brief ...
(AI_HYDRA_LEO_MISSING_COMMA)
[typographical] ~46-~46: Do not use a colon (:) before a series that is introduced by a preposition (‘with’). Remove the colon or add a noun or a noun phrase after the preposition.
Context: ...s extensive, create a docs/ directory with: - CLAUDE.md - Navigation guide for th...
(RP_COLON)
[grammar] ~101-~101: Collocation: With the noun “changes”, you should use the verb “make”.
Context: ...rate section): - What the instruction does - Key state changes - Usage scenari...
(MAKE_A_CHANGE)
[misspelling] ~132-~132: This word is normally spelled as one.
Context: ...s** - Attack vectors and mitigations Anti-patterns to avoid: - Generic performance optim...
(EN_COMPOUNDS_ANTI_PATTERNS)
CLAUDE.md
[duplication] ~153-~153: Possible typo: you repeated a word.
Context: ...s in js/ directory #### 5. Go Prover Tests Tests for the ZK proof generation server (Gna...
(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~195-~195: Loose punctuation mark.
Context: ...zation Principles - program-libs/: Pure Rust libraries, unit tests with `c...
(UNLIKELY_OPENING_PUNCTUATION)
🪛 markdownlint-cli2 (0.18.1)
CLAUDE.md
5-5: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
45-45: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
186-186: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
192-192: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
- GitHub Check: stateless-js-v1
- GitHub Check: Forester e2e test
- GitHub Check: lint
- GitHub Check: system-programs (token test, ["cargo-test-sbf -p sdk-token-test"])
- GitHub Check: system-programs (anchor & pinocchio, ["cargo-test-sbf -p sdk-anchor-test", "cargo-test-sbf -p sdk...
- GitHub Check: system-programs (sdk-libs, light-sdk-macros light-sdk light-program-test light-client light-compr...
- GitHub Check: system-programs (native, ["cargo-test-sbf -p sdk-native-test", "cargo-test-sbf -p sdk-v1-native-t...
- GitHub Check: Test program-libs-fast
- GitHub Check: Test batched-merkle-tree-simulate
- GitHub Check: Test program-libs-slow
- GitHub Check: stateless-js-v2
- GitHub Check: cli-v1
- GitHub Check: cli-v2
- GitHub Check: programs (light-system-program-compression, ["cargo-test-sbf -p system-test -- test_with_compress...
- GitHub Check: programs (compressed-token-and-e2e, ["cargo-test-sbf -p compressed-token-test --test v1", "cargo-...
- 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 (account-compression-and-registry, ["cargo-test-sbf -p account-compression-test", "cargo...
- GitHub Check: programs (system-cpi-test-v2-functional-account-infos, ["cargo-test-sbf -p system-cpi-v2-test -- ...
- GitHub Check: programs (light-system-program-address, ["cargo-test-sbf -p system-test -- test_with_address", "c...
- GitHub Check: programs (compressed-token-batched-tree, ["cargo-test-sbf -p compressed-token-test -- test_transf...
🔇 Additional comments (1)
DOCS.md (1)
1-225: Strong documentation guidelines aligned with repository standards.This comprehensive guidelines document provides clear, actionable requirements for documentation across the codebase. The structure—covering crate documentation, topic-specific documentation (accounts, instructions, errors, serialization, CPI), and documentation standards—mirrors established patterns documented in learnings and aligns well with the repository's CLAUDE.md structure requirements.
Strengths:
- Clear required vs. optional sections for each document type
- Specific guidance on error codes, account layouts, and instruction documentation
- Practical examples referencing actual repository locations
- Anti-patterns section helps writers avoid common pitfalls
- Code examples show both correct usage and context
This creates a strong foundation for maintaining consistent, high-quality documentation as new crates and features are added. The guidelines should be referenced in repository onboarding and CI/CD documentation to ensure adoption.
Consider adding this file to a central documentation index or linking it from the root README.md so contributors discover it early. Per learnings, CLAUDE.md files serve as navigation guides—this file extends that pattern repository-wide.
⛔ Skipped due to learnings
Learnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/docs/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:45:40.038Z Learning: Applies to programs/compressed-token/program/docs/**/CLAUDE.md : Include a CLAUDE.md in each relevant documentation directory that serves as the documentation structure guide for that directoryLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:46:03.556Z Learning: Applies to programs/compressed-token/program/docs/instructions/**/CLAUDE.md : Maintain CLAUDE.md (this file) as the documentation structure guide for the compressed token program docsLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/docs/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:52.712Z Learning: Applies to program-libs/account-checks/docs/**/{ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,DISCRIMINATOR.md,ERRORS.md,PACKED_ACCOUNTS.md} : Each document should focus on a single module or conceptLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/docs/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:52.712Z Learning: Applies to program-libs/account-checks/docs/**/{ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,DISCRIMINATOR.md,ERRORS.md,PACKED_ACCOUNTS.md} : Code examples should demonstrate both Solana and Pinocchio usage where applicableLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/CLAUDE.md:0-0 Timestamp: 2025-10-16T06:33:55.362Z Learning: Applies to programs/compressed-token/program/docs/ACCOUNTS.md : Account documentation must include: description, discriminator, state layout, serialization example, hashing (only for compressed accounts), derivation (only for PDAs), and associated instructionsLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/CLAUDE.md:0-0 Timestamp: 2025-10-16T06:33:55.362Z Learning: Applies to programs/compressed-token/program/docs/instructions/*.md : Every instruction description must include: path, description, instruction_data (code paths), Accounts (order and checks), instruction logic and checks, and Errors (with causes)Learnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:46:03.556Z Learning: Applies to programs/compressed-token/program/docs/instructions/instructions/{CREATE_TOKEN_ACCOUNT,MINT_ACTION,TRANSFER2,CLAIM,CLOSE_TOKEN_ACCOUNT,DECOMPRESSED_TRANSFER,WITHDRAW_FUNDING_POOL}.md : Every instruction description must include sections: path, description, instruction_data, Accounts, instruction logic and checks, ErrorsLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/docs/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:45:40.038Z Learning: Applies to programs/compressed-token/program/docs/**/CLAUDE.md : Ensure the parent-level CLAUDE.md acts as the main entry point containing a summary and instruction indexLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: programs/compressed-token/program/docs/instructions/CLAUDE.md:0-0 Timestamp: 2025-10-15T03:46:03.556Z Learning: Applies to programs/compressed-token/program/docs/instructions/**/ACCOUNTS.md : Provide complete account layouts and data structures in ACCOUNTS.mdLearnt from: CR Repo: Lightprotocol/light-protocol PR: 0 File: program-libs/account-checks/CLAUDE.md:0-0 Timestamp: 2025-10-11T21:59:25.222Z Learning: Applies to program-libs/account-checks/docs/{CLAUDE.md,ACCOUNT_INFO_TRAIT.md,ACCOUNT_CHECKS.md,ACCOUNT_ITERATOR.md,ERRORS.md,DISCRIMINATOR.md,PACKED_ACCOUNTS.md} : Keep component documentation up to date in the corresponding docs/*.md files listed
Summary by CodeRabbit
New Features
Documentation
Chores