Provide the data and interfaces to focus on executions in the Engine.
Right now events and task executions are two things quite separated. With the introduction of the workflow and with the goal to decentralize these executions we need to have an execution that links events and task executions together in a way that any node can have access to the same data and that these data should be sufficient to reach consensus, process and verify the execution.
Executions should not be possible without any workflow. Execution will be triggered because of an event or a result of a previous execution.
We need to make sure that we can trace any execution back to its beginning, an event and a list of result. more details here.
We need to remove/rename/add a bunch of attributes:
- ID to rename in hash (we calculate the hash so let’s call it hash)
- remove ExecutionDuration (calculated so don’t need to be in the data, can be transformed in function if we need to)
- remove Service and just put the service definition hash (we don’t need the full service definition)
- OutputData and OutputKey (Simplification of the task's output)
The previous execution that we can call
parentHash(this will be helpful for data resolution of the workflow)
- Calculate the hash of the execution based on previous execution hash, inputs, service hash, task key
When we will start the network we will add a few attributes for consensus of the event (emitters), execution (executor) and validation (validators).
With this focus on execution, we need proper API for that. The goal is on future versions to only use this API and deprecate and even delete the ExecuteTask, ListenEvent, ListenResult, SubmitResult.
Create a new proto
executions.protoin this package
Create a proto service
Create the apis
Get(hash) -> Execution
List() -> Execution
Updates(filter) -> Stream<Execution>
Create the api server in the
/api/ package (previouslyinterface`)
Create a manager/subpackage in the
executionand create the functions
Get -> Execution
List -> Execution
Updates -> Channel<Execution>
- Link the api to the sdk functions
In another step we will remove the ExecuteTask, ListenEvent, ListenResult and SubmitResult in order to use only the Execution’s APIs