Liveliness AVS Sample

Intro

AVSs, much like Ethereum, employ slashing in order to disincentivize unlawful behavior. However, unlike Ethereum, AVSs do not account by default for the problem of inactive operators.

Instead of requiring each AVS to implement a system that punishes unhealthy behavior, AVSs can rely on data provided by Liveliness AVS.

Liveliness AVS has two main functions:

  • Facilitate consensus on unhealthy operator behavior

  • Manage a reputation system for registered operators

Any AVS operator can join the network and start gaining a reputation profile by consistently being available when the network chooses to test its healthiness.

Operators are compensated with a reputation score and punished if the network reaches a consensus on unhealthy behavior within a specific period of time.

This is WIP AVS and not a finalized product.

How It Works

In addition to joining the AVS, operators need to register an endpoint that will provide health proofs when queried. Operators can also choose not to register an endpoint, but as a result, they will not gain a reputation.

Task Performer

Task Performer executes a task, provides a Proof of Task, and sends the results to Attesters. The Performer is punished if inactive for a long time or if performs a task incorrectly.

The Task Performer performs the following steps at regular intervals:

  • Chooses a random operator set

  • Queries their healthcheck endpoints

  • Publishes a task to the network for the operators’ response (healthy/not healthy)

Task Attesters

Task Attesters are the quorum that attests to the validity of the executed task.

The Task Attesters quorum performs the following steps when a task is submitted:

  • Validates the health statuses of operators submitted in the task

  • Votes on the task accordingly

Task Aggregator

Task Aggregator listens to events from the Attester nodes and monitors the necessary voting power contribution to a certain task. The Aggregator aggregates the signatures of the Attesters into a BLS aggregated signature and submits a transaction.

Whenever there are enough votes (66% approval of voting power) any operator can aggregate the votes of the network and submit the task on-chain.

Submitting the task on-chain updates the LivelinessRegistry contract, which holds the reputation scores of all operators in the network.

In order to save gas, reputation scores are calculated dynamically from the amount of penalties an operator has. The function of reputation scores is: blockRegistered - penalties * C where C is an arbitrary penalty factor. Reputation scores grow linearly indefinitely.

AVSs can use reputation scores to activate slashing and penalty conditions or leverage the system for other applications, such as reputation-based access gating.

How To Run Locally

Prerequisites:

Steps:

  • Remove any installation of the othentic-cli.

  • Install the test version of the cli:

> npm install @othentic/othentic-cli-test
  • Clone Liveliness-AVS and switch to the branch:

> git clone git@github.com:Othentic-Labs/Liveliness-AVS.git
> cd Liveliness-AVS
> git switch SCRUM-114/liveliness-avs
  • Fill up .env files (look at .env.example for reference)

  • Deploy LivelinessRegistry.sol (read LivelinessRegistry.s.sol for instructions)

  • Register all operators to liveliness registry by running Liveliness_AVS_JS/register_liveliness.sh

  • Run docker-compose up --build

Last updated