Skip to content

Commit 56dba96

Browse files
Update Lighthouse book and some FAQs (#4178)
## Issue Addressed Updated Lighthouse book on Section 2 and added some FAQs ## Proposed Changes All changes are made in the book/src .md files. ## Additional Info Please provide any additional information. For example, future considerations or information useful for reviewers. Co-authored-by: chonghe <tanck2005@gmail.com> Co-authored-by: Michael Sproul <micsproul@gmail.com>
1 parent a3669ab commit 56dba96

File tree

8 files changed

+147
-86
lines changed

8 files changed

+147
-86
lines changed

book/src/SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
* [Introduction](./intro.md)
44
* [Installation](./installation.md)
5-
* [System Requirements](./system-requirements.md)
65
* [Pre-Built Binaries](./installation-binaries.md)
76
* [Docker](./docker.md)
87
* [Build from Source](./installation-source.md)

book/src/docker.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ way to run Lighthouse without building the image yourself.
1616
Obtain the latest image with:
1717

1818
```bash
19-
$ docker pull sigp/lighthouse
19+
docker pull sigp/lighthouse
2020
```
2121

2222
Download and test the image with:
2323

2424
```bash
25-
$ docker run sigp/lighthouse lighthouse --version
25+
docker run sigp/lighthouse lighthouse --version
2626
```
2727

2828
If you can see the latest [Lighthouse release](https://github.com/sigp/lighthouse/releases) version
2929
(see example below), then you've successfully installed Lighthouse via Docker.
3030

31-
> Pro tip: try the `latest-modern` image for a 20-30% speed-up! See [Available Docker
32-
> Images](#available-docker-images) below.
33-
3431
### Example Version Output
3532

3633
```
3734
Lighthouse vx.x.xx-xxxxxxxxx
3835
BLS Library: xxxx-xxxxxxx
3936
```
4037

38+
> Pro tip: try the `latest-modern` image for a 20-30% speed-up! See [Available Docker
39+
> Images](#available-docker-images) below.
40+
4141
### Available Docker Images
4242

4343
There are several images available on Docker Hub.
@@ -47,11 +47,10 @@ Lighthouse with optimizations enabled. If you are running on older hardware then
4747
`latest` image bundles a _portable_ version of Lighthouse which is slower but with better hardware
4848
compatibility (see [Portability](./installation-binaries.md#portability)).
4949

50-
To install a specific tag (in this case `latest-modern`) add the tag name to your `docker` commands
51-
like so:
50+
To install a specific tag (in this case `latest-modern`), add the tag name to your `docker` commands:
5251

5352
```
54-
$ docker pull sigp/lighthouse:latest-modern
53+
docker pull sigp/lighthouse:latest-modern
5554
```
5655

5756
Image tags follow this format:
@@ -65,17 +64,17 @@ The `version` is:
6564
* `vX.Y.Z` for a tagged Lighthouse release, e.g. `v2.1.1`
6665
* `latest` for the `stable` branch (latest release) or `unstable` branch
6766

68-
The `stability` is:
69-
70-
* `-unstable` for the `unstable` branch
71-
* empty for a tagged release or the `stable` branch
72-
7367
The `arch` is:
7468

7569
* `-amd64` for x86_64, e.g. Intel, AMD
7670
* `-arm64` for aarch64, e.g. Raspberry Pi 4
7771
* empty for a multi-arch image (works on either `amd64` or `arm64` platforms)
7872

73+
The `stability` is:
74+
75+
* `-unstable` for the `unstable` branch
76+
* empty for a tagged release or the `stable` branch
77+
7978
The `modernity` is:
8079

8180
* `-modern` for optimized builds
@@ -99,26 +98,26 @@ To build the image from source, navigate to
9998
the root of the repository and run:
10099

101100
```bash
102-
$ docker build . -t lighthouse:local
101+
docker build . -t lighthouse:local
103102
```
104103

105104
The build will likely take several minutes. Once it's built, test it with:
106105

107106
```bash
108-
$ docker run lighthouse:local lighthouse --help
107+
docker run lighthouse:local lighthouse --help
109108
```
110109

111110
## Using the Docker image
112111

113112
You can run a Docker beacon node with the following command:
114113

115114
```bash
116-
$ docker run -p 9000:9000/tcp -p 9000:9000/udp -p 127.0.0.1:5052:5052 -v $HOME/.lighthouse:/root/.lighthouse sigp/lighthouse lighthouse --network mainnet beacon --http --http-address 0.0.0.0
115+
docker run -p 9000:9000/tcp -p 9000:9000/udp -p 127.0.0.1:5052:5052 -v $HOME/.lighthouse:/root/.lighthouse sigp/lighthouse lighthouse --network mainnet beacon --http --http-address 0.0.0.0
117116
```
118117

119-
> To join the Prater testnet, use `--network prater` instead.
118+
> To join the Goerli testnet, use `--network goerli` instead.
120119
121-
> The `-p` and `-v` and values are described below.
120+
> The `-v` (Volumes) and `-p` (Ports) and values are described below.
122121
123122
### Volumes
124123

@@ -131,7 +130,7 @@ The following example runs a beacon node with the data directory
131130
mapped to the users home directory:
132131

133132
```bash
134-
$ docker run -v $HOME/.lighthouse:/root/.lighthouse sigp/lighthouse lighthouse beacon
133+
docker run -v $HOME/.lighthouse:/root/.lighthouse sigp/lighthouse lighthouse beacon
135134
```
136135

137136
### Ports
@@ -140,14 +139,14 @@ In order to be a good peer and serve other peers you should expose port `9000` f
140139
Use the `-p` flag to do this:
141140

142141
```bash
143-
$ docker run -p 9000:9000/tcp -p 9000:9000/udp sigp/lighthouse lighthouse beacon
142+
docker run -p 9000:9000/tcp -p 9000:9000/udp sigp/lighthouse lighthouse beacon
144143
```
145144

146145
If you use the `--http` flag you may also want to expose the HTTP port with `-p
147146
127.0.0.1:5052:5052`.
148147

149148
```bash
150-
$ docker run -p 9000:9000/tcp -p 9000:9000/udp -p 127.0.0.1:5052:5052 sigp/lighthouse lighthouse beacon --http --http-address 0.0.0.0
149+
docker run -p 9000:9000/tcp -p 9000:9000/udp -p 127.0.0.1:5052:5052 sigp/lighthouse lighthouse beacon --http --http-address 0.0.0.0
151150
```
152151

153152
[docker_hub]: https://hub.docker.com/repository/docker/sigp/lighthouse/

book/src/faq.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
- [What is "Syncing deposit contract block cache"?](#what-is-syncing-deposit-contract-block-cache)
1010
- [Can I use redundancy in my staking setup?](#can-i-use-redundancy-in-my-staking-setup)
1111
- [How can I monitor my validators?](#how-can-i-monitor-my-validators)
12+
- [I see beacon logs showing `WARN: Execution engine called failed`, what should I do?](#i-see-beacon-logs-showing-warn-execution-engine-called-failed-what-should-i-do)
13+
- [How do I check or update my withdrawal credentials?](#how-do-i-check-or-update-my-withdrawal-credentials)
14+
- [I am missing attestations. Why?](#i-am-missing-attestations-why)
15+
- [Sometimes I miss the attestation head vote, resulting in penalty. Is this normal?](#sometimes-i-miss-the-attestation-head-vote-resulting-in-penalty-is-this-normal)
16+
- [My beacon node is stuck at downloading historical block using checkpoing sync. What can I do?](#my-beacon-node-is-stuck-at-downloading-historical-block-using-checkpoing-sync-what-can-i-do)
1217

1318
### Why does it take so long for a validator to be activated?
1419

@@ -185,4 +190,47 @@ However, there are some components which can be configured with redundancy. See
185190

186191
Apart from using block explorers, you may use the "Validator Monitor" built into Lighthouse which
187192
provides logging and Prometheus/Grafana metrics for individual validators. See [Validator
188-
Monitoring](./validator-monitoring.md) for more information.
193+
Monitoring](./validator-monitoring.md) for more information. Lighthouse has also developed Lighthouse UI (Siren) to monitor performance, see [Lighthouse UI (Siren)](./lighthouse-ui.md).
194+
195+
### I see beacon logs showing `WARN: Execution engine called failed`, what should I do?
196+
197+
The `WARN Execution engine called failed` log is shown when the beacon node cannot reach the execution engine. When this warning occurs, it will be followed by a detailed message. A frequently encountered example of the error message is:
198+
199+
`error: Reqwest(reqwest::Error { kind: Request, url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(8551), path: "/", query: None, fragment: None }, source: TimedOut }), service: exec`
200+
201+
which says `TimedOut` at the end of the message. This means that the execution engine has not responded in time to the beacon node. There are a few reasons why this can occur:
202+
1. The execution engine is not synced. Check the log of the execution engine to make sure that it is synced. If it is syncing, wait until it is synced and the error will disappear. You will see the beacon node logs `INFO Execution engine online` when it is synced.
203+
1. The computer is overloaded. Check the CPU and RAM usage to see if it has overloaded. You can use `htop` to check for CPU and RAM usage.
204+
1. Your SSD is slow. Check if your SSD is in "The Bad" list [here](https://gist.github.com/yorickdowne/f3a3e79a573bf35767cd002cc977b038). If your SSD is in "The Bad" list, it means it cannot keep in sync to the network and you may want to consider upgrading to a better SSD.
205+
206+
If the reason for the error message is caused by no. 1 above, you may want to look further. If the execution engine is out of sync suddenly, it is usually caused by ungraceful shutdown. The common causes for ungraceful shutdown are:
207+
- Power outage. If power outages are an issue at your place, consider getting a UPS to avoid ungraceful shutdown of services.
208+
- The service file is not stopped properly. To overcome this, make sure that the process is stop properly, e.g., during client updates.
209+
- Out of memory (oom) error. This can happen when the system memory usage has reached its maximum and causes the execution engine to be killed. When this occurs, the log file will show `Main process exited, code=killed, status=9/KILL`. You can also run `sudo journalctl -a --since "18 hours ago" | grep -i "killed process` to confirm that the execution client has been killed due to oom. If you are using geth as the execution client, a short term solution is to reduce the resources used, for example: (1) reduce the cache by adding the flag `--cache 2048` (2) connect to less peers using the flag `--maxpeers 10`. If the oom occurs rather frequently, a long term solution is to increase the memory capacity of the computer.
210+
211+
212+
### How do I check or update my withdrawal credentials?
213+
Withdrawals will be available after the Capella/Shanghai upgrades on 12<sup>th</sup> April 2023. To check that if you are eligible for withdrawals, go to [Staking launchpad](https://launchpad.ethereum.org/en/withdrawals), enter your validator index and click `verify on mainnet`:
214+
- `withdrawals enabled` means you will automatically receive withdrawals to the withdrawal address that you set.
215+
- `withdrawals not enabled` means you will need to update your withdrawal credentials from `0x00` type to `0x01` type. The common way to do this is using `Staking deposit CLI` or `ethdo`, with the instructions available [here](https://launchpad.ethereum.org/en/withdrawals#update-your-keys).
216+
217+
For the case of `withdrawals not enabled`, you can update your withdrawal credentials **anytime**, and there is no deadline for that. The catch is that as long as you do not update your withdrawal credentials, your rewards in the beacon chain will continue to be locked in the beacon chain. Only after you update the withdrawal credentials, will the rewards be withdrawn to the withdrawal address.
218+
219+
220+
### I am missing attestations. Why?
221+
The first thing is to ensure both consensus and execution clients are synced with the network. If they are synced, there may still be some issues with the node setup itself that is causing the missed attestations. Check the setup to ensure that:
222+
- the clock is synced
223+
- the computer has sufficient resources and is not overloaded
224+
- the internet is working well
225+
- you have sufficient peers
226+
227+
You can see more information on the [Ethstaker KB](https://ethstaker.gitbook.io/ethstaker-knowledge-base/help/missed-attestations). Once the above points are good, missing attestation should be a rare occurance.
228+
229+
### Sometimes I miss the attestation head vote, resulting in penalty. Is this normal?
230+
231+
In general it is unavoiadable to have some penalties occasionally. This is particularly the case when you are assigned to attest on the first slot of an epoch and if the proposer of that slot releases the block late, then you will get penalised for missing the target and head votes. Your attestation performance does not only depend on your own setup, but also on everyone else's performance.
232+
233+
234+
### My beacon node is stuck at downloading historical block using checkpoing sync. What can I do?
235+
236+
Check the number of peers you are connected to. If you have low peers (less than 50), try to do port forwarding on the port 9000 TCP/UDP to increase peer count.

book/src/installation-binaries.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,24 @@ For details, see [Portability](#portability).
2323
## Usage
2424

2525
Each binary is contained in a `.tar.gz` archive. For this example, lets assume the user needs
26-
a portable `x86_64` binary.
26+
a `x86_64` binary.
2727

2828
### Steps
2929

3030
1. Go to the [Releases](https://github.com/sigp/lighthouse/releases) page and
3131
select the latest release.
32-
1. Download the `lighthouse-${VERSION}-x86_64-unknown-linux-gnu-portable.tar.gz` binary.
33-
1. Extract the archive:
34-
1. `cd Downloads`
35-
1. `tar -xvf lighthouse-${VERSION}-x86_64-unknown-linux-gnu.tar.gz`
32+
1. Download the `lighthouse-${VERSION}-x86_64-unknown-linux-gnu.tar.gz` binary. For example, to obtain the binary file for v4.0.1 (the latest version at the time of writing), a user can run the following commands in a linux terminal:
33+
```bash
34+
cd ~
35+
curl -LO https://github.com/sigp/lighthouse/releases/download/v4.0.1/lighthouse-v4.0.1-x86_64-unknown-linux-gnu.tar.gz
36+
tar -xvf lighthouse-v4.0.1-x86_64-unknown-linux-gnu.tar.gz
37+
```
3638
1. Test the binary with `./lighthouse --version` (it should print the version).
37-
1. (Optional) Move the `lighthouse` binary to a location in your `PATH`, so the `lighthouse` command can be called from anywhere.
38-
- E.g., `cp lighthouse /usr/bin`
39+
1. (Optional) Move the `lighthouse` binary to a location in your `PATH`, so the `lighthouse` command can be called from anywhere. For example, to copy `lighthouse` from the current directory to `usr/bin`, run `sudo cp lighthouse /usr/bin`.
3940

40-
> Windows users will need to execute the commands in Step 3 from PowerShell.
41+
42+
43+
> Windows users will need to execute the commands in Step 2 from PowerShell.
4144

4245
## Portability
4346

@@ -64,4 +67,4 @@ WARN CPU seems incompatible with optimized Lighthouse build, advice: If you get
6467
6568
On some VPS providers, the virtualization can make it appear as if CPU features are not available,
6669
even when they are. In this case you might see the warning above, but so long as the client
67-
continues to function it's nothing to worry about.
70+
continues to function, it's nothing to worry about.

book/src/installation-source.md

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,20 @@ the instructions below, and then proceed to [Building Lighthouse](#build-lightho
55

66
## Dependencies
77

8-
First, **install Rust** using [rustup](https://rustup.rs/). The rustup installer provides an easy way
9-
to update the Rust compiler, and works on all platforms.
8+
First, **install Rust** using [rustup](https://rustup.rs/)
9+
10+
```bash
11+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
12+
```
13+
14+
The rustup installer provides an easy way to update the Rust compiler, and works on all platforms.
15+
16+
> Tips:
17+
>
18+
> - During installation, when prompted, enter `1` for the default installation.
19+
> - After Rust installation completes, try running `cargo version` . If it cannot
20+
> be found, run `source $HOME/.cargo/env`. After that, running `cargo version` should return the version, for example `cargo 1.68.2`.
21+
> - It's generally advisable to append `source $HOME/.cargo/env` to `~/.bashrc`.
1022
1123
With Rust installed, follow the instructions below to install dependencies relevant to your
1224
operating system.
@@ -19,10 +31,17 @@ Install the following packages:
1931
sudo apt install -y git gcc g++ make cmake pkg-config llvm-dev libclang-dev clang protobuf-compiler
2032
```
2133

34+
> Tips:
35+
>
36+
> - If there are difficulties, try updating the package manager with `sudo apt
37+
> update`.
38+
2239
> Note: Lighthouse requires CMake v3.12 or newer, which isn't available in the package repositories
2340
> of Ubuntu 18.04 or earlier. On these distributions CMake can still be installed via PPA:
2441
> [https://apt.kitware.com/](https://apt.kitware.com)
2542
43+
After this, you are ready to [build Lighthouse](#build-lighthouse).
44+
2645
#### macOS
2746

2847
1. Install the [Homebrew][] package manager.
@@ -39,10 +58,19 @@ brew install protobuf
3958

4059
[Homebrew]: https://brew.sh/
4160

61+
After this, you are ready to [build Lighthouse](#build-lighthouse).
62+
4263
#### Windows
4364

44-
1. Install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
65+
1. Install [Git](https://git-scm.com/download/win).
4566
1. Install the [Chocolatey](https://chocolatey.org/install) package manager for Windows.
67+
> Tips:
68+
> - Use PowerShell to install. In Windows, search for PowerShell and run as administrator.
69+
> - You must ensure `Get-ExecutionPolicy` is not Restricted. To test this, run `Get-ExecutionPolicy` in PowerShell. If it returns `restricted`, then run `Set-ExecutionPolicy AllSigned`, and then run
70+
```bash
71+
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
72+
```
73+
> - To verify that Chocolatey is ready, run `choco` and it should return the version.
4674
1. Install Make, CMake, LLVM and protoc using Chocolatey:
4775

4876
```
@@ -67,6 +95,8 @@ should follow the instructions for Ubuntu listed in the [Dependencies (Ubuntu)](
6795
6896
[WSL]: https://docs.microsoft.com/en-us/windows/wsl/about
6997
98+
After this, you are ready to [build Lighthouse](#build-lighthouse).
99+
70100
## Build Lighthouse
71101
72102
Once you have Rust and the build dependencies you're ready to build Lighthouse:
@@ -136,7 +166,7 @@ Commonly used features include:
136166
* `spec-minimal`: support for the minimal preset (useful for testing).
137167
138168
Default features (e.g. `slasher-mdbx`) may be opted out of using the `--no-default-features`
139-
argument for `cargo`, which can plumbed in via the `CARGO_INSTALL_EXTRA_FLAGS` environment variable.
169+
argument for `cargo`, which can be plumbed in via the `CARGO_INSTALL_EXTRA_FLAGS` environment variable.
140170
E.g.
141171
142172
```
@@ -171,12 +201,11 @@ PROFILE=maxperf make
171201
Lighthouse will be installed to `CARGO_HOME` or `$HOME/.cargo`. This directory
172202
needs to be on your `PATH` before you can run `$ lighthouse`.
173203
174-
See ["Configuring the `PATH` environment variable"
175-
(rust-lang.org)](https://www.rust-lang.org/tools/install) for more information.
204+
See ["Configuring the `PATH` environment variable"](https://www.rust-lang.org/tools/install) for more information.
176205
177206
### Compilation error
178207
179-
Make sure you are running the latest version of Rust. If you have installed Rust using rustup, simply type `rustup update`.
208+
Make sure you are running the latest version of Rust. If you have installed Rust using rustup, simply run `rustup update`.
180209
181210
If you can't install the latest version of Rust you can instead compile using the Minimum Supported
182211
Rust Version (MSRV) which is listed under the `rust-version` key in Lighthouse's
@@ -185,7 +214,7 @@ Rust Version (MSRV) which is listed under the `rust-version` key in Lighthouse's
185214
If compilation fails with `(signal: 9, SIGKILL: kill)`, this could mean your machine ran out of
186215
memory during compilation. If you are on a resource-constrained device you can
187216
look into [cross compilation](./cross-compiling.md), or use a [pre-built
188-
binary](./installation-binaries.md).
217+
binary](https://github.com/sigp/lighthouse/releases).
189218
190219
If compilation fails with `error: linking with cc failed: exit code: 1`, try running `cargo clean`.
191220

0 commit comments

Comments
 (0)