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
Rust 1.68 has changed memory layout of certain types, which impacts Vec and other types within the codebase. This is an issue for any types that are used within the VM where its memory layout is assumed.
let renbt_epoch_ptr = (account_info_addr + 32)as*constEpoch;
unsafe{
assert_eq!(*renbt_epoch_ptr,42);
}
}
}
For types that are used that assume a certain layout, we may need to create our own stable-layout versions of those types. Here's an example for Vec: https://godbolt.org/z/v4qa9vGYz
I noticed at least a few types in the VM do this already with types prefixed by Sol, i.e. SolInstruction, SolAccountMeta, and SolAccountInfo:
Audit types used by the VM that may assume layout (Instruction, AccountInfo, AccountMeta, etc) and see if any require a stable layout. Nail down those layouts and update the check_type_assumptions test.
The text was updated successfully, but these errors were encountered:
Problem
Rust 1.68 has changed memory layout of certain types, which impacts
Vec
and other types within the codebase. This is an issue for any types that are used within the VM where its memory layout is assumed.This was discovered when upgrading Rust to 1.66.0, which also upgraded
nightly
to 1.68. Thecheck_type_assumptions
test failed due to the layout ofInstruction
andAccountInfo
changing.solana/sdk/program/src/program.rs
Lines 394 to 545 in aef1a43
For types that are used that assume a certain layout, we may need to create our own stable-layout versions of those types. Here's an example for
Vec
:https://godbolt.org/z/v4qa9vGYz
I noticed at least a few types in the VM do this already with types prefixed by
Sol
, i.e.SolInstruction
,SolAccountMeta
, andSolAccountInfo
:solana/programs/bpf_loader/src/syscalls/cpi.rs
Lines 390 to 425 in aef1a43
Proposed Solution
Audit types used by the VM that may assume layout (
Instruction
,AccountInfo
,AccountMeta
, etc) and see if any require a stable layout. Nail down those layouts and update thecheck_type_assumptions
test.The text was updated successfully, but these errors were encountered: