-
Notifications
You must be signed in to change notification settings - Fork 52
SNARK-friendly STM: Re-organize modules #2804
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
base: main
Are you sure you want to change the base?
Conversation
Test Results 4 files ±0 168 suites ±0 22m 25s ⏱️ - 1m 51s Results for commit fe11a48. ± Comparison against base commit 0a23618. This pull request removes 46 and adds 46 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
1ec9ee5 to
1673005
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR reorganizes the mithril-stm library's module structure in preparation for SNARK integration. The refactoring consolidates code into four main modules: signature_scheme (for BLS and Schnorr signatures), protocol (for STM protocol logic), membership_commitment (for Merkle trees), and proof_system (for concatenation proofs). This reorganization improves separation of concerns and prepares the codebase for future SNARK-friendly implementations.
Key changes:
- Introduces new top-level module structure grouping related functionality
- Updates import paths throughout the codebase to reflect new organization
- Moves deprecated aliases from
lib.rstoprotocol/mod.rs - Changes
blst_error_to_stm_errorvisibility frompub(crate)topub
Reviewed changes
Copilot reviewed 30 out of 36 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| mithril-stm/src/lib.rs | Simplified to export from new top-level modules; moved deprecated aliases to protocol module |
| mithril-stm/src/signature_scheme/mod.rs | New module aggregating BLS and Schnorr signature schemes |
| mithril-stm/src/signature_scheme/schnorr_signature/mod.rs | Empty placeholder module for future Schnorr implementation |
| mithril-stm/src/protocol/mod.rs | New module aggregating protocol components with deprecated aliases |
| mithril-stm/src/protocol/error.rs | Changed blst_error_to_stm_error visibility to public |
| mithril-stm/src/protocol/eligibility_check.rs | Moved from root to protocol module |
| mithril-stm/src/membership_commitment/mod.rs | New module for Merkle tree implementations |
| mithril-stm/src/proof_system/mod.rs | New module for proof system implementations |
| mithril-stm/src/signature_scheme/bls_multi_signature/*.rs | Updated import paths to reference new module structure |
| mithril-stm/src/protocol/aggregate_signature/*.rs | Updated import paths for new module locations |
| mithril-stm/src/protocol/participant/*.rs | Updated import paths for signature scheme and protocol references |
| mithril-stm/Cargo.toml | Version bumped from 0.6.0 to 0.6.1 |
| mithril-stm/CHANGELOG.md | Added entry for version 0.6.1 documenting reorganization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mithril-stm/src/membership_commitment/merkle_tree/commitment.rs
Outdated
Show resolved
Hide resolved
mithril-stm/src/signature_scheme/bls_multi_signature/proof_of_possession.rs
Outdated
Show resolved
Hide resolved
14f8b4b to
bfb326e
Compare
mithril-stm/src/signature_scheme/schnorr_signature/signature.rs
Outdated
Show resolved
Hide resolved
0ed080a to
fe11a48
Compare
| use serde::{Deserialize, Serialize}; | ||
| use std::cmp::Ordering; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| use serde::{Deserialize, Serialize}; | |
| use std::cmp::Ordering; | |
| use std::cmp::Ordering; | |
| use serde::{Deserialize, Serialize}; |
| use anyhow::anyhow; | ||
| use blake2::digest::{Digest, FixedOutput}; | ||
| use serde::{Deserialize, Serialize}; | ||
| use std::{collections::HashMap, fmt::Display, hash::Hash}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| use anyhow::anyhow; | |
| use blake2::digest::{Digest, FixedOutput}; | |
| use serde::{Deserialize, Serialize}; | |
| use std::{collections::HashMap, fmt::Display, hash::Hash}; | |
| use std::{collections::HashMap, fmt::Display, hash::Hash}; | |
| use anyhow::anyhow; | |
| use blake2::digest::{Digest, FixedOutput}; | |
| use serde::{Deserialize, Serialize}; |
| use anyhow::anyhow; | ||
| use blake2::digest::{Digest, FixedOutput}; | ||
| use std::{ | ||
| collections::{HashMap, hash_map::Entry}, | ||
| sync::Arc, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| use anyhow::anyhow; | |
| use blake2::digest::{Digest, FixedOutput}; | |
| use std::{ | |
| collections::{HashMap, hash_map::Entry}, | |
| sync::Arc, | |
| }; | |
| use std::{ | |
| collections::{HashMap, hash_map::Entry}, | |
| sync::Arc, | |
| }; | |
| use anyhow::anyhow; | |
| use blake2::digest::{Digest, FixedOutput}; |
| use anyhow::{Context, anyhow}; | ||
| use blake2::digest::{Digest, FixedOutput}; | ||
| use serde::{Deserialize, Serialize}; | ||
| use std::{ | ||
| cmp::Ordering, | ||
| hash::{Hash, Hasher}, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| use anyhow::{Context, anyhow}; | |
| use blake2::digest::{Digest, FixedOutput}; | |
| use serde::{Deserialize, Serialize}; | |
| use std::{ | |
| cmp::Ordering, | |
| hash::{Hash, Hasher}, | |
| }; | |
| use std::{ | |
| cmp::Ordering, | |
| hash::{Hash, Hasher}, | |
| }; | |
| use anyhow::{Context, anyhow}; | |
| use blake2::digest::{Digest, FixedOutput}; | |
| use serde::{Deserialize, Serialize}; |
| BlsSigningKey, POP, | ||
| helper::unsafe_helpers::{compress_p1, scalar_to_pk_in_g1, uncompress_p1}, | ||
| }; | ||
| use crate::{MultiSignatureError, StmResult, blst_error_to_stm_error}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the blst_error_to_stm_error to be public?
Content
This PR includes re-organization of the modules in
mithril-stmto make the library ready for SNARK integration.Pre-submit checklist
Comments
Issue(s)
Closes #2793