Anoma.Node.Transaction.Executor (Anoma v0.29.0)

I am the Executor Engine.

My main functionality is to launch new workers and keep track of finalized transaction execution, sending the consensus ordering data to the Ordering Engine and waiting for workers to signal process completion. That is, I mark beginning and end of the transaction execution, abstracting the functionality away from the Mempool.

Public API

I provide the following public functionality:

Summary

Types

t()

I am the type of the Executor Engine.

Functions

Returns a specification to start this module under a supervisor.

I am a filter for completion messages from workers.

I am the Executor execute function.

I am the intialization function for the Executor Engine.

I am the Executor launch function.

I am the start_link function of the Executor Engine.

Types

@type t() :: %Anoma.Node.Transaction.Executor{node_id: String.t() | nil}

I am the type of the Executor Engine.

Currently I only keep information of the relevant node identitfication.

Fileds

  • :node_id - The ID of the node to which an Executor instantiation is
             bound.

Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

complete_filter()

I am a filter for completion messages from workers.

Link to this function

execute(node_id, consensus)

@spec execute(String.t(), [binary()]) :: :ok

I am the Executor execute function.

I accept the node ID and a list of transaction IDs as my arguments. Afterwards, the list is sent to the Ordering.

At that point, I make Executor go into a receive loop processing all messages about finished workers. If all consensus-provided workers with specified IDs have finished in time, I broadcast a completion message with all the execution results. Otherwise, Executor crashes.

@spec init([startup_options()]) :: {:ok, t()}

I am the intialization function for the Executor Engine.

Given the arguments containing a node ID, I subscribe to all messages which come from completed workers of that node and launch the Executor with appropriate state.

Link to this function

launch(node_id, tw_w_backend, id)

@spec launch(
  String.t(),
  {Anoma.Node.Transaction.Backends.backend(), Noun.t()},
  binary()
) :: :ok

I am the Executor launch function.

Given a transaction in {backend, code} format with specific ID, I launch that transaction as a task.

Link to this function

start_link(args)

@spec start_link([startup_options()]) :: GenServer.on_start()

I am the start_link function of the Executor Engine.

I register the engine with supplied node ID provided by the arguments.