Skip to content

refactor(stm): update PoP, protocol parameters and decoding functions#3431

Draft
damrobi wants to merge 8 commits into
mainfrom
damrobi/msnark/refactor-pop-snark-params-decoding
Draft

refactor(stm): update PoP, protocol parameters and decoding functions#3431
damrobi wants to merge 8 commits into
mainfrom
damrobi/msnark/refactor-pop-snark-params-decoding

Conversation

@damrobi

@damrobi damrobi commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Content

This PR includes an update to the handling of the proof of possession of BLS keys, a modification of the checks done on the protocol parameters and a modification to the decoding function of the merkle tree path and concatenation proof.

Changes

  • Add checked arithmetic to legacy byte decoders (Merkle tree, batch commitment, ConcatenationProof, SingleSignature)
  • Validate phi_f is within (0, 1] before use in lottery/eligibility computations
  • Restrict KeyRegistration::register_by_entry to pub(crate) so external registration must go through register(), which always verifies proof of possession
  • Make ClosedKeyRegistration fields private with a pub(crate) constructor
  • Narrow RegistrationEntry/ClosedRegistrationEntry (types, constructors, methods) to pub(crate) and dropped RegistrationEntry's unused Serialize/Deserialize
  • Fix resulting lint warnings: #[allow(private_interfaces)] where a public error/field intentionally carries a now-private type, #[cfg(test)] on Merkle tree byte (de)serialization helpers that are test-only

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
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

Comments

Issue(s)

@damrobi damrobi self-assigned this Jul 22, 2026
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Test Results

     5 files  ± 0     209 suites  ±0   1h 37m 49s ⏱️ - 59m 2s
 3 334 tests  - 54   3 334 ✅  - 54  0 💤 ±0  0 ❌ ±0 
11 072 runs   - 54  11 072 ✅  - 54  0 💤 ±0  0 ❌ ±0 

Results for commit 917a568. ± Comparison against base commit 2eedbd2.

This pull request removes 56 and adds 2 tests. Note that renamed tests count towards both.
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::index_out_of_bounds
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::index_too_large_for_circuit_range
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::indices_not_increasing
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_merkle_path_mismatch
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_swap_keep_merkle_path
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_wrong_verification_key
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_corrupt_sibling
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_flip_position
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_length_long
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_length_short
…
mithril-stm ‑ proof_system::concatenation::eligibility::tests::is_lottery_won_rejects_out_of_range_phi_f
mithril-stm ‑ proof_system::halo2_snark::eligibility::tests::compute_target_value_for_snark_lottery_rejects_out_of_range_phi_f

♻️ This comment has been updated with latest results.

@damrobi
damrobi force-pushed the damrobi/msnark/refactor-pop-snark-params-decoding branch from 7f5d023 to 98489af Compare July 24, 2026 07:18
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.

1 participant