raydium-io / raydium-cpi-example

cpi call example for amm, cpswap and clmm program
19 stars 8 forks source link

Build error and missing fields in generated idl #2

Closed tuncatunc closed 3 months ago

tuncatunc commented 3 months ago

I got following error while building the raydium-cpi-example, I can deploy the program on localnet.

bash-3.2$ anchor build
Error: Function _ZN112_$LT$solana_program..instruction..InstructionError$u20$as$u20$solana_frozen_abi..abi_example..AbiEnumVisitor$GT$13visit_for_abi17h92f6c13729b47ac6E 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$7example17h89337dccb9a791b1E Stack offset of 4640 exceeded max offset of 4096 by 544 bytes, please minimize large stack variables
Error: Function _ZN161_$LT$raydium_cp_swap..instructions..initialize..Initialize$u20$as$u20$anchor_lang..Accounts$LT$raydium_cp_swap..instructions..initialize..InitializeBumps$GT$$GT$12try_accounts17h4cf2520c4043d755E Stack offset of 4848 exceeded max offset of 4096 by 752 bytes, please minimize large stack variables
    Finished release [optimized] target(s) in 0.28s

when trying to write a test with typescript, the generated types is missing address and metadata fields.

The generated type for puppet program is on the right has address and metadata fields, however the cp-swap-cpi is missing them.

image

raydium-cpi-example/cp-swap-cpi/target/types/cp_swap_cpi.ts

0x777A commented 3 months ago

Run solana --version, make sure you solana version < 1.18.0 and anchor verison is v0.29.0