Repository navigation
define-syscall: expose SYSCALLS list of syscall names - #1060
Merged
Merged
Conversation
Contributor
|
As a cleanup step, I'd also remove I'll open a PR there. |
LucasSte
previously approved these changes
Oct 30, 2026
Contributor
joncinque
reviewed
Oct 30, 2026
joncinque
left a comment
Collaborator
There was a problem hiding this comment.
Looks great! I tested locally just to make sure it was exported correctly and all that.
Could you just add a simple sanity test to make sure that SYSCALLS.contains("some_syscall")?
buffalojoec
enabled auto-merge (squash)
November 1, 2026 03:13
Contributor
Author
Done in e1df7eb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In https://github.com/anza-xyz/cargo-build-sbf we maintain a separate
SYSCALLSlist for evaluating supported symbols in post processing. With anza-xyz/cargo-build-sbf#107 it will become even more relevant.However, keeping the list in two places is cumbersome. When new syscalls are added to the protocol, they also get added to
solana-define-syscall, which serves as a de facto source of truth for on-chain programs that use pinocchio or the SDK.We can share this same source of truth in
cargo-build-sbfas well. The only thing missing is the string representations of the syscall names.Summary of Changes
Add yet another macro layer to insert each
define_syscall!entry's stringified name into one bigSYSCALLSlist. Then tools likecargo-build-sbfcan importSYSCALLSfromsolana-define-syscalland can inherit new or disabled syscalls with only a version bump.This does not break any offered bindings and only adds the new
SYSCALLSconst.