Persist the SNARK test caches across CI runs

Abierto
#3,467 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
38/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
github-actions, rust

Línea de trabajo

Primero comprueba la dependencia de #3433; después, lee el trabajo de prueba en .github/workflows/test-rust.yml y los lectores de caché en circuits/key_provider.rs y circuits/trusted_setup.rs. Compara las rutas de caché duplicadas en proof_system/ivc_halo2_snark/prover_setup.rs y circuits/halo2_ivc/tests/common/generators/setup.rs. Se considera terminado cuando un CI con caché caliente restaura de forma segura, las entradas obsoletas se autocorrigen, solo las ejecuciones completas de la suite lenta guardan cachés podadas y el issue informa de la mejora medida.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

cryptography :closed_lock_with_key: testing :repeat: to-groom :thinking:

Why

Neither the keygen cache nor the SRS is persisted across CI runs (the toolchain-and-cache action only saves dependency artifacts through Swatinem/rust-cache), so every nightly and every slow PR leg starts cold.

What

Add an actions/cache layer for target/mithril-circuit-test-cache with a three-layer invalidation design: content-keyed directories for semantic staleness, a versions-scoped cache key for serialization format drift, and self-healing readers as backstop.

How

Paths are relative to mithril-stm/src/ unless they start with .github/.

  • Add an actions/cache/restore step for target/mithril-circuit-test-cache in the test job of .github/workflows/test-rust.yml (next to the toolchain-and-cache composite step), with an exact key folding a manual generation token and a hash of the midnight-* entries of Cargo.lock
  • Scope every restore-keys prefix to that versions hash so a midnight-proofs upgrade (serialization format drift) can never restore stale bytes
  • Save with actions/cache/save only from the runs that execute the full slow suite (the include-slow-tests: true invocation from nightly-dispatcher.yml); PR runs stay restore-only
  • Make the readers self-healing: on deserialization failure, KeyProvider::cache_state and read_optional (circuits/key_provider.rs) and TrustedSetupProvider::get_trusted_setup_parameters (circuits/trusted_setup.rs) should delete the offending file and regenerate instead of failing the test
  • Prune fingerprint directories not touched by the current run before saving, so retired fingerprints do not accumulate in the archive
  • Make one recursive verifying-key cache canonical for both the circuit tests and IvcSnarkProverSetup::build_for_test_degree, with the prover path storing only the additional proving key: today proof_system/ivc_halo2_snark/prover_setup.rs and circuits/halo2_ivc/tests/common/generators/setup.rs hold the same key under two protocols, because KeyProvider::verification_key treats a missing proving key as a miss and regenerates the pair
  • Assess the gain (expected: removes the cold start from warm CI runs) and report it in the issue

Depends on #3433.

Lenguaje dominante
Rust
Estrellas
155
Forks
52
Merge medio
2 d 17 h
PR fusionados (30 d)
37

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de IntersectMBO/mithril

Todos los issues de IntersectMBO/mithril

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.