Skip to content

chore: rename remaining ctoken/cmint to light-token/light-mint in sdk comments#2313

Open
tilo-14 wants to merge 1 commit intomainfrom
sdk-rename-light-token-comments
Open

chore: rename remaining ctoken/cmint to light-token/light-mint in sdk comments#2313
tilo-14 wants to merge 1 commit intomainfrom
sdk-rename-light-token-comments

Conversation

@tilo-14
Copy link
Member

@tilo-14 tilo-14 commented Feb 25, 2026

Summary

Continuation of #2299. Renames remaining old terminology in comments, doc strings, and markdown files across sdk-libs/ and sdk-tests/:

  • ctoken / CToken / c-tokenlight-token / Light Token
  • cmint / CMint / compressed mintlight-mint / Light Mint
  • token poolSPL interface PDA
  • compressed token (when referring to the program) → Light Token

No code identifiers, variable names, struct names, or module paths were modified. Only comments, doc strings, and markdown documentation.

Scope

  • 114 files changed, 276 insertions, 276 deletions
  • sdk-libs/: token-sdk, token-pinocchio, sdk-types, compressed-token-sdk, instruction-decoder, macros, program-test, sdk, client
  • sdk-tests/: sdk-light-token-test, sdk-light-token-pinocchio, csdk-anchor-full-derived-test, anchor-semi-manual-test, pinocchio-manual-test, client-test, single-account-loader-test, single-ata-test

Exclusions (intentionally not renamed)

  • Code identifiers (ctoken_config, solana_ctoken_accounts, etc.)
  • Program ID cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m
  • Discriminator references (CTokenBurn, CTokenApprove, etc.)
  • Module paths in doc examples (crate::programs::ctoken::...)
  • "compressed token" when describing ZK-compressed accounts (the concept, not the program)

Test plan

  • cargo build passes for all affected crates
  • cargo test passes for affected crates (comment-only changes)

Open with Devin

Summary by CodeRabbit

  • New Features

    • Extended Transfer2 account metadata configuration with new fields and constructors for SPL pool handling.
    • Added new client-mode constructor for MintToCompressed operations.
    • Expanded UpdateMint instruction inputs with authority and proof parameters.
    • CompressibleParams now supports rent sponsor and compression-only modes.
  • Documentation

    • Comprehensive terminology rebrand from "Compressed Token" to "Light Token" across SDK documentation.

… comments

Continuation of #2299. Renames old terminology (ctoken, CToken, cmint,
compressed mint, token pool) to new names (light-token, Light Token,
light-mint, Light Mint, SPL interface PDA) across sdk-libs/ and
sdk-tests/ comments and documentation.

Only comments, doc strings, and markdown files are changed — no code
identifiers, variable names, or module paths were modified.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

📝 Walkthrough

Walkthrough

A systematic renaming of terminology across the Light SDK codebase: "compressed token/mint" becomes "light token/mint," "ctoken" becomes "light-token," and "token pool PDA" becomes "SPL interface PDA." Includes minimal API expansions (new struct fields, constructors) in v2 transfer and mint modules.

Changes

