Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) * Fix struct size discrepancy by specifying enum representation This commit resolves a size discrepancy issue observed with structs derived from the Pyth SDK when executed on Solana's runtime vs off-chain. The use of `#[repr(C)]` in enum definitions, leading to an unexpected increase in struct sizes when compiled for the Solana BPF target, causing the SDK to fail deserialization. The account size for std::mem::size_of::<SolanaPriceAccount>() returned 3840, when the correct size is 3312. By changing the enum representation from `#[repr(C)]` to `#[repr(u8)]`, we ensure a consistent and minimal size for the enums across both execution environments. --------- Co-authored-by: Burbo <[email protected]>
- Loading branch information