Update Lighthouse Book API and Advanced Usage section (#4300)

## Issue Addressed

Update Information in Lighthouse Book

## Proposed Changes

- move Validator Graffiti from Advanced Usage to Validator Management
- update API response and command
- some items that aren't too sure I put it in comment, which can be seen in raw/review format but not live


## Additional Info

Please provide any additional information. For example, future considerations
or information useful for reviewers.


Co-authored-by: chonghe <44791194+chong-he@users.noreply.github.com>
This commit is contained in:
chonghe
2023-06-02 03:17:36 +00:00
parent 749a242b0f
commit 6c769ed86c
20 changed files with 706 additions and 278 deletions

View File

@@ -23,13 +23,17 @@ states to slow down dramatically. A lower _slots per restore point_ value (SPRP)
frequent restore points, while a higher SPRP corresponds to less frequent. The table below shows
some example values.
| Use Case | SPRP | Yearly Disk Usage | Load Historical State |
|--------------------------|------|-------------------|-----------------------|
| Block explorer/analysis | 32 | 1.4 TB | 155 ms |
| Hobbyist (prev. default) | 2048 | 23.1 GB | 10.2 s |
| Validator only (default) | 8192 | 5.7 GB | 41 s |
| Use Case | SPRP | Yearly Disk Usage* | Load Historical State |
|----------------------------|------|-------------------|-----------------------|
| Research | 32 | 3.4 TB | 155 ms |
| Block explorer/analysis | 128 | 851 GB | 620 ms |
| Enthusiast (prev. default) | 2048 | 53.6 GB | 10.2 s |
| EHobbyist | 4096 | 26.8 GB | 20.5 s |
| Validator only (default) | 8192 | 8.1 GB | 41 s |
As you can see, it's a high-stakes trade-off! The relationships to disk usage and historical state
*Last update: May 2023.
As we can see, it's a high-stakes trade-off! The relationships to disk usage and historical state
load time are both linear doubling SPRP halves disk usage and doubles load time. The minimum SPRP
is 32, and the maximum is 8192.
@@ -38,9 +42,11 @@ The default value is 8192 for databases synced from scratch using Lighthouse v2.
The values shown in the table are approximate, calculated using a simple heuristic: each
`BeaconState` consumes around 18MB of disk space, and each block replayed takes around 5ms. The
**Yearly Disk Usage** column shows the approx size of the freezer DB _alone_ (hot DB not included),
and the **Load Historical State** time is the worst-case load time for a state in the last slot
before a restore point.
**Yearly Disk Usage** column shows the approximate size of the freezer DB _alone_ (hot DB not included), calculated proportionally using the total freezer database disk usage.
The **Load Historical State** time is the worst-case load time for a state in the last slot
before a restore point.
As an example, we use an SPRP of 4096 to calculate the total size of the freezer database until May 2023. It has been about 900 days since the genesis, the total disk usage by the freezer database is therefore: 900/365*26.8 GB = 66 GB.
### Defaults
@@ -68,6 +74,8 @@ The historical state cache size can be specified with the flag `--historic-state
lighthouse beacon_node --historic-state-cache-size 4
```
> Note: This feature will cause high memory usage.
## Glossary
* _Freezer DB_: part of the database storing finalized states. States are stored in a sparser