coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.61k stars 1.32k forks source link

every pubkey in anchor cost 96bytes #1041

Closed yiranlandtour closed 2 years ago

yiranlandtour commented 2 years ago

we hava a problem Error: Function _ZN14raydium_anchor9__private8__global7refresh17h1a97f3ac58fed417E Stack offset of -15064 exceeded max offset of -4096 by 10968 bytes, please minimize large stack variables Error: Function _ZN14raydium_anchor9__private8__global4swap17h19364952264608abE Stack offset of -5224 exceeded max offset of -4096 by 1128 bytes, please minimize large stack variables Error: Function _ZN14raydium_anchor9__private8__global13add_liquidity17hbb5b055de86f3430E Stack offset of -5032 exceeded max offset of -4096 by 936 bytes, please minimize large stack variables Error: Function _ZN14raydium_anchor9__private8__global30initialize_withdraw_lp_account17hefda176dd9abba46E Stack offset of -5560 exceeded max offset of -4096 by 1464 bytes, please minimize large stack variables Error: Function _ZN11anchor_lang7account16Account$LT$T$GT$8try_from17ha1699cfeec7786fbE Stack offset of -9776 exceeded max offset of -4096 by 5680 bytes, please minimize large stack variables Error: Function _ZN14raydium_anchor9__private8__global11withdraw_lp17h06787c7f5dc12214E Stack offset of -5248 exceeded max offset of -4096 by 1152 bytes, please minimize large stack variables Error: Function _ZN65_$LT$raydium_anchor..Refresh$u20$as$u20$anchor_lang..Accounts$GT$12try_accounts17h82a25eecf011b19dE Stack offset of -4992 exceeded max offset of -4096 by 896 bytes, please minimize large stack variables

so i try to delete some data. `#[account]

[derive(Default)]

pub struct Pool{ pub owner:Pubkey,` i found the owner pubkey cost 96bytes, i dont know why

fanatid commented 2 years ago

Please format your question. How do you calculate that the owner pubkey costs 96 bytes?

archseer commented 2 years ago

I think this is because the owner is also a signer. So it's 32 bytes for the account, and 64 for the transaction signature.