Skip to content

Conversation

@ananas-block
Copy link
Contributor

@ananas-block ananas-block commented Jan 29, 2026

New Features

  1. AccountLoader
  2. LightAccount trait
  3. decompress atas
  4. in light_account rename token::authority -> token::owner_seeds
  5. require all owner_seeds to be constant. Otherwise we cannot know that we are decompressing to the correct owner.
  6. in light_account require token::seeds
  7. all seeds are collected from within the light_account attribute (all in one place now and explicit)
  8. require a pda_rent_sponsor account info if light_account(init) is present
  9. added validation.rs files in macros/src/light_pdas/account and accounts to make it easier to review validations
  10. decompress_runtime: resize accounts that have a lamport balances but no data instead of failing on the create_account syscall
  11. CreateAccountsProofResult add system_accounts_offset
  12. rename COMPRESSIBLE_CONFIG_V1 -> LIGHT_TOKEN_CONFIG
  13. refactor rent sponsor pda to constant pda
  14. remove compress_account_on_init
  15. add discriminator to LightConfig

Refactors

  1. Create parsing pipeline for accounts structures - New modules consolidating parsing and extracting instruction arguments, accounts structs, and crate context
    from Rust AST
  2. Refactor token interface serialization - Update to use AnchorSerialize/AnchorDeserialize with IdlBuild trait implementations for UFCS compatibility
  3. Create comprehensive macro documentation - New documentation in sdk-libs/macros/docs/ covering architecture, design patterns, and refactored macro capabilities
  4. Update dependencies - Add bytemuck to test crates, local path for light-anchor-spl, add light-program-profiler and light-token-interface to compressed-token
    dependencies
  5. Update forester compressible PDA tests - Add pda_rent_sponsor parameter to test functions

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

Important

Review skipped

Too many files!

This PR contains 165 files, which is 15 over the limit of 150.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jorrit/feat-account-loader3

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 force-pushed the jorrit/feat-account-loader3 branch from 26e379b to 402c1d1 Compare January 29, 2026 16:57
- Field must be named `compression_info`
- Type must be `CompressionInfo` (not `Option<CompressionInfo>`)
- Must be **first or last** field in the struct
- Excluded from `PackedT` struct (saves 24 bytes in compressed form)
Copy link
Contributor

Choose a reason for hiding this comment

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

can clients still deserialize the compressed acc data using their regular UserRecord struct? is "compressed form" here != "when the account is compressed/cold"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah compressed account and account state both have CompressionInfo we just dont send it in instruction data

The LightAccount macro generates structs with non-Option CompressionInfo
as the first field, but extract_compression_info was trying to deserialize
Option<CompressionInfo>. This caused all PDA tracking to fail silently.
Comment on lines 120 to 145
// TODO: make compression_authority a signer and validate against config
let _compression_authority =
account_iter
.next_account("compression_authority")
.map_err(|e| {
solana_msg::msg!("compress: compression_authority failed: {:?}", e);
ProgramError::from(e)
})?;

// Load and validate config
let light_config = LightConfig::load_checked(config, program_id).map_err(|e| {
solana_msg::msg!("compress: LightConfig::load_checked failed: {:?}", e);
ProgramError::InvalidAccountData
})?;

// Validate rent_sponsor matches config
let _ = light_config
.validate_rent_sponsor(rent_sponsor)
.map_err(|e| {
solana_msg::msg!("compress: validate_rent_sponsor failed: {:?}", e);
e
})?;
// TODO: validate compression_authority matches config
// if *compression_authority.key != light_config.compression_authority {
// return Err(ProgramError::InvalidAccountData);
// }
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems compression_authority isn't checked against config / nor signer checked

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes its not used yet, I want to set compression authority to a pda of a proxy program but thats not implemented yet

@ananas-block ananas-block force-pushed the jorrit/feat-account-loader3 branch from e6b2434 to d467cd4 Compare January 30, 2026 05:14
@ananas-block ananas-block force-pushed the jorrit/feat-account-loader3 branch from fc6166b to 550b42d Compare January 30, 2026 17:48
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.

3 participants