Expand description
LightFinalize and LightPreInit traits for compression operations.
These traits are implemented by the #[derive(LightFinalize)] macro from light-sdk-macros.
They provide hooks for running compression operations at different points in an instruction:
LightPreInit: Called at START of instruction - creates mints via CPI context writeLightFinalize: Called at END of instruction - compresses PDAs and executes with proof
This two-phase design allows mints to be created BEFORE the instruction body runs, so they can be used during the instruction (e.g., for vault creation, minting tokens).
Traitsยง
- Light
Finalize - Trait for finalizing compression operations on accounts.
- Light
PreInit - Trait for pre-initialization operations (mint creation).