diff --git a/Cargo.lock b/Cargo.lock index 68563aa3a63..3c4aa51d212 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2356,7 +2356,7 @@ dependencies = [ [[package]] name = "mithril-stm" -version = "0.3.6" +version = "0.3.7" dependencies = [ "bincode", "blake2 0.10.6", diff --git a/mithril-stm/CHANGELOG.md b/mithril-stm/CHANGELOG.md index d1973c76987..7b78145a674 100644 --- a/mithril-stm/CHANGELOG.md +++ b/mithril-stm/CHANGELOG.md @@ -1,27 +1,44 @@ # Changelog + 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.7 (10-10-2023) + +### Added + +- Implemented a build script that automatically detects that WASM is not targeted, and automatically activates the feature `batch-verify-aggregates` (which enables batch verification of signatures). + ## 0.3.0 (10-08-2023) + ### Added + - Added `Coreverifier` struct and its functionalities to cover signature procedure for a full node. - Adapted existing functionality to inherit from a more generic structure `Coreverifier`. - Added tests for core verification. ## 0.2.5 (15-03-2023) + ### Added + - Included helper functions for unsafe code - Added tests for batch verification + ## 0.2.1 (04-01-2023) + ### Added + - Batch verification for `StmAggrSig`. ## 0.2.0 (16-12-2022) + ### Changed + - Adapted the `Signature` struct, so that it does not contain the verification key and - the stake, as these values are not required. + the stake, as these values are not required. ## 0.1.0 (05-12-2022) -Initial release. \ No newline at end of file + +Initial release. diff --git a/mithril-stm/Cargo.toml b/mithril-stm/Cargo.toml index 49bb298f0a1..d736cf646ac 100644 --- a/mithril-stm/Cargo.toml +++ b/mithril-stm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-stm" -version = "0.3.6" +version = "0.3.7" edition = { workspace = true } authors = { workspace = true } documentation = { workspace = true } diff --git a/mithril-stm/build.rs b/mithril-stm/build.rs new file mode 100644 index 00000000000..644f2c84dd4 --- /dev/null +++ b/mithril-stm/build.rs @@ -0,0 +1,11 @@ +use std::env; + +fn main() { + let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap(); + let target_no_batch_verify_aggregates = + target_arch.eq("wasm32") || env::var("STM_TEST_NO_BATCH_VERIFY_AGGREGATES").is_ok(); + + if !target_no_batch_verify_aggregates { + println!("cargo:rustc-cfg=feature=\"batch-verify-aggregates\""); + } +} diff --git a/mithril-stm/src/multi_sig.rs b/mithril-stm/src/multi_sig.rs index 42e90810ab5..2783a418aab 100644 --- a/mithril-stm/src/multi_sig.rs +++ b/mithril-stm/src/multi_sig.rs @@ -404,6 +404,7 @@ impl Signature { } /// Batch verify several sets of signatures with their corresponding verification keys. + #[cfg(feature = "batch-verify-aggregates")] pub fn batch_verify_aggregates( msgs: &[Vec], vks: &[VerificationKey], diff --git a/mithril-stm/src/stm.rs b/mithril-stm/src/stm.rs index 3c1743baf54..4f298b0c352 100644 --- a/mithril-stm/src/stm.rs +++ b/mithril-stm/src/stm.rs @@ -789,6 +789,7 @@ impl StmAggrSig { } /// Batch verify a set of signatures, with different messages and avks. + #[cfg(feature = "batch-verify-aggregates")] pub fn batch_verify( stm_signatures: &[Self], msgs: &[Vec],