Harden the SRS download of `TrustedSetupProvider`

Aperta
#3,425 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
rust, wasm
Ambito
cryptography

Direzione di ricerca

Inizia con circuits/trusted_setup.rs, poi inventaria ogni chiamante di TrustedSetupProvider e i parametri che ciascuno dovrebbe fornire. Valuta il wasm target e i mithril-stm feature flags prima di decidere se l’acquisizione di SRS debba essere spostata all’esterno. Il lavoro è completato quando la posizione di destinazione e l’interfaccia dei parametri del provider sono registrate, il comportamento di streaming e retry è definito, i dati memorizzati nella cache vengono riverificati e gli errori di rete e di hash sono distinti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

cryptography :closed_lock_with_key: to-groom :thinking:

Why

The SRS is downloaded in a single blocking request, fully buffered in memory before being hashed, with no retry. A transient network error fails the whole startup, and the memory peak is proportional to the SRS size.

The same code pulls reqwest and a TLS backend into a cryptographic library, which drives the feature complexity of mithril-stm and its wasm story. Deciding where the SRS acquisition belongs shapes how the hardening is done, so both are handled together.

What

Make the download resilient and bounded in memory, re-verify what is served from the cache, and settle whether the SRS acquisition stays in mithril-stm.

How

  • Inventory the callers of TrustedSetupProvider and what they would need to provide instead
  • Assess the impact on the wasm target and on the feature flags of mithril-stm
  • Decide whether the SRS acquisition moves out of mithril-stm, and record the decision with a target location and an interface for the parameters provider
  • Stream the download and compute the SHA-256 hash incrementally (circuits/trusted_setup.rs)
  • Add bounded retries with backoff on a transient download error
  • Re-verify the hash of a cached SRS file, if the cost is acceptable, and decide whether it is done on every load or on a schedule
  • Report a clear error distinguishing a network failure from a hash mismatch
Lingua principale
Rust
Stelle
155
Fork
52
Merge medio
2g 17h
PR unite (30g)
37

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di IntersectMBO/mithril

Tutte le issue di IntersectMBO/mithril

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.