Skip to content

feat: enforce the circuit verification key registry - #3514

Open
jpraynaud wants to merge 24 commits into
jpraynaud/3148-prepare-circuit-key-registryfrom
jpraynaud/3148-enforce-circuit-key-registry
Open

jpraynaud wants to merge 24 commits into
jpraynaud/3148-prepare-circuit-key-registryfrom
jpraynaud/3148-enforce-circuit-key-registry

Conversation

@jpraynaud

@jpraynaud jpraynaud commented Sep 2, 2026

Copy link
Copy Markdown
Member

Content

This PR includes the enforcement of the circuit verification key registry prepared in #3513:

  • Enforce the certification of the circuit verification keys in MithrilCertificateVerifier for the Snark and IvcSnark aggregate signature types, on both the standard and the full chain shortcut paths, with a mandatory certifier
  • Resolve the registry of the client's Mithril network in mithril-client through the published networks.json by matching the aggregator endpoint, enabled by default
  • Add the unstable --circuit-verification-key-registry-path parameter to the client CLI to read the registry from a local file (tests and local deployments)
  • Enforce the registry in the aggregator at certificate creation and chain synchronization: the new circuit_verification_key_registry_url parameter selects the registry source, downloaded at every hourly refresh (a file:// URL reads a local file), the certificates requiring the registry being rejected without a source
  • Generate and enforce the registry on the fly in the end to end tests at genesis bootstrap
  • Adapt the infrastructure and CI to support the registry
  • Add the circuit verification key registry runbook

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

Issue(s)

Relates to #3148

@jpraynaud jpraynaud changed the title Jpraynaud/3148 enforce circuit key registry feat: enforce the circuit verification key registry Sep 2, 2026
@jpraynaud
jpraynaud requested a lite review from Copilot September 2, 2026 14:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment thread mithril-aggregator/src/configuration.rs Fixed
Comment thread mithril-aggregator/src/configuration.rs Fixed
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Test Results

     5 files  ±0     222 suites  ±0   54m 0s ⏱️ + 10m 59s
 3 724 tests +3   3 724 ✅ +3  0 💤 ±0  0 ❌ ±0 
11 934 runs  +3  11 934 ✅ +3  0 💤 ±0  0 ❌ ±0 

Results for commit eaef674. ± Comparison against base commit c6f2e05.

♻️ This comment has been updated with latest results.

@jpraynaud jpraynaud self-assigned this Sep 4, 2026
Base automatically changed from jpraynaud/3148-introduce-circuit-key-registry to main September 9, 2026 16:10
@jpraynaud
jpraynaud force-pushed the jpraynaud/3148-enforce-circuit-key-registry branch 3 times, most recently from 222ca3e to be3d77c Compare September 14, 2026 13:40
@jpraynaud
jpraynaud deployed to testing-preview September 14, 2026 13:57 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-2-preview September 14, 2026 13:57 — with GitHub Actions Active
@jpraynaud
jpraynaud force-pushed the jpraynaud/3148-enforce-circuit-key-registry branch from be3d77c to 266575d Compare September 14, 2026 16:43
@jpraynaud
jpraynaud force-pushed the jpraynaud/3148-enforce-circuit-key-registry branch from 266575d to a7c308d Compare September 15, 2026 10:27
@jpraynaud
jpraynaud removed this pull request from stack #3527 September 15, 2026 10:30
@jpraynaud
jpraynaud changed the base branch from main to jpraynaud/3148-prepare-circuit-key-registry September 15, 2026 10:30
@jpraynaud
jpraynaud added this pull request to stack #3542 September 15, 2026 10:31
@jpraynaud
jpraynaud deployed to testing-preview September 15, 2026 10:41 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-2-preview September 15, 2026 10:41 — with GitHub Actions Active
@jpraynaud
jpraynaud force-pushed the jpraynaud/3148-enforce-circuit-key-registry branch from a7c308d to 3c09645 Compare September 15, 2026 13:23
@jpraynaud
jpraynaud requested a lite review from Copilot September 15, 2026 13:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical, moderate, and nit findings remain across configuration, cache enforcement, registry publication, and test coverage.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

mithril-client/src/circuit_key_registry.rs:39

  • This is an Option, but without default serde treats the field as required. The checked-in networks.json currently omits this property, so filter_map(...ok()) drops each entire Cardano environment instead of retaining networks without a registry; even a mixed old/new configuration cannot be resolved. Make the optional field default to None.
    #[serde(rename = "circuit-verification-key-registry")]
    circuit_verification_key_registry: Option<UrlReference>,

mithril-client/src/circuit_key_registry.rs:15

  • with_circuit_verification_key_registry_retriever is a public customization API, but this module only privately imports CircuitVerificationKeyRegistryRetriever and the public types in its method signature. Downstream library users cannot name or implement the trait without adding the internal registry crate as a direct dependency. Re-export the trait, retriever error, and signed-registry types from this public module.
use mithril_circuit_key_registry::{
    BoundedHttpDownloader, CircuitVerificationKeyRegistryRetriever,
    CircuitVerificationKeyRegistryRetrieverError, SignedCircuitVerificationKeyRegistry,
};
  • Files reviewed: 32/33 changed files
  • Comments generated: 6
  • Review effort level: Lite

Comment thread mithril-aggregator/src/configuration.rs
Comment thread mithril-client/src/certificate_client/verify.rs
Comment thread mithril-client/src/circuit_key_registry.rs Outdated
Comment thread mithril-client/src/circuit_key_registry.rs
Comment thread mithril-test-lab/mithril-end-to-end/src/mithril/aggregator.rs Outdated
Comment thread mithril-common/src/certificate_chain/certificate_verifier.rs
…verification key

A revoked circuit verification key is rejected for every epoch, so the epoch
a certificate claims cannot bypass a revocation.
The retriever downloads the signed registry from a URL with a bounded downloader,
so a node refreshes the registry itself.
… older refresh

A failed refresh, or one yielding a lower registry version, no longer fails the
check: the previously verified registry is kept until the next refresh.
Export the circuit key digests, whitelist or revoke a key with a genesis
signed registry update, sign a registry and bootstrap one for tests.
Generated with the hidden documentation subcommand of the aggregator.
…se body

Read the body chunks in a dedicated function so the limit can be checked
on chunks beyond the first one, without a server.
…in HTTP

Guards the WASM build, where the client cannot restrict the scheme itself,
against a redirect downgrading the download.
A refresh returning the cached registry unchanged counts as a new
verification and replaces the cache.
…rameters

Inject the digest computation so the naming of each parameter set is
tested without deriving a circuit verification key.
Check the circuit verification key digests against the registry certifier
before verifying SNARK certificates, on both the standard and the full
chain shortcut paths, failing closed when the certifier is missing.
Resolve the registry of the client's network through the published networks
configuration, with a CLI parameter reading it from a local file for tests.
…ation

Wire the certifier into the certificate verifier and the chain
synchronizer when a signed registry file path is configured, so SNARK
certificates fail fast at creation when their circuit keys are not
certified.
Generate the signed registry on the fly with the devnet genesis key at
genesis bootstrap, in the system temporary directory read by default by
the aggregators and pointed at by the clients.
…egator

Fetch the signed registry from the configured URL into the aggregator stores
at provisioning, and redeploy the aggregator when the URL changes.
…yments

The URL comes from the CIRCUIT_VERIFICATION_KEY_REGISTRY_URL variable of the
GitHub environments, left empty where SNARK certificates are not produced.
Document the circuit-key-registry command and the circuit verification
key registry path parameters generated by the doc subcommand.
Cover the registry format, offline signing, publication at the repository
root, rotation and the revocation procedure.
@jpraynaud
jpraynaud force-pushed the jpraynaud/3148-enforce-circuit-key-registry branch from 8c87e15 to 13c8f50 Compare September 22, 2026 09:17
@jpraynaud
jpraynaud deployed to testing-2-preview September 22, 2026 09:36 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-preview September 22, 2026 09:36 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-preview September 22, 2026 13:36 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-2-preview September 22, 2026 13:36 — with GitHub Actions Active

This branch was successfully deployed

2 active deployments
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.

3 participants