Skip to content

Commit

Permalink
Merge pull request #1290 from input-output-hk/jpraynaud/1254-fix-buil…
Browse files Browse the repository at this point in the history
…d-stm-wasm

Fix `mithril-stm` WASM build
  • Loading branch information
jpraynaud authored Oct 12, 2023
2 parents e1c36ba + df47efe commit 75dfb67
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 4 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.

21 changes: 19 additions & 2 deletions mithril-stm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.

Initial release.
2 changes: 1 addition & 1 deletion 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.6"
version = "0.3.7"
edition = { workspace = true }
authors = { workspace = true }
documentation = { workspace = true }
Expand Down
11 changes: 11 additions & 0 deletions mithril-stm/build.rs
Original file line number Diff line number Diff line change
@@ -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\"");
}
}
1 change: 1 addition & 0 deletions mithril-stm/src/multi_sig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8>],
vks: &[VerificationKey],
Expand Down
1 change: 1 addition & 0 deletions mithril-stm/src/stm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ impl<D: Clone + Digest + FixedOutput + Send + Sync> StmAggrSig<D> {
}

/// 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<u8>],
Expand Down

0 comments on commit 75dfb67

Please sign in to comment.