-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Simplify syscall register and bind #24546
Simplify syscall register and bind #24546
Conversation
@@ -146,6 +146,9 @@ pub fn create_executor( | |||
reject_callx_r10: invoke_context | |||
.feature_set | |||
.is_active(&reject_callx_r10::id()), | |||
dynamic_stack_frames: false, | |||
enable_sdiv: false, | |||
optimize_rodata: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add features for these items in later PRs, @alessandrod I think these are all yours correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct! Yup sure there's no rush. For the first two we don't have a (released) toolchain that can exercise those features yet anyway, and for optimize_rodata I want to land solana-labs/rbpf#301 first
.register_syscall_by_name(b"sol_get_rent_sysvar", SyscallGetRentSysvar::call)?; | ||
register_feature_gated_syscall!( | ||
syscall_registry, | ||
disable_fees_sysvar, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Lichtso I suspect this is the issue; invert of the logic on the disable_fees_sysvar
, should be !disable_fees_sysvar
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, looks promising. Can you test that?
- Checkout 6bbfef7 the commit before Bumps solana_rbpf to v0.2.27 #24694 made it in
- Revert the revert (revert #24546 #24647)
- Fix this boolean inversion
- Test by running a validator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reverts commit f6257a4.
* Revert "declare syscalls with macro (solana-labs#24564)" 38bdb40 * Revert "Simplify syscall register and bind (solana-labs#24546)" 28ed2a9 Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
* Revert "declare syscalls with macro (solana-labs#24564)" 38bdb40 * Revert "Simplify syscall register and bind (solana-labs#24546)" 28ed2a9 Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
* Revert "Bumps solana_rbpf to v0.2.27 (solana-labs#24694)" This reverts commit f3d27cc. * Simplify syscall register and bind (solana-labs#24546) * declare syscalls with macro (solana-labs#24564)
* Revert "declare syscalls with macro (solana-labs#24564)" 38bdb40 * Revert "Simplify syscall register and bind (solana-labs#24546)" 28ed2a9 Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
* Revert "declare syscalls with macro (solana-labs#24564)" 38bdb40 * Revert "Simplify syscall register and bind (solana-labs#24546)" 28ed2a9 Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
* Revert "declare syscalls with macro (solana-labs#24564)" 38bdb40 * Revert "Simplify syscall register and bind (solana-labs#24546)" 28ed2a9 Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
Problem
Syscall registration and binding are currently disjoint operations requiring the callers to explicitly do both for each syscall.
This can lead to mismatch or missing registration/binds and complicates the code. Another side effect is that it is difficult/impossible given the current API for callers to filter syscalls at the registration stage but allow them at the binding stage. One example is the effort to deprecate/disallow syscalls by preventing new deployments of programs that rely on a disallowed syscall while continuing to support existing programs that already rely on them.
Summary of Changes
These changes depend and build off the changes here: solana-labs/rbpf#293
Syscalls are registered once, and later the bind operation uses a common context to bind all the previously registered syscalls. Thus, no longer requires an explicit bind for each syscall and without the complications of keeping two identical lists of syscalls for registration and bind.
Fixes #