refactor!(workspace): add global separation of syscall kind#5401
refactor!(workspace): add global separation of syscall kind#5401StackOverflowExcept1on wants to merge 16 commits intomasterfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements a global separation of syscall kinds within the workspace. By introducing Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces SyscallKind to distinguish between Vara and Ethereum (ethexe) execution environments across the workspace. It propagates this kind through the core backend, processor, and WASM instrumentation layers to ensure environment-specific syscall validation and binding. Additionally, it applies conditional compilation to disable unsupported syscalls like wait, random, and program creation in the ethexe context, while updating tests and examples to support both execution modes. I have no feedback to provide.
| SyscallName::SendWGas, // Deprecated | ||
| SyscallName::SystemReserveGas, // Deprecated | ||
| SyscallName::UnreserveGas, // Deprecated | ||
| SyscallName::Wait, // Deprecated |
There was a problem hiding this comment.
same order as gsys and gear-wasm-instrument
|
@claude opus review |
|
Claude finished @StackOverflowExcept1on's task in 7m 43s —— View job Claude Opus PR ReviewThis PR introduces Overall the change is well-structured. I found one critical issue, one design concern around drift, and a couple of small things. severity: critical — File: The new macro in
So
But the assertion immediately after still compares against the unconditional total: assert_eq!(
builder.funcs_count,
SyscallName::all().count(),
"Not all existing syscalls were added to the module's env."
);This means every call to The fix is to make the assertion match the new semantics — e.g. compare against severity: medium — three sources of truth for the ethexe-disabled syscall list with no enforced consistency There are now three places that must agree on which syscalls are unavailable in ethexe:
The PR description and the author's own comment on line 210 acknowledge this: "same order as Suggestion: derive severity: low — misleading grouping comment in File: let precise_syscalls: [(...); 5] = [
(ReservationSend, Self::generate_send_from_reservation),
(ReservationReply, Self::generate_reply_from_reservation),
// Available for both `SyscallKind::Vara` and `SyscallKind::Eth`
(SendCommit, Self::generate_send_commit),
(SendCommitWGas, Self::generate_send_commit_with_gas),
(ReplyDeposit, Self::generate_reply_deposit),
];The "Available for both" comment is placed before three entries but only severity: low — intra-doc links to gated File:
When docs are built with Things that look good
|
Resolves #4138
TLDR:
utils/wasm-instrument/src/syscalls.rs,gsys/src/lib.rs,ethexe/runtime/common/src/lib.rsgr_create_program,gr_random,gr_waithave been disabled inethexeand in the ecosystem to avoid wasm files with unimplemented syscallsgtest,gear-wasm-buildernow automatically throw error if some import is missing (depending on wasm runtime)