From 06efc141786f3c959d13476b63df28726b46cbc7 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Thu, 18 Sep 2025 12:54:12 +0200 Subject: [PATCH 1/2] docs(stm): fix doctest deprecated functions --- mithril-stm/README.md | 16 ++++++++-------- mithril-stm/src/lib.rs | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mithril-stm/README.md b/mithril-stm/README.md index c81f4377e87..aa8f6a6adb3 100644 --- a/mithril-stm/README.md +++ b/mithril-stm/README.md @@ -95,8 +95,8 @@ let mut key_reg = KeyRegistration::init(); let mut ps: Vec = Vec::with_capacity(nparties as usize); for stake in parties { - let p = Initializer::setup(params, stake, &mut rng); - key_reg.register(stake, p.verification_key()).unwrap(); + let p = Initializer::new(params, stake, &mut rng); + key_reg.register(stake, p.get_verification_key_proof_of_possession()).unwrap(); ps.push(p); } @@ -104,7 +104,7 @@ let closed_reg = key_reg.close(); let ps = ps .into_par_iter() - .map(|p| p.new_signer(closed_reg.clone()).unwrap()) + .map(|p| p.create_signer(closed_reg.clone()).unwrap()) .collect::>>(); ///////////////////// @@ -116,22 +116,22 @@ let sigs = ps .filter_map(|p| p.sign(&msg)) .collect::>(); -let clerk = Clerk::from_signer(&ps[0]); -let avk = clerk.compute_avk(); +let clerk = Clerk::new_clerk_from_signer(&ps[0]); +let avk = clerk.compute_aggregate_verification_key(); // Check all parties can verify every sig for (s, p) in sigs.iter().zip(ps.iter()) { - assert!(s.verify(¶ms, &p.verification_key(), &p.get_stake(), &avk, &msg).is_ok(), "Verification + assert!(s.verify(¶ms, &p.get_verification_key(), &p.get_stake(), &avk, &msg).is_ok(), "Verification failed"); } // Aggregate with random parties -let msig = clerk.aggregate(&sigs, &msg); +let msig = clerk.aggregate_signatures(&sigs, &msg); match msig { Ok(aggr) => { println!("Aggregate ok"); - assert!(aggr.verify(&msg, &clerk.compute_avk(), ¶ms).is_ok()); + assert!(aggr.verify(&msg, &clerk.compute_aggregate_verification_key(), ¶ms).is_ok()); } Err(AggregationError::NotEnoughSignatures(n, k)) => { println!("Not enough signatures"); diff --git a/mithril-stm/src/lib.rs b/mithril-stm/src/lib.rs index 2b18368bc94..a7e1294d80d 100644 --- a/mithril-stm/src/lib.rs +++ b/mithril-stm/src/lib.rs @@ -53,7 +53,7 @@ //! let mut ps: Vec = Vec::with_capacity(nparties); //! for stake in stakes { //! // Create keys for this party -//! let p = Initializer::setup(params, stake, &mut rng); +//! let p = Initializer::new(params, stake, &mut rng); //! // Register keys with the KeyRegistration service //! key_reg //! .register(p.stake, p.verification_key()) From 9316709803503d51c1e1290de4554e2af4b852b7 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Thu, 18 Sep 2025 13:03:09 +0200 Subject: [PATCH 2/2] chore: upgrade crate versions * mithril-stm from `0.5.0` to `0.5.1` --- Cargo.lock | 2 +- mithril-stm/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a35d5e4ac63..c5b2c40cc2d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4522,7 +4522,7 @@ dependencies = [ [[package]] name = "mithril-stm" -version = "0.5.0" +version = "0.5.1" dependencies = [ "bincode", "blake2 0.10.6", diff --git a/mithril-stm/Cargo.toml b/mithril-stm/Cargo.toml index a540daa0ece..7d3f23e3d2e 100644 --- a/mithril-stm/Cargo.toml +++ b/mithril-stm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-stm" -version = "0.5.0" +version = "0.5.1" edition = { workspace = true } authors = { workspace = true } homepage = { workspace = true }