Skip to content

fix: require custom rent sponsor to sign#2125

Merged
ananas-block merged 1 commit intomainfrom
jorrit/fix-account-creation-edge-case
Dec 9, 2025
Merged

fix: require custom rent sponsor to sign#2125
ananas-block merged 1 commit intomainfrom
jorrit/fix-account-creation-edge-case

Conversation

@ananas-block
Copy link
Contributor

@ananas-block ananas-block commented Dec 9, 2025

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Implemented validation checks to ensure custom rent payers must be authorized signers when creating token accounts. Transactions with non-signer rent payers will now be rejected with an error.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Walkthrough

The PR adds validation checks in two token account creation functions to enforce that custom rent payers must be signers, preventing unauthorized sponsorship. If a custom rent payer is detected but is not a signer, the code returns ProgramError::MissingRequiredSignature and short-circuits execution.

Changes

Cohort / File(s) Summary
Rent Payer Signer Validation
programs/compressed-token/program/src/create_associated_token_account.rs, programs/compressed-token/program/src/create_token_account.rs
Adds validation branch in each function to verify that when a custom rent payer is used (one distinct from the default rent sponsor PDA), that payer must be a signer. Logs an error and returns ProgramError::MissingRequiredSignature if validation fails, preventing non-signer accounts from being used as rent sponsors.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Consistent, straightforward validation logic applied across two functions
  • Changes are narrowly scoped with clear intent
  • Areas for attention: Verify that the validation checkpoint is positioned before any account state mutation or fund transfers; confirm error messaging is consistent and appropriate for auditing purposes.

Possibly related PRs

  • fix: robust account creation #2097 — Modifies the same account-creation functions and handles custom rent-payer / fee-payer seed and signer logic, suggesting alignment with broader fee-payer security improvements.

Suggested labels

ai-review

Suggested reviewers

  • sergeytimoshin
  • SwenSchaeferjohann

Poem

🔐 A signer must sign when rents are on the line,
No phantom accounts in the account design—
Validation stands guard at the gate's first door,
Keeping unauthorized sponsors out forevermore! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding validation to ensure custom rent sponsors sign transactions, which is the core security fix across both modified files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 70.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jorrit/fix-account-creation-edge-case

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

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
programs/compressed-token/program/src/create_associated_token_account.rs (1)

191-202: Custom rent payer signer guard is correct; consider clarifying the comment

The new guard

let custom_rent_payer =
    *rent_payer.key() != compressible_config_account.rent_sponsor.to_bytes();

// Prevents setting executable accounts as rent_sponsor
if custom_rent_payer && !rent_payer.is_signer() {
    msg!("Custom rent payer must be a signer");
    return Err(ProgramError::MissingRequiredSignature);
}

is logically sound: when using a custom rent payer (i.e., not the rent_sponsor PDA), requiring is_signer() ensures only accounts that can actually authorize lamport debits (including PDAs via invoke_signed) are used as sponsors, and it blocks misuse of non-signer/executable accounts.

Minor nit: the comment is slightly misleading. At this point custom_rent_payer is true, so you’re really preventing non‑signer custom rent payers, not “executable accounts as rent_sponsor”. Something like:

// Prevent using non-signer (e.g. executable) accounts as custom rent payer

would match the condition more precisely. Behavior is otherwise good as-is and aligns with the rent_sponsor PDA design described in the compressible CONFIG docs. Based on learnings, ...

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4056b66 and 60f47c0.

⛔ Files ignored due to path filters (2)
  • program-tests/compressed-token-test/tests/ctoken/create.rs is excluded by none and included by none
  • program-tests/compressed-token-test/tests/ctoken/create_ata.rs is excluded by none and included by none
📒 Files selected for processing (2)
  • programs/compressed-token/program/src/create_associated_token_account.rs (1 hunks)
  • programs/compressed-token/program/src/create_token_account.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
