hardening: add static assertion for WASM mavros stub type layout
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start in provekit/common/src/mavros.rs, where the WASM stub types for WitnessLayout and ConstraintsLayout are defined, and compare them with the native mavros_vm types. Add the requested native-target compile-time layout checks or a postcard roundtrip test; done means layout divergence is caught clearly while WASM remains unsupported.
Written by the indexing model from the issue text.
Description
Context
From PR #246 review: the WASM stub types for WitnessLayout and ConstraintsLayout in provekit/common/src/mavros.rs must exactly mirror the real mavros_vm types for postcard serialization compatibility. Currently enforced only by a comment.
If mavros_vm adds a field, the stubs silently diverge and deserialization fails with a confusing error instead of the clean "Mavros prover is not supported on WASM" message.
Proposed Fix
Add a compile-time size assertion on native targets:
#[cfg(not(target_arch = "wasm32"))]
const _: () = {
assert!(std::mem::size_of::<mavros_vm::WitnessLayout>() == 5 * std::mem::size_of::<usize>());
assert!(std::mem::size_of::<mavros_vm::ConstraintsLayout>() == 3 * std::mem::size_of::<usize>());
};
Or a test that roundtrips both real and stub types through postcard to verify wire compatibility.
- Dominant language
- Noir
- Stars
- 138
- Forks
- 47
- Avg merge
- 1d 34m
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from worldfnd/provekit
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in worldfnd/provekit
Similar issues
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100