You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-4Lines changed: 31 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,19 @@ work as part of a Hashi-based cross-chain bridge system.
18
18
-**ROFL Runtime**: Uses Oasis confidential compute for secure oracle operations
19
19
-**Event-Driven**: Processes `BlockHeaderRequested` events in real-time
20
20
21
+
## Oracle Modes
22
+
23
+
The oracle supports four operating modes, configured via `ORACLE_MODE`:
24
+
25
+
| Mode | Use When | How It Works |
26
+
|------|----------|-------------|
27
+
|`event_listener`| A `BlockHeaderRequester` contract exists on the source chain and emits requests for specific block headers | Polls for `BlockHeaderRequested` events and submits only the requested headers |
28
+
|`push`| You need continuous, unconditional block header availability on Sapphire (e.g., for a bridge that may need any recent header) | Pushes the latest block headers at a fixed interval, regardless of demand |
29
+
|`watcher`| You want headers only for blocks where specific addresses have on-chain activity (transactions to/from) | Scans blocks for interactions with watched addresses and submits only those block headers. Supports optional internal transaction detection via `debug_traceTransaction`|
30
+
|`token_watcher`| You want headers only for blocks containing ERC-20 transfers to specific recipients (e.g., bridge deposit addresses) | Monitors `Transfer` events on configured token contracts filtered by recipient addresses, and submits headers for blocks with matching transfers |
31
+
32
+
All modes include a **heartbeat mechanism** (except `push`, which inherently submits regularly) that periodically stores a checkpoint block header even when no activity is detected, bounding sync time on oracle restart.
33
+
21
34
## Requirements
22
35
23
36
- Docker and Docker Compose
@@ -33,9 +46,9 @@ The oracle is configured through environment variables defined in `compose.yaml`
33
46
34
47
### Environment Variables
35
48
36
-
The oracle supports three modes: **event_listener**, **push**, and
37
-
**watcher**. Some environment variables are required for all modes, while
38
-
others are specific to a mode.
49
+
The oracle supports four modes: **event_listener**, **push**, **watcher**,
50
+
and **token_watcher**. Some environment variables are required for all
51
+
modes, while others are specific to a mode.
39
52
40
53
#### **Common Variables (All Modes)**
41
54
@@ -47,9 +60,10 @@ others are specific to a mode.
47
60
|`ROFL_ADAPTER_ADDRESS`| Address of the ROFLAdapter contract on Oasis Sapphire | - |**Yes**|
48
61
|`REQUEST_TIMEOUT`| HTTP request timeout (seconds) |`30`| No |
49
62
|`RETRY_COUNT`| Number of retry attempts for operations |`3`| No |
50
-
|`ORACLE_MODE`| Operating mode: `event_listener`, `push`, or `watcher`|`event_listener`| No |
63
+
|`ORACLE_MODE`| Operating mode (see [Oracle Modes](#oracle-modes)) |`event_listener`| No |
0 commit comments