-
Notifications
You must be signed in to change notification settings - Fork 82
feat: Bots docs #915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: Bots docs #915
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # Late Prover Bot | ||
|
|
||
| ## Introduction | ||
|
|
||
| Late Prover Bot monitors the beacon chain for validator exit requests that have passed their required deadline. When a validator fails to exit on time, the bot generates a cryptographic Merkle proof of the delay and submits it to the `ValidatorExitDelayVerifier` smart contract, enabling penalty enforcement on the responsible node operator. | ||
|
|
||
| ## Requirements | ||
|
|
||
| ### Hardware | ||
|
|
||
| - 1-core CPU | ||
| - 8GB RAM | ||
|
|
||
| ### Nodes | ||
|
|
||
| - Ethereum EL RPC service | ||
| - Ethereum CL API service (Beacon Node) | ||
|
|
||
| ## How to use | ||
|
|
||
| The bot runs as a daemon, continuously processing finalized beacon chain roots. For each root, it discovers `ValidatorsExitBusOracle` events in the corresponding EL block range, groups validators by their exit deadline slot, and generates proofs for any that have exceeded their deadline. Proofs are submitted in batches via `verifyValidatorExitDelay()` (or `verifyHistoricalValidatorExitDelay()` for older roots). | ||
|
|
||
| ### Envs | ||
|
|
||
| Required variables are (mainnet): | ||
|
|
||
| | Variable | Default | Description | | ||
| |---|---|---| | ||
| | `CHAIN_ID` | - | Ethereum chain ID. `1` for mainnet, `560048` for Hoodi | | ||
| | `EL_RPC_URLS` | - | Comma-separated list of EL RPC endpoints | | ||
| | `CL_API_URLS` | - | Comma-separated list of CL Beacon API endpoints | | ||
| | `LIDO_LOCATOR_ADDRESS` | - | Lido Locator contract address. Addresses for each network can be found [here](/deployed-contracts/) | | ||
| | `TX_SIGNER_PRIVATE_KEY` | - | Private key used to sign and submit transactions. Not required when `DRY_RUN=true` | | ||
| | `DRY_RUN` | `false` | If `true`, proofs are generated but transactions are not sent | | ||
|
|
||
| Optional variables can be found [here](https://github.com/lidofinance/late-prover-bot#readme). | ||
|
|
||
| ## Running | ||
|
|
||
| ### Source Code | ||
|
|
||
| 1. Clone repository and install requirements: | ||
| ```bash | ||
| git clone git@github.com:lidofinance/late-prover-bot.git | ||
| cd late-prover-bot | ||
| ``` | ||
| 2. Install dependencies: | ||
| ```bash | ||
| yarn install | ||
| yarn run typechain | ||
| yarn build | ||
| ``` | ||
| 3. Run the bot: | ||
| ```bash | ||
| yarn run start:prod | ||
| ``` | ||
|
|
||
| ### Docker | ||
|
|
||
| Docker image can be found [here](/guides/tooling/#late-prover-bot). | ||
|
F4ever marked this conversation as resolved.
|
||
|
|
||
| ## Monitoring | ||
|
|
||
| Prometheus metrics and health check are available on the same port: | ||
| - `http://localhost:${HTTP_PORT}/metrics` | ||
| - `http://localhost:${HTTP_PORT}/health` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Validator Exit Bot | ||
|
|
||
| ## Introduction | ||
|
|
||
| Validator Exit Bot automates triggering exits for Lido validators that have missed their exit deadline. The bot monitors the [ValidatorExitBusOracle](/guides/oracle-spec/validator-exit-bus) for exit requests, checks the current status of each validator on the beacon chain, and uses [EIP-7002](https://eips.ethereum.org/EIPS/eip-7002) triggerable exits to force the exit of any validator that has not exited on time. Exit trigger fees are paid from the bot's account and refunded by the withdrawal vault. | ||
|
|
||
| ## Requirements | ||
|
|
||
| ### Hardware | ||
|
|
||
| - 1-core CPU | ||
| - 1GB RAM | ||
|
|
||
| ### Nodes | ||
|
|
||
| - Ethereum EL RPC service | ||
| - Ethereum CL API service (Beacon Node) | ||
|
|
||
| ## How to use | ||
|
|
||
| On startup the bot fetches historical `ExitDataProcessing` events from the `ValidatorExitBusOracle` for the configured lookback period. It then runs in a continuous loop: for each validator in its state, the bot checks whether the validator has already exited on the CL, and if not, whether it has missed its exit deadline. Validators past their deadline are included in a batched `trigger_exits` transaction. The bot's address is set as the refund recipient to recover the per-validator withdrawal request fee. | ||
|
|
||
| ### Envs | ||
|
|
||
| Required variables are (mainnet): | ||
|
|
||
| | Variable | Default | Description | | ||
| |---|---|---| | ||
| | `WEB3_RPC_ENDPOINTS` | - | Comma-separated list of EL RPC endpoints | | ||
|
F4ever marked this conversation as resolved.
|
||
| | `CONSENSUS_CLIENT_URL` | - | CL Beacon API endpoint | | ||
| | `WALLET_PRIVATE_KEY` | - | Private key used to send transactions. Omit to run in dry mode (no transactions sent) | | ||
| | `LIDO_LOCATOR` | `0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb` | Lido Locator address for Ethereum mainnet. Addresses for other supported networks can be found [here](/deployed-contracts/) | | ||
| | `DRY_RUN` | `false` | If `true`, transactions are built but not submitted | | ||
|
|
||
| Optional variables can be found [here](https://github.com/lidofinance/validator-exit-bot#readme). | ||
|
|
||
| ## Running | ||
|
|
||
| ### Source Code | ||
|
|
||
| 1. Clone repository and install requirements: | ||
| ```bash | ||
| git clone git@github.com:lidofinance/validator-exit-bot.git | ||
| cd validator-exit-bot | ||
| ``` | ||
| 2. Install requirements: | ||
| ```bash | ||
| poetry install | ||
| ``` | ||
| 3. Run validator exit bot: | ||
| ```bash | ||
| poetry run python -m src.main | ||
| ``` | ||
|
|
||
| ### Docker | ||
|
|
||
| Docker image can be found [here](/guides/tooling/#validator-exit-bot). | ||
|
F4ever marked this conversation as resolved.
|
||
|
|
||
| ## Monitoring | ||
|
|
||
| Prometheus metrics will be available on endpoint `http://localhost:${PROMETHEUS_PORT}/metrics`. | ||
|
|
||
| Health check endpoint: `http://localhost:${SERVER_PORT}/health`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.