Skip to content

define-syscall: expose SYSCALLS list of syscall names - #1060

Merged
buffalojoec merged 2 commits into
anza-xyz:masterfrom
buffalojoec:syscall-sot
Nov 2, 2026
Merged

buffalojoec merged 2 commits into
anza-xyz:masterfrom
buffalojoec:syscall-sot

Conversation

@buffalojoec

Copy link
Copy Markdown
Contributor

Problem

In https://github.com/anza-xyz/cargo-build-sbf we maintain a separate SYSCALLS list 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-sbf as 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 big SYSCALLS list. Then tools like cargo-build-sbf can import SYSCALLS from solana-define-syscall and can inherit new or disabled syscalls with only a version bump.

This does not break any offered bindings and only adds the new SYSCALLS const.

@LucasSte

Copy link
Copy Markdown
Contributor

As a cleanup step, I'd also remove gen-syscall-list from Agave. If we make the integration, then that part of Agave is no longer necessary.

I'll open a PR there.

LucasSte
LucasSte previously approved these changes Oct 30, 2026
@LucasSte

Copy link
Copy Markdown
Contributor

anza-xyz/agave#16580

@joncinque joncinque left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Could you just add a simple sanity test to make sure that SYSCALLS.contains("some_syscall")?

Done in e1df7eb

@joncinque joncinque left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@buffalojoec
buffalojoec merged commit 001c6d9 into anza-xyz:master Nov 2, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants