Skip to content

Commit

Permalink
chore: add desc to README
Browse files Browse the repository at this point in the history
  • Loading branch information
vgorkavenko committed Feb 5, 2024
1 parent 4c733df commit df0dc33
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@

Tool for reporting Slashings and Withdrawals for Lido Community Staking Module

### Daemon working mode

The tool is a daemon that listens to the CL and reports any slashings and withdrawals to the Lido Community Staking Module.

The algorithm is as follows:
0. Get the current CL finalized head.
1. Run `KeysIndexer` service to get the current validator set of the CS Module.
> It is necessary at the first startup. All subsequent runs of the indexer will be performed when necessary and independently of the main processing*
2. Choose the next block service to process from `RootsProvider`.
> The provider chooses the next root with the following priority:
> - Return the root from `RootsStack` service if exists and `KeyIndexer` is helthy enougth to be trusted completely to process this root
> - *When no any processed roots yet* Return a configured root (from `.env` file) or the last finalized root
> - Return a finalized child root of the last processed root
> - Sleep 12s if nothing to process and **return to the step 0**
3. Run `RootsProcessor` service to process the root.
> The processor does the following:
> - Get the block info from CL by the root
> - If the current state of `KeysIndexer` is outdated (~15-27h behind from the block) to be trusted completely, add the block root to `RootsStack`
> - If the block has a slashing or withdrawal, report it to the CS Module
> - If the current state of `KeysIndexer` is helthy enougth to be trusted completely, remove the root from `RootsStack`
## Installation

```bash
Expand Down

0 comments on commit df0dc33

Please sign in to comment.