Skip to content

Commit

Permalink
Revert "Update BLST, add force-adx support (#1595)" (#1649)
Browse files Browse the repository at this point in the history
This reverts commit 4fca306.

Something in the BLST update is causing SIGILLs on aarch64 non-portable builds. While we debug the issue, I think it's best if we just revert the update.
  • Loading branch information
michaelsproul committed Sep 23, 2020
1 parent a97ec31 commit 62c8548
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

18 changes: 10 additions & 8 deletions book/src/cross-compiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ project.

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

- `build-x86_64`: builds an optimized version for x86_64 processors (suitable for most users).
Supports Intel Broadwell (2014) and newer, and AMD Ryzen (2017) and newer.
- `build-x86_64-portable`: builds a version for x86_64 processors which avoids using some modern CPU
instructions that are incompatible with older CPUs. Suitable for pre-Broadwell/Ryzen CPUs.
- `build-aarch64`: builds an optimized version for 64-bit ARM processors
- `build-x86_64`: builds an optimized version for x86_64 processors (suitable
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.
- `build-aarch64`: builds an optimized version for 64bit ARM processors
(suitable for Raspberry Pi 4).
- `build-aarch64-portable`: builds a version for 64-bit ARM processors which avoids using some
modern CPU instructions. In practice, very few ARM processors lack the instructions necessary to
run the faster non-portable build.
- `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

Expand Down
3 changes: 1 addition & 2 deletions crypto/bls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ 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/supranational/blst.git", rev = "a8398ed284b0d78858302ad1ceb25a80e7bbe535" }
blst = { git = "https://github.com/sigp/blst.git", rev = "284f7059642851c760a09fb1708bcb59c7ca323c" }

[features]
default = ["supranational"]
fake_crypto = []
milagro = []
supranational = []
supranational-portable = ["supranational", "blst/portable"]
supranational-force-adx = ["supranational", "blst/force-adx"]
3 changes: 0 additions & 3 deletions lighthouse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ edition = "2018"
write_ssz_files = ["beacon_node/write_ssz_files"]
# Compiles the BLS crypto code so that the binary is portable across machines.
portable = ["bls/supranational-portable"]
# Compiles BLST so that it always uses ADX instructions.
# Compatible with processors from 2013 onwards.
modern = ["bls/supranational-force-adx"]
# Uses the slower Milagro BLS library, which is written in native Rust.
milagro = ["bls/milagro"]

Expand Down
9 changes: 0 additions & 9 deletions lighthouse/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ pub const ETH2_CONFIG_FILENAME: &str = "eth2-spec.toml";
fn bls_library_name() -> &'static str {
if cfg!(feature = "portable") {
"blst-portable"
} else if cfg!(feature = "modern") {
"blst-modern"
} else if cfg!(feature = "milagro") {
"milagro"
} else {
Expand Down Expand Up @@ -183,13 +181,6 @@ fn run<E: EthSpec>(
));
}

#[cfg(all(feature = "modern", target_arch = "x86_64"))]
if !std::is_x86_feature_detected!("adx") {
return Err(format!(
"CPU incompatible with optimized binary, please try Lighthouse portable build"
));
}

let debug_level = matches
.value_of("debug-level")
.ok_or_else(|| "Expected --debug-level flag".to_string())?;
Expand Down

0 comments on commit 62c8548

Please sign in to comment.