Skip to main content

Crate agave_scheduler_bindings

Crate agave_scheduler_bindings 

Source
πŸ‘ŽDeprecated since 3.1.0:

This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Expand description

Messages passed between agave and an external pack process. Messages are passed via shaq::Consumer/Producer.

Memory freeing is responsibility of the external pack process, and is done via rts-alloc crate. It is also possible the external pack process allocates memory to pass to agave, BUT it will still be the responsibility of the external pack process to free that memory.

Setting up the shared memory allocator and queues is done outside of agave - it can be done by the external pack process or another process. agave will just join shared memory regions, but not create them. Similarly, agave will not delete files used for shared memory regions. See shaq and rts-alloc crates for details.

The basic architecture is as follows: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ tpu_to_pack β”‚ β”‚ progress_trackerβ”‚ β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β” β”‚ external scheduler β”‚ └─▲─────── β–²β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–²β”€β”€β”˜ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β–Όβ”€β”€β”€β” β”Œβ”€β”€β–Όβ”€β”€β”€β”€β”€β” … β”Œβ”€β”€β”€β–Όβ”€β”€β”€β” β”‚worker1β”‚ β”‚worker2 β”‚ β”‚workerNβ”‚ β””β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”˜

  • TpuToPackMessage are sent from tpu_to_pack queue to the external scheduler process. This passes in tpu transactions to be scheduled, and optionally vote transactions.
  • ProgressMessage are sent from progress_tracker queue to the external scheduler process. This passes information about leader status and slot progress to the external scheduler process.
  • PackToWorkerMessage are sent from the external scheduler process to worker threads within agave. This passes a batch of transactions to be processed by the worker threads. This processing can also involve resolving the transactions’ addresses, or similar operations beyond execution.
  • WorkerToPackMessage are sent from worker threads within agave back to the external scheduler process. This passes back the results of processing the transactions.

ModulesΒ§

pack_message_flagsDeprecated
Flags for crate::PackToWorkerMessage::flags. These flags can be ORed together so must be unique bits, with the exception of NONE. The default behavior, NONE, is to attempt execution and inclusion in the specified max_execution_slot.
tpu_message_flagsDeprecated
worker_message_typesDeprecated

StructsΒ§

PackToWorkerMessageDeprecated
Message: [Pack -> Worker] External pack processe passes transactions to worker threads within agave.
ProgressMessageDeprecated
Message: [Agave -> Pack] Agave passes leader status to the external pack process.
SharablePubkeysDeprecated
Reference to an array of Pubkeys that can be shared safely across processes.
SharableTransactionBatchRegionDeprecated
Reference to an array of SharableTransactionRegion that can be shared safely across processes. General flow:
SharableTransactionRegionDeprecated
Reference to a transaction that can shared safely across processes.
TpuToPackMessageDeprecated
Message: [TPU -> Pack] TPU passes transactions to the external pack process. This is also a transfer of ownership of the transaction: the external pack process is responsible for freeing the memory.
TransactionResponseRegionDeprecated
Reference to an array of response messages. General flow:
WorkerToPackMessageDeprecated
Message: [Worker -> Pack] Message from worker threads in response to a PackToWorkerMessage.

ConstantsΒ§

IS_LEADERDeprecated
Indicates the node is leader.
IS_NOT_LEADERDeprecated
Indicates the node is not leader.
MAX_TRANSACTIONS_PER_MESSAGEDeprecated
Maximum number of transactions allowed in a PackToWorkerMessage. If the number of transactions exceeds this value, agave will not process the message.
NOT_PROCESSEDDeprecated
The message was not processed.
PROCESSEDDeprecated
The message was processed.