Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,28 @@ else
cargo install --path lcli --force --locked
endif

# The following commands use `cross` to build a cross-compile.
#
# These commands require that:
#
# - `cross` is installed (`cargo install cross`).
# - Docker is running.
# - The current user is in the `docker` group.
#
# The resulting binaries will be created in the `target/` directory.
#
# The *-portable options compile the blst library *without* the use of some
# optimized CPU functions that may not be available on some systems. This
# results in a more portable binary with ~20% slower BLS verification.
build-x86_64:
cross build --release --manifest-path lighthouse/Cargo.toml --target x86_64-unknown-linux-gnu
build-x86_64-portable:
cross build --release --manifest-path lighthouse/Cargo.toml --target x86_64-unknown-linux-gnu --features portable
build-aarch64:
cross build --release --manifest-path lighthouse/Cargo.toml --target aarch64-unknown-linux-gnu
build-aarch64-portable:
cross build --release --manifest-path lighthouse/Cargo.toml --target aarch64-unknown-linux-gnu --features portable

# Runs the full workspace tests in **release**, without downloading any additional
# test vectors.
test-release:
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ slog-async = "2.5.0"
tokio = "0.2.21"
dirs = "2.0.2"
futures = "0.3.5"
reqwest = "0.10.4"
reqwest = { version = "0.10.4", features = ["native-tls-vendored"] }
url = "2.1.1"
eth1 = { path = "../eth1" }
genesis = { path = "../genesis" }
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/eth1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ web3 = "0.11.0"
sloggers = "1.0.0"

