diff --git a/Cargo.lock b/Cargo.lock index 2940605f5a4..c1bab7e3fd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4522,7 +4522,7 @@ dependencies = [ [[package]] name = "mithril-stm" -version = "0.4.12" +version = "0.5.0" dependencies = [ "bincode", "blake2 0.10.6", diff --git a/mithril-common/Cargo.toml b/mithril-common/Cargo.toml index d11070d4040..3c54662c771 100644 --- a/mithril-common/Cargo.toml +++ b/mithril-common/Cargo.toml @@ -50,7 +50,7 @@ kes-summed-ed25519 = { version = "0.2.1", features = [ "serde_enabled", "sk_clone_enabled", ] } -mithril-stm = { path = "../mithril-stm", version = "=0.4", default-features = false } +mithril-stm = { path = "../mithril-stm", version = ">=0.4", default-features = false } nom = "8.0.0" rand_chacha = { workspace = true } rand_core = { workspace = true } diff --git a/mithril-stm/CHANGELOG.md b/mithril-stm/CHANGELOG.md index 5b1376de77f..371e1914814 100644 --- a/mithril-stm/CHANGELOG.md +++ b/mithril-stm/CHANGELOG.md @@ -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.5.0 (09-09-2025) + +### Changed + +- Bumped new minor version for release following deprecations of structure names and functions. + ## 0.4.9 (07-07-2025) ### Changed diff --git a/mithril-stm/Cargo.toml b/mithril-stm/Cargo.toml index a5ae89e9e14..a540daa0ece 100644 --- a/mithril-stm/Cargo.toml +++ b/mithril-stm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-stm" -version = "0.4.12" +version = "0.5.0" edition = { workspace = true } authors = { workspace = true } homepage = { workspace = true } diff --git a/mithril-stm/src/aggregate_signature/aggregate_key.rs b/mithril-stm/src/aggregate_signature/aggregate_key.rs index 741f5cc7b46..e7be9328cf6 100644 --- a/mithril-stm/src/aggregate_signature/aggregate_key.rs +++ b/mithril-stm/src/aggregate_signature/aggregate_key.rs @@ -22,7 +22,7 @@ impl AggregateVerificationKey { } #[deprecated( - since = "0.4.9", + since = "0.5.0", note = "Use `get_merkle_tree_batch_commitment` instead" )] pub fn get_mt_commitment(&self) -> MerkleTreeBatchCommitment { diff --git a/mithril-stm/src/aggregate_signature/basic_verifier.rs b/mithril-stm/src/aggregate_signature/basic_verifier.rs index 22402770f43..ab59658650f 100644 --- a/mithril-stm/src/aggregate_signature/basic_verifier.rs +++ b/mithril-stm/src/aggregate_signature/basic_verifier.rs @@ -45,7 +45,7 @@ impl BasicVerifier { /// * Collect the unique signers in a hash set, /// * Calculate the total stake of the eligible signers, /// * Sort the eligible signers. - #[deprecated(since = "0.4.9", note = "Use `new` instead")] + #[deprecated(since = "0.5.0", note = "Use `new` instead")] pub fn setup(public_signers: &[(BlsVerificationKey, Stake)]) -> Self { Self::new(public_signers) } @@ -181,7 +181,7 @@ impl BasicVerifier { // todo: We need to agree on a criteria to dedup (by default we use a BTreeMap that guarantees keys order) // todo: not good, because it only removes index if there is a conflict (see benches) #[deprecated( - since = "0.4.9", + since = "0.5.0", note = "Use `select_valid_signatures_for_k_indices` instead" )] pub fn dedup_sigs_for_indices( diff --git a/mithril-stm/src/aggregate_signature/clerk.rs b/mithril-stm/src/aggregate_signature/clerk.rs index 8e54edb031a..4fa21e1328a 100644 --- a/mithril-stm/src/aggregate_signature/clerk.rs +++ b/mithril-stm/src/aggregate_signature/clerk.rs @@ -29,7 +29,7 @@ impl Clerk { /// Create a new `Clerk` from a closed registration instance. #[deprecated( - since = "0.4.9", + since = "0.5.0", note = "Use `new_clerk_from_closed_key_registration` instead" )] pub fn from_registration(params: &Parameters, closed_reg: &ClosedKeyRegistration) -> Self { @@ -51,7 +51,7 @@ impl Clerk { } /// Create a Clerk from a signer. - #[deprecated(since = "0.4.9", note = "Use `new_clerk_from_signer` instead")] + #[deprecated(since = "0.5.0", note = "Use `new_clerk_from_signer` instead")] pub fn from_signer(signer: &Signer) -> Self { Self::new_clerk_from_signer(signer) } @@ -108,7 +108,7 @@ impl Clerk { /// The list of merkle tree indexes is used to create a batch proof, to prove that all signatures are from eligible signers. /// /// It returns an instance of `AggregateSignature`. - #[deprecated(since = "0.4.9", note = "Use `aggregate_signatures` instead")] + #[deprecated(since = "0.5.0", note = "Use `aggregate_signatures` instead")] pub fn aggregate( &self, sigs: &[SingleSignature], @@ -124,7 +124,7 @@ impl Clerk { /// Compute the `AggregateVerificationKey` related to the used registration. #[deprecated( - since = "0.4.9", + since = "0.5.0", note = "Use `compute_aggregate_verification_key` instead" )] pub fn compute_avk(&self) -> AggregateVerificationKey { @@ -143,7 +143,7 @@ impl Clerk { } /// Get the (VK, stake) of a party given its index. - #[deprecated(since = "0.4.9", note = "Use `get_registered_party_for_index` instead")] + #[deprecated(since = "0.5.0", note = "Use `get_registered_party_for_index` instead")] pub fn get_reg_party(&self, party_index: &Index) -> Option<(VerificationKey, Stake)> { Self::get_registered_party_for_index(self, party_index) } diff --git a/mithril-stm/src/bls_multi_signature/verification_key.rs b/mithril-stm/src/bls_multi_signature/verification_key.rs index a4b7389ab23..61f8d9e3d37 100644 --- a/mithril-stm/src/bls_multi_signature/verification_key.rs +++ b/mithril-stm/src/bls_multi_signature/verification_key.rs @@ -164,7 +164,7 @@ impl BlsVerificationKeyProofOfPossession { /// manually. // If we are really looking for performance improvements, we can combine the // two final exponentiations (for verifying k1 and k2) into a single one. - #[deprecated(since = "0.4.9", note = "Use `verify_proof_of_possesion` instead")] + #[deprecated(since = "0.5.0", note = "Use `verify_proof_of_possesion` instead")] pub fn check(&self) -> Result<(), MultiSignatureError> { Self::verify_proof_of_possesion(self) } diff --git a/mithril-stm/src/lib.rs b/mithril-stm/src/lib.rs index 690facc9211..2b18368bc94 100644 --- a/mithril-stm/src/lib.rs +++ b/mithril-stm/src/lib.rs @@ -140,47 +140,47 @@ pub type Stake = u64; pub type Index = u64; // Aliases -#[deprecated(since = "0.4.8", note = "Use `AggregateSignature` instead")] +#[deprecated(since = "0.5.0", note = "Use `AggregateSignature` instead")] pub use aggregate_signature::AggregateSignature as StmAggrSig; -#[deprecated(since = "0.4.8", note = "Use `AggregateVerificationKey` instead")] +#[deprecated(since = "0.5.0", note = "Use `AggregateVerificationKey` instead")] pub use aggregate_signature::AggregateVerificationKey as StmAggrVerificationKey; -#[deprecated(since = "0.4.8", note = "Use `Clerk` instead")] +#[deprecated(since = "0.5.0", note = "Use `Clerk` instead")] pub use aggregate_signature::Clerk as StmClerk; -#[deprecated(since = "0.4.8", note = "Use `ClosedKeyRegistration` instead")] +#[deprecated(since = "0.5.0", note = "Use `ClosedKeyRegistration` instead")] pub use key_registration::ClosedKeyRegistration as ClosedKeyReg; -#[deprecated(since = "0.4.8", note = "Use `KeyRegistration` instead")] +#[deprecated(since = "0.5.0", note = "Use `KeyRegistration` instead")] pub use key_registration::KeyRegistration as KeyReg; -#[deprecated(since = "0.4.8", note = "Use `Parameters` instead")] +#[deprecated(since = "0.5.0", note = "Use `Parameters` instead")] pub use parameters::Parameters as StmParameters; -#[deprecated(since = "0.4.8", note = "Use `Initializer` instead")] +#[deprecated(since = "0.5.0", note = "Use `Initializer` instead")] pub use participant::Initializer as StmInitializer; -#[deprecated(since = "0.4.8", note = "Use `Signer` instead")] +#[deprecated(since = "0.5.0", note = "Use `Signer` instead")] pub use participant::Signer as StmSigner; -#[deprecated(since = "0.4.8", note = "Use `VerificationKey` instead")] +#[deprecated(since = "0.5.0", note = "Use `VerificationKey` instead")] pub use participant::VerificationKey as StmVerificationKey; #[deprecated( - since = "0.4.8", + since = "0.5.0", note = "Use `VerificationKeyProofOfPossession` instead" )] pub use participant::VerificationKeyProofOfPossession as StmVerificationKeyPoP; -#[deprecated(since = "0.4.8", note = "Use `SingleSignature` instead")] +#[deprecated(since = "0.5.0", note = "Use `SingleSignature` instead")] pub use single_signature::SingleSignature as StmSig; -#[deprecated(since = "0.4.6", note = "Use `BasicVerifier` instead")] +#[deprecated(since = "0.5.0", note = "Use `BasicVerifier` instead")] pub use aggregate_signature::BasicVerifier as CoreVerifier; #[deprecated( - since = "0.4.6", + since = "0.5.0", note = "Use `SingleSignatureWithRegisteredParty` instead" )] pub use single_signature::SingleSignatureWithRegisteredParty as StmSigRegParty; diff --git a/mithril-stm/src/merkle_tree/commitment.rs b/mithril-stm/src/merkle_tree/commitment.rs index 663371e9e45..a700bcb4990 100644 --- a/mithril-stm/src/merkle_tree/commitment.rs +++ b/mithril-stm/src/merkle_tree/commitment.rs @@ -57,7 +57,7 @@ impl MerkleTreeCommitment { /// # Error /// If the merkle tree path is invalid, then the function fails. #[deprecated( - since = "0.4.9", + since = "0.5.0", note = "Use `verify_leaf_membership_from_path` instead" )] pub fn check( @@ -86,7 +86,7 @@ impl MerkleTreeCommitment { /// Serializes the Merkle Tree commitment together with a message in a single vector of bytes. /// Outputs `msg || self` as a vector of bytes. - #[deprecated(since = "0.4.9", note = "Use `concatenate_with_message` instead")] + #[deprecated(since = "0.5.0", note = "Use `concatenate_with_message` instead")] pub fn concat_with_msg(&self, msg: &[u8]) -> Vec where D: Digest, @@ -136,7 +136,7 @@ impl MerkleTreeBatchCommitment { /// Serializes the Merkle Tree commitment together with a message in a single vector of bytes. /// Outputs `msg || self` as a vector of bytes. // todo: Do we need to concat msg to whole commitment (nr_leaves and root) or just the root? - #[deprecated(since = "0.4.9", note = "Use `concatenate_with_message` instead")] + #[deprecated(since = "0.5.0", note = "Use `concatenate_with_message` instead")] pub fn concat_with_msg(&self, msg: &[u8]) -> Vec { Self::concatenate_with_message(self, msg) } @@ -241,7 +241,7 @@ impl MerkleTreeBatchCommitment { // todo: Simplify the algorithm. // todo: Maybe we want more granular errors, rather than only `BatchPathInvalid` #[deprecated( - since = "0.4.9", + since = "0.5.0", note = "Use `verify_leaves_membership_from_batch_path` instead" )] pub fn check( diff --git a/mithril-stm/src/merkle_tree/tree.rs b/mithril-stm/src/merkle_tree/tree.rs index 0a56a04d892..f2d753218e5 100644 --- a/mithril-stm/src/merkle_tree/tree.rs +++ b/mithril-stm/src/merkle_tree/tree.rs @@ -64,7 +64,7 @@ impl MerkleTree { } /// Provided a non-empty list of leaves, `create` generates its corresponding `MerkleTree`. - #[deprecated(since = "0.4.9", note = "Use `new` instead")] + #[deprecated(since = "0.5.0", note = "Use `new` instead")] pub fn create(leaves: &[MerkleTreeLeaf]) -> MerkleTree { Self::new(leaves) } @@ -83,7 +83,7 @@ impl MerkleTree { /// Convert merkle tree to a batch compatible commitment. /// This function simply returns the root and the number of leaves in the tree. #[deprecated( - since = "0.4.9", + since = "0.5.0", note = "Use `to_merkle_tree_batch_commitment` instead" )] pub fn to_commitment_batch_compat(&self) -> MerkleTreeBatchCommitment { @@ -169,7 +169,7 @@ impl MerkleTree { /// If the indices provided are out of bounds (higher than the number of elements /// committed in the `MerkleTree`) or are not ordered, the function fails. // todo: Update doc. - #[deprecated(since = "0.4.9", note = "Use `compute_merkle_tree_batch_path` instead")] + #[deprecated(since = "0.5.0", note = "Use `compute_merkle_tree_batch_path` instead")] pub fn get_batched_path(&self, indices: Vec) -> MerkleBatchPath where D: FixedOutput, @@ -226,7 +226,7 @@ impl MerkleTree { } /// Convert merkle tree to a commitment. This function simply returns the root. - #[deprecated(since = "0.4.9", note = "Use `to_merkle_tree_commitment` instead")] + #[deprecated(since = "0.5.0", note = "Use `to_merkle_tree_commitment` instead")] pub fn to_commitment(&self) -> MerkleTreeCommitment { Self::to_merkle_tree_commitment(self) } @@ -260,7 +260,7 @@ impl MerkleTree { /// Get a path (hashes of siblings of the path to the root node) /// for the `i`th value stored in the tree. /// Requires `i < self.n` - #[deprecated(since = "0.4.9", note = "Use `compute_merkle_tree_path` instead")] + #[deprecated(since = "0.5.0", note = "Use `compute_merkle_tree_path` instead")] pub fn get_path(&self, i: usize) -> MerklePath { Self::compute_merkle_tree_path(self, i) } diff --git a/mithril-stm/src/participant/initializer.rs b/mithril-stm/src/participant/initializer.rs index 1292226bf5e..af7358f98d4 100644 --- a/mithril-stm/src/participant/initializer.rs +++ b/mithril-stm/src/participant/initializer.rs @@ -41,7 +41,7 @@ impl Initializer { /// Builds an `Initializer` that is ready to register with the key registration service. /// This function generates the signing and verification key with a PoP, and initialises the structure. - #[deprecated(since = "0.4.9", note = "Use `new` instead")] + #[deprecated(since = "0.5.0", note = "Use `new` instead")] pub fn setup(params: Parameters, stake: Stake, rng: &mut R) -> Self { Self::new(params, stake, rng) } @@ -53,7 +53,7 @@ impl Initializer { /// Extract the verification key. #[deprecated( - since = "0.4.9", + since = "0.5.0", note = "Use `get_verification_key_proof_of_possession` instead" )] pub fn verification_key(&self) -> VerificationKeyProofOfPossession { @@ -109,7 +109,7 @@ impl Initializer { /// * the current total stake (according to the registration service) /// # Error /// This function fails if the initializer is not registered. - #[deprecated(since = "0.4.9", note = "Use `create_signer` instead")] + #[deprecated(since = "0.5.0", note = "Use `create_signer` instead")] pub fn new_signer( self, closed_reg: ClosedKeyRegistration, @@ -151,7 +151,7 @@ impl Initializer { /// Takes `eligible_parties` as a parameter and determines the signer's index in the parties. /// `eligible_parties` is verified and trusted which is only run by a full-node /// that has already verified the parties. - #[deprecated(since = "0.4.9", note = "Use `create_basic_signer` instead")] + #[deprecated(since = "0.5.0", note = "Use `create_basic_signer` instead")] pub fn new_core_signer( self, eligible_parties: &[RegisteredParty], diff --git a/mithril-stm/src/participant/signer.rs b/mithril-stm/src/participant/signer.rs index 68324970e42..da9a06f8d60 100644 --- a/mithril-stm/src/participant/signer.rs +++ b/mithril-stm/src/participant/signer.rs @@ -46,7 +46,7 @@ impl Signer { } /// Create a Signer for given input - #[deprecated(since = "0.4.9", note = "Use `set_signer` instead")] + #[deprecated(since = "0.5.0", note = "Use `set_signer` instead")] pub fn set_stm_signer( signer_index: u64, stake: Stake, @@ -77,7 +77,7 @@ impl Signer { } /// Create a core signer (no registration data) for given input - #[deprecated(since = "0.4.9", note = "Use `set_basic_signer` instead")] + #[deprecated(since = "0.5.0", note = "Use `set_basic_signer` instead")] pub fn set_core_signer( signer_index: u64, stake: Stake, @@ -115,7 +115,7 @@ impl Signer { } /// Extract the verification key. - #[deprecated(since = "0.4.9", note = "Use `get_verification_key` instead")] + #[deprecated(since = "0.5.0", note = "Use `get_verification_key` instead")] pub fn verification_key(&self) -> VerificationKey { Self::get_verification_key(self) } @@ -150,7 +150,7 @@ impl Signer { /// Once the signature is produced, this function checks whether any index in `[0,..,self.params.m]` /// wins the lottery by evaluating the dense mapping. /// It records all the winning indexes in `Self.indexes`. - #[deprecated(since = "0.4.9", note = "Use `basic_sign` instead")] + #[deprecated(since = "0.5.0", note = "Use `basic_sign` instead")] pub fn core_sign(&self, msg: &[u8], total_stake: Stake) -> Option { Self::basic_sign(self, msg, total_stake) } @@ -177,7 +177,7 @@ impl Signer { } /// Get Parameters - #[deprecated(since = "0.4.9", note = "Use `get_parameters` instead")] + #[deprecated(since = "0.5.0", note = "Use `get_parameters` instead")] pub fn get_params(&self) -> Parameters { Self::get_parameters(self) } @@ -188,7 +188,7 @@ impl Signer { } /// Get closed key registration - #[deprecated(since = "0.4.9", note = "Use `get_closed_key_registration` instead")] + #[deprecated(since = "0.5.0", note = "Use `get_closed_key_registration` instead")] pub fn get_closed_reg(&self) -> Option> { Self::get_closed_key_registration(self) } diff --git a/mithril-stm/src/single_signature/signature.rs b/mithril-stm/src/single_signature/signature.rs index 1fcf0d3a46b..3aff046b715 100644 --- a/mithril-stm/src/single_signature/signature.rs +++ b/mithril-stm/src/single_signature/signature.rs @@ -131,7 +131,7 @@ impl SingleSignature { } /// Compare two `SingleSignature` by their signers' merkle tree indexes. - #[deprecated(since = "0.4.9", note = "This function will be removed")] + #[deprecated(since = "0.5.0", note = "This function will be removed")] pub fn cmp_stm_sig(&self, other: &Self) -> Ordering { Self::compare_signer_index(self, other) } @@ -153,7 +153,7 @@ impl SingleSignature { } /// Will be deprecated. Use `basic_verify` instead. - #[deprecated(since = "0.4.9", note = "Use `basic_verify` instead")] + #[deprecated(since = "0.5.0", note = "Use `basic_verify` instead")] pub fn core_verify( &self, params: &Parameters,