Juvix imports
module arch.node.engines.mempool_worker_messages;
import prelude open;
import arch.node.types.basics open;
import arch.node.types.identities open;
Mempool Worker Messages¶
These are the specific messages that the Mempool Worker engine can receive/respond to.
Message interface¶
type MempoolWorkerMsg KVSKey Executable :=
| MempoolWorkerMsgTransactionRequest (TransactionRequest KVSKey Executable)
| MempoolWorkerMsgTransactionAck TransactionAck;
Message sequence diagrams¶
Transaction request flow¶
sequenceDiagram
participant User
participant MempoolWorker
participant Shard
participant Executor
User->>MempoolWorker: MempoolWorkerMsgTransactionRequest
MempoolWorker->>User: MempoolWorkerMsgTransactionAck
MempoolWorker->>Shard: KVSAcquireLock
Shard->>MempoolWorker: KVSLockAcquired
MempoolWorker->>Executor: ExecutorPIDAssigned
Executor->>MempoolWorker: ExecutorFinished
Message types¶
TransactionRequest
¶
A request from a user or solver to order and execute a transaction candidate.
type TransactionRequest KVSKey Executable :=
mkTransactionRequest@{
tx : TransactionCandidate KVSKey KVSKey Executable;
resubmission : Option TxFingerprint;
};
Arguments
tx
- The transaction candidate to be ordered and executed.
resubmission
- Optional reference to a previous occurrence of the same transaction candidate (currently unused).
TransactionAck
¶
Acknowledgment sent to the user or solver that a transaction request has been accepted.
type TransactionAck :=
mkTransactionAck@{
tx_hash : Hash;
batch_number : BatchNumber;
batch_start : WallClockTime;
worker_id : EngineID;
signature : Signature;
};
Arguments
tx_hash
- The hash of the acknowledged transaction candidate (Currently unused).
batch_number
- The batch number assigned to the transaction (Currently unused).
batch_start
- The wall clock time when the batch was opened (Currently unused).
worker_id
- The external identity of the worker engine that processed the transaction.
signature
- The signature of the worker engine over the above fields (Currently unused).
MempoolWorkerMsg
¶
type MempoolWorkerMsg KVSKey Executable :=
| MempoolWorkerMsgTransactionRequest (TransactionRequest KVSKey Executable)
| MempoolWorkerMsgTransactionAck TransactionAck;