Make InstructionAccount compatible with #[repr(C)]#6829
Make InstructionAccount compatible with #[repr(C)]#6829LucasSte merged 5 commits intoanza-xyz:masterfrom
InstructionAccount compatible with #[repr(C)]#6829Conversation
|
The Firedancer team maintains a line-for-line reimplementation of the |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #6829 +/- ##
=======================================
Coverage 83.2% 83.2%
=======================================
Files 856 856
Lines 376863 376858 -5
=======================================
+ Hits 313749 313774 +25
+ Misses 63114 63084 -30 🚀 New features to boost your workflow:
|
buffalojoec
left a comment
There was a problem hiding this comment.
Lgtm. Do we want to actually add #[repr(C)] in this PR, or not yet?
|
To keep track we could mark the things which are now runtime-VM-sharable as |
I haven't added the marker, because the struct isn't in the format suggested in the SIMD yet: https://github.com/solana-foundation/solana-improvement-documents/pull/177/files#diff-57951771b76e6c68725097214b9c8db27ace5e34dc1ca67b423e1eb441e9caa0R116-R120 There is still one more refactor to remove the |
This next refactoring step has nothing to do with |
Added the marker in 4482181 |
|
I had to rebase and fix conflicts after #5871 was merged. Can someone approve again? @Lichtso or @buffalojoec ? |
Problem
In runtime ABIv2, we want to share the same data structures between programs and the validator. In SIMD-0177, we propose the usage of
InstructionAccountto hold the information about the accounts an instruction needs in its own memory region.Exposing the data structure to programs means it must be
#[repr(C)]in Rust so that it can have a stable layout between Rust versions.Rust does not support
booltypes in#[repr(C)], soInstructionAccountis not stable.Summary of Changes
is_signerandis_writableprivate.is_signerandis_writablemembers.InstructionAccount, since two of its members are now private.is_signerandis_writabletou8.