Skip to content

Commit

Permalink
Update database size
Browse files Browse the repository at this point in the history
  • Loading branch information
chong-he committed Dec 11, 2023
1 parent ad95220 commit 37c5c3d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions book/src/advanced_database.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ 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 |
| 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 |
| Hobbyist | 4096 | 26.8 GB | 20.5 s |
| Validator only (default) | 8192 | 12.7 GB | 41 s |
| Research | 32 | more than 10 TB | 155 ms |
| Enthusiast (prev. default) | 2048 | hundreds of GB | 10.2 s |
| Validator only (default) | 8192 | tens of GB | 41 s |

*Last update: May 2023.
*Last update: Dec 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
Expand All @@ -46,7 +44,7 @@ The values shown in the table are approximate, calculated using a simple heurist
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.
To run a full archival node with fast access to beacon states and a SPRP of 32, the disk usage will be more than 10 TB per year, which is impractical for many users. As such, users may consider running the [tree-states](https://github.com/sigp/lighthouse/releases/tag/v4.5.444-exp) release, which only uses less than 150 GB for a full archival node. The caveat is that it is currently experimental and in alpha release (as of Dec 2023), thus not recommended for running mainnet validators. Nevertheless, it is suitable to be used for analysis purposes, and if you encounter any issues in tree-states, we do appreciate any feedback. We plan to have a stable release of tree-states in 1H 2024.

### Defaults

Expand Down

0 comments on commit 37c5c3d

Please sign in to comment.