Skip to content

Pass on stm module #199

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

Merged
merged 9 commits into from
May 19, 2022
Merged

Pass on stm module #199

merged 9 commits into from
May 19, 2022

Conversation

iquerejeta
Copy link
Contributor

@iquerejeta iquerejeta commented May 12, 2022

Refactor of the library. Goal is to simplify the core-library in the next few iterations, and provide what is strictly required. This PR simplifies the crate, and in particular the stm module.

  • StmSig does not require the Verification key + PoP, as in the registration PoP is already verified.
  • PartyId is no longer linked to a signature.
  • Introduced the StmAggrVerificationKey, which essentially is the root of the merkle tree and the full stake.
  • Renamed StmMultiSig -> StmAggrSig to have a clearer distinction with the multi signature.
  • Minor optimisation in StmAggrSig. Instead of individually verifying k signatures (= to evaluating k pairings), we first aggregate the signatures, and the keys, and verify the aggregate (= k additions in G1 and G2 and one pairing evaluation)
  • Removed serialisation from ClosedRegistration, Signer and Clerk. This is intentional, to force generation of signers or clerks to produce an instance from valid keys (and their PoP).
  • Removed C-API. We are expecting a lot of changes to the library, and not expecting to use it out of rust. A C-API may be useful in the future, but not now.
  • Created a dense_mapping module to simplify the stm module (by far the most complex and crucial module of the library).
  • Clerks no longer verify multi signatures. Instead, we have multi signatures capable of being verified provided a verification key. This allows for signature verification without the need to generating a Clerk.

@github-actions
Copy link

github-actions bot commented May 12, 2022

Unit Test Results

    5 files   - 1    14 suites   - 1   2m 19s ⏱️ -3s
113 tests  - 7  113 ✔️  - 7  0 💤 ±0  0 ±0 

Results for commit cf26c38. ± Comparison against base commit f20638e.

This pull request removes 9 and adds 2 tests. Note that renamed tests count towards both.
src/stm.rs - stm::StmSigner<D> ‑ new_epoch (line 634)
stm ‑ clerkFromPublicData
stm ‑ dynamicStake
stm ‑ failSigningIfIneligible
stm ‑ invalidRegistration
stm ‑ produceAndVerifyAggregateSignature
stm::tests ‑ test_clerk_serialize_deserialize
stm::tests ‑ test_precision_approximation
stm::tests ‑ test_signer_serialize_deserialize
dense_mapping::tests ‑ test_precision_approximation
src/stm.rs - stm::StmSigner<D> ‑ new_epoch (line 674)

♻️ This comment has been updated with latest results.

@iquerejeta iquerejeta marked this pull request as ready for review May 13, 2022 14:53
@jpraynaud jpraynaud requested review from a user, Alenar and ghubertpalo May 18, 2022 09:39
iquerejeta and others added 9 commits May 18, 2022 19:37
* StmSig does not require the Verification key + PoP, as in the registration PoP is already verified.
* PartyId is no longer linked to a signature.
* Introduced the StmAggrVerificationKey, which essentially is the root of the merkle tree and the full stake.
* Renamed StmMultiSig -> StmAggrSig
* Minor optimisation in StmAggrSig. Instead of individually verifying `k` signatures (= to evaluating `k` pairings), we first aggregate the signatures, and the keys, and verify the aggregate (= `k` additions in G1 and G2 and one pairing evaluation)
This is intentional, to force generation of signers or clerks to produce an instance from valid keys (and their PoP).
* Removed C-API. We are expecting a lot of changes to the library, and not expecting to use it out of rust. A C-API may be useful in the future, but not now.
* Created a `dense_mapping` module to simplify the STM module (by far the most complex and crucial module of the library).
* Clerks no longer verify Multi Signatures. Instead, we have multi signatures capable of being verified provided a verification key.
@jpraynaud jpraynaud merged commit d896b55 into main May 19, 2022
@jpraynaud jpraynaud deleted the pass_stm branch May 19, 2022 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants