Skip to content

chore: increase mint cache robustness#2237

Merged
ananas-block merged 1 commit intomainfrom
jorrit/chore-increase-mint-check-robustness
Feb 6, 2026
Merged

chore: increase mint cache robustness#2237
ananas-block merged 1 commit intomainfrom
jorrit/chore-increase-mint-check-robustness

Conversation

@ananas-block
Copy link
Contributor

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

Summary by CodeRabbit

Bug Fixes

  • Enhanced validation for token compression operations with improved error detection when cache data is unavailable
  • Strengthened error handling and diagnostic messaging to provide clearer feedback during compression workflows

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

This pull request adds a new error variant MintNotInCache to the error code enum and implements validation to enforce that the mint extension exists in the cache, returning the error if the mint is missing instead of handling a None value.

Changes

Cohort / File(s) Summary
Error Definition
programs/compressed-token/anchor/src/lib.rs
Added new error variant MintNotInCache (code 6172) with diagnostic message indicating a missing mint in cache, representing an internal error condition.
Cache Validation
programs/compressed-token/program/src/compressed_token/transfer2/compression/mod.rs
Added validation to enforce mint extension exists in cache; replaced Optional mint_checks handling with concrete value via error return; adjusted downstream call to pass Some(mint_checks) and simplified is_restricted derivation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

ai-review

Suggested reviewers

  • sergeytimoshin
  • SwenSchaeferjohann

Poem

A mint slipped through the cache's door,
Now errors catch what's lost before—
With code 6172, we stand our ground,
No ghosts in cache when we're around! 🏦✨

🚥 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 'chore: increase mint cache robustness' accurately reflects the main change: adding a MintNotInCache error and enforcing mint existence checks in the cache.
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/chore-increase-mint-check-robustness

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.

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