fn generate_and_write_setup_data(
        &self,
        circuit: ProverServiceDataKey,
        dry_run: bool,
        recompute_if_missing: bool,
    ) -> anyhow::Result<String> {
        if recompute_if_missing && self.keystore().is_setup_data_present(&circuit) {
            tracing::info!(
                "Skipping setup computation for {:?} as file is already present.",
                circuit.name(),
            );
            return Ok("Skipped".to_string());
        }

        if circuit == ProverServiceDataKey::snark() {
            unreachable!(
                "Snark setup data should be generated with generate-compressor-data command"
            )
        }

        let serialized = self.generate_setup_data(circuit)?;
        let digest = md5::compute(&serialized);

        if !dry_run {
            self.keystore()
                .save_setup_data_for_circuit_type(circuit, &serialized)
                .context("save_setup_data()")?;
        } else {
            tracing::warn!("Dry run - not writing the key");
        }
        Ok(format!("{:?}", digest))
    }
Generates and stores the setup keys.
Returns the md5 check sum of the stored file.
prover/crates/lib/keystore/src/setup_data_generator.rs