refactor: expose DECOMPRESSED_DISCRIMINATOR and pubkey in decompressed accounts#2208
Conversation
📝 WalkthroughWalkthroughAdds a new public constant Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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: 2
🤖 Fix all issues with AI agents
In `@program-libs/compressible/src/lib.rs`:
- Around line 7-10: Update the doc comment for DECOMPRESSED_PDA_DISCRIMINATOR to
state that the decompressed PDA entry stores the raw PDA pubkey bytes in the
account data (not a hashed pubkey) and that the pubkey is hashed separately into
data_hash elsewhere; mention that this discriminator marks a compressed account
as a decompressed PDA placeholder so readers know where raw pubkey bytes are
stored and how the hash is derived later.
In `@sdk-libs/sdk/src/interface/compress_account_on_init.rs`:
- Around line 133-140: The code uses a temporary method call &account_info.key()
when calling set_decompressed_pda_output; update this to the established pattern
by passing a reference to the byte array from the field conversion used
elsewhere—replace the argument with &account_info.key.to_bytes() (keeping the
surrounding logic in the if !with_data branch where compressed_account,
account_info_result, with_data, and set_decompressed_pda_output are used) so the
call site matches decompress_idempotent.rs and stays consistent across the
codebase.
ac354b7 to
2de431e
Compare
Changes
Three files updated to handle decompressed mint placeholders:
mint_output.rs:
mint_input.rs:
zero_copy_config.rs:
Three files updated for generic PDA compression/decompression flows:
compress_account_on_init.rs:
compress_account.rs:
decompress_idempotent.rs:
Technical Details
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.