Skip to content

chore: csdk macros3#2062

Merged
ananas-block merged 6 commits intomainfrom
swen/csdk-macro-rent
Nov 24, 2025
Merged

chore: csdk macros3#2062
ananas-block merged 6 commits intomainfrom
swen/csdk-macro-rent

Conversation

@SwenSchaeferjohann
Copy link
Copy Markdown
Contributor

@SwenSchaeferjohann SwenSchaeferjohann commented Nov 18, 2025

stacked on top of #2020, merge 2020 first

  • rent impl for c-PDA.

reuses most of the rent impl of c-token, however we always transfer rent to the program's rent_sponsor pda, even if a different fee_payer paid for rent exemption.

for a rent v1 the benefits of this (saves account space, simpler) outweigh the cons. I think thats fair because the "fee" goes to the program's rent_sponsor PDA, funding the next user's PDA rent exemption.

  • added derive_rent_sponsor!(program_id) macro
  • allow rust expressions as seeds to add_compressible_instructions!() macro
  • allow seed references to other instruction accounts as well as instruction_data
  • made macros modular, moved processors to token-sdk and sdk (compress_runtime.rs, decompress_runtime.rs)

added tests for the macros at every level:

  • sdk-compressible-test is a manual implementation of the hooks
  • csdk-anchor-derived-test uses most smaller macros
  • csdk-anchor-full-derived-test uses add_compressible_instructions macro

Summary by CodeRabbit

  • New Features

    • New compressible macros/derives and runtime processors for idempotent compression/decompression (PDAs & tokens).
    • RentSponsor type and rent-sponsor PDA derivation helpers.
  • Documentation

    • Added comprehensive Compressible GUIDE and README with PDA-only, token, cToken, cMint, and client workflows.
  • Improvements

    • Config extended with compression authority, rent settings, and write top-up; simplified per-account idempotent compression flow and safer edge-case handling (fewer required parameters).

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

Loading
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