System Architecture

This document provides a detailed explanation of the EigenLayer-AVS system architecture and the relationships between components.

This document provides a detailed explanation of the EigenLayer-AVS system architecture, including the relationships between major components, data flow patterns, and execution models. For information about smart contract integration specifically, see Smart Contract Integration.

Overview#

EigenLayer-AVS is a decentralized task automation platform built on Ethereum and integrated with EigenLayer for security. The system enables the creation and execution of automated tasks triggered by blockchain events, time schedules, or block intervals.

Sources:

Core Components#

The system consists of three main components:

ComponentDescriptionKey Responsibilities
AggregatorCentral service that coordinates operators, manages tasks, and communicates with clients via gRPC and HTTPTask management, operator coordination, data storage, authentication
OperatorsDistributed nodes that monitor blockchain events, blocks, and time triggers, then report to aggregator when tasks should runEvent monitoring, trigger detection, task execution
Task EngineProcessing system that executes task graphs with various node types including contract interactions, API calls, and moreTask compilation, VM execution, external system integration

Sources:

Aggregator Architecture#

The Aggregator acts as the central hub for the entire system, providing interfaces for clients and coordinating the operator network.

Sources:

RPC Server#

The RPC Server implements the gRPC interface defined in protobuf/avs.proto providing methods for task management, execution tracking, and operator coordination. Key services include:

  • Task Management: CreateTask, ListTasks, GetTask, DeleteTask
  • Task Execution: TriggerTask, GetExecution, GetExecutionStatus
  • Smart Account Operations: GetNonce, GetWallet, ListWallets
  • Secret Management: CreateSecret, UpdateSecret, ListSecrets, DeleteSecret
  • Authentication: GetKey for API key generation

Sources:

Operator Pool#

The Operator Pool maintains connections with registered operators, tracks their status, and distributes tasks and trigger monitoring duties. It also verifies that operators are properly registered with the EigenLayer AVS contracts.

Task Engine System#

The Task Engine compiles and executes task graphs, managing the Virtual Machine that processes individual task nodes.

Sources:

Task Model#

Tasks in the system are represented as directed graphs of nodes (operations) connected by edges (flow control). Each node performs a specific operation, and edges define the execution flow between nodes.

Sources:

Node Types#

The system supports multiple node types for different operations:

Node TypeDescriptionUse Cases
ETHTransferNodeTransfers native ETH to a destination addressSending payments, distributing funds
ContractWriteNodeExecutes a state-changing contract callContract interactions, token transfers
ContractReadNodeReads data from a contract without changing stateBalance checks, contract state queries
GraphQLQueryNodeMakes a GraphQL API queryFetching data from indexers, subgraphs
RestAPINodeMakes HTTP requests to REST APIsInteracting with external web services
BranchNodeConditional branching based on expressionsWorkflow control, decision making
FilterNodeFilters arrays based on expressionsData processing, selection
CustomCodeNodeExecutes custom JavaScript codeComplex transformations, custom logic

Sources:

Trigger Types#

Tasks can be triggered through various mechanisms:

Trigger TypeDescriptionConfiguration
ManualUser-initiated executionNo additional configuration
FixedTimeExecution at specific timestampsList of epoch timestamps
CronScheduled execution using cron syntaxCron expression (e.g., "0 */12 * * *")
BlockExecution at specific block intervalsBlock interval (e.g., every 100 blocks)
EventExecution when matching contract events occurTopic filters, address filters

Sources:

Task Execution Flow#

The following sequence diagram illustrates how tasks flow through the system from creation to execution:

Sources:

Operator System#

Operators are distributed nodes that monitor for trigger conditions and report to the aggregator when tasks should be executed.

Sources:

Operator Registration#

Operators must register with the EigenLayer AVS contracts before connecting to the aggregator. This involves:

  1. Generating BLS keys for authentication
  2. Registering with the Registry Coordinator contract
  3. Staking tokens (directly or delegated) with EigenLayer
  4. Declaring aliases in the AP Config contract
  5. Connecting to the aggregator with proper authentication

Sources:

Storage System#

The system uses BadgerDB, an embedded key-value database, for persistent storage.

The storage system maintains several key data collections:

  • Tasks: Stores task definitions, including nodes, edges, and triggers
  • Executions: Records task execution history, including step-by-step results
  • Wallets: Manages smart wallet addresses for task execution
  • Secrets: Securely stores secrets used in task definitions

Deployment Options#

The system can be deployed in several configurations:

  1. Aggregator Service: Typically managed by the Ava Protocol team, accessible at:

    • Holesky Testnet: aggregator-holesky.avaprotocol.org:2206
    • Mainnet: aggregator.avaprotocol.org:2206
  2. Operators: Can be run by the community or by the Ava Protocol team:

    • Testnet Operator: 0x997e5d40a32c44a3d93e59fc55c4fd20b7d2d49d
    • Mainnet Operator: 0xc6B87cc9e85b07365b6aBEfff061F237F7cf7Dc3

Sources:

Security Model#

The security of the system is based on several mechanisms:

  1. EigenLayer Staking: Operators stake tokens with EigenLayer, creating economic security through slashing
  2. BLS Signatures: Operators authenticate using BLS signatures
  3. API Key Authentication: Clients authenticate using API keys generated from cryptographic signatures
  4. Quorum-based Consensus: Multiple operators must agree on trigger conditions

Sources:

Conclusion#

The EigenLayer-AVS architecture provides a robust platform for decentralized task automation with strong security guarantees through EigenLayer integration. By separating the system into distinct components (Aggregator, Operators, Task Engine), it achieves scalability and resilience while maintaining coordination through the centralized aggregator service.

For more information about the smart contract integration aspects of the system, see the Smart Contract Integration page.

Feature this wiki to auto refresh weekly

Try DeepWiki on your private codebase with Devin