fix: panic on unknown extension types in CToken equality check#2106
fix: panic on unknown extension types in CToken equality check#2106ananas-block merged 5 commits intomainfrom
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughAdds test-only cross-type Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
program-libs/ctoken-interface/src/state/ctoken/zero_copy.rs(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
program-libs/**/*.rs
📄 CodeRabbit inference engine (CLAUDE.md)
Unit tests in program-libs must not depend on light-test-utils; tests requiring light-test-utils must be located in program-tests/
Files:
program-libs/ctoken-interface/src/state/ctoken/zero_copy.rs
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-tests/sdk-ctoken-test/README.md:0-0
Timestamp: 2025-12-07T00:45:07.921Z
Learning: Applies to sdk-tests/sdk-ctoken-test/**/*.rs : Use the builder pattern from `light-ctoken-sdk::ctoken` module for CPI operations in native Solana programs
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2025-12-06T00:49:21.983Z
Learning: Applies to program-libs/compressible/src/error.rs : Error types must use numeric codes in the 19xxx range for CToken-specific errors
📚 Learning: 2025-11-24T17:54:20.982Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/zero-copy-derive/README.md:0-0
Timestamp: 2025-11-24T17:54:20.982Z
Learning: Applies to program-libs/zero-copy-derive/**/*.rs : Apply #[derive(ZeroCopyEq)] macro to structs to derive PartialEq comparing ZeroCopy representation with original struct
Applied to files:
program-libs/ctoken-interface/src/state/ctoken/zero_copy.rs
📚 Learning: 2025-12-06T00:49:21.983Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2025-12-06T00:49:21.983Z
Learning: Applies to program-libs/compressible/src/error.rs : Error types must use numeric codes in the 19xxx range for CToken-specific errors
Applied to files:
program-libs/ctoken-interface/src/state/ctoken/zero_copy.rs
📚 Learning: 2025-12-06T00:49:37.752Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-06T00:49:37.752Z
Learning: Applies to programs/compressed-token/program/**/create_*token_account*.rs : CToken account layout is the same as SPL tokens but implements a custom Compressible extension
Applied to files:
program-libs/ctoken-interface/src/state/ctoken/zero_copy.rs
📚 Learning: 2025-12-06T00:49:37.752Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-06T00:49:37.752Z
Learning: Applies to programs/compressed-token/program/**/mint_action/*.rs : Compressed mint accounts support one extension: TokenMetadata
Applied to files:
program-libs/ctoken-interface/src/state/ctoken/zero_copy.rs
📚 Learning: 2025-12-06T00:49:21.983Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/CLAUDE.md:0-0
Timestamp: 2025-12-06T00:49:21.983Z
Learning: Applies to program-libs/compressible/src/config.rs : Implement default initialization for CToken V1 config in CompressibleConfig structure
Applied to files:
program-libs/ctoken-interface/src/state/ctoken/zero_copy.rs
📚 Learning: 2025-11-24T17:54:20.982Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/zero-copy-derive/README.md:0-0
Timestamp: 2025-11-24T17:54:20.982Z
Learning: Applies to program-libs/zero-copy-derive/**/*.rs : Boolean types are converted to u8 in zero-copy structs for alignment and serialization
Applied to files:
program-libs/ctoken-interface/src/state/ctoken/zero_copy.rs
📚 Learning: 2025-11-24T17:55:17.323Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-libs/macros/src/compressible/README.md:0-0
Timestamp: 2025-11-24T17:55:17.323Z
Learning: Applies to sdk-libs/macros/src/compressible/**/instructions.rs : Compress/decompress instruction handlers and context struct generation should be implemented in `instructions.rs`, with compress using PDA-only and decompress supporting full PDA + ctoken
Applied to files:
program-libs/ctoken-interface/src/state/ctoken/zero_copy.rs
📚 Learning: 2025-12-06T00:49:37.752Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-06T00:49:37.752Z
Learning: Applies to programs/compressed-token/program/**/ctoken_transfer.rs : CTokenTransfer instruction is SPL-compatible and transfers between decompressed accounts only
Applied to files:
program-libs/ctoken-interface/src/state/ctoken/zero_copy.rs
📚 Learning: 2025-12-06T00:49:37.752Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-06T00:49:37.752Z
Learning: Applies to programs/compressed-token/program/program-libs/ctoken-types/src/{state,instructions}/**/*.rs : All program state and instruction data structures must be defined in the program-libs/ctoken-types crate (light-ctoken-interface) under state/ and instructions/ directories to allow SDKs to import types without pulling in program dependencies
Applied to files:
program-libs/ctoken-interface/src/state/ctoken/zero_copy.rs
📚 Learning: 2025-11-24T17:55:17.323Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: sdk-libs/macros/src/compressible/README.md:0-0
Timestamp: 2025-11-24T17:55:17.323Z
Learning: Applies to sdk-libs/macros/src/compressible/**/decompress_context.rs : Decompression trait implementation (`DecompressContext`) with account accessors, PDA/token separation logic, and token processing delegation should be in `decompress_context.rs`
Applied to files:
program-libs/ctoken-interface/src/state/ctoken/zero_copy.rs
Summary by CodeRabbit
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.