whirlpools
whirlpools copied to clipboard
update anchor and solana
Hope i get right!
Problems faced during upgrade:
- Anchor specific Zero copy does not support tuple structs and unaligned fields: https://solana.stackexchange.com/questions/15043/can-not-use-zero-copy-with-u8-primitive-type
- Max stack size is 4 kb and it is strict. So we most likely should refactor alignments in big accounts and make them zero_copy so it will use bytemuck (custom Zeroable and Pod does not work, as it creates wrong IDL) and read from validator directly.
- Solana 1.18.17 uses some solana deps which are v2, need to forcefully downgrade at list this one: https://solana.stackexchange.com/questions/14973/error-after-updating-solana-program-to-1-18-17-and-anchor-to-0-30-1
- Anchor deprecates AccountInfo, which is heavily used in this program: https://github.com/coral-xyz/anchor/issues/2794
- Remaining accounts now have lifetimes and this is a problem, because Account::try_from(account_info) does not live long enough: https://solana.stackexchange.com/questions/13310/how-to-use-lifetime-on-context-correctly
- Big Accounts should use zero_copy and AccountLoad, but this program is not using it: https://github.com/solana-developers/anchor-zero-copy-example
- Use spl-transfer-hook-interface v0.6.3
- cargo update -p [email protected] --precise 1.18.17 (https://github.com/coral-xyz/anchor/issues/3044)
- https://solana.stackexchange.com/questions/5489/getting-an-error-of-proc-macro-derive-panicked-message-invariant-violation-com
- Lifetimes changes: https://solana.stackexchange.com/questions/11823/anchor-28-to-29-ctx-remaining-accounts-lifetime
Closing this since it is superseded by https://github.com/orca-so/whirlpools/pull/174