Computation Initiation
Once a computation is created, it can be scheduled for execution. Before that happens, several key details must be specified, including the necessary arguments, the timing for execution, post-execution callbacks, and payment bid details. Additionally, the computation customer may define a valid time window for execution. Once all this information is provided, the computation is submitted to the network’s on-chain mempool.
The mempool assigns each computation to either the active or dependent pool. Computations that don’t rely on the results of other tasks are placed in the active mempool for immediate execution, while those that depend on the completion of other computations are placed in the dependent mempool, awaiting their turn. The network’s mempool architecture ensures proper handling of all tasks.
When commissioning a computation, the customer must also define the priority fee they are willing to pay, which determines the computation's position in the execution queue.
During execution, the arguments passed correspond exactly to those defined when the computation was set up. These can either be data objects, which encompass various on-chain and off-chain data sources, or binary data, which consists of raw binary strings.
Callbacks come into play after execution, allowing for customized actions. Defined during commissioning rather than at the time of setup, callbacks are tailored to each instance without changing the core logic of the computation. They can be set for both success and failure, providing different follow-up actions based on the outcome.
For successful executions, callbacks may involve either static or dynamic instructions. Static instructions trigger pre-defined on-chain actions, while dynamic instructions offer more flexibility, such as creating new data objects for future computations, performing complex actions based on the computation’s output.
In cases of failure, callbacks are always static, as no output is generated. However, they can still trigger static on-chain or off-chain actions.
Last updated