How can I fix this error? This is a basic anchor smart contract that initializes an account. There's only one value, an integer, stored. I tried boxing the account (to put the storage on the heap, according to other questions), but that did not fix.
Warning: cargo-build-bpf is deprecated. Please, use cargo-build-sbf
cargo-build-bpf child: /home/user/.local/share/solana/install/active_release/bin/cargo-build-sbf --arch bpf
Error: Function _ZN14solana_program4vote5state9VoteState11deserialize17h4e0d3b92a7040b50E Stack offset of 6344 exceeded max offset of 4096 by 2248 bytes, please minimize large stack variables
Error: Function _ZN229_$LT$solana_program..vote..state..vote_state_0_23_5.._..$LT$impl$u20$serde..de..Deserialize$u20$for$u20$solana_program..vote..state..vote_state_0_23_5..VoteState0_23_5$GT$..deserialize..__Visitor$u20$as$u20$serde..de..Visitor$GT$9visit_seq17h1fa296554d54dcceE Stack offset of 5752 exceeded max offset of 4096 by 1656 bytes, please minimize large stack variables
Finished release [optimized] target(s) in 0.24s
Smart contract:
use anchor_lang::prelude::*;
declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");
#[program]
pub mod testw {
use super::*;
pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
let account
= &mut ctx.accounts.counter_account;
account.counter_number = 0;
return Ok(());
}
}
#[derive(Accounts)]
pub struct Initialize<'info> {
#[account(init, payer=signer, space=64)]
counter_account: Box<Account<'info, CounterAccount>>,
#[account(mut)]
signer: Signer<'info>,
system_program: Program<'info, System>,
}
#[account]
pub struct CounterAccount {
counter_number: i64,
}
anchor test
runs a basic initialize account test that is successful. The stack offset error is still there.