Skip to content

Use BLST portable feature to enable runtime ADX instruction set check #1630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 11, 2024
Merged
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
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ jobs:
# We separate the build in 2 steps as we want to avoid side effects with Rust feature unification.
- name: Cargo build - Tooling
shell: bash
run: |
cargo build --features portable --release -p mithril-end-to-end
run: cargo build --release -p mithril-end-to-end

- name: Build Mithril workspace & publish artifacts
uses: ./.github/workflows/actions/build-upload-mithril-artifact
Expand Down Expand Up @@ -166,7 +165,7 @@ jobs:

include:
- os: ubuntu-22.04
test-args: --features portable,full,unstable --workspace
test-args: --features full,unstable --workspace
# Only test client on windows & mac (since its the only binaries supported for those os for now)
- os: macos-12
test-args: --package mithril-client --package mithril-client-cli --features full,unstable
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ As a minor extension, we have adopted a slightly different versioning convention

- Chain observers support the retrieval of the current Cardano chain point.

- Deprecate `portable` feature of `mithril-stm` and `mithril-client`:
- Instead, always enable BLST `portable` feature in `mithril-stm` for runtime check of intel ADX instruction set.
- `portable` feature now has no effect and should be removed from crate dependencies.
- Removed it from all other crates (including `mithril-common`).

- Crates versions:

| Crate | Version |
Expand Down
16 changes: 8 additions & 8 deletions Cargo.lock

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

5 changes: 1 addition & 4 deletions demo/protocol-demo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithrildemo"
version = "0.1.33"
version = "0.1.34"
authors = { workspace = true }
edition = { workspace = true }
documentation = { workspace = true }
Expand Down Expand Up @@ -30,6 +30,3 @@ mithril-stm = { path = "../../mithril-stm" }
mithril-stm = { path = "../../mithril-stm", default-features = false, features = [
"num-integer-backend",
] }

[features]
portable = ["mithril-common/portable", "mithril-stm/portable"]
5 changes: 1 addition & 4 deletions mithril-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-aggregator"
version = "0.4.56"
version = "0.4.57"
description = "A Mithril Aggregator server"
authors = { workspace = true }
edition = { workspace = true }
Expand Down Expand Up @@ -57,7 +57,4 @@ slog-term = "2.9.0"
tempfile = "3.9.0"

[features]
portable = [
"mithril-common/portable",
] # portable feature avoids SIGILL crashes on CPUs not supporting Intel ADX instruction set when built on CPUs that support it
bundle_openssl = ["dep:openssl", "dep:openssl-probe"]
3 changes: 1 addition & 2 deletions mithril-client-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-client-cli"
version = "0.7.8"
version = "0.7.9"
description = "A Mithril Client"
authors = { workspace = true }
edition = { workspace = true }
Expand Down Expand Up @@ -53,5 +53,4 @@ tokio = { version = "1.35.1", features = ["full"] }
mithril-common = { path = "../mithril-common", features = ["test_tools"] }

[features]
portable = ["mithril-client/portable"]
bundle_openssl = ["dep:openssl", "dep:openssl-probe"]
4 changes: 2 additions & 2 deletions mithril-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-client"
version = "0.7.1"
version = "0.7.2"
description = "Mithril client library"
authors = { workspace = true }
edition = { workspace = true }
Expand Down Expand Up @@ -76,7 +76,7 @@ full = ["fs"]

# Enable file system releated functionnality, right now that mean ony snapshot download
fs = ["flate2", "flume", "tar", "tokio/rt", "zstd"]
portable = ["mithril-common/portable"]
portable = [] # deprecated, will be removed soon
unstable = []

[package.metadata.docs.rs]
Expand Down
5 changes: 1 addition & 4 deletions mithril-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-common"
version = "0.3.29"
version = "0.3.30"
description = "Common types, interfaces, and utilities for Mithril nodes."
authors = { workspace = true }
edition = { workspace = true }
Expand Down Expand Up @@ -117,9 +117,6 @@ fs = [
"dep:pallas-traverse",
]

# Portable feature avoids SIGILL crashes on CPUs not supporting Intel ADX instruction set when built on CPUs that support it
portable = ["mithril-stm/portable"]

# Disable signer certification, to be used only for tests
allow_skip_signer_certification = []
# Enable all tests tools
Expand Down
5 changes: 1 addition & 4 deletions mithril-signer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-signer"
version = "0.2.122"
version = "0.2.123"
description = "A Mithril Signer"
authors = { workspace = true }
edition = { workspace = true }
Expand Down Expand Up @@ -46,7 +46,4 @@ prometheus-parse = "0.2.5"
slog-term = "2.9.0"

[features]
portable = [
"mithril-common/portable",
] # portable feature avoids SIGILL crashes on CPUs not supporting Intel ADX instruction set when built on CPUs that support it
bundle_openssl = ["dep:openssl", "dep:openssl-probe"]
6 changes: 6 additions & 0 deletions mithril-stm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.3.18 (11-04-2024)

- Deprecate `portable` feature:
- Instead, always enable BLST `portable` feature for runtime check of intel ADX instruction set.
- `portable` feature now has no effect and should be removed from crate dependencies.

## 0.3.7 (10-10-2023)

### Added
Expand Down
9 changes: 4 additions & 5 deletions mithril-stm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-stm"
version = "0.3.17"
version = "0.3.18"
edition = { workspace = true }
authors = { workspace = true }
homepage = { workspace = true }
Expand All @@ -15,7 +15,8 @@ crate-type = ["lib", "cdylib", "staticlib"]

[dependencies]
blake2 = "0.10.6"
blst = { version = "0.3.11" }
# Enforce blst portable feature for runtime detection of Intel ADX instruction set.
blst = { version = "0.3.11", features = ["portable"] }
digest = { version = "0.10.7", features = ["alloc"] }
num-bigint = { version = "0.4.4", optional = true }
num-rational = { version = "0.4.1", optional = true }
Expand Down Expand Up @@ -53,7 +54,5 @@ harness = false
default = ["rug-backend"]
rug-backend = ["rug/default"]
num-integer-backend = ["num-bigint", "num-rational", "num-traits"]
portable = [
"blst/portable",
] # portable feature avoids SIGILL crashes on CPUs not supporting Intel ADX instruction set when built on CPUs that support it
portable = [] # deprecated, will be removed soon
benchmark-internals = [] # For benchmarking multi_sig
3 changes: 1 addition & 2 deletions mithril-test-lab/mithril-end-to-end/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-end-to-end"
version = "0.4.8"
version = "0.4.9"
authors = { workspace = true }
edition = { workspace = true }
documentation = { workspace = true }
Expand Down Expand Up @@ -41,5 +41,4 @@ tokio-util = { version = "0.7.10", features = ["codec"] }

[features]
default = []
portable = ["mithril-common/portable"]
allow_skip_signer_certification = []
Loading