Documentation for Trigger Engines in the EigenLayer-AVS system.
Trigger Engines are a critical component of the EigenLayer-AVS platform's automation capabilities. They enable operators to monitor various sources (blockchain events, blocks, and time intervals) to determine when tasks should be executed. When a trigger condition is met, the operator notifies the Aggregator, which then initiates task execution.
This page documents the different trigger mechanisms implemented in the system, their internal architecture, and how they integrate with the Operator subsystem. For information about how triggers are defined in the Task Model, see Task Model.
Sources:
The Trigger Engine system consists of a base CommonTrigger structure that provides shared functionality for all trigger types, with specialized implementations for different trigger sources (events, blocks, and time intervals).
Sources:
This diagram illustrates how triggers initiate task execution in the EigenLayer-AVS system. When a trigger condition is met, the corresponding trigger engine notifies the operator, which then reports to the aggregator to execute the task.
Sources:
All trigger types extend a common base structure that provides shared functionality:
The CommonTrigger structure provides:
Each specific trigger type embeds this common structure and implements its own monitoring and evaluation logic.
Sources:
The EigenLayer-AVS system supports three main trigger types:
| Trigger Type | Description | Monitoring Source | Marker Type |
|---|---|---|---|
| Event Trigger | Executes tasks when specific blockchain events occur | Ethereum event logs | EventMark (BlockNumber, LogIndex, TxHash) |
| Block Trigger | Executes tasks on specific block intervals | Ethereum block headers | Block Number (int64) |
| Time Trigger | Executes tasks at specific time intervals | System clock | Timestamp (time.Time) |
Each trigger type monitors different sources using specialized logic but follows a similar pattern of subscribing to data sources, evaluating conditions, and notifying when triggers occur.
Sources:
The Event Trigger Engine monitors blockchain event logs and executes tasks when specified conditions are met.
The Event Trigger Engine consists of:
Sources:
Event triggers can be defined using two methods:
Matcher-based conditions: Simple conditions that match specific event properties:
topics: Match event topics (e.g., event signatures and indexed parameters)address: Match the contract address that emitted the eventJavaScript expressions: Advanced conditions using a JavaScript expression to evaluate event data:
chainlinkPrice)When a blockchain event occurs, the Event Trigger Engine evaluates all registered checks against the event and notifies when conditions are met.
Sources:
When evaluating an event against a trigger condition, the following process occurs:
If the check has Matcher conditions:
If the check has a JavaScript expression:
If the condition is met, send a notification with the task ID and event details
Sources:
The Block Trigger Engine monitors blockchain blocks and executes tasks at specified block intervals.
The Block Trigger Engine consists of:
Sources:
Block triggers are simpler than event triggers and operate based on block number intervals:
When a task with a block trigger is registered, it's added to a schedule map with its block interval
The system subscribes to new block headers from the Ethereum network
For each new block:
This enables tasks to run periodically based on blockchain progression rather than wall-clock time.
Sources:
All trigger engines include error handling and reconnection logic for RPC connections:
This ensures resilience against temporary RPC failures and network issues.
Sources:
The trigger engines include several optimizations to ensure efficient operation:
Additionally, the system logs metrics about the number of checks processed and their processing rate, which helps identify performance bottlenecks.
Sources:
Trigger engines are initialized and managed by the Operator component:
This separation of concerns allows each trigger engine to focus on its specific monitoring logic while the Operator handles coordination with the broader system.
Sources:
The Trigger Engines in EigenLayer-AVS provide a flexible and extensible system for task automation based on blockchain events, blocks, and time intervals. Key features include:
These engines enable sophisticated automation workflows that respond to on-chain events and conditions, forming a core part of the EigenLayer-AVS automation platform.
Feature this wiki to auto refresh weekly