Task & Task Definitions
Last updated
Last updated
AVS Protocol core service can be broken down into “Tasks", each representing a unit of work to be carried out by the Operators. A Task is any off-chain computation the AVS network performs, from fetching price feeds to training ML models.
Othentic Stack enables AVS developers to configure multiple tasks for operators to execute, each with customizable parameters, rewards, and operator clusters. Through Task Definitions, you can specify the required security levels, number of operators, and other operational criteria necessary for task execution. This flexibility ensures that tasks requiring consensus can be precisely tailored to meet your security and operational needs.
Task definition creation ⇒ A one-time transaction defines the task parameters.
Task execution using ⇒ Task is executed off-chain.
Task validation using ⇒ Task is validated by the .
Task submission by ⇒ Finally, the Task is submitted on-chain.
Task definition specifies the task parameters including required security levels, number of operators, and other operational criteria for task execution. These parameters ensure that the Tasks requiring consensus can be clearly defined as per the security and operational needs.
Othentic Stack enables you to configure Tasks with the following parameters:
taskDefinitionId
uint16
Auto-generated incremental ID
name
string
A human-readable name for the task
blockExpiry
uint256
The block after which tasks of this type are no longer valid and will be rejected by the AttestationCenter
baseRewardFeeForAttesters
uint256
baseRewardFeeForPerformer
uint256
baseRewardFeeForAggregator
uint256
minimumVotingPower
uint256
_restrictedOperatorIndexes
uint256[]
An array of operators allowed to execute the task
Each task defines the base rewards for all entities participating in consensus: the Performer, the Attesters, and the Aggregators.
To create a task definition, execute the following command:
Follow these steps when prompted:
Provide the private key of the multi-sig address.
Enter the Attestation Center contract address.
Specify all the task parameters as specified above.
_taskDefinitionId
uint16
Task Definition ID
_minimumVotingPower
uint256
Minimum Voting Power (in wei)
If an operator attests to a task and has less than the minimum voting power, the task would fail with a OperatorDoesNotHaveMinimumVotingPower(operatorIndex)
error.
The AVS Governance Multisig should not set this value too high so that no attester passes the threshold.
To configure the minimum voting power for a specific Task ID, execute the following command:
Follow these steps when prompted:
Provide the private key of the multi-sig address.
Enter the Attestation Center contract address.
Specify the Task ID and its corresponding minimum voting power.
AVS can have an unlimited number of tasks, and each task can be executed by different Operator clusters. For certain tasks, you may want to restrict execution to a specific group of operators.
_taskDefinitionId
uint16
Task Definition ID
_restrictedOperatorIndexes
uint256[]
Restricted Operator Set
If a task that has restricted operators is submitted, the system checks that the Operators are part of the restrictedOperatorIndexes
list. If an unrestricted operator attests to this task, then it will revert with a InvalidRestrictedOperator(taskDefinitionId, attesterId)
error.
To configure the restricted operator set for a specific Task ID, execute the following command:
Follow these steps when prompted:
Provide the private key of the multi-sig address.
Enter the Attestation Center contract address.
Specify the Task ID and restricted attester Ids.
_taskDefinitionId
uint16
Task Definition ID
_maximumNumberOfAttesters
uint256
Maximum number of Attesters
Tasks can be triggered manually via an API call. This can be done using curl
or any HTTP client to send a request to the execution service.
Tasks can be automatically triggered based on external events or conditions. This includes factors like data changes, user actions, or events from external systems that indicate the task should be executed. The system listens for specific events and executes tasks when conditions are met.
Implementation
Monitor specific contract addresses for predefined event signatures
Parse and decode emitted events from transaction logs
Trigger task execution when qualifying events occur
Tasks can be scheduled to trigger at specific times or after certain time intervals.
Tasks can be queued and executed in order of arrival or priority. A task enters a queue and is executed when its turn comes, or when resources become available.
Triggers may include specific conditions or thresholds that must be met before the task is executed. For example, a task might be triggered when a user reaches a specific condition in an application or when a predefined error threshold is exceeded.
The for the Attester rewards function
The for the Performer rewards function
The for the Aggregator rewards function
for any operator
New Task Definitions are created on-chain via the smart contract. To create a task definition, call as shown in the example below:
You can set a minimum voting power per task definition. By default, the minimum voting power is zero, which means that any active operator can participate in any consensus role and task execution. You can restrict this to having only operators with minimum shares. Learn more about voting power .
You can define a restricted operator set—an "allowlist" of operators—who are eligible to execute a particular task. This can be specified within the task definition or set as registration criteria in the .
You can define a maximum number of Attesters—who are eligible to validate a particular task. This can be specified within the task definition or set as registration criteria in the
To execute a specific task, Performer node invokes the using taskDefinitionId. Othentic framework allows you to customize the logic to trigger a task based on the different use cases.