Skip to content
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

Accelerate signer fixtures creation in tests #2161

Merged
merged 5 commits into from
Dec 9, 2024

Conversation

sfauvel
Copy link
Collaborator

@sfauvel sfauvel commented Dec 5, 2024

Content

Cryptographic operations takes a long time when we creating signers in tests.
To reduce this time, we precompute keskey for some party ids.

This PR stores in a file precomputed keskey for some party ids and use them if they match with the party id to create.
A test check that all keys are precomputed up to a party id number.
If precomputed keys are differents from the real ones, the test output the code to copy in function that provide precomputed keys.

Important

The directory /tmp/mithril_crypto_helper_material have to be removed to not reuse old kes.sk and opcert.cert files.

Time observed on the local environment before and after this PR.

Aggregator Signer Common Total
Before 52.6 s 5.7s  52.8s 111.1s
After 30.4s  3.9s   34.3s 68.7 s 
Delta -42% -30% -34% -38%

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)
    • Add dev blog post (if relevant)

Issue(s)

Closes #2153

@sfauvel sfauvel changed the title Sfa/2153/accelerate signer fixtures creation in tests Accelerate signer fixtures creation in tests Dec 5, 2024
@sfauvel sfauvel force-pushed the sfa/2153/accelerate_signer_fixtures_creation_in_tests branch from 680ef13 to e797ece Compare December 5, 2024 13:52
Copy link

github-actions bot commented Dec 5, 2024

Test Results

    4 files  ±0     52 suites  ±0   9m 45s ⏱️ - 2m 8s
1 429 tests +1  1 429 ✅ +1  0 💤 ±0  0 ❌ ±0 
1 640 runs  +1  1 640 ✅ +1  0 💤 ±0  0 ❌ ±0 

Results for commit 38314fe. ± Comparison against base commit f1441bc.

♻️ This comment has been updated with latest results.

@sfauvel sfauvel force-pushed the sfa/2153/accelerate_signer_fixtures_creation_in_tests branch 2 times, most recently from 06a9710 to a167bac Compare December 5, 2024 17:43
@sfauvel sfauvel temporarily deployed to testing-preview December 5, 2024 17:53 — with GitHub Actions Inactive
@sfauvel sfauvel temporarily deployed to testing-sanchonet December 5, 2024 17:54 — with GitHub Actions Inactive
@sfauvel sfauvel marked this pull request as ready for review December 6, 2024 10:55
@sfauvel sfauvel force-pushed the sfa/2153/accelerate_signer_fixtures_creation_in_tests branch from 35f45e5 to c71819a Compare December 6, 2024 10:59
@sfauvel sfauvel force-pushed the sfa/2153/accelerate_signer_fixtures_creation_in_tests branch from c71819a to 2dc1c26 Compare December 6, 2024 11:11
Copy link
Collaborator

@Alenar Alenar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sfauvel sfauvel temporarily deployed to testing-preview December 6, 2024 11:24 — with GitHub Actions Inactive
@sfauvel sfauvel temporarily deployed to testing-sanchonet December 6, 2024 11:24 — with GitHub Actions Inactive
Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Can you add a brief summary about how much this accelerates the performances of the fixture creation?

mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/mod.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/precomputed_keskey.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@dlachaume dlachaume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍, just minor suggestions.

mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/fixture_builder.rs Outdated Show resolved Hide resolved
mithril-common/src/test_utils/mod.rs Outdated Show resolved Hide resolved
@sfauvel sfauvel temporarily deployed to testing-preview December 9, 2024 10:49 — with GitHub Actions Inactive
@sfauvel sfauvel temporarily deployed to testing-sanchonet December 9, 2024 10:49 — with GitHub Actions Inactive
@sfauvel sfauvel force-pushed the sfa/2153/accelerate_signer_fixtures_creation_in_tests branch from a75319d to 38314fe Compare December 9, 2024 13:32
@sfauvel sfauvel temporarily deployed to testing-preview December 9, 2024 13:41 — with GitHub Actions Inactive
@sfauvel sfauvel temporarily deployed to testing-sanchonet December 9, 2024 13:41 — with GitHub Actions Inactive
@sfauvel sfauvel merged commit 84530e0 into main Dec 9, 2024
51 of 54 checks passed
@sfauvel sfauvel deleted the sfa/2153/accelerate_signer_fixtures_creation_in_tests branch December 9, 2024 14:07
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.

Accelerate signer fixtures creation in tests with pre-computation
4 participants