programs/**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

Unit tests in programs must not depend on light-test-utils; integration tests must be located in program-tests/

Files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
  • programs/compressed-token/program/src/create_token_account.rs
programs/compressed-token/program/src/create_token_account.rs

📄 CodeRabbit inference engine (programs/compressed-token/program/CLAUDE.md)

Create token account instructions (CreateTokenAccount, CreateAssociatedCTokenAccount, CreateAssociatedTokenAccountIdempotent) require ACTIVE config validation only

Files:

  • programs/compressed-token/program/src/create_token_account.rs
🧠 Learnings (29)
📓 Common learnings
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/SOLANA_RENT.md:0-0
Timestamp: 2025-11-24T18:00:48.449Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : Light Protocol accounts must satisfy both Solana rent exemption and Light Protocol rent requirements, plus an 11,000 lamport compression incentive during creation
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_state_tree.rs : Use `check_account_balance_is_rent_exempt` function from `light-account-checks` to verify rent exemption for both queue_account and merkle_tree_account during initialization
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/ERRORS.md:0-0
Timestamp: 2025-11-24T17:59:46.693Z
Learning: Applies to program-libs/account-checks/docs/program-libs/account-checks/src/checks/**/*.rs : Validation functions (check_owner, check_signer, check_discriminator, check_pda_seeds) must return specific AccountError variants as documented: check_owner returns AccountOwnedByWrongProgram (20001), check_signer returns InvalidSigner (20009), check_discriminator returns InvalidDiscriminator (20000) or InvalidAccountSize (20004), check_pda_seeds returns InvalidSeeds (20010)
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-12-07T03:17:42.199Z
Learning: Applies to program-libs/account-checks/**/checks.rs : Implement permission check functions (`check_mut`, `check_non_mut`, `check_signer`) for account state validation
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/DISCRIMINATOR.md:0-0
Timestamp: 2025-11-24T17:59:36.701Z
Learning: Applies to program-libs/account-checks/docs/**/account-checks/**/*.rs : Use check_account_info<T> function for full account validation including discriminator and ownership checks
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/ACCOUNT_ITERATOR.md:0-0
Timestamp: 2025-11-24T17:59:13.714Z
Learning: Applies to program-libs/account-checks/docs/**/*.rs : Validate account permissions (signers and mutability) early in instruction processing using AccountIterator methods
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-07T18:10:14.595Z
Learning: Applies to programs/compressed-token/program/{src/claim/*.rs,src/withdraw_funding_pool.rs} : Rent management instructions (Claim, WithdrawFundingPool) require validation that config is not INACTIVE (accepts ACTIVE or DEPRECATED states)
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-12-07T03:17:42.199Z
Learning: Applies to program-libs/account-checks/**/checks.rs : Implement rent exemption checks (`check_account_balance_is_rent_exempt`) in checks module
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-12-07T03:17:42.199Z
Learning: Applies to program-libs/account-checks/**/checks.rs : Provide account ownership validation functions (`check_owner`, `check_program`) in checks module
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/DISCRIMINATOR.md:0-0
Timestamp: 2025-11-24T17:59:36.701Z
Learning: Applies to program-libs/account-checks/docs/**/account-checks/**/*.rs : Ensure discriminator validation is Anchor-compatible by using sha256 hashing for consistency with Anchor accounts
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:59:23.357Z
Learning: Applies to program-libs/account-checks/docs/src/**/checks.rs : Implement comprehensive validation functions in the checks module covering ownership validation, permission checks, discriminator handling, and PDA verification
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/ACCOUNT_CHECKS.md:0-0
Timestamp: 2025-11-24T17:58:50.237Z
Learning: Applies to program-libs/account-checks/docs/program-libs/account-checks/src/checks.rs : Implement `check_signer` function to verify account is a transaction signer, returning `InvalidSigner` (20009) error if not
📚 Learning: 2025-12-07T18:10:14.595Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-07T18:10:14.595Z
Learning: Applies to programs/compressed-token/program/src/create_token_account.rs : Create token account instructions (CreateTokenAccount, CreateAssociatedCTokenAccount, CreateAssociatedTokenAccountIdempotent) require ACTIVE config validation only

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-12-07T18:10:14.595Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-07T18:10:14.595Z
Learning: Applies to programs/compressed-token/program/src/close_token_account.rs : Close token account instruction must return rent exemption to rent recipient if compressible and remaining lamports to destination account

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-12-07T18:10:14.595Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: programs/compressed-token/program/CLAUDE.md:0-0
Timestamp: 2025-12-07T18:10:14.595Z
Learning: Applies to programs/compressed-token/program/{src/claim/*.rs,src/withdraw_funding_pool.rs} : Rent management instructions (Claim, WithdrawFundingPool) require validation that config is not INACTIVE (accepts ACTIVE or DEPRECATED states)

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-12-07T18:09:57.230Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/CONFIG_ACCOUNT.md:0-0
Timestamp: 2025-12-07T18:09:57.230Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : CompressibleConfig account state in Solana programs must validate active state using `validate_active()` method before allowing new compressible token account creation

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.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 state validation methods (`validate_active`, `validate_not_inactive`) on CompressibleConfig account structure

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
📚 Learning: 2025-12-07T03:17:42.199Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-12-07T03:17:42.199Z
Learning: Applies to program-libs/account-checks/**/checks.rs : Implement rent exemption checks (`check_account_balance_is_rent_exempt`) in checks module

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-11-24T17:56:50.011Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_state_tree.rs : Use `check_account_balance_is_rent_exempt` function from `light-account-checks` to verify rent exemption for both queue_account and merkle_tree_account during initialization

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
📚 Learning: 2025-11-24T17:57:39.230Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/QUEUE_ACCOUNT.md:0-0
Timestamp: 2025-11-24T17:57:39.230Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/queue.rs : Validate account ownership by Light account compression program using `check_owner` from `light-account-checks` when deserializing `BatchedQueueAccount` with `output_from_account_info`

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
📚 Learning: 2025-12-07T18:09:57.230Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/CONFIG_ACCOUNT.md:0-0
Timestamp: 2025-12-07T18:09:57.230Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : Anchor deserialization of CompressibleConfig must use `AccountDeserialize::try_deserialize()` which automatically validates the discriminator to prevent invalid account type mismatches

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
📚 Learning: 2025-11-24T18:00:48.449Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/SOLANA_RENT.md:0-0
Timestamp: 2025-11-24T18:00:48.449Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : Light Protocol accounts must satisfy both Solana rent exemption and Light Protocol rent requirements, plus an 11,000 lamport compression incentive during creation

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
📚 Learning: 2025-11-24T18:00:36.663Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/RENT.md:0-0
Timestamp: 2025-11-24T18:00:36.663Z
Learning: Applies to program-libs/compressible/docs/**/*rent*.rs : Implement `calculate_rent_and_balance` function to determine compressibility by checking if account balance covers required rent for epochs since last claim, returning (bool, u64) tuple.

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
📚 Learning: 2025-11-24T17:56:50.011Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_STATE_TREE.md:0-0
Timestamp: 2025-11-24T17:56:50.011Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_state_tree.rs : Return error `AccountError::AccountNotRentExempt` (error code 12011) when account balance is insufficient for rent exemption at calculated size

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-11-24T18:00:21.501Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/ERRORS.md:0-0
Timestamp: 2025-11-24T18:00:21.501Z
Learning: Applies to program-libs/compressible/docs/program-libs/compressible/src/error.rs : FailedBorrowRentSysvar (Error Code 19001): Ensure the rent sysvar is properly initialized in test environments and verify the sysvar is accessible for on-chain programs. Use `solana_program::rent::Rent::get()` with proper error handling for borrowing rent sysvar.

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
📚 Learning: 2025-11-24T17:58:50.237Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/ACCOUNT_CHECKS.md:0-0
Timestamp: 2025-11-24T17:58:50.237Z
Learning: Applies to program-libs/account-checks/docs/program-libs/account-checks/src/checks.rs : Implement `check_account_balance_is_rent_exempt` function to verify account size matches expected_size and account balance meets rent exemption requirement, returning rent exemption amount or errors `InvalidAccountSize` (20004), `InvalidAccountBalance` (20007), or `FailedBorrowRentSysvar` (20008)

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-11-24T17:56:20.711Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/batched-merkle-tree/docs/INITIALIZE_ADDRESS_TREE.md:0-0
Timestamp: 2025-11-24T17:56:20.711Z
Learning: Applies to program-libs/batched-merkle-tree/docs/src/initialize_address_tree.rs : Verify merkle_tree_account balance is rent-exempt in `src/initialize_address_tree.rs`. Use `check_account_balance_is_rent_exempt` from `light-account-checks` library. Return error `AccountError::AccountNotRentExempt` (error code: 12011) if account balance is insufficient for rent exemption at calculated size.

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
  • programs/compressed-token/program/src/create_token_account.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/rent.rs : Implement rent calculation functions including `rent_curve_per_epoch`, `calculate_rent_and_balance`, `claimable_lamports`, and `calculate_close_lamports` in rent.rs

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
📚 Learning: 2025-12-07T18:09:57.230Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/CONFIG_ACCOUNT.md:0-0
Timestamp: 2025-12-07T18:09:57.230Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : CompressibleConfig rent_sponsor PDA and compression_authority PDA must be derived separately using `get_rent_sponsor_seeds()` and `get_compression_authority_seeds()` helper methods with version-specific seeds

Applied to files:

  • programs/compressed-token/program/src/create_associated_token_account.rs
  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-11-24T17:59:54.233Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/PACKED_ACCOUNTS.md:0-0
Timestamp: 2025-11-24T17:59:54.233Z
Learning: Applies to program-libs/account-checks/docs/program-libs/account-checks/src/**/*.rs : Provide descriptive names in ProgramPackedAccounts error messages (e.g., 'token_mint' instead of 'account')

Applied to files:

  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-12-07T03:17:42.199Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-12-07T03:17:42.199Z
Learning: Applies to program-libs/account-checks/**/checks.rs : Provide account ownership validation functions (`check_owner`, `check_program`) in checks module

Applied to files:

  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-11-24T17:59:36.701Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/DISCRIMINATOR.md:0-0
Timestamp: 2025-11-24T17:59:36.701Z
Learning: Applies to program-libs/account-checks/docs/**/account-checks/**/*.rs : Use check_account_info<T> function for full account validation including discriminator and ownership checks

Applied to files:

  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-11-24T17:59:46.693Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/ERRORS.md:0-0
Timestamp: 2025-11-24T17:59:46.693Z
Learning: Applies to program-libs/account-checks/docs/program-libs/account-checks/src/checks/**/*.rs : Validation functions (check_owner, check_signer, check_discriminator, check_pda_seeds) must return specific AccountError variants as documented: check_owner returns AccountOwnedByWrongProgram (20001), check_signer returns InvalidSigner (20009), check_discriminator returns InvalidDiscriminator (20000) or InvalidAccountSize (20004), check_pda_seeds returns InvalidSeeds (20010)

Applied to files:

  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-12-07T03:17:42.199Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/CLAUDE.md:0-0
Timestamp: 2025-12-07T03:17:42.199Z
Learning: Applies to program-libs/account-checks/**/checks.rs : Implement permission check functions (`check_mut`, `check_non_mut`, `check_signer`) for account state validation

Applied to files:

  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-11-24T17:59:23.357Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/CLAUDE.md:0-0
Timestamp: 2025-11-24T17:59:23.357Z
Learning: Applies to program-libs/account-checks/docs/src/**/checks.rs : Implement comprehensive validation functions in the checks module covering ownership validation, permission checks, discriminator handling, and PDA verification

Applied to files:

  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-11-24T17:58:50.237Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/ACCOUNT_CHECKS.md:0-0
Timestamp: 2025-11-24T17:58:50.237Z
Learning: Applies to program-libs/account-checks/docs/program-libs/account-checks/src/checks.rs : Implement `check_pda_seeds` function to derive PDA using `find_program_address` and verify it matches account key, returning `InvalidSeeds` (20010) error on mismatch

Applied to files:

  • programs/compressed-token/program/src/create_token_account.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 PDA derivation methods (`derive_pda`, `derive_v1_config_pda`) on CompressibleConfig for account discovery

Applied to files:

  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-11-24T17:58:50.237Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/ACCOUNT_CHECKS.md:0-0
Timestamp: 2025-11-24T17:58:50.237Z
Learning: Applies to program-libs/account-checks/docs/program-libs/account-checks/src/checks.rs : Implement `check_pda_seeds_with_bump` function to verify PDA with known bump seed using `create_program_address`, returning `InvalidSeeds` (20010) error on mismatch

Applied to files:

  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-12-07T18:09:57.230Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/compressible/docs/CONFIG_ACCOUNT.md:0-0
Timestamp: 2025-12-07T18:09:57.230Z
Learning: Applies to program-libs/compressible/docs/**/*.rs : CompressibleConfig PDA must be derived using seeds `[b"compressible_config", version.to_le_bytes()]` with the stored bump seed for deterministic account address generation in Light Protocol

Applied to files:

  • programs/compressed-token/program/src/create_token_account.rs
📚 Learning: 2025-11-24T17:58:50.237Z
Learnt from: CR
Repo: Lightprotocol/light-protocol PR: 0
File: program-libs/account-checks/docs/ACCOUNT_CHECKS.md:0-0
Timestamp: 2025-11-24T17:58:50.237Z
Learning: Applies to program-libs/account-checks/docs/program-libs/account-checks/src/checks.rs : Implement `check_signer` function to verify account is a transaction signer, returning `InvalidSigner` (20009) error if not

Applied to files:

  • programs/compressed-token/program/src/create_token_account.rs
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: system-programs (sdk-libs, light-sdk-macros light-sdk light-program-test light-client light-ctoke...
  • GitHub Check: system-programs (anchor & pinocchio, ["cargo-test-sbf -p sdk-anchor-test", "cargo-test-sbf -p sdk...
  • GitHub Check: system-programs (native, ["cargo-test-sbf -p sdk-native-test", "cargo-test-sbf -p sdk-v1-native-t...
  • GitHub Check: cli-v2
  • GitHub Check: stateless-js-v2
  • GitHub Check: cli-v1
  • GitHub Check: Forester e2e 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-v2-functional-account-infos, ["cargo-test-sbf -p system-cpi-v2-test -- ...
  • GitHub Check: programs (account-compression-and-registry, ["cargo-test-sbf -p account-compression-test", "cargo...
  • GitHub Check: programs (light-system-program-address, ["cargo-test-sbf -p system-test -- test_with_address", "c...
  • GitHub Check: programs (compressed-token-and-e2e, ["cargo test -p light-compressed-token", "cargo-test-sbf -p c...
  • GitHub Check: programs (system-cpi-test, ["cargo-test-sbf -p system-cpi-test", "cargo test -p light-system-prog...
  • GitHub Check: stateless-js-v1

@ananas-block ananas-block merged commit 1d64a75 into main Dec 9, 2025
29 checks passed
@ananas-block ananas-block deleted the jorrit/fix-account-creation-edge-case branch December 9, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants