Is it possible to allocate space to an account based on account provided in remaining_accounts? I want to allocate enough space to store public key of the accounts provided in remaining_accounts in a struct (State).
This demonstrates what I am trying to do:
#[account(
init,
seeds = [STATE_SEED.as_ref(), signer.key().as_ref()],
bump,
payer = proposer,
space = 8 + 4 + remaining_accounts.len() * 32
)]
pub state: Account<'info, State>
Should I just send the length of remaining_accounts as instruction data?