pub fn process_initialize_light_config<'info>(
config_account: &AccountInfo<'info>,
update_authority: &AccountInfo<'info>,
rent_sponsor: &Pubkey,
compression_authority: &Pubkey,
rent_config: RentConfig,
write_top_up: u32,
address_space: Vec<Pubkey>,
config_bump: u8,
payer: &AccountInfo<'info>,
system_program: &AccountInfo<'info>,
program_id: &Pubkey,
) -> Result<(), ProgramError>Expand description
Creates a new compressible config PDA
§Security - Solana Best Practice
This function follows the standard Solana pattern where only the program’s upgrade authority can create the initial config. This prevents unauthorized parties from hijacking the config system.
§Arguments
config_account- The config PDA account to initializeupdate_authority- Authority that can update the config after creationrent_sponsor- Account that receives rent from compressed PDAscompression_authority- Authority that can compress/close PDAsrent_config- Rent function parameterswrite_top_up- Lamports to top up on each writeaddress_space- Address space for compressed accounts (currently 1 address_tree allowed)config_bump- Config bump seed (must be 0 for now)payer- Account paying for the PDA creationsystem_program- System programprogram_id- The program that owns the config
§Required Validation (must be done by caller)
The caller MUST validate that the signer is the program’s upgrade authority by checking against the program data account. This cannot be done in the SDK due to dependency constraints.
§Returns
Ok(())if config was created successfullyErr(ProgramError)if there was an error