Skip to content

Conversation

@buffalojoec
Copy link
Collaborator

This PR adds the ability to register custom syscalls in Mollusk's test environment. This allows developers to define their own custom syscalls, register them with the test environment, then write programs that access these syscalls and test their functionality.

Since program cache entries for Agave's JIT cache require an environment parameter of type Arc<BuiltinProgram<InvokeContext<'static>>>, creating an API for developers to register syscalls was slightly convoluted.

  • Add an owned BuiltinProgram<InvokeContext<'static>> field to ProgramStore directly, which can be updated when new functions are registered.
  • Each time a program is added to the store, instead of calling create_program_runtime_environment_v1, create a new loader from the config and function registry of the owned loader stored on the program store. This should be functionally equivalent to what was already implemented.

@buffalojoec buffalojoec merged commit eb5fea3 into main Jun 9, 2025
5 checks passed
@buffalojoec buffalojoec deleted the register-function branch June 9, 2025 07:47
buffalojoec added a commit that referenced this pull request Jun 9, 2025
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.

2 participants