Cohort / File(s) Summary
Account & Library Core
sdk-libs/account-pinocchio/src/lib.rs, sdk-libs/account/src/lib.rs
Updated derive_mint_compressed_address documentation to reference "light mint" instead of "compressed mint."
Client Interface
sdk-libs/client/src/interface/create_accounts_proof.rs
Updated Mint variant documentation from "Compressed mint" to "Light mint."
Compressed Token SDK - Documentation & Module
sdk-libs/compressed-token-sdk/README.md, sdk-libs/compressed-token-sdk/src/compressed_token/mod.rs, sdk-libs/compressed-token-sdk/src/compat.rs
Renamed operation reference and module documentation to use "light token" terminology; updated TLV field documentation.
Compressed Token SDK v1 - Approve
sdk-libs/compressed-token-sdk/src/compressed_token/v1/approve/account_metas.rs, sdk-libs/compressed-token-sdk/src/compressed_token/v1/approve/instruction.rs
Updated comments and doc strings to reference "light token" instead of "compressed token."
Compressed Token SDK v1 - Batch & Transfer
sdk-libs/compressed-token-sdk/src/compressed_token/v1/batch_compress/account_metas.rs, sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/account_infos.rs, sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/account_metas.rs, sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/instruction.rs
Terminology updates in comments and doc strings; added debug println statement in transfer account_metas.
Compressed Token SDK v2 - Core Modules
sdk-libs/compressed-token-sdk/src/compressed_token/v2/account2.rs, sdk-libs/compressed-token-sdk/src/compressed_token/v2/compress_and_close.rs, sdk-libs/compressed-token-sdk/src/compressed_token/v2/decompress_full.rs
Updated documentation and comments to reference "light token/mint" terminology throughout.
Compressed Token SDK v2 - Mint Operations
sdk-libs/compressed-token-sdk/src/compressed_token/v2/create_compressed_mint/account_metas.rs, sdk-libs/compressed-token-sdk/src/compressed_token/v2/create_compressed_mint/instruction.rs, sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_action/account_metas.rs, sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_action/mod.rs, sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_to_compressed/account_metas.rs
Documentation updates to "light mint" terminology; added MintToCompressedMetaConfig::new_client() constructor in mint_to_compressed.
Compressed Token SDK v2 - Transfer & Update
sdk-libs/compressed-token-sdk/src/compressed_token/v2/transfer2/account_metas.rs, sdk-libs/compressed-token-sdk/src/compressed_token/v2/transfer2/instruction.rs, sdk-libs/compressed-token-sdk/src/compressed_token/v2/update_compressed_mint/account_metas.rs, sdk-libs/compressed-token-sdk/src/compressed_token/v2/update_compressed_mint/instruction.rs
New Transfer2AccountsMetaConfig struct with multiple fields and constructors; expanded UpdateMintInputs and new UpdateMintInputsCpiWrite struct; terminology updates throughout.
Compressed Token SDK - Library & Interface
sdk-libs/compressed-token-sdk/src/lib.rs, sdk-libs/compressed-token-sdk/src/spl_interface.rs, sdk-libs/compressed-token-sdk/src/utils.rs
Updated crate-level documentation and module docs to reference "light token" instead of "compressed token."
Event Types
sdk-libs/event/src/event.rs
Updated field documentation for ATA owner info to reference "light-token ATAs" instead of "compressed ATAs."
Instruction Decoder
sdk-libs/instruction-decoder/src/core.rs, sdk-libs/instruction-decoder/src/lib.rs, sdk-libs/instruction-decoder/src/programs/ctoken.rs, sdk-libs/instruction-decoder/src/programs/mod.rs
Updated program name and module documentation to reference "Light Token" instead of "Compressed Token"; updated instruction variant docs and discriminator descriptions.
Macros - Documentation & Core
sdk-libs/macros/docs/accounts/architecture.md, sdk-libs/macros/docs/accounts/associated_token.md, sdk-libs/macros/docs/accounts/mint.md, sdk-libs/macros/src/lib.rs
Updated documentation to reference "light mint/token" instead of "compressed mint/token"; extensive terminology updates in mint lifecycle and account type documentation.
Macros - Light PDAs
sdk-libs/macros/src/light_pdas/accounts/derive.rs, sdk-libs/macros/src/light_pdas/accounts/light_account.rs, sdk-libs/macros/src/light_pdas/parsing/accounts_struct.rs, sdk-libs/macros/src/light_pdas/program/instructions.rs
Comment updates to replace "compressed mint" with "light mint" and "CToken seed provider" with "Light Token seed provider."
Program Test Utilities
sdk-libs/program-test/src/compressible.rs, sdk-libs/program-test/src/forester/claim_forester.rs, sdk-libs/program-test/src/forester/compress_and_close_forester.rs, sdk-libs/program-test/src/program_test/test_rpc.rs
Updated documentation and error messages to reference "Light Token program" and "light-token accounts" instead of "compressed token/ctoken" variants.
SDK Types - Core & CPI
sdk-libs/sdk-types/src/cpi_context_write.rs, sdk-libs/sdk-types/src/interface/account/compression_info.rs, sdk-libs/sdk-types/src/interface/accounts/create_accounts.rs, sdk-libs/sdk-types/src/interface/cpi/create_mints.rs, sdk-libs/sdk-types/src/interface/cpi/create_token_accounts.rs
Updated documentation to reference "light token/mint" instead of "compressed token/mint."
SDK Types - Processors
sdk-libs/sdk-types/src/interface/program/decompression/processor.rs, sdk-libs/sdk/src/lib.rs
Updated token account layout and CPI context documentation to reference "light-token" instead of "ctoken."
Token Client
sdk-libs/token-client/src/actions/create_mint.rs
Updated CreateMint documentation to reference "light mint" instead of "compressed mint."
Token Pinocchio Instructions
sdk-libs/token-pinocchio/src/instruction/approve.rs, sdk-libs/token-pinocchio/src/instruction/burn.rs, sdk-libs/token-pinocchio/src/instruction/burn_checked.rs, sdk-libs/token-pinocchio/src/instruction/close.rs, sdk-libs/token-pinocchio/src/instruction/create.rs, sdk-libs/token-pinocchio/src/instruction/create_ata.rs, sdk-libs/token-pinocchio/src/instruction/create_mint.rs, sdk-libs/token-pinocchio/src/instruction/create_mints.rs, sdk-libs/token-pinocchio/src/instruction/freeze.rs, sdk-libs/token-pinocchio/src/instruction/mint_to.rs, sdk-libs/token-pinocchio/src/instruction/mint_to_checked.rs, sdk-libs/token-pinocchio/src/instruction/revoke.rs, sdk-libs/token-pinocchio/src/instruction/thaw.rs, sdk-libs/token-pinocchio/src/instruction/transfer.rs, sdk-libs/token-pinocchio/src/instruction/transfer_checked.rs, sdk-libs/token-pinocchio/src/instruction/transfer_from_spl.rs, sdk-libs/token-pinocchio/src/instruction/transfer_to_spl.rs
Widespread documentation updates replacing "ctoken" with "light-token" in CPI instruction builder doc comments and module descriptions.
Token SDK Instructions
sdk-libs/token-sdk/src/instruction/burn.rs, sdk-libs/token-sdk/src/instruction/burn_checked.rs, sdk-libs/token-sdk/src/instruction/close.rs, sdk-libs/token-sdk/src/instruction/compressible.rs, sdk-libs/token-sdk/src/instruction/create.rs, sdk-libs/token-sdk/src/instruction/create_associated_token_account.rs, sdk-libs/token-sdk/src/instruction/create_ata.rs, sdk-libs/token-sdk/src/instruction/decompress.rs, sdk-libs/token-sdk/src/instruction/decompress_mint.rs, sdk-libs/token-sdk/src/instruction/mint_to.rs, sdk-libs/token-sdk/src/instruction/mint_to_checked.rs, sdk-libs/token-sdk/src/instruction/transfer.rs, sdk-libs/token-sdk/src/instruction/transfer_checked.rs, sdk-libs/token-sdk/src/instruction/transfer_from_spl.rs, sdk-libs/token-sdk/src/instruction/transfer_to_spl.rs
Added rent_sponsor and compression_only fields to CompressibleParams; widespread documentation updates replacing "ctoken" with "light-token."
Token Types
sdk-libs/token-types/src/account_infos/mint_to_compressed.rs, sdk-libs/token-types/src/account_infos/transfer.rs, sdk-libs/token-types/src/error.rs, sdk-libs/token-types/src/lib.rs
Renamed "token pool PDA" to "SPL interface PDA" in documentation and error messages; updated terminology in type and error descriptions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

ai-review, documentation, refactoring

Suggested reviewers

  • ananas-block

Poem

🔦 From "compressed" we ascend, to "light" the token flows,

Renaming spreads like morning sun through SDK's rows,

"ctoken" → "light-token," the terminology glows,

Yet buried in the many docs, a println! shows— ✨

Review with care, the pattern's clear, but check what code bestows.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: renaming legacy terminology (ctoken/cmint) to light-token/light-mint across SDK comments and documentation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 70.00%.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sdk-rename-light-token-comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (10)
sdk-libs/token-pinocchio/src/instruction/mint_to.rs (1)

13-30: ⚠️ Potential issue | 🟡 Minor

Fix stale MintToCpi doc example fields.

Line 26 shows max_top_up, but MintToCpi no longer has that field (it has fee_payer). This example is now misleading for consumers.

📝 Suggested doc fix
 /// MintToCpi {
 ///     mint: &ctx.accounts.mint,
 ///     destination: &ctx.accounts.destination,
 ///     amount: 100,
 ///     authority: &ctx.accounts.authority,
 ///     system_program: &ctx.accounts.system_program,
-///     max_top_up: None,
 ///     fee_payer: None,
 /// }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk-libs/token-pinocchio/src/instruction/mint_to.rs` around lines 13 - 30,
Update the stale doc example for MintToCpi: remove the nonexistent max_top_up
field and ensure the current fields are shown (e.g., mint, destination, amount,
authority, system_program, and fee_payer) so the example matches the MintToCpi
struct; locate the example in the mint_to.rs doc block that references MintToCpi
and replace the struct literal to include fee_payer (and any other current
fields) and omit max_top_up.
sdk-libs/macros/src/light_pdas/program/instructions.rs (1)

771-776: 🧹 Nitpick | 🔵 Trivial

Comment now diverges from the function it annotates — track for follow-up rename.

The updated comment correctly says "Light Token seed provider impls", but the function it documents is still named generate_ctoken_seed_provider_implementation (line 775). Per the PR's stated scope this is intentional, yet the drift between the comment and the code identifier will keep catching readers' eyes until the function itself is renamed.

