Skip to content

fix: allow to close frozen light token accounts#2243

Merged
ananas-block merged 1 commit intomainfrom
jorrit/fix-allow-to-close-frozen-token-accounts
Feb 9, 2026
Merged

fix: allow to close frozen light token accounts#2243
ananas-block merged 1 commit intomainfrom
jorrit/fix-allow-to-close-frozen-token-accounts

Conversation

@ananas-block
Copy link
Contributor

@ananas-block ananas-block commented Feb 5, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Frozen token accounts can now be successfully closed, aligning behavior with standard SPL Token operations.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

This change modifies token account validation in the close processor by introducing a new internal parser that relaxes frozen state restrictions. The new from_account_info_mut_for_close function allows closing frozen token accounts while still enforcing ownership checks and rejecting uninitialized states, aligning with SPL Token behavior.

Changes

Cohort / File(s) Summary
Close Processor State Validation
programs/compressed-token/program/src/ctoken/close/processor.rs
Introduces from_account_info_mut_for_close internal parser replacing strict state validation. Allows closing frozen accounts while rejecting uninitialized state, maintaining ownership and data integrity checks. Updates lamport-distribution path to use the new parser.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • fix: CToken checked deserialization #1995 — Relates to CToken zero-copy deserialization and account-state validation, though takes opposite direction by enforcing stricter Initialized checks versus this PR's relaxation for frozen account closure.

Suggested labels

ai-review

Suggested reviewers

  • sergeytimoshin
  • SwenSchaeferjohann

Poem

❄️ A frozen token's prison door swings wide,
State validation bends with careful pride,
No longer banned from closing their account,
SPL's blessing, aligned and profound! 🔐✨

🚥 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 clearly and concisely describes the main change: allowing frozen token accounts to be closed, which aligns with the core modification in the PR.
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
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jorrit/fix-allow-to-close-frozen-token-accounts

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.

@ananas-block ananas-block merged commit a36919a into main Feb 9, 2026
31 checks passed
@ananas-block ananas-block deleted the jorrit/fix-allow-to-close-frozen-token-accounts branch February 9, 2026 14:58
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