feat: SNARK-friendly certificate chain - #3073
Conversation
Test Results 5 files ± 0 190 suites ±0 1h 6m 38s ⏱️ + 8m 34s Results for commit 4949549. ± Comparison against base commit ceb0c72. This pull request removes 1 and adds 42 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
a596cd6 to
b3610e9
Compare
There was a problem hiding this comment.
Pull request overview
This PR implements SNARK support for the aggregate verification key (AVK) across the full Mithril certificate chain (#2811). It introduces a new SnarkClerk, AggregateVerificationKeyForSnark, and a new NextSnarkAggregateVerificationKey protocol message part key, then integrates these end-to-end from key registration through aggregator/signer/client logic, with Pythagoras/Lagrange era-gating at every level.
Changes:
- mithril-stm: New
SnarkClerkfor computing SNARK AVK from key registration;AggregateVerificationKeyForSnarkgainstotal_stake/target_valuefields, customPartialEq, and byte serialization;Clerkupdated to hold an optionalSnarkClerk. - mithril-common / mithril-aggregator / mithril-signer:
ProtocolAggregateVerificationKeyForSnarktype alias;NextSnarkAggregateVerificationKeyprotocol message part key;CertificateandCertificateMessagegain the SNARK AVK field; verifier adds SNARK AVK chaining logic dispatched byAggregateSignatureType; database migration 41 adds theaggregate_verification_key_snarkcolumn;EpochServicegainsmithril_era(). - mithril-client / mithril-client-cli:
future_snarkfeature flag propagation; message builder computes SNARK AVK when the protocol message contains the SNARK AVK part key.
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
mithril-stm/src/proof_system/halo2_snark/clerk.rs |
New SnarkClerk for SNARK AVK computation |
mithril-stm/src/proof_system/halo2_snark/aggregate_key.rs |
AggregateVerificationKeyForSnark extended with stake/target fields and byte serialization |
mithril-stm/src/protocol/aggregate_signature/clerk.rs |
Clerk holds optional SnarkClerk and uses it for AVK |
mithril-stm/src/proof_system/mod.rs |
Exports AggregateVerificationKeyForSnark (feature-gated) and SnarkClerk |
mithril-common/src/entities/protocol_message.rs |
New NextSnarkAggregateVerificationKey enum variant |
mithril-common/src/entities/certificate.rs |
Adds SNARK AVK field, strip_snark_aggregate_verification_key, and CertificateSignature::aggregate_signature_type() |
mithril-common/src/messages/certificate.rs |
Adds SNARK AVK field to the message DTO |
mithril-common/src/certificate_chain/certificate_verifier.rs |
Dispatches AVK chaining verification by signature type; new SNARK-specific chaining method |
mithril-common/src/certificate_chain/certificate_genesis.rs |
Genesis message enriched with SNARK AVK |
mithril-common/src/crypto_helper/types/wrappers.rs |
Adds ProtocolAggregateVerificationKeyForSnark type alias; changes VerificationKeyForSnark from bytes_hex_codec to json_hex_codec |
mithril-common/src/signable_builder/interface.rs |
SignableSeedBuilder trait gains compute_next_aggregate_verification_key_for_snark |
mithril-aggregator/src/services/certifier/certifier_service.rs |
Strips SNARK AVK during Pythagoras era |
mithril-aggregator/src/database/migration.rs |
Migration 41 adds aggregate_verification_key_snark column |
mithril-aggregator/src/database/record/certificate.rs |
CertificateRecord persistence of SNARK AVK |
mithril-signer/src/services/epoch_service.rs |
Adds era_checker dependency and mithril_era() to epoch service |
mithril-client/src/message.rs |
Computes and includes SNARK AVK in protocol message when needed |
mithril-client/Cargo.toml / mithril-client-cli/Cargo.toml |
future_snark feature propagation |
b3610e9 to
cf99c75
Compare
476c0ef to
6c53d3a
Compare
545f1bc to
217984d
Compare
217984d to
9d08dd0
Compare
9d08dd0 to
9e07bd1
Compare
When a previous client tries to verify a certificate with a Concatenation proof which has been created with a new aggregator compiled with 'future_snark', it can't parse it because it embeds a 'ClosedKeyRegistrationEntry' which has a rigid serde deserialization based on array representation (receives an array of length 4 when expecting 2).
bdde290 to
2e4c153
Compare
Alenar
left a comment
There was a problem hiding this comment.
LGTM, mostly nitpick comments
8b10e7d to
14c19e5
Compare
* mithril-aggregator from `0.8.33` to `0.8.34` * mithril-client-cli from `0.12.42` to `0.12.43` * mithril-client from `0.13.4` to `0.13.5` * mithril-common from `0.6.55` to `0.6.56` * mithril-signer from `0.3.22` to `0.3.23` * mithril-stm from `0.9.28` to `0.9.29` * mithril-end-to-end from `0.4.121` to `0.4.122`
14c19e5 to
4949549
Compare
Content
This PR includes the implementation of the SNARK support for the aggregate verification key across the full certificate chain:
mithril-stm:SnarkClerkfor computing SNARK AVK from closed key registration,AggregateVerificationKeyForSnarkwrapper type, and extension ofAggregateVerificationKey<D>to carry both concatenation and SNARK AVKsmithril-common:ProtocolAggregateVerificationKeyForSnarktype alias with bytes_hex_codec,NextSnarkAggregateVerificationKeyprotocol message part key (ungated for deserialization compatibility), SNARK AVK field onCertificateandMithrilCertificateMessage, unified AVK chaining verification dispatching by signature type, genesis protocol message enrichment, and signable builder / test infrastructure extensionsmithril-aggregator: database migration addingaggregate_verification_key_snarkcolumn,CertificateRecordpersistence, era-gated SNARK AVK stripping in certifier service (Pythagorasstrips,Lagrangerequires), seed builder with era-aware SNARK AVK computation, and genesis tooling updatesmithril-signer: Era-gated SNARK AVK computation in seed builder and epoch service, single signer and dependency injection wiringmithril-client/mithril-client-cli:future_snarkfeature propagation, SNARK AVK verification in message builder when present in protocol message, and test struct literal updatesCases support
Distributions backward compatibility
With
future_snark2603.12543.1-hotfix2543.02537.02524.0Without
future_snark2603.12543.1-hotfix2543.02537.02524.0Pre-submit checklist
Issue(s)
Closes #2811