Skip to content

Commit 6b413cc

Browse files
chong-hedanielrachi1
authored andcommitted
Some updates in Lighthouse Book (sigp#5000)
* Add jq in api-bn * Update beaconstate size * Add fields to web3signer API * Link web3signer API * Update /lighthouse/logs in table * plural * update slasher doc * update FAQ * Add link in validator section * Add more info on state pruning * Update database size * Merge branch 'unstable' into book-update * Revise Siren for vc to connect bn * Merge branch 'book-update' of https://github.com/chong-he/lighthouse into book-update * Corrections to siren faq * Fix typos * Update release date for 4.6.0 * Merge branch 'unstable' into book-update
1 parent f30884e commit 6b413cc

File tree

9 files changed

+68
-32
lines changed

9 files changed

+68
-32
lines changed

book/src/advanced_database.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,13 @@ states to slow down dramatically. A lower _slots per restore point_ value (SPRP)
2323
frequent restore points, while a higher SPRP corresponds to less frequent. The table below shows
2424
some example values.
2525

26-
| Use Case | SPRP | Yearly Disk Usage* | Load Historical State |
26+
| Use Case | SPRP | Yearly Disk Usage*| Load Historical State |
2727
|----------------------------|------|-------------------|-----------------------|
28-
| Research | 32 | 3.4 TB | 155 ms |
29-
| Block explorer/analysis | 128 | 851 GB | 620 ms |
30-
| Enthusiast (prev. default) | 2048 | 53.6 GB | 10.2 s |
31-
| Hobbyist | 4096 | 26.8 GB | 20.5 s |
32-
| Validator only (default) | 8192 | 12.7 GB | 41 s |
28+
| Research | 32 | more than 10 TB | 155 ms |
29+
| Enthusiast (prev. default) | 2048 | hundreds of GB | 10.2 s |
30+
| Validator only (default) | 8192 | tens of GB | 41 s |
3331

34-
*Last update: May 2023.
32+
*Last update: Dec 2023.
3533

3634
As we can see, it's a high-stakes trade-off! The relationships to disk usage and historical state
3735
load time are both linear – doubling SPRP halves disk usage and doubles load time. The minimum SPRP
@@ -41,12 +39,12 @@ The default value is 8192 for databases synced from scratch using Lighthouse v2.
4139
2048 for prior versions. Please see the section on [Defaults](#defaults) below.
4240

4341
The values shown in the table are approximate, calculated using a simple heuristic: each
44-
`BeaconState` consumes around 18MB of disk space, and each block replayed takes around 5ms. The
42+
`BeaconState` consumes around 145MB of disk space, and each block replayed takes around 5ms. The
4543
**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.
4644
The **Load Historical State** time is the worst-case load time for a state in the last slot
4745
before a restore point.
4846

49-
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.
47+
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.
5048

5149
### Defaults
5250

book/src/api-bn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ The `jq` tool is used to format the JSON data properly. If it returns `jq: comma
100100
Shows the status of validator at index `1` at the `head` state.
101101

102102
```bash
103-
curl -X GET "http://localhost:5052/eth/v1/beacon/states/head/validators/1" -H "accept: application/json"
103+
curl -X GET "http://localhost:5052/eth/v1/beacon/states/head/validators/1" -H "accept: application/json" | jq
104104
```
105105

106106
```json

book/src/api-vc-endpoints.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ HTTP Path | Description |
1616
[`POST /lighthouse/validators/keystore`](#post-lighthousevalidatorskeystore) | Import a keystore.
1717
[`POST /lighthouse/validators/mnemonic`](#post-lighthousevalidatorsmnemonic) | Create a new validator from an existing mnemonic.
1818
[`POST /lighthouse/validators/web3signer`](#post-lighthousevalidatorsweb3signer) | Add web3signer validators.
19+
[`GET /lighthouse/logs`](#get-lighthouselogs) | Get logs
1920

2021
The query to Lighthouse API endpoints requires authorization, see [Authorization Header](./api-vc-auth-header.md).
2122

@@ -745,27 +746,27 @@ Create any number of new validators, all of which will refer to a
745746
"graffiti": "Mr F was here",
746747
"suggested_fee_recipient": "0xa2e334e71511686bcfe38bb3ee1ad8f6babcc03d",
747748
"voting_public_key": "0xa062f95fee747144d5e511940624bc6546509eeaeae9383257a9c43e7ddc58c17c2bab4ae62053122184c381b90db380",
749+
"builder_proposals": true,
748750
"url": "http://path-to-web3signer.com",
749-
"root_certificate_path": "/path/on/vc/filesystem/to/certificate.pem",
751+
"root_certificate_path": "/path/to/certificate.pem",
752+
"client_identity_path": "/path/to/identity.p12",
753+
"client_identity_password": "pass",
750754
"request_timeout_ms": 12000
751755
}
752756
]
757+
753758
```
754759

755-
The following fields may be omitted or nullified to obtain default values:
760+
Some of the fields above may be omitted or nullified to obtain default values (e.g., `graffiti`, `request_timeout_ms`).
756761

757-
- `graffiti`
758-
- `suggested_fee_recipient`
759-
- `root_certificate_path`
760-
- `request_timeout_ms`
761762

762763
Command:
763764
```bash
764765
DATADIR=/var/lib/lighthouse
765766
curl -X POST http://localhost:5062/lighthouse/validators/web3signer \
766767
-H "Authorization: Bearer $(cat ${DATADIR}/validators/api-token.txt)" \
767768
-H "Content-Type: application/json" \
768-
-d "[{\"enable\":true,\"description\":\"validator_one\",\"graffiti\":\"Mr F was here\",\"suggested_fee_recipient\":\"0xa2e334e71511686bcfe38bb3ee1ad8f6babcc03d\",\"voting_public_key\":\"0xa062f95fee747144d5e511940624bc6546509eeaeae9383257a9c43e7ddc58c17c2bab4ae62053122184c381b90db380\",\"url\":\"http://path-to-web3signer.com\",\"request_timeout_ms\":12000}]"
769+
-d "[{\"enable\":true,\"description\":\"validator_one\",\"graffiti\":\"Mr F was here\",\"suggested_fee_recipient\":\"0xa2e334e71511686bcfe38bb3ee1ad8f6babcc03d\",\"voting_public_key\":\"0xa062f95fee747144d5e511940624bc6546509eeaeae9383257a9c43e7ddc58c17c2bab4ae62053122184c381b90db380\",\"builder_proposals\":true,\"url\":\"http://path-to-web3signer.com\",\"root_certificate_path\":\"/path/to/certificate.pem\",\"client_identity_path\":\"/path/to/identity.p12\",\"client_identity_password\":\"pass\",\"request_timeout_ms\":12000}]"
769770
```
770771

771772

book/src/database-migrations.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ validator client or the slasher**.
1616

1717
| Lighthouse version | Release date | Schema version | Downgrade available? |
1818
|--------------------|--------------|----------------|----------------------|
19+
1920
| v4.6.0 | Dec 2023 | v19 | yes before Deneb |
2021
| v4.6.0-rc.0 | Dec 2023 | v18 | yes before Deneb |
2122
| v4.5.0 | Sep 2023 | v17 | yes |
@@ -158,8 +159,7 @@ lighthouse db version --network mainnet
158159

159160
Pruning historic states helps in managing the disk space used by the Lighthouse beacon node by removing old beacon
160161
states from the freezer database. This can be especially useful when the database has accumulated a significant amount
161-
of historic data. This command is intended for nodes synced before 4.4.1, as newly synced node no longer store
162-
historic states by default.
162+
of historic data. This command is intended for nodes synced before 4.4.1, as newly synced nodes no longer store historic states by default.
163163

164164
Here are the steps to prune historic states:
165165

@@ -175,14 +175,27 @@ Here are the steps to prune historic states:
175175
sudo -u "$LH_USER" lighthouse db prune-states --datadir "$LH_DATADIR" --network "$NET"
176176
```
177177

178+
If pruning is available, Lighthouse will log:
179+
180+
```
181+
INFO Ready to prune states
182+
WARN Pruning states is irreversible
183+
WARN Re-run this command with --confirm to commit to state deletion
184+
INFO Nothing has been pruned on this run
185+
```
186+
178187
3. If you are ready to prune the states irreversibly, add the `--confirm` flag to commit the changes:
179188
180189
```bash
181190
sudo -u "$LH_USER" lighthouse db prune-states --confirm --datadir "$LH_DATADIR" --network "$NET"
182191
```
183192
184-
The `--confirm` flag ensures that you are aware the action is irreversible, and historic states will be permanently removed.
193+
The `--confirm` flag ensures that you are aware the action is irreversible, and historic states will be permanently removed. Lighthouse will log:
185194
195+
```
196+
INFO Historic states pruned successfully
197+
```
198+
186199
4. After successfully pruning the historic states, you can restart the Lighthouse beacon node:
187200
188201
```bash

book/src/faq.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
- [Does increasing the number of validators increase the CPU and other computer resources used?](#vc-resource)
2323
- [I want to add new validators. Do I have to reimport the existing keys?](#vc-reimport)
2424
- [Do I have to stop `lighthouse vc` the when importing new validator keys?](#vc-import)
25-
25+
- [How can I delete my validator once it is imported?](#vc-delete)
2626

2727
## [Network, Monitoring and Maintenance](#network-monitoring-and-maintenance-1)
2828
- [I have a low peer count and it is not increasing](#net-peer)
@@ -33,6 +33,7 @@
3333
- [Should I do anything to the beacon node or validator client settings if I have a relocation of the node / change of IP address?](#net-ip)
3434
- [How to change the TCP/UDP port 9000 that Lighthouse listens on?](#net-port)
3535
- [Lighthouse `v4.3.0` introduces a change where a node will subscribe to only 2 subnets in total. I am worried that this will impact my validators return.](#net-subnet)
36+
- [How to know how many of my peers are connected through QUIC?](#net-quic)
3637

3738
## [Miscellaneous](#miscellaneous-1)
3839
- [What should I do if I lose my slashing protection database?](#misc-slashing)
@@ -41,6 +42,7 @@
4142
- [Does Lighthouse have pruning function like the execution client to save disk space?](#misc-prune)
4243
- [Can I use a HDD for the freezer database and only have the hot db on SSD?](#misc-freezer)
4344
- [Can Lighthouse log in local timestamp instead of UTC?](#misc-timestamp)
45+
- [My hard disk is full and my validator is down. What should I do? ](#misc-full)
4446

4547
## Beacon Node
4648

@@ -345,6 +347,13 @@ Generally yes.
345347

346348
If you do not want to stop `lighthouse vc`, you can use the [key manager API](./api-vc-endpoints.md) to import keys.
347349

350+
351+
### <a name="vc-delete"></a> How can I delete my validator once it is imported?
352+
353+
Lighthouse supports the [KeyManager API](https://ethereum.github.io/keymanager-APIs/#/Local%20Key%20Manager/deleteKeys) to delete validators and remove them from the `validator_definitions.yml` file. To do so, start the validator client with the flag `--http` and call the API.
354+
355+
If you are looking to delete the validators in one node and import it to another, you can use the [validator-manager](./validator-manager-move.md) to move the validators across nodes without the hassle of deleting and importing the keys.
356+
348357
## Network, Monitoring and Maintenance
349358

350359
### <a name="net-peer"></a> I have a low peer count and it is not increasing
@@ -486,6 +495,23 @@ While subscribing to more subnets can ensure you have peers on a wider range of
486495
487496
If you would still like to subscribe to all subnets, you can use the flag `subscribe-all-subnets`. This may improve the block rewards by 1-5%, though it comes at the cost of a much higher bandwidth requirement.
488497
498+
### <a name="net-quic"></a> How to know how many of my peers are connected via QUIC?
499+
500+
With `--metrics` enabled in the beacon node, you can find the number of peers connected via QUIC using:
501+
502+
```bash
503+
curl -s "http://localhost:5054/metrics" | grep libp2p_quic_peers
504+
```
505+
506+
A response example is:
507+
508+
```
509+
# HELP libp2p_quic_peers Count of libp2p peers currently connected via QUIC
510+
# TYPE libp2p_quic_peers gauge
511+
libp2p_quic_peers 4
512+
```
513+
which shows that there are 4 peers connected via QUIC.
514+
489515
## Miscellaneous
490516

491517
### <a name="misc-slashing"></a> What should I do if I lose my slashing protection database?
@@ -533,9 +559,11 @@ Yes, you can do so by using the flag `--freezer-dir /path/to/freezer_db` in the
533559

534560
The reason why Lighthouse logs in UTC is due to the dependency on an upstream library that is [yet to be resolved](https://github.com/sigp/lighthouse/issues/3130). Alternatively, using the flag `disable-log-timestamp` in combination with systemd will suppress the UTC timestamps and print the logs in local timestamps.
535561

562+
### <a name="misc-full"></a> My hard disk is full and my validator is down. What should I do?
536563

564+
A quick way to get the validator back online is by removing the Lighthouse beacon node database and resync Lighthouse using checkpoint sync. A guide to do this can be found in the [Lighthouse Discord server](https://discord.com/channels/605577013327167508/605577013331361793/1019755522985050142). With some free space left, you will then be able to prune the execution client database to free up more space.
537565

538-
566+
For a relatively long term solution, if you are using Geth and Nethermind as the execution client, you can consider setup the online pruning feature. Refer to [Geth](https://blog.ethereum.org/2023/09/12/geth-v1-13-0) and [Nethermind](https://gist.github.com/yorickdowne/67be09b3ba0a9ff85ed6f83315b5f7e0) for details.
539567

540568

541569

book/src/slasher.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ of the immaturity of the slasher UX and the extra resources required.
1717
The slasher runs inside the same process as the beacon node, when enabled via the `--slasher` flag:
1818

1919
```
20-
lighthouse bn --slasher --debug-level debug
20+
lighthouse bn --slasher
2121
```
2222

2323
The slasher hooks into Lighthouse's block and attestation processing, and pushes messages into an
@@ -26,9 +26,6 @@ verifies the signatures of otherwise invalid messages. When a slasher batch upda
2626
messages are filtered for relevancy, and all relevant messages are checked for slashings and written
2727
to the slasher database.
2828

29-
You **should** run with debug logs, so that you can see the slasher's internal machinations, and
30-
provide logs to the developers should you encounter any bugs.
31-
3229
## Configuration
3330

3431
The slasher has several configuration options that control its functioning.

book/src/ui-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To enable the HTTP API for the beacon node, utilize the `--gui` CLI flag. This a
1818
1919
If you require accessibility from another machine within the network, configure the `--http-address` to match the local LAN IP of the system running the Beacon Node and Validator Client.
2020

21-
> To access from another machine on the same network (192.168.0.200) set the Beacon Node and Validator Client `--http-address` as `192.168.0.200`.
21+
> To access from another machine on the same network (192.168.0.200) set the Beacon Node and Validator Client `--http-address` as `192.168.0.200`. When this is set, the validator client requires the flag `--beacon-nodes http://192.168.0.200:5052` to connect to the beacon node.
2222
2323
In a similar manner, the validator client requires activation of the `--http` flag, along with the optional consideration of configuring the `--http-address` flag. If `--http-address` flag is set on the Validator Client, then the `--unencrypted-http-transport` flag is required as well. These settings will ensure compatibility with Siren's connectivity requirements.
2424

book/src/ui-faqs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The required Api token may be found in the default data directory of the validat
1010
If you receive a red notification with a BEACON or VALIDATOR NODE NETWORK ERROR you can refer to the lighthouse ui configuration and [`connecting to clients section`](./ui-configuration.md#connecting-to-the-clients).
1111

1212
## 4. How do I connect Siren to Lighthouse from a different computer on the same network?
13-
The most effective approach to enable access for a local network computer to Lighthouse's HTTP API ports is by configuring the `--http-address` to match the local LAN IP of the system running the beacon node and validator client. For instance, if the said node operates at `192.168.0.200`, this IP can be specified using the `--http-address` parameter as `--http-address 192.168.0.200`.
13+
The most effective approach to enable access for a local network computer to Lighthouse's HTTP API ports is by configuring the `--http-address` to match the local LAN IP of the system running the beacon node and validator client. For instance, if the said node operates at `192.168.0.200`, this IP can be specified using the `--http-address` parameter as `--http-address 192.168.0.200`. When this is set, the validator client requires the flag `--beacon-nodes http://192.168.0.200:5052` to connect to the beacon node.
1414
Subsequently, by designating the host as `192.168.0.200`, you can seamlessly connect Siren to this specific beacon node and validator client pair from any computer situated within the same network.
1515

1616
## 5. How can I use Siren to monitor my validators remotely when I am not at home?
@@ -22,7 +22,7 @@ Most contemporary home routers provide options for VPN access in various ways. A
2222
In the absence of a VPN, an alternative approach involves utilizing an SSH tunnel. To achieve this, you need remote SSH access to the computer hosting the Beacon Node and Validator Client pair (which necessitates a port forward in your router). In this context, while it is not obligatory to set a `--http-address` flag on the Beacon Node and Validator Client, you can configure an SSH tunnel to the local ports on the node and establish a connection through the tunnel. For instructions on setting up an SSH tunnel, refer to [`Connecting Siren via SSH tunnel`](./ui-faqs.md#6-how-do-i-connect-siren-to-lighthouse-via-a-ssh-tunnel) for detailed guidance.
2323

2424
## 6. How do I connect Siren to Lighthouse via a ssh tunnel?
25-
If you would like to access Siren beyond the local network (i.e across the internet), we recommend using an SSH tunnel. This requires a tunnel for 3 ports: `80` (assuming the port is unchanged as per the [installation guide](./ui-installation.md#docker-recommended), `5052` (for beacon node) and `5062` (for validator client). You can use the command below to perform SSH tunneling:
25+
If you would like to access Siren beyond the local network (i.e across the internet), we recommend using an SSH tunnel. This requires a tunnel for 3 ports: `80` (assuming the port is unchanged as per the [installation guide](./ui-installation.md#docker-recommended)), `5052` (for beacon node) and `5062` (for validator client). You can use the command below to perform SSH tunneling:
2626

2727
```bash
2828

@@ -55,7 +55,7 @@ If you have separate address setups for your Validator Client and Beacon Node re
5555

5656

5757
## 8. How do I change my Beacon or Validator address after logging in?
58-
Once you have successfully arrived to the main dashboard, use the sidebar to access the settings view. In the top right hand corner there is a `Configuration` action button that will redirect you back to the configuration screen where you can make appropriate changes.
58+
Once you have successfully arrived to the main dashboard, use the sidebar to access the settings view. In the top right-hand corner there is a `Configuration` action button that will redirect you back to the configuration screen where you can make appropriate changes.
5959

6060
## 9. Why doesn't my validator balance graph show any data?
6161
If your graph is not showing data, it usually means your validator node is still caching data. The application must wait at least 3 epochs before it can render any graphical visualizations. This could take up to 20min.

book/src/validator-web3signer.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ or effectiveness.
3030
## Usage
3131

3232
A remote signing validator is added to Lighthouse in much the same way as one that uses a local
33-
keystore, via the [`validator_definitions.yml`](./validator-management.md) file or via the `POST
34-
/lighthouse/validators/web3signer` API endpoint.
33+
keystore, via the [`validator_definitions.yml`](./validator-management.md) file or via the [`POST /lighthouse/validators/web3signer`](./api-vc-endpoints.md#post-lighthousevalidatorsweb3signer) API endpoint.
3534

3635
Here is an example of a `validator_definitions.yml` file containing one validator which uses a
3736
remote signer:

0 commit comments

Comments
 (0)