-    // Light Token seed provider impls (one per token variant)
+    // Light Token seed provider impls (one per token variant)
+    // TODO: rename `generate_ctoken_seed_provider_implementation` → `generate_light_token_seed_provider_implementation`
     if let Some(ref seeds) = token_seeds {
         if !seeds.is_empty() {
             let impl_code =
                 super::seed_codegen::generate_ctoken_seed_provider_implementation(seeds)?;

Consider opening a follow-up issue to rename the function and any siblings in seed_codegen that still carry ctoken in their identifiers.

Would you like me to open a tracking issue for the generate_ctoken_seed_provider_implementationgenerate_light_token_seed_provider_implementation rename (and any related seed_codegen siblings)?

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk-libs/macros/src/light_pdas/program/instructions.rs` around lines 771 -
776, The comment/identifier drift: rename the function
generate_ctoken_seed_provider_implementation in the seed_codegen module to
generate_light_token_seed_provider_implementation (and update any sibling
functions that include "ctoken") and then update all call sites (e.g., the
invocation in program/instructions.rs), public exports, use/imports, docs, and
tests to the new name; search the seed_codegen module for any remaining "ctoken"
identifiers and replace them consistently, run cargo build/test to ensure
nothing breaks, or if you prefer not to rename now create a tracking issue
describing the rename from generate_ctoken_seed_provider_implementation →
generate_light_token_seed_provider_implementation and list all seed_codegen
siblings that need the same change.
sdk-libs/event/src/event.rs (1)

10-18: 🧹 Nitpick | 🔵 Trivial

Opportunity: add struct-level doc comments to BatchPublicTransactionEvent and PublicTransactionEvent.

Since this is a documentation-focused PR, it's a great time to add the missing top-level doc comments for both public structs. The coding guidelines explicitly require comprehensive documentation for these types, including their field semantics.

📝 Proposed additions
+/// Batch of compressed-account transaction events, enriched with address,
+/// nullifier, and sequence-number data not present in `PublicTransactionEvent`.
+///
+/// - `event` — the base event (input/output hashes, relay fee, etc.)
+/// - `new_addresses` — freshly inserted addresses with their Merkle-tree placement
+/// - `input_sequence_numbers` / `address_sequence_numbers` — per-tree sequence numbers
+/// - `tx_hash` — 32-byte transaction hash
+/// - `batch_input_accounts` — nullifier contexts for every spent account
 #[derive(Debug, Clone, Default, PartialEq)]
 pub struct BatchPublicTransactionEvent {
+/// On-chain event emitted by the Light System Program for every transaction
+/// that creates or spends compressed accounts.
+///
+/// - `input_compressed_account_hashes` — hashes of all consumed accounts
+/// - `output_compressed_account_hashes` — hashes of all newly created accounts
+/// - `output_compressed_accounts` — full account data with packed Merkle context
+/// - `ata_owners` — ATA owner metadata for light-token `compress_and_close` outputs
 #[derive(Debug, Clone, BorshSerialize, BorshDeserialize, Default, PartialEq)]
 pub struct PublicTransactionEvent {

Based on learnings: "Maintain comprehensive documentation for public types and functions including PublicTransactionEvent, BatchPublicTransactionEvent, and event_from_light_transaction in the event parsing module" and "Provide type descriptions for event types: PublicTransactionEvent should contain input/output compressed account hashes, and BatchPublicTransactionEvent should contain accounts, addresses, and sequence numbers."

Also applies to: 20-35

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk-libs/event/src/event.rs` around lines 10 - 18, Add comprehensive
struct-level doc comments for PublicTransactionEvent and
BatchPublicTransactionEvent (and update event_from_light_transaction docs)
describing the purpose and semantics of each public field: for
PublicTransactionEvent explain it holds compressed input/output account hashes
and their meanings; for BatchPublicTransactionEvent document event,
new_addresses, input_sequence_numbers, address_sequence_numbers, tx_hash, and
batch_input_accounts (what each represents and any invariants, e.g., ordering or
length relationships). Place these docs above the respective struct declarations
(PublicTransactionEvent, BatchPublicTransactionEvent) and extend the doc for
event_from_light_transaction to note how it constructs these types and any
expectations about inputs/outputs per the project coding guidelines.
sdk-libs/program-test/src/forester/compress_and_close_forester.rs (2)

44-44: ⚠️ Potential issue | 🟠 Major

Hardcoded current_epoch = 0 will derive the wrong forester PDA on any live epoch.

The forester epoch PDA is keyed by epoch number. Hardcoding 0 means get_forester_epoch_pda_from_authority always returns the PDA for epoch 0, which will not match the actual registered forester once the protocol has advanced past the genesis epoch. Any transaction signed with the wrong PDA will be rejected by the registry program.

🐛 Proposed fix: fetch the actual current epoch from the RPC/indexer
-    let current_epoch = 0;
+    let current_epoch = rpc
+        .get_epoch_info()
+        .await
+        .map_err(|e| RpcError::CustomError(format!("Failed to get epoch info: {}", e)))?
+        .epoch;

If the registry program tracks its own epoch counter (separate from Solana's epoch), substitute the appropriate getter.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk-libs/program-test/src/forester/compress_and_close_forester.rs` at line
44, The code hardcodes current_epoch = 0 which causes
get_forester_epoch_pda_from_authority to derive the wrong PDA; replace the
literal with a runtime fetch of the real epoch (e.g., call the indexer or RPC to
get the current protocol epoch or use the registry program's epoch getter) and
assign that value to current_epoch before calling
get_forester_epoch_pda_from_authority so the derived PDA matches the active
registered forester.

50-56: ⚠️ Potential issue | 🔴 Critical

Pass the correct compression_authority from account data to the instruction, and remove debug artifact.

Line 50 constructs config with two Pubkey::default() arguments, making compression_authority at line 55 a zero-derived PDA that doesn't match the on-chain authority. This wrong value is passed directly to build_compress_and_close_instruction at line 190 and becomes a writable account in the instruction (AccountMeta::new(compression_authority, false)). The registry program will attempt to write to a non-existent account and fail.

The correct authority is already extracted from account extension data at line 124 (current_authority), stored in compression_authority_pubkey (lines 127–164), and added to packed accounts at line 167. Use that value instead.

Also remove the debug println! at line 56.

Proposed fix
-    let config = CompressibleConfig::light_token_v1(Pubkey::default(), Pubkey::default());
-
     let compressible_config = CompressibleConfig::derive_v1_config_pda(&REGISTRY_PROGRAM_ID).0;
-
-    // Derive compression_authority PDA (uses u16 version)
-    let compression_authority = config.compression_authority;
-    println!("config compression_authority {:?}", compression_authority);

     // Validate input

Then at line 187–196:

     let compress_and_close_ix = build_compress_and_close_instruction(
         authority.pubkey(),
         registered_forester_pda,
-        compression_authority,
+        compression_authority_pubkey,
         compressible_config,
         authority_index,
         destination_index,
         indices_vec,
         remaining_account_metas,
     );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk-libs/program-test/src/forester/compress_and_close_forester.rs` around
lines 50 - 56, The code constructs a dummy CompressibleConfig via
CompressibleConfig::light_token_v1 which yields a default/computed
compression_authority that is incorrect — remove the debug println! and stop
using config.compression_authority; instead pass the extracted on-chain
authority variable compression_authority_pubkey (previously derived from
current_authority in the account extension parsing) into
build_compress_and_close_instruction so the instruction uses the real
compression authority account already added to packed accounts; update any
AccountMeta creation to reference compression_authority_pubkey (preserving
writable/signer flags as required) rather than
Pubkey::default()/config.compression_authority.
sdk-libs/token-pinocchio/src/instruction/burn.rs (1)

20-29: ⚠️ Potential issue | 🟡 Minor

Stale doc example — max_top_up field no longer exists on BurnCpi.

The rust,ignore example references max_top_up: None, but BurnCpi has no such field (the struct goes directly from system_program to fee_payer). A reader who copies this example will get a compile error.

📝 Proposed fix
 /// BurnCpi {
 ///     source: &ctx.accounts.source,
 ///     mint: &ctx.accounts.mint,
 ///     amount: 100,
 ///     authority: &ctx.accounts.authority,
 ///     system_program: &ctx.accounts.system_program,
-///     max_top_up: None,
 ///     fee_payer: None,
 /// }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk-libs/token-pinocchio/src/instruction/burn.rs` around lines 20 - 29, The
example doc for BurnCpi is stale because it includes a nonexistent field
`max_top_up`; update the snippet in burn.rs to remove `max_top_up: None` so the
struct initializer matches the current BurnCpi fields (e.g., keep
`system_program: &ctx.accounts.system_program, fee_payer: None` and ensure the
order/field names match the BurnCpi definition).
sdk-libs/token-sdk/src/instruction/decompress.rs (1)

63-63: ⚠️ Potential issue | 🟡 Minor

Missed terminology rename: "cToken" still present in doc comment.

Line 63 still reads /// Destination cToken account (must exist). This should be updated to "light-token account" to stay consistent with the rest of this PR's rename.

Proposed fix
-    /// Destination cToken account (must exist)
+    /// Destination light-token account (must exist)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk-libs/token-sdk/src/instruction/decompress.rs` at line 63, Update the
leftover doc comment in sdk-libs/token-sdk/src/instruction/decompress.rs that
reads "/// Destination cToken account (must exist)" to use the new terminology
"light-token" (e.g., "/// Destination light-token account (must exist)"),
ensuring the field/argument comment in the decompress instruction matches the
PR-wide rename.
sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/account_metas.rs (1)

184-193: ⚠️ Potential issue | 🟡 Minor

Remove the debug println! statement from account-meta construction.

This stray debug print adds an unexpected runtime side effect in SDK instruction-building code and should be removed before merging.

Suggested fix
-    println!("config.with_anchor_none {}", config.with_anchor_none);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/account_metas.rs`
around lines 184 - 193, Remove the stray debug print in the account-meta
construction block: delete the println!("config.with_anchor_none {}",
config.with_anchor_none); line so the function that builds metas (the code using
config, metas, AccountMeta::new/AccountMeta::new_readonly and
default_pubkeys.compressed_token_program) has no runtime side effects; ensure no
other debug prints remain in that scope.
sdk-libs/token-sdk/src/instruction/compressible.rs (1)

84-85: ⚠️ Potential issue | 🔴 Critical

Fix invalid module paths in doctest example — ctoken:: module does not exist.

Lines 84–85 reference ctoken::LIGHT_TOKEN_CONFIG, ctoken::config_pda(), ctoken::RENT_SPONSOR, and ctoken::rent_sponsor_pda(). These symbols are not defined in any ctoken module within light_token. They exist in light_token::constants — some are re-exported at the crate root (config_pda) while others are not (LIGHT_TOKEN_CONFIG). Update the example to use the correct paths: light_token::config_pda() and light_token::constants::LIGHT_TOKEN_CONFIG / light_token::constants::RENT_SPONSOR so the doctest compiles and users can follow the example.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk-libs/token-sdk/src/instruction/compressible.rs` around lines 84 - 85,
Update the doctest example to use the actual module paths: replace references to
ctoken::LIGHT_TOKEN_CONFIG and ctoken::RENT_SPONSOR with
light_token::constants::LIGHT_TOKEN_CONFIG and
light_token::constants::RENT_SPONSOR, and replace ctoken::config_pda() and
ctoken::rent_sponsor_pda() with the re-exported light_token::config_pda() (and
if needed light_token::rent_sponsor_pda() or the constant in
light_token::constants), so the example imports and calls the correct symbols
(refer to LIGHT_TOKEN_CONFIG, RENT_SPONSOR, config_pda, rent_sponsor_pda in the
doctest).
sdk-libs/sdk-types/src/interface/cpi/create_mints.rs (1)

868-873: ⚠️ Potential issue | 🟠 Major

Silent u64 → u32 truncation in get_output_queue_next_index can corrupt decompress leaf indices.

The raw account data holds a u64 at NEXT_INDEX_OFFSET, but the function narrows it to u32 via as u32. Rust's as cast wraps on overflow — no panic, no error — so any queue whose next_index exceeds u32::MAX (~4.3 billion) will return a silently wrong base_leaf_index. That value flows directly into invoke_decompress as the leaf address for each prove-by-index CPI, meaning the wrong compressed account gets decompressed.

Return u64 (or add a checked cast with an explicit error) and propagate through CreateMintsParams::base_leaf_index and invoke_decompress.

🐛 Proposed fix (minimal — add a checked cast)
-    Ok(next_index as u32)
+    u32::try_from(next_index).map_err(|_| LightSdkTypesError::InvalidInstructionData)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk-libs/sdk-types/src/interface/cpi/create_mints.rs` around lines 868 - 873,
The function get_output_queue_next_index currently reads a u64 from the account
bytes at NEXT_INDEX_OFFSET then returns it cast with as u32 which silently
truncates on overflow; change get_output_queue_next_index to return a u64 (or
perform a checked cast using try_from and return an explicit error on overflow)
and update all call sites including CreateMintsParams::base_leaf_index and the
invoke_decompress invocation to accept and propagate a u64 (or handle the
explicit error) so no u64→u32 silent truncation occurs when reading
NEXT_INDEX_OFFSET.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_to_compressed/account_metas.rs`:
- Line 167: Update the duplicated-word inline comment in account_metas.rs that
currently reads "Optional light mint account accounts" (near the Optional light
mint account accounts comment) to a clearer phrase such as "Optional light mint
accounts" so the comment is concise and readable; locate the comment in the
compressed_token/v2/mint_to_compressed/account_metas.rs file and replace the
text accordingly.

In `@sdk-libs/sdk-types/src/interface/cpi/create_mints.rs`:
- Line 4: Update the stale comment string "generic over `AccountInfoTrait`.
Account order matches the cToken program" in create_mints.rs so it uses the new
product name (replace "cToken program" with "Light Token program"); locate the
comment in the module/doc comment near the top of create_mints.rs and perform
the exact textual rename to keep the rest of the comment (including the
reference to `AccountInfoTrait`) unchanged.

In `@sdk-libs/sdk-types/src/interface/program/decompression/processor.rs`:
- Around line 330-331: The adjacent comment mixes the new "light-token" wording
with legacy struct field names (ctoken_rent_sponsor,
ctoken_compressible_config); update the comment near the token accounts layout
to add a brief annotation stating that "light-token" is the new terminology
while the ctoken_* identifiers are legacy field names kept for compatibility/PR
exclusion, e.g. a short parenthetical like "(\"light-token\" terminology used
here; legacy field names ctoken_rent_sponsor, ctoken_compressible_config
retained intentionally)"; place this annotation on the same or next line to make
the intent explicit.

In `@sdk-libs/token-sdk/src/instruction/transfer_from_spl.rs`:
- Line 54: Update the stale cToken reference in the top doc comment of
transfer_from_spl.rs: find the line that reads "Create a transfer SPL to cToken
instruction" and change it to "Create a transfer SPL to light-token instruction"
(or similar consistent light-token wording) so the doc block matches the
renamed/light-token terminology elsewhere in this module.

---

Outside diff comments:
In
`@sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/account_metas.rs`:
- Around line 184-193: Remove the stray debug print in the account-meta
construction block: delete the println!("config.with_anchor_none {}",
config.with_anchor_none); line so the function that builds metas (the code using
config, metas, AccountMeta::new/AccountMeta::new_readonly and
default_pubkeys.compressed_token_program) has no runtime side effects; ensure no
other debug prints remain in that scope.

In `@sdk-libs/event/src/event.rs`:
- Around line 10-18: Add comprehensive struct-level doc comments for
PublicTransactionEvent and BatchPublicTransactionEvent (and update
event_from_light_transaction docs) describing the purpose and semantics of each
public field: for PublicTransactionEvent explain it holds compressed
input/output account hashes and their meanings; for BatchPublicTransactionEvent
document event, new_addresses, input_sequence_numbers, address_sequence_numbers,
tx_hash, and batch_input_accounts (what each represents and any invariants,
e.g., ordering or length relationships). Place these docs above the respective
struct declarations (PublicTransactionEvent, BatchPublicTransactionEvent) and
extend the doc for event_from_light_transaction to note how it constructs these
types and any expectations about inputs/outputs per the project coding
guidelines.

In `@sdk-libs/macros/src/light_pdas/program/instructions.rs`:
- Around line 771-776: The comment/identifier drift: rename the function
generate_ctoken_seed_provider_implementation in the seed_codegen module to
generate_light_token_seed_provider_implementation (and update any sibling
functions that include "ctoken") and then update all call sites (e.g., the
invocation in program/instructions.rs), public exports, use/imports, docs, and
tests to the new name; search the seed_codegen module for any remaining "ctoken"
identifiers and replace them consistently, run cargo build/test to ensure
nothing breaks, or if you prefer not to rename now create a tracking issue
describing the rename from generate_ctoken_seed_provider_implementation →
generate_light_token_seed_provider_implementation and list all seed_codegen
siblings that need the same change.

In `@sdk-libs/program-test/src/forester/compress_and_close_forester.rs`:
- Line 44: The code hardcodes current_epoch = 0 which causes
get_forester_epoch_pda_from_authority to derive the wrong PDA; replace the
literal with a runtime fetch of the real epoch (e.g., call the indexer or RPC to
get the current protocol epoch or use the registry program's epoch getter) and
assign that value to current_epoch before calling
get_forester_epoch_pda_from_authority so the derived PDA matches the active
registered forester.
- Around line 50-56: The code constructs a dummy CompressibleConfig via
CompressibleConfig::light_token_v1 which yields a default/computed
compression_authority that is incorrect — remove the debug println! and stop
using config.compression_authority; instead pass the extracted on-chain
authority variable compression_authority_pubkey (previously derived from
current_authority in the account extension parsing) into
build_compress_and_close_instruction so the instruction uses the real
compression authority account already added to packed accounts; update any
AccountMeta creation to reference compression_authority_pubkey (preserving
writable/signer flags as required) rather than
Pubkey::default()/config.compression_authority.

In `@sdk-libs/sdk-types/src/interface/cpi/create_mints.rs`:
- Around line 868-873: The function get_output_queue_next_index currently reads
a u64 from the account bytes at NEXT_INDEX_OFFSET then returns it cast with as
u32 which silently truncates on overflow; change get_output_queue_next_index to
return a u64 (or perform a checked cast using try_from and return an explicit
error on overflow) and update all call sites including
CreateMintsParams::base_leaf_index and the invoke_decompress invocation to
accept and propagate a u64 (or handle the explicit error) so no u64→u32 silent
truncation occurs when reading NEXT_INDEX_OFFSET.

In `@sdk-libs/token-pinocchio/src/instruction/burn.rs`:
- Around line 20-29: The example doc for BurnCpi is stale because it includes a
nonexistent field `max_top_up`; update the snippet in burn.rs to remove
`max_top_up: None` so the struct initializer matches the current BurnCpi fields
(e.g., keep `system_program: &ctx.accounts.system_program, fee_payer: None` and
ensure the order/field names match the BurnCpi definition).

In `@sdk-libs/token-pinocchio/src/instruction/mint_to.rs`:
- Around line 13-30: Update the stale doc example for MintToCpi: remove the
nonexistent max_top_up field and ensure the current fields are shown (e.g.,
mint, destination, amount, authority, system_program, and fee_payer) so the
example matches the MintToCpi struct; locate the example in the mint_to.rs doc
block that references MintToCpi and replace the struct literal to include
fee_payer (and any other current fields) and omit max_top_up.

In `@sdk-libs/token-sdk/src/instruction/compressible.rs`:
- Around line 84-85: Update the doctest example to use the actual module paths:
replace references to ctoken::LIGHT_TOKEN_CONFIG and ctoken::RENT_SPONSOR with
light_token::constants::LIGHT_TOKEN_CONFIG and
light_token::constants::RENT_SPONSOR, and replace ctoken::config_pda() and
ctoken::rent_sponsor_pda() with the re-exported light_token::config_pda() (and
if needed light_token::rent_sponsor_pda() or the constant in
light_token::constants), so the example imports and calls the correct symbols
(refer to LIGHT_TOKEN_CONFIG, RENT_SPONSOR, config_pda, rent_sponsor_pda in the
doctest).

In `@sdk-libs/token-sdk/src/instruction/decompress.rs`:
- Line 63: Update the leftover doc comment in
sdk-libs/token-sdk/src/instruction/decompress.rs that reads "/// Destination
cToken account (must exist)" to use the new terminology "light-token" (e.g.,
"/// Destination light-token account (must exist)"), ensuring the field/argument
comment in the decompress instruction matches the PR-wide rename.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 12bec0c and e65124a.

⛔ Files ignored due to path filters (26)
  • sdk-tests/CLAUDE.md is excluded by none and included by none
  • sdk-tests/anchor-semi-manual-test/tests/shared/mod.rs is excluded by none and included by none
  • sdk-tests/anchor-semi-manual-test/tests/test_create_all.rs is excluded by none and included by none
  • sdk-tests/anchor-semi-manual-test/tests/test_create_ata.rs is excluded by none and included by none
  • sdk-tests/client-test/tests/light_client.rs is excluded by none and included by none
  • sdk-tests/client-test/tests/light_program_test.rs is excluded by none and included by none
  • sdk-tests/csdk-anchor-full-derived-test/tests/amm_test.rs is excluded by none and included by none
  • sdk-tests/csdk-anchor-full-derived-test/tests/mint/metadata_test.rs is excluded by none and included by none
  • sdk-tests/pinocchio-light-program-test/tests/shared/mod.rs is excluded by none and included by none
  • sdk-tests/pinocchio-light-program-test/tests/stress_test.rs is excluded by none and included by none
  • sdk-tests/pinocchio-manual-test/src/all/accounts.rs is excluded by none and included by none
  • sdk-tests/pinocchio-manual-test/src/all/mod.rs is excluded by none and included by none
  • sdk-tests/pinocchio-manual-test/src/two_mints/mod.rs is excluded by none and included by none
  • sdk-tests/pinocchio-manual-test/tests/account_loader.rs is excluded by none and included by none
  • sdk-tests/pinocchio-manual-test/tests/all.rs is excluded by none and included by none
  • sdk-tests/pinocchio-manual-test/tests/two_mints.rs is excluded by none and included by none
  • sdk-tests/sdk-light-token-pinocchio/README.md is excluded by none and included by none
  • sdk-tests/sdk-light-token-pinocchio/tests/test_create_mint.rs is excluded by none and included by none
  • sdk-tests/sdk-light-token-test/README.md is excluded by none and included by none
  • sdk-tests/sdk-light-token-test/tests/scenario_spl.rs is excluded by none and included by none
  • sdk-tests/sdk-light-token-test/tests/shared.rs is excluded by none and included by none
  • sdk-tests/sdk-light-token-test/tests/test_create_mint.rs is excluded by none and included by none
  • sdk-tests/sdk-light-token-test/tests/test_transfer_checked.rs is excluded by none and included by none
  • sdk-tests/sdk-light-token-test/tests/test_transfer_interface.rs is excluded by none and included by none
  • sdk-tests/single-account-loader-test/tests/test.rs is excluded by none and included by none
  • sdk-tests/single-ata-test/tests/test.rs is excluded by none and included by none
📒 Files selected for processing (88)
  • sdk-libs/account-pinocchio/src/lib.rs
  • sdk-libs/account/src/lib.rs
  • sdk-libs/client/src/interface/create_accounts_proof.rs
  • sdk-libs/compressed-token-sdk/README.md
  • sdk-libs/compressed-token-sdk/src/compat.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/mod.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v1/approve/account_metas.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v1/approve/instruction.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v1/batch_compress/account_metas.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/account_infos.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/account_metas.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v1/transfer/instruction.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v2/account2.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v2/compress_and_close.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v2/create_compressed_mint/account_metas.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v2/create_compressed_mint/instruction.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v2/decompress_full.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_action/account_metas.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_action/mod.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_to_compressed/account_metas.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v2/transfer2/account_metas.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v2/transfer2/instruction.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v2/update_compressed_mint/account_metas.rs
  • sdk-libs/compressed-token-sdk/src/compressed_token/v2/update_compressed_mint/instruction.rs
  • sdk-libs/compressed-token-sdk/src/lib.rs
  • sdk-libs/compressed-token-sdk/src/spl_interface.rs
  • sdk-libs/compressed-token-sdk/src/utils.rs
  • sdk-libs/event/src/event.rs
  • sdk-libs/instruction-decoder/src/core.rs
  • sdk-libs/instruction-decoder/src/lib.rs
  • sdk-libs/instruction-decoder/src/programs/ctoken.rs
  • sdk-libs/instruction-decoder/src/programs/mod.rs
  • sdk-libs/macros/docs/accounts/architecture.md
  • sdk-libs/macros/docs/accounts/associated_token.md
  • sdk-libs/macros/docs/accounts/mint.md
  • sdk-libs/macros/src/lib.rs
  • sdk-libs/macros/src/light_pdas/accounts/derive.rs
  • sdk-libs/macros/src/light_pdas/accounts/light_account.rs
  • sdk-libs/macros/src/light_pdas/parsing/accounts_struct.rs
  • sdk-libs/macros/src/light_pdas/program/instructions.rs
  • sdk-libs/program-test/src/compressible.rs
  • sdk-libs/program-test/src/forester/claim_forester.rs
  • sdk-libs/program-test/src/forester/compress_and_close_forester.rs
  • sdk-libs/program-test/src/program_test/test_rpc.rs
  • sdk-libs/sdk-types/src/cpi_context_write.rs
  • sdk-libs/sdk-types/src/interface/account/compression_info.rs
  • sdk-libs/sdk-types/src/interface/accounts/create_accounts.rs
  • sdk-libs/sdk-types/src/interface/cpi/create_mints.rs
  • sdk-libs/sdk-types/src/interface/cpi/create_token_accounts.rs
  • sdk-libs/sdk-types/src/interface/program/decompression/processor.rs
  • sdk-libs/sdk/src/lib.rs
  • sdk-libs/token-client/src/actions/create_mint.rs
  • sdk-libs/token-pinocchio/src/instruction/approve.rs
  • sdk-libs/token-pinocchio/src/instruction/burn.rs
  • sdk-libs/token-pinocchio/src/instruction/burn_checked.rs
  • sdk-libs/token-pinocchio/src/instruction/close.rs
  • sdk-libs/token-pinocchio/src/instruction/create.rs
  • sdk-libs/token-pinocchio/src/instruction/create_ata.rs
  • sdk-libs/token-pinocchio/src/instruction/create_mint.rs
  • sdk-libs/token-pinocchio/src/instruction/create_mints.rs
  • sdk-libs/token-pinocchio/src/instruction/freeze.rs
  • sdk-libs/token-pinocchio/src/instruction/mint_to.rs
  • sdk-libs/token-pinocchio/src/instruction/mint_to_checked.rs
  • sdk-libs/token-pinocchio/src/instruction/revoke.rs
  • sdk-libs/token-pinocchio/src/instruction/thaw.rs
  • sdk-libs/token-pinocchio/src/instruction/transfer.rs
  • sdk-libs/token-pinocchio/src/instruction/transfer_checked.rs
  • sdk-libs/token-pinocchio/src/instruction/transfer_from_spl.rs
  • sdk-libs/token-pinocchio/src/instruction/transfer_to_spl.rs
  • sdk-libs/token-sdk/src/instruction/burn.rs
  • sdk-libs/token-sdk/src/instruction/burn_checked.rs
  • sdk-libs/token-sdk/src/instruction/close.rs
  • sdk-libs/token-sdk/src/instruction/compressible.rs
  • sdk-libs/token-sdk/src/instruction/create.rs
  • sdk-libs/token-sdk/src/instruction/create_associated_token_account.rs
  • sdk-libs/token-sdk/src/instruction/create_ata.rs
  • sdk-libs/token-sdk/src/instruction/decompress.rs
  • sdk-libs/token-sdk/src/instruction/decompress_mint.rs
  • sdk-libs/token-sdk/src/instruction/mint_to.rs
  • sdk-libs/token-sdk/src/instruction/mint_to_checked.rs
  • sdk-libs/token-sdk/src/instruction/transfer.rs
  • sdk-libs/token-sdk/src/instruction/transfer_checked.rs
  • sdk-libs/token-sdk/src/instruction/transfer_from_spl.rs
  • sdk-libs/token-sdk/src/instruction/transfer_to_spl.rs
  • sdk-libs/token-types/src/account_infos/mint_to_compressed.rs
  • sdk-libs/token-types/src/account_infos/transfer.rs
  • sdk-libs/token-types/src/error.rs
  • sdk-libs/token-types/src/lib.rs

}

// Optional decompressed mint accounts
// Optional light mint account accounts
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix duplicated word in inline comment.

“Optional light mint account accounts” should be simplified for readability.

✏️ Suggested edit
-    // Optional light mint account accounts
+    // Optional light mint accounts
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Optional light mint account accounts
// Optional light mint accounts
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@sdk-libs/compressed-token-sdk/src/compressed_token/v2/mint_to_compressed/account_metas.rs`
at line 167, Update the duplicated-word inline comment in account_metas.rs that
currently reads "Optional light mint account accounts" (near the Optional light
mint account accounts comment) to a clearer phrase such as "Optional light mint
accounts" so the comment is concise and readable; locate the comment in the
compressed_token/v2/mint_to_compressed/account_metas.rs file and replace the
text accordingly.

//! Generic CPI for creating multiple light mints.
//!
//! This module provides framework-agnostic mint creation via `CreateMintsCpi`,
//! generic over `AccountInfoTrait`. Account order matches the cToken program
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Stale cToken program reference — rename missed on this line.

The PR renames cTokenLight Token throughout comments, but line 4 still says "the cToken program". This is the one spot in the file the automated rename didn't catch.

📝 Proposed fix
-/// generic over `AccountInfoTrait`. Account order matches the cToken program
+/// generic over `AccountInfoTrait`. Account order matches the Light Token program
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
//! generic over `AccountInfoTrait`. Account order matches the cToken program
//! generic over `AccountInfoTrait`. Account order matches the Light Token program
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk-libs/sdk-types/src/interface/cpi/create_mints.rs` at line 4, Update the
stale comment string "generic over `AccountInfoTrait`. Account order matches the
cToken program" in create_mints.rs so it uses the new product name (replace
"cToken program" with "Light Token program"); locate the comment in the
module/doc comment near the top of create_mints.rs and perform the exact textual
rename to keep the rest of the comment (including the reference to
`AccountInfoTrait`) unchanged.

Comment on lines +330 to 331
// Token (light-token) accounts layout (only required when token accounts are present):
// [3] ctoken_rent_sponsor, [6] ctoken_compressible_config
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor clarity nit: mixed new prose and old identifier names in adjacent comment lines.

Line 330 now reads "light-token" while Line 331 still names the struct fields using the legacy ctoken_ prefix — this is intentional per the PR's exclusion policy, but readers may find the juxtaposition jarring. Consider annotating it so the intent is clear:

-    // Token (light-token) accounts layout (only required when token accounts are present):
-    // [3] ctoken_rent_sponsor, [6] ctoken_compressible_config
+    // Token (light-token) accounts layout (only required when token accounts are present):
+    // [3] ctoken_rent_sponsor (field name), [6] ctoken_compressible_config (field name)
+    //     ^ legacy identifiers intentionally kept; only doc wording is renamed in this PR
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Token (light-token) accounts layout (only required when token accounts are present):
// [3] ctoken_rent_sponsor, [6] ctoken_compressible_config
// Token (light-token) accounts layout (only required when token accounts are present):
// [3] ctoken_rent_sponsor (field name), [6] ctoken_compressible_config (field name)
// ^ legacy identifiers intentionally kept; only doc wording is renamed in this PR
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk-libs/sdk-types/src/interface/program/decompression/processor.rs` around
lines 330 - 331, The adjacent comment mixes the new "light-token" wording with
legacy struct field names (ctoken_rent_sponsor, ctoken_compressible_config);
update the comment near the token accounts layout to add a brief annotation
stating that "light-token" is the new terminology while the ctoken_* identifiers
are legacy field names kept for compatibility/PR exclusion, e.g. a short
parenthetical like "(\"light-token\" terminology used here; legacy field names
ctoken_rent_sponsor, ctoken_compressible_config retained intentionally)"; place
this annotation on the same or next line to make the intent explicit.

}

/// # Transfer SPL to ctoken via CPI:
/// # Transfer SPL to light-token via CPI:
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

There’s still one stale cToken reference in this doc block.

Line 15 still reads “Create a transfer SPL to cToken instruction,” which conflicts with the rename objective and the updated light-token wording below.

Suggested doc fix
-/// # Create a transfer SPL to cToken instruction
+/// # Create a transfer SPL to light-token instruction
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk-libs/token-sdk/src/instruction/transfer_from_spl.rs` at line 54, Update
the stale cToken reference in the top doc comment of transfer_from_spl.rs: find
the line that reads "Create a transfer SPL to cToken instruction" and change it
to "Create a transfer SPL to light-token instruction" (or similar consistent
light-token wording) so the doc block matches the renamed/light-token
terminology elsewhere in this module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant