-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests about size of SpotMarket and PerpMarket are failing #891
Comments
I observed there is some end padding with the repr(C) struct
|
https://internals.rust-lang.org/t/auto-trait-for-stable-layout-types-with-no-padding/20339/2 |
|
info: The currently active solana is 1.14.16 For assert_no_slop, I had a glance at the code. It looks fine, and bytemuck is doing similar check with However, only usage of assert_no_slop is AAM, but other types, including the whole PerpMarket and SpotMarket is not asserted |
solana uses 64 bit architecture, i'm guessing you're using 128 bit architecture. if you're using apple, i'd use x86_64 toolchain |
I never heard of any machine that runs 128bit architecture. |
@JakkuSakura the issue is from solana program memory layout not matching aarch64 layout of m-series macs, it breaks some de/serialization logic. as @crispheaney mentioned build for x86_64 will fix it softwareupdate --install-rosetta
rustup install 1.76.0-x86_64-apple-darwin
rustup override set 1.76.0-x86_64-apple-darwin |
Thanks for the update. However, the link provided doesn't work.
Moreover, I have also tested on x86_64 Archlinux and arm64 Fedora, on neither of which the test passes with default triplet |
I think this issue is caused by memory layout change with rust compiler >= v1.77.0
deserializing program types relies on these layouts matching and it does not anymore (program built on ~1.62.0-ish). |
Seems like aligning i128 to 32 bytes can solve this issue. But not sure about a compatible way with older compilers |
Just fyi there is some more info about compatibility in the blog post https://blog.rust-lang.org/2024/03/30/i128-layout-update.html |
I'm using commit 79fdcab, with
cargo test
These tests are failing, rendering the programs unusable
The text was updated successfully, but these errors were encountered: