You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix struct size discrepancy by specifying enum representation #115 (#117)
* 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]>
0 commit comments