Skip to content

Conversation

@abelmarnk
Copy link

@abelmarnk abelmarnk commented Dec 7, 2025

This PR adds the batch instruction to the token-2022 program, implementation drawn from here and originally proposed here.

The purpose is to allow the execution of multiple token instructions in a single program instruction – e.g., it is possible to execute multiple instructions in a single CPI call, which saves at least 1000 CUs (CPI base fee) for each additional instruction.

Scope

  • Update the TokenInstruction instruction variants(regular and POD) and associated tests
  • Add de/ser helper for the TokenInstruction variant
  • Update the processor code
  • Update the processor tests

It closes #787.

@abelmarnk
Copy link
Author

@joncinque, I didn't add client code because the main purpose of the instruction seems to be for use with CPI, would it still be better to add it in as an instruction that takes raw bytes as arguments?

@abelmarnk abelmarnk marked this pull request as ready for review December 8, 2025 13:46
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.

Feature proposal: batch instruction

1 participant