[dependencies]
reqwest = "0.10.4"
reqwest = { version = "0.10.4", features = ["native-tls-vendored"] }
futures = { version = "0.3.5", features = ["compat"] }
serde_json = "1.0.52"
serde = { version = "1.0.110", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/eth2_libp2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ snap = "1.0.0"
void = "1.0.2"
tokio-io-timeout = "0.4.0"
tokio-util = { version = "0.3.1", features = ["codec", "compat"] }
discv5 = { version = "0.1.0-alpha.8", features = ["libp2p"] }
discv5 = { version = "0.1.0-alpha.8", features = ["libp2p", "openssl-vendored"] }
tiny-keccak = "2.0.2"
environment = { path = "../../lighthouse/environment" }
# TODO: Remove rand crate for mainnet
Expand Down
1 change: 1 addition & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* [Installation](./installation.md)
* [Docker](./docker.md)
* [Raspberry Pi 4](./pi.md)
* [Cross-Compiling](./cross-compiling.md)
* [Key Management](./key-management.md)
* [Create a wallet](./wallet-create.md)
* [Create a validator](./validator-create.md)
Expand Down
4 changes: 3 additions & 1 deletion book/src/become-a-validator-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
## 0. Install Rust
If you don't have Rust installed already, visit [rustup.rs](https://rustup.rs/) to install it.

> Note: if you're not familiar with Rust or you'd like more detailed instructions, see our [installation guide](./installation.md).
> Notes:
> - If you're not familiar with Rust or you'd like more detailed instructions, see our [installation guide](./installation.md).
> - Windows is presently only supported via [WSL](https://docs.microsoft.com/en-us/windows/wsl/about).


## 1. Download and install Lighthouse
Expand Down
41 changes: 41 additions & 0 deletions book/src/cross-compiling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Cross-compiling

Lighthouse supports cross-compiling, allowing users to run a binary on one
platform (e.g., `aarch64`) that was compiled on another platform (e.g.,
`x86_64`).


## Instructions

Cross-compiling requires [`Docker`](https://docs.docker.com/engine/install/),
[`rustembedded/cross`](https://github.com/rust-embedded/cross) and for the
current user to be in the `docker` group.

The binaries will be created in the `target/` directory of the Lighthouse
project.

### Targets

The `Makefile` in the project contains four targets for cross-compiling:

- `build-x86_64`: builds an optimized version for x86_64 processors (suitable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that this produces a portable binary, but it seems to (I ran the v0.2.2 release on my laptop just fine). The binary must still be compiled with -march=native inside the Docker image, which would tailor it to the host machine, so I'm not sure if we just got lucky with the choice of host. I've opened #1505 to track this.

for most users).
- `build-x86_64-portable`: builds a version x86_64 processors which avoids
using some modern CPU instructions that might cause an "illegal
instruction" error on older CPUs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still an issue with pre-SSSE3 CPUs. I've opened #1504 to track it

- `build-aarch64`: builds an optimized version for 64bit ARM processors
(suitable for Raspberry Pi 4).
- `build-aarch64-portable`: builds a version 64 bit ARM processors which avoids
using some modern CPU instructions that might cause an "illegal
instruction" error on older CPUs.


### Example

```bash
cd lighthouse
make build-aarch64
```

The `lighthouse` binary will be compiled inside a Docker container and placed
in `lighthouse/target/aarch64-unknown-linux-gnu/release`.
5 changes: 5 additions & 0 deletions book/src/pi.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Tested on:
- Raspberry Pi 4 Model B (4GB)
- `Ubuntu 20.04 LTS (GNU/Linux 5.4.0-1011-raspi aarch64)`


*Note: [Lighthouse supports cross-compiling](./cross-compiling.md) to target a
Raspberry Pi (`aarch64`). Compiling on a faster machine (i.e., `x86_64`
desktop) may be convenient.*

### 1. Install Ubuntu

Follow the [Ubuntu Raspberry Pi installation instructions](https://ubuntu.com/download/raspberry-pi).
Expand Down
2 changes: 1 addition & 1 deletion common/deposit_contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2018"
build = "build.rs"

[build-dependencies]
reqwest = { version = "0.10.4", features = ["blocking", "json"] }
reqwest = { version = "0.10.4", features = ["blocking", "json", "native-tls-vendored"] }
serde_json = "1.0.52"
sha2 = "0.9.1"
hex = "0.4.2"
Expand Down
2 changes: 1 addition & 1 deletion common/eth2_testnet_config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2018"
build = "build.rs"

[build-dependencies]
reqwest = { version = "0.10.4", features = ["blocking"] }
reqwest = { version = "0.10.4", features = ["blocking", "native-tls-vendored"] }
eth2_config = { path = "../eth2_config"}
handlebars = "3.3.0"
serde_json = "1.0.56"
Expand Down
2 changes: 1 addition & 1 deletion common/remote_beacon_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
reqwest = { version = "0.10.4", features = ["json"] }
reqwest = { version = "0.10.4", features = ["json", "native-tls-vendored"] }
url = "2.1.1"
serde = "1.0.110"
futures = "0.3.5"
Expand Down
2 changes: 1 addition & 1 deletion crypto/bls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ eth2_hashing = "0.1.0"
ethereum-types = "0.9.1"
arbitrary = { version = "0.4.4", features = ["derive"], optional = true }
zeroize = { version = "1.0.0", features = ["zeroize_derive"] }
blst = { git = "https://github.com/sigp/blst.git", rev = "22bfb91721af125d1cb08aa201a18477665a45fe" }
blst = { git = "https://github.com/sigp/blst.git", rev = "284f7059642851c760a09fb1708bcb59c7ca323c" }

[features]
default = ["supranational"]
Expand Down
2 changes: 1 addition & 1 deletion crypto/eth2_hashing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "Hashing primitives used in Ethereum 2.0"
lazy_static = { version = "1.4.0", optional = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
ring = "0.16.9"
ring = "0.16.12"

[target.'cfg(target_arch = "wasm32")'.dependencies]
sha2 = "0.9.1"
Expand Down
2 changes: 1 addition & 1 deletion lighthouse/environment/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ slog-json = "2.3.0"
exit-future = "0.2.0"
lazy_static = "1.4.0"
lighthouse_metrics = { path = "../../common/lighthouse_metrics" }
discv5 = "0.1.0-alpha.8"
discv5 = { version = "0.1.0-alpha.8", features = ["libp2p", "openssl-vendored"] }
2 changes: 1 addition & 1 deletion testing/node_test_rig/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ beacon_node = { path = "../../beacon_node" }
types = { path = "../../consensus/types" }
eth2_config = { path = "../../common/eth2_config" }
tempdir = "0.3.7"
reqwest = "0.10.4"
reqwest = { version = "0.10.4", features = ["native-tls-vendored"] }
url = "2.1.1"
serde = "1.0.110"
futures = "0.3.5"
Expand Down