Skip to content

Commit 4db77ef

Browse files
authored
Merge pull request #703 from lidofinance/csm_into_oracle
feat: add CSM to the oracle manual
2 parents 2fe3e41 + fb20140 commit 4db77ef

File tree

1 file changed

+65
-22
lines changed

1 file changed

+65
-22
lines changed

docs/guides/oracle-operator-manual.md

Lines changed: 65 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Due to the lack of native communication between these two networks, Lido employs
99
2. Launch and sync an [archive](https://ethereum.org/en/developers/docs/nodes-and-clients/#archive-node) (archive data for at least 2 weeks) Execution Layer node with JSON-RPC endpoint enabled.
1010
3. Launch and sync an [archive](https://ethereum.org/en/developers/docs/nodes-and-clients/#archive-node) Consensus Layer node with API endpoint enabled.
1111
4. Launch and sync a [Keys API Service](https://github.com/lidofinance/lido-keys-api).
12-
5. Launch the accounting and ejector modules of Oracle.
12+
5. Launch the **accounting**, **ejector**, and **csm** modules of the Oracle.
1313
6. [**Optional**] Add alerts to Oracle's Prometheus metrics.
14-
7. In case of mainnet share your address and intention to join the Oracle set with public. You need to publish it on Twitter and also write a message with a twitter link under Onboarding post on [the Research forum](https://research.lido.fi/).
15-
8. Propose your Oracle's ethereum address to Lido Team to vote on your address being added to the Oracle Members.
14+
7. In case of mainnet, share your address and intention to join the Oracle set with the public. You need to publish it on Twitter and also write a message with a Twitter link under the Onboarding post on [the Research forum](https://research.lido.fi/). You need to publish it on Twitter and also write a message with a twitter link under the Onboarding post on [the Research forum](https://research.lido.fi/).
15+
8. Propose your Oracle's Ethereum address to the Lido team to vote on adding your address to the Oracle Members.
1616

1717
## Intro
1818

@@ -113,45 +113,45 @@ The latest updates can be found in the [Expansion of Lido on Ethereum Oracle set
113113

114114
### Execution Client Node
115115

116-
To prepare the report, Oracle fetches up to 10 days old events, makes historical requests for balance data and makes simulated reports on historical blocks. This requires an [archive](https://ethereum.org/en/developers/docs/nodes-and-clients/#archive-node) execution node.
117-
Oracle needs two weeks of archived data.
116+
To prepare reports, the Oracle might fetch a few months' worth of old events. It also makes historical requests for balance data and simulates reports on historical blocks. This requires an [archive](https://ethereum.org/en/developers/docs/nodes-and-clients/#archive-node) execution node.
118117

119118
| Client | Tested | Notes |
120-
|-------------------------------------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
121-
| [Geth](https://geth.ethereum.org/) | | `--gcmode=archive` <br/> `--syncmode=snap` <br/><br/>OR<br/><br/>`--gcmode=archive`<br/>`--syncmode=full` |
122-
| [Nethermind](https://nethermind.io/) | | Not tested yet |
123-
| [Besu](https://besu.hyperledger.org/en/stable/) | | Use <br/>`--rpc-max-logs-range=100000` <br/> `--sync-mode=FULL` <br/> `--data-storage-format="FOREST"` <br/> `--pruning-enabled` <br/>`--pruning-blocks-retained=100000` <br/> params |
124-
| [Erigon](https://github.com/ledgerwatch/erigon) | | Use <br/> `--prune=htc` <br/> `--prune.h.before=100000` <br/> `--prune.t.before=100000` <br/> `--prune.c.before=100000` <br/> params |
119+
|-------------------------------------------------|:------:|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
120+
| [Geth](https://geth.ethereum.org/) | 🟢 | `--gcmode=archive` <br/> `--syncmode=snap` <br/><br/>OR<br/><br/>`--gcmode=archive`<br/>`--syncmode=full` |
121+
| [Nethermind](https://nethermind.io/) | 🔴 | Not tested yet |
122+
| [Besu](https://besu.hyperledger.org/en/stable/) | 🔴 | Recent changes require FULL sync |
123+
| [Erigon](https://github.com/ledgerwatch/erigon) | 🟢 | Use<br/> `--prune=rhtc`<br/> `--prune.r.before=324000`<br/> `--prune.h.before=324000`<br/> `--prune.t.before=256`<br/> `--prune.c.before=256`<br/> params |
124+
| [Reth](https://reth.rs/) | 🔴 | Not tested yet |
125125

126126
### Consensus Client Node
127127

128128
To calculate some metrics for bunker mode Oracle needs [archive](https://ethereum.org/en/developers/docs/nodes-and-clients/#archive-node) consensus node.
129129

130130
| Client | Tested | Notes |
131-
|---------------------------------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
132-
| [Lighthouse](https://lighthouse.sigmaprime.io/) | | Use `--reconstruct-historic-states` param |
133-
| [Lodestar](https://nethermind.io/) | | Not tested yet |
134-
| [Nimbus](https://nimbus.guide/quick-start.html) | | Not tested yet |
135-
| [Prysm](https://github.com/ledgerwatch/erigon) | | Use <br/> `--grpc-max-msg-size=104857600` <br/> `--enable-historical-state-representation=true` <br/> `--slots-per-archive-point=1024` <br/> params |
136-
| [Teku](https://docs.teku.consensys.net) | | Use <br/> `--data-storage-mode=archive` <br/>`--data-storage-archive-frequency=1024`<br/> `--reconstruct-historic-states=true`<br/> params |
131+
|---------------------------------------------------|:------:|-----------------------------------------------------------------------------------------------------------------------------------------------------|
132+
| [Lighthouse](https://lighthouse.sigmaprime.io/) | 🟢 | Use `--reconstruct-historic-states` param |
133+
| [Lodestar](https://nethermind.io/) | 🔴 | Not tested yet |
134+
| [Nimbus](https://nimbus.guide/quick-start.html) | 🔴 | Not tested yet |
135+
| [Prysm](https://github.com/ledgerwatch/erigon) | 🟢 | Use <br/> `--grpc-max-msg-size=104857600` <br/> `--enable-historical-state-representation=true` <br/> `--slots-per-archive-point=1024` <br/> params |
136+
| [Teku](https://docs.teku.consensys.net) | 🟢 | Use <br/> `--data-storage-mode=archive` <br/>`--data-storage-archive-frequency=1024`<br/> `--reconstruct-historic-states=true`<br/> params |
137+
| [Grandine](https://grandine.io/) | 🔴 | Not tested yet |
137138

138139
### Keys API Service
139140

140-
This is a separate service that uses Execution Client to fetch all lido keys. It stores the latest state of lido keys in database.
141+
This is a separate service that uses the Execution Client to fetch all Lido keys. It stores the latest state of Lido keys in a database.
141142

142143
[Lido Keys API repository.](https://github.com/lidofinance/lido-keys-api)
143144

144145
## The oracle daemon
145146

146-
The Oracle daemon is a Python application that contains two modules:
147+
The Oracle daemon is a Python application that contains the following modules:
147148

148149
- Accounting module
149150
- Ejector module
151+
- CSM module
150152

151153
The oracle source code is available at [https://github.com/lidofinance/lido-oracle](https://github.com/lidofinance/lido-oracle).
152154

153-
Modules fetch the reportable slot, and if this slot is finalized, calculate and send the report to AccountingOracle and ExitBusOracle smart contracts.
154-
155155
### Environment variables
156156

157157
The oracle daemon requires the following environment variables:
@@ -163,6 +163,13 @@ The oracle daemon requires the following environment variables:
163163
- `KEYS_API_URI` - list of Key API client uris separated with comma. The second and next uris will be used as fallback.
164164
- `LIDO_LOCATOR_ADDRESS` - Lido Locator smart contract address.
165165

166+
Additional variables required by the CSM module:
167+
168+
- `CSM_MODULE_ADDRESS` - Community Staking Module address.
169+
- `PINATA_JWT` - Pinata IPFS provider JWT token.
170+
- `PINATA_DEDICATED_GATEWAY_URL` - Pinata IPFS provider dedicated gateway URL.
171+
- `PINATA_DEDICATED_GATEWAY_TOKEN` - Pinata IPFS provider dedicated gateway access token.
172+
166173
**Optional**
167174

168175
**One of:**
@@ -177,8 +184,8 @@ Full list could be found [here](https://github.com/lidofinance/lido-oracle#env-v
177184
**Mainnet**
178185
**[0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb](https://etherscan.io/address/0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb)**
179186

180-
**Holešky**
181-
**[0x28FAB2059C713A7F9D8c86Db49f9bb0e96Af1ef8](https://holesky.etherscan.io/address/0x28FAB2059C713A7F9D8c86Db49f9bb0e96Af1ef8)**
187+
**Hoodi**
188+
**[0xe2EF9536DAAAEBFf5b1c130957AB3E80056b06D8 ](https://hoodi.etherscan.io/address/0xe2EF9536DAAAEBFf5b1c130957AB3E80056b06D8 )**
182189

183190
### Running the daemon
184191

@@ -206,6 +213,42 @@ docker run -d --name lido-oracle-ejector \
206213
lidofinance/oracle@<image-hash> ejector
207214
```
208215

216+
Startup CSM module
217+
218+
```shell
219+
docker run -d --name lido-oracle-csm \
220+
--env "EXECUTION_CLIENT_URI=$EXECUTION_CLIENT_URI" \
221+
--env "CONSENSUS_CLIENT_URI=$CONSENSUS_CLIENT_URI" \
222+
--env "KEYS_API_URI=$KEYS_API_URI" \
223+
--env "LIDO_LOCATOR_ADDRESS=$LOCATOR_ADDRESS" \
224+
--env "MEMBER_PRIV_KEY=$MEMBER_PRIV_KEY" \
225+
--env "CSM_MODULE_ADDRESS=$CSM_MODULE_ADDRESS" \
226+
--env "PINATA_JWT=$PINATA_JWT" \
227+
--env "PINATA_DEDICATED_GATEWAY_URL=$PINATA_DEDICATED_GATEWAY_URL" \
228+
--env "PINATA_DEDICATED_GATEWAY_TOKEN=$PINATA_DEDICATED_GATEWAY_TOKEN" \
229+
lidofinance/oracle@<image-hash> csm
230+
```
231+
232+
#### Persistent cache of CSM module
233+
234+
CSM module of the Oracle uses a cache to store per-epoch data of network-wide validator performance. It takes a significant amount of time to collect the data from scratch. That's why it's encouraged to set up a persistent cache location for the oracle outside of a Docker container in order to keep the cache in case of container destruction for maintenance purposes.
235+
236+
The `CACHE_PATH` environment variable sets the path to a directory where the oracle will store its cache. Run the container with the additional arguments:
237+
238+
```shell
239+
docker run -d --name lido-oracle-csm \
240+
"...required_variables_from_the_example_above" \
241+
--env "CACHE_PATH=/app/cache" \
242+
--volume "/var/lib/lido_csm_cache/:/app/cache"
243+
lidofinance/oracle@<image-hash> csm
244+
```
245+
246+
Make sure the correct permissions are set up for the mounted directory. The UID of the oracle process in the image provided by Lido is `33`, and it might require changing the owner of the directory on the host machine:
247+
248+
```shell
249+
chown -R 33:33 /path/to/cache/on/host
250+
```
251+
209252
**Latest image hash**
210253
[https://docs.lido.fi/guides/tooling/#oracle](https://docs.lido.fi/guides/tooling/#oracle)
211254

0 commit comments

Comments
 (0)