Skip to content

Conversation

@ananas-block
Copy link

Changes:

  1. new instructions including tests
  2. ci tests (integration, examples, rust lint)
  3. bump dependencies (pinocchio 0.9, forked pinocchio-token to bump the pinocchio version, solana 2.3.0)
  4. add rust format and lint scripts
  5. extend generate-clients.js with static compression accounts
  6. regenerate idls & clients
    • ts-client, added helpers:
      • deriveCompressedAttestationPda
      • fetchCompressedAttestation
  7. demos (compression rust, typescript gill and kit)
  8. fixed pinocchio-token initialize metadata instruction builder (tests didn't pass at least post version bump)

New Instructions:

  1. create compressed attestation
    • Same behavior as create attestation.
  2. close compressed attestation
    • Same behavior as close attestation.
  3. compress attestations
    • Only the credential authority can compress attestations.
    • Attestation pdas can be closed or not closed up on compression.

Tests

  1. create compressed attestation
    1. create_compressed_attestation_success
    2. create_compressed_attestation_invalid_data
    3. create_compressed_attestation_paused_schema
    4. create_compressed_attestation_unauthorized_signer
    5. create_compressed_attestation_expired
    6. create_compressed_attestation_wrong_credential
    7. create_compressed_attestation_wrong_address_tree
  2. close compressed attestation
    1. close_compressed_attestation_success
    2. close_compressed_attestation_unauthorized_signer
    3. close_compressed_attestation_wrong_credential
    4. close_compressed_attestation_paused_schema_success
    5. close_compressed_attestation_invalid_attestation_data
    6. close_compressed_attestation_max_data_size
  3. compress attestations
    1. test_compress_1_attestation_no_close
    2. test_compress_2_attestations_no_close
    3. test_compress_1_attestation_with_close
    4. test_compress_2_attestations_with_close
    5. test_compress_attestation_unauthorized_signer
    6. test_compress_attestation_wrong_credential
    7. test_compress_attestation_invalid_address_tree

TODO:

  • replace light git dependencies, and bump stateless.js version as soon as packages are released
  • add light cli to ci tests as soon as released
  • cleanup

feat: add lint and format scripts, chore: remove version bump warnings

feat: create compressed account

test: create compressed attestation

feat: add close compressed attestation

test: close compressed attestation

feat: compress attestations

test: compress attestations

fix: add minimum account size validation to prevent panics

- Add MIN_ATTESTATION_SIZE (173 bytes) check in attestation.rs
- Add MIN_CREDENTIAL_SIZE (41 bytes) check in credential.rs
- Add MIN_SCHEMA_SIZE (51 bytes) check in schema.rs
- Add MIN_INSTRUCTION_SIZE (174 bytes) check in create_compressed_attestation.rs
- Return InvalidAccountData/InvalidInstructionData on undersized buffers

fix: add account size validation for compressed attestations

- Add minimum size constants to prevent panics in try_from_bytes
- Add MAX_COMPRESSED_ATTESTATION_SIZE (350 bytes) to fit in 1232 byte mainnet MTU
- Apply validation in create_compressed_attestation and compress_attestations
- Add test verifying transaction sizes with 350 byte data

refactor: compress attestations, add constant accounts to codama clients

feat: add rust demo

feat: add gill example

feat: add kit example

fix: token22 tests

chore: add ci
Copy link
Contributor

@dev-jodee dev-jodee left a comment

Choose a reason for hiding this comment

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

Just a couple of small optimizations / nits :)

- Add clients/rust/src/pdas.rs with centralized PDA derivation functions
- Fix derive_schema_pda to use u8 version (1 byte) instead of u32 (4 bytes)
- Use const-evaluated PDAs for EVENT_AUTHORITY and SAS_AUTHORITY
- Update all compressed test files to use SDK PDA functions
- Update compression-demo example to use SDK PDA functions
- Move TestData and TestFixtures to helpers module
- Add thiserror derive to program errors for IDL export
- Generate error enum in Rust client
- Replace hardcoded error numbers with SolanaAttestationServiceError constants in tests
@ananas-block ananas-block marked this pull request as ready for review October 23, 2025 02:07
@ellipsis-dev
Copy link

ellipsis-dev bot commented Oct 23, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

@ananas-block ananas-block force-pushed the jorrit/feat-compressed-attestations branch 6 times, most recently from 6c885f6 to c1fc8e8 Compare October 23, 2025 03:29
@ananas-block
Copy link
Author

ananas-block commented Oct 23, 2025

Thanks for the comments addressed all of them.

remaining TODOs:

  • add lookup table to test to relax the 350 bytes size constraint
  • fix versions (still need to do releases)
  • double check open questions see slack

@ananas-block ananas-block force-pushed the jorrit/feat-compressed-attestations branch from c1fc8e8 to 7da5fd3 Compare October 23, 2025 03:44
@ananas-block ananas-block force-pushed the jorrit/feat-compressed-attestations branch 4 times, most recently from 3901b7d to 0514263 Compare October 23, 2025 18:11
@ananas-block ananas-block force-pushed the jorrit/feat-compressed-attestations branch from 0514263 to e4fa189 Compare October 23, 2025 18:46
@ananas-block ananas-block force-pushed the jorrit/feat-compressed-attestations branch from 6cc51cb to f72fd84 Compare October 28, 2025 18:09
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