Closed 0xk2 closed 5 months ago
Code in zero copy section is not working in anchor ^v0.27
Change from
#[account(zero_copy)] pub struct SomeReallyBigDataStruct { pub really_big_data: [u128; 1024], // 16,384 bytes } pub struct ConceptZeroCopy<'info> { #[account(zero)] pub some_really_big_data: AccountLoader<'info, SomeReallyBigDataStruct>, }
to
#[account(zero_copy(unsafe))] pub struct SomeBigDataStruct { pub really_big_data: [u128; 1024], // 16,384 bytes } #[derive(Accounts)] pub struct SomeFunctionContext<'info> { #[account(zero)] pub some_really_big_data: AccountLoader<'info, SomeBigDataStruct>, }
Also, add dependency in Cargo.toml
bytemuck="1.15.0"
Fixed the issue, closing.
https://github.com/Unboxed-Software/solana-course/commit/6678e68b4d80a21b4b7c2a06f47766a6e7e62fc4
Code in zero copy section is not working in anchor ^v0.27
Change from
to
Also, add dependency in Cargo.toml