raydium-io / raydium-clmm

Open-Source Concentrated Liquidity Market Maker
Apache License 2.0
98 stars 78 forks source link

Bug "Stack offset exeded max offset" on build #79

Closed ghost closed 2 months ago

ghost commented 2 months ago

When running anchor build it fails exceeding the max offset in the stack

$:~/raydium-clmm$ anchor build
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   ~/raydium-clmm/programs/amm/Cargo.toml
workspace: ~/raydium-clmm/Cargo.toml
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
Error: Function _ZN112_$LT$solana_program..instruction..InstructionError$u20$as$u20$solana_frozen_abi..abi_example..AbiEnumVisitor$GT$13visit_for_abi17h924a4c4b235ebb75E Stack offset of 4608 exceeded max offset of 4096 by 512 bytes, please minimize large stack variables
Error: Function _ZN108_$LT$solana_program..vote..state..CircBuf$LT$I$GT$$u20$as$u20$solana_frozen_abi..abi_example..AbiExample$GT$7example17h3e8bb5d02c2fb9a0E Stack offset of 4640 exceeded max offset of 4096 by 544 bytes, please minimize large stack variables
Error: Function _ZN161_$LT$raydium_amm_v3..instructions..create_pool..CreatePool$u20$as$u20$anchor_lang..Accounts$LT$raydium_amm_v3..instructions..create_pool..CreatePoolBumps$GT$$GT$12try_accounts17hf3b3785f4a6b2a5fE Stack offset of 5216 exceeded max offset of 4096 by 1120 bytes, please minimize large stack variables
Error: Function _ZN169_$LT$raydium_amm_v3..instructions..open_position..OpenPosition$u20$as$u20$anchor_lang..Accounts$LT$raydium_amm_v3..instructions..open_position..OpenPositionBumps$GT$$GT$12try_accounts17h930d0b1f4594b175E Stack offset of 4824 exceeded max offset of 4096 by 728 bytes, please minimize large stack variables
Error: Function _ZN173_$LT$raydium_amm_v3..instructions..open_position..OpenPositionV2$u20$as$u20$anchor_lang..Accounts$LT$raydium_amm_v3..instructions..open_position..OpenPositionV2Bumps$GT$$GT$12try_accounts17h7af24b7af999638cE Stack offset of 4968 exceeded max offset of 4096 by 872 bytes, please minimize large stack variables
    Finished release [optimized] target(s) in 0.23s

Anchor version:

$:~/raydium-clmm$ anchor --version
anchor-cli 0.29.0

Solana version:

$:~/raydium-clmm$ solana --version
solana-cli 1.18.18 (src:83047136; feat:4215500110, client:SolanaLabs)

To reproduce the issue clone the repo and run anchor build. Is this a known issue @0x777A, @RainRaydium, @rudy5348 ?

ghost commented 2 months ago

With the following version of SolanaCli it works well:

solana-cli 1.17.34 (src:b04a806c; feat:3746964731, client:SolanaLabs)