You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once the pre-aggregation SNARK primitives are implemented (see #2792), we can activate the snark feature by default. The impact should only exist in the signer and aggregator which will start creating/registering "extended" key registration including Schnorr verification key. We want to be sure that the activation of the feature has no other impact on the Mithril network and that backward compatibility is fully maintained.
What
Activate the snark feature by default and provide full backward compatibility for Mithril networks.
How
Remove unnecessary/unused code before activation. Example:
params and merkle_tree_depth in SnarkProof
Some allow(dead_code)
Unnecessary feature flags
Update golden values
Removing the cfg_num_integer! macro from the SNARK lottery computation
Removing some dependencies from the snark feature (rand, rand-chacha)
Activate the snark feature by default in the STM library
Update the CI:
Do not run tests twice with snark
Include the .asset and .vkey files in the Hydra CI (flake.nix)
Run a green minimal e2e test with IVC Prover locallly
Run backward compatibility tests for concatenation locally:
Stable signer with new aggregator
Stable aggregator with new signer
Mix stable/new signer/aggregator
Bump the versions of the modified crates to the next minor/major
I ran the end-to-end tests with the nodes of the branch (4a97e3b22f1, built with the default features) and swapped some nodes for a released distribution built without the snark feature:
Concatenation runs use --cardano-node-version 11.1.3 --cardano-slot-length 0.25 --cardano-epoch-length 45.0 full --signed-entity-types CardanoTransactions,CardanoStakeDistribution,CardanoDatabase.
The SNARK run uses the settings of the nightly minimal-snark job.
To mix signer versions in one run, the mithril-signer binary was a wrapper script picking the release or the branch binary from the DB_DIRECTORY of each pool.
Test number
Era
Aggregator version
Signer version
Client version
Aggregate signature
Outcome
Expected result
1
Pythagoras
2642.0
unstable
unstable
Concatenation
✅
Success
2
Pythagoras
unstable
2642.0
unstable
Concatenation
✅
Success
3
Pythagoras
unstable
unstable
2642.0
Concatenation
✅
Success
4
Pythagoras
2630.1-hotfix
unstable
unstable
Concatenation
✅
Success
5
Pythagoras
unstable
2630.1-hotfix
unstable
Concatenation
✅
Success
6
Pythagoras
unstable
unstable
2630.1-hotfix
Concatenation
✅
Success
7
Pythagoras → Lagrange
unstable
all signers 2642.0
unstable
Concatenation
❌
Failure: No certificate after the switch: "Lagrange era requires a SNARK aggregate verification key"
8
Pythagoras → Lagrange
unstable
all signers 2642.0, with re-genesis
unstable
Concatenation
❌
Failure: The re-genesis fails: "Rigid next_aggregate_verification_key_snark value is required"
9
Pythagoras → Lagrange
unstable
all signers 2630.1-hotfix
unstable
Concatenation
❌
Failure: Same as 2642.0, with and without re-genesis
10
Pythagoras → Lagrange
unstable
1 signer 2642.0 out of 2
unstable
Concatenation
❌
Failure: Quorum not reached after the switch: 226 lotteries out of 283, the old signer's signatures are dropped
11
Pythagoras → Lagrange
unstable
1 signer 2642.0 out of 5
unstable
Concatenation
✅ Certificates signed by the 4 upgraded signers
Success
12
Lagrange
unstable
1 signer 2642.0 out of 2
unstable
Snark
✅ SNARK certificates signed by the upgraded signer
Success
13
Lagrange
unstable
unstable
client 2642.0
Concatenation
❌
Failure: The client cannot decode the dual genesis verification key
14
Lagrange
aggregator 2642.0
unstable
unstable
Concatenation
❌
Failure: The aggregator does not start, it cannot decode the dual genesis verification key
15
Lagrange
unstable
unstable
unstable
Concatenation
✅
Success
The runner checks that every signer signs each certificate, so it reports the two ✅ mixed signer runs as failures.
The certificates were checked in the aggregator database.
Test-rust CI timings with SNARK activated by default
Measured on the 2 linux amd64 test-rust jobs, main vs damrobi/msnark/3573-activate-snark-by-default, each job run alone from a clean build on 4 CPUs (2 physical cores, like a GitHub runner).
TLDR
Activating SNARK by default does not make the CI pipeline slower: the pipeline time (the slower of the 2 jobs) is lower than on main, with and without slow tests.
The workspace job becomes the bottleneck without slow tests: it is about 2x slower than on main, because the certificate chain fixtures rebuild the aggregate verification key (AVK), which costs more with SNARK registrations at opt-level 0.
Caching the AVK in MithrilFixture can remove about 15% of the workspace job time.
Pipeline time
main
SNARK branch with fixture cache
Reduction
Without slow tests
921 s
700 s
24%
With slow tests
3540 s
2920 s
18%
Without slow tests
Filter not test(#*slow::*), cargo profile ci-tests.
Version
Job
Build
Tests
Total
main
Workspace
357 s
205 s
562 s
main
SNARK (7 crates)
330 s
591 s
921 s
SNARK branch
Workspace (--exclude mithril-stm)
377 s
448 s
825 s
SNARK branch
mithril-stm
69 s
223 s
292 s
SNARK branch with fixture cache
Workspace (--exclude mithril-stm)
359 s
341 s
700 s
With slow tests
Filter all(), cargo profile ci-tests-snark for the job with SNARK slow tests, ci-tests for the workspace job.
Version
Job
Cargo profile
Build
Tests
Total
main
Workspace
ci-tests
326 s
203 s
529 s
main
SNARK (7 crates)
ci-tests-snark
959 s
2581 s
3540 s
SNARK branch with fixture cache
Workspace (--exclude mithril-stm)
ci-tests
370 s
373 s
743 s
SNARK branch with fixture cache
mithril-stm
ci-tests-snark
389 s
2531 s
2920 s
The job with SNARK slow tests stays the bottleneck on both branches, and it is faster on the SNARK branch because it builds and tests only mithril-stm instead of 7 crates.
Workspace job bottleneck
Profile of verify_certificate_chain_verifies_all_chained_certificates with ci-tests:
Measure
main
SNARK branch
Test time
6.2 s
19.8 s
Share in build_base_certificate
34%
52%
KES verification
3.7 s
8.9 s
SNARK lottery target computation
5.1 s
Each registration runs 2 KES verifications (concatenation and SNARK) and computes the SNARK lottery target, and the fixtures did it again for every certificate of a chain.
ci-tests-snark for the workspace job
Cargo profile
Build
Tests
Total
ci-tests
359 s
341 s
700 s
ci-tests-snark
762 s
86 s
848 s
From a clean build it is slower, but the Rust cache on CI should keep the optimized dependencies, so it is worth a CI run before deciding.
Next steps
Cache the AVK in MithrilFixture to remove about 15% of the workspace job time, and confirm the gain on CI.
Reduce the number of certificates of the slowest certificate chain tests to the minimum they need (about 6% of the workspace job time).
Build the era transition chain fixture once and share it between its tests (about 2% of the workspace job time).
Try ci-tests-snark for the workspace job (--exclude mithril-stm) in a CI run and keep it if the job is faster with the Rust cache.
Activity
damrobi commentedon Oct 30, 2026
Backward compatibility checks
I ran the end-to-end tests with the nodes of the branch (
4a97e3b22f1, built with the default features) and swapped some nodes for a released distribution built without thesnarkfeature:2642.0: aggregator0.10.21, signer1.2.5, client0.13.292630.1-hotfix: aggregator0.9.22, signer1.1.9, client0.13.20Concatenation runs use
--cardano-node-version 11.1.3 --cardano-slot-length 0.25 --cardano-epoch-length 45.0 full --signed-entity-types CardanoTransactions,CardanoStakeDistribution,CardanoDatabase.The SNARK run uses the settings of the nightly
minimal-snarkjob.To mix signer versions in one run, the
mithril-signerbinary was a wrapper script picking the release or the branch binary from theDB_DIRECTORYof each pool.2642.0unstableunstableunstable2642.0unstableunstableunstable2642.02630.1-hotfixunstableunstableunstable2630.1-hotfixunstableunstableunstable2630.1-hotfixunstable2642.0unstableunstable2642.0, with re-genesisunstablenext_aggregate_verification_key_snarkvalue is required"unstable2630.1-hotfixunstable2642.0, with and without re-genesisunstable2642.0out of 2unstableunstable2642.0out of 5unstableunstable2642.0out of 2unstableunstableunstable2642.02642.0unstableunstableunstableunstableunstableThe runner checks that every signer signs each certificate, so it reports the two ✅ mixed signer runs as failures.
The certificates were checked in the aggregator database.
jpraynaud commentedon Nov 3, 2026
Test-rust CI timings with SNARK activated by default
Measured on the 2 linux amd64
test-rustjobs,mainvsdamrobi/msnark/3573-activate-snark-by-default, each job run alone from a clean build on 4 CPUs (2 physical cores, like a GitHub runner).TLDR
main, with and without slow tests.main, because the certificate chain fixtures rebuild the aggregate verification key (AVK), which costs more with SNARK registrations at opt-level 0.MithrilFixturecan remove about 15% of the workspace job time.mainWithout slow tests
Filter
not test(#*slow::*), cargo profileci-tests.mainmain--exclude mithril-stm)mithril-stm--exclude mithril-stm)With slow tests
Filter
all(), cargo profileci-tests-snarkfor the job with SNARK slow tests,ci-testsfor the workspace job.mainci-testsmainci-tests-snark--exclude mithril-stm)ci-testsmithril-stmci-tests-snarkThe job with SNARK slow tests stays the bottleneck on both branches, and it is faster on the SNARK branch because it builds and tests only
mithril-stminstead of 7 crates.Workspace job bottleneck
Profile of
verify_certificate_chain_verifies_all_chained_certificateswithci-tests:mainbuild_base_certificateEach registration runs 2 KES verifications (concatenation and SNARK) and computes the SNARK lottery target, and the fixtures did it again for every certificate of a chain.
ci-tests-snarkfor the workspace jobci-testsci-tests-snarkFrom a clean build it is slower, but the Rust cache on CI should keep the optimized dependencies, so it is worth a CI run before deciding.
Next steps
MithrilFixtureto remove about 15% of the workspace job time, and confirm the gain on CI.ci-tests-snarkfor the workspace job (--exclude mithril-stm) in a CI run and keep it if the job is faster with the Rust cache.jpraynaud commentedon Nov 3, 2026
Proposed certificate chain reductions
Chain size is (total certificates, certificates per epoch), the genesis certificate is alone in epoch 1 and
[0]is the latest certificate.test_convert_certificatestest_get_certificate_records_by_epochverify_certificate_chain_verifies_all_chained_certificatesverify_genesis_certificate_*,verify_standard_certificate_*,verify_certificate_integrity_*,verify_certificate_success_*tests[0],[1]in different epochs, and the genesissnark_avk_chaining_*andavk_chaining_dispatches_*tests with different epochs[3]becomes[1]in..._when_previous_is_genesis_certificateverify_standard_certificate_success_with_same_epoch_as_previous, 4snark_avk_chaining_*_same_epoch_*)[0],[1]in the same epoch,[1]not genesisverify_certificate_chain_success_when_chain_is_valid,..._fails_when_chain_is_tamperedstore_partial[5]becomes[2]store_all,check_and_raise_epoch_gap_errorsucceed_with_a_valid_certificate_chain_and_only_get_first_certificate_of_each_epoch_plus_genesis