I'm getting the following error using Anchor 0.25.0 Stack offset of 11792 exceeded max offset of 4096 by 7696 bytes, please minimize large stack variables
initializing my accounts on local testing.
I'm initializing a boxed account (Board) that represents a 10x10 optional board, where each cell contains a public key and some values.
pub struct Create<'info> {
#[account(mut)]
pub user: Signer<'info>,
#[account(
init,
payer = user,
space = 8 + board::MAXIMUM_SIZE,
seeds = [b"board"],
bump
)]
pub board: Box<Account<'info, Board>>,
... etc
pub const MAXIMUM_SIZE: usize = 32 + 8 + 1 + (100 * (32 + 1 + 1 + 1 + 1 + 1));
public initializer function that is failing
pub fn create(ctx: Context<Create>) -> Result<()> {
let pixel_board = &mut ctx.accounts.board;
pixel_board.bump = *ctx.bumps.get("board").unwrap();
pixel_board.count = 0;
pixel_board.gov = *ctx.accounts.gov.key;
Ok(())
}
```
any tips / pointers on how to reduce this the stack variables here? I'd like to scale beyond 10x10 at some point if possible. Thank you in advance