Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
LightProgramPinocchioderive macro to derive seed structs, pack, unpack, compress and decompress traits and helpersNew Crates
light-account(sdk-libs/account/)Re-exports macros and generic types specialized with Solana's
AccountInfo<'info>:CpiAccounts<'c, 'info>,CompressCtx<'a, 'info>,DecompressCtx<'a, 'info>,ValidatedPdaContext<'info>,PackedAccountslight-sdk-macros:#[light_program],#[derive(LightAccount)],#[derive(LightAccounts)],#[derive(LightProgram)], etc.light_err(),derive_rent_sponsor_pda(),find_mint_address(),derive_associated_token_account()light-account-pinocchio(sdk-libs/account-pinocchio/)Re-exports macros and generic types specialized with Pinocchio's
AccountInfo(no lifetime):CpiAccounts<'c>,CompressCtx<'a>,DecompressCtx<'a>,ValidatedPdaContext#[derive(LightProgramPinocchio)](replaces#[derive(LightProgram)])[u8; 32]byte arrays instead ofPubkeylight-sdk-typesChangesAdded
interface/directory with generic interface types:Key generic types:
CompressCtx<'a, AI: AccountInfoTrait>- Compression contextDecompressCtx<'a, AI: AccountInfoTrait>- Decompression contextCpiAccounts<'a, T: AccountInfoTrait>- CPI account collectionValidatedPdaContext<AI: AccountInfoTrait>- Validated PDA accountsTest Programs
manual-test-pinocchio(sdk-tests/manual-test-pinocchio/)pinocchio-light-program-test(sdk-tests/pinocchio-light-program-test/)#[derive(LightProgramPinocchio)]on enumanchor-semi-manual-test(sdk-tests/anchor-semi-manual-test/)#[derive(LightProgram)]with standard Anchor#[program]#[derive(Accounts, LightAccounts)]on instruction account structslight-account-checksChangesNew
AccountMetaTraitNew Generic Functions
invoke_cpi()- Generic CPI invocation abstractiontransfer_lamports_cpi()- Transfer via system program CPIcreate_pda_account()- Generic PDA creationclose_account()- Account closuretransfer_lamports()- Direct lamport manipulationPackedAccounts<AM: AccountMetaTrait>Generic instruction account packing with deduplication:
insert_or_get()- Insert or get existing account indexadd_pre_accounts_signer()/add_pre_accounts_meta()- Pre-account managementadd_system_accounts_raw()- System account insertionImplementations
AccountMetaTraitforsolana_instruction::AccountMetaOwnedAccountMetawrapper +AccountMetaTraitimplementationlight-compressibleChangesCreateAccountsProoftolight-sdk-typeslight-sdk-macrosChangesRemoved
#[derive(Compressible)]- unused macro removedUpdated
light_sdk::interface->light_account#[derive(LightProgramPinocchio)]for Pinocchio programsRenamings
COMPRESSIBLE_CONFIG_SEEDLIGHT_CONFIG_SEEDSummary by CodeRabbit
New Features
New Features
Improvements
Documentation
Chores