Skip to content

chore: delete job_dir [skip-line-limit]#1585

Merged
0xjei merged 1 commit into
mainfrom
delete/tmp
Jun 7, 2026
Merged

chore: delete job_dir [skip-line-limit]#1585
0xjei merged 1 commit into
mainfrom
delete/tmp

Conversation

@0xjei

@0xjei 0xjei commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

this will avoid to maintain data in storage for each node after the computation. We just need proof + public_inputs and all the state is persistent in ThresholdKeyshare so, we are good to go!

Summary by CodeRabbit

Release Notes

  • Tests

    • Updated benchmark test results with fresh performance data
  • Chores

    • Optimized internal proof generation and verification cleanup workflow

@0xjei 0xjei self-assigned this Jun 7, 2026
@vercel

vercel Bot commented Jun 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
crisp Ready Ready Preview, Comment Jun 7, 2026 4:43pm
enclave-docs Ready Ready Preview, Comment Jun 7, 2026 4:43pm
enclave-enclave-dashboard Ready Ready Preview, Comment Jun 7, 2026 4:43pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR refactors job directory cleanup in the proof system to centralize responsibility in prover.rs instead of individual accumulator functions, and refreshes benchmark metrics with newly measured constraint and timing data.

Changes

Job Directory Cleanup Refactoring

Layer / File(s) Summary
Centralized cleanup in prover
crates/zk-prover/src/prover.rs
Proof generation and verification paths now explicitly remove job directories via fs::remove_dir_all after successful proof generation and after verification completion, including failure paths.
Remove local cleanup from accumulators
crates/zk-prover/src/circuits/aggregation/c3_accumulator.rs, crates/zk-prover/src/circuits/aggregation/nodes_fold_accumulator.rs
Post-proof cleanup calls (prover.cleanup(job_id)) are removed from generate_c3_fold_kernel_genesis_proof and generate_nodes_fold_kernel_genesis_proof, shifting cleanup responsibility to the central prover module.

Benchmark Results Refresh

Layer / File(s) Summary
Medium report metrics update
circuits/benchmarks/results_secure_agg_medium/report.md
Report header is updated with new generation timestamp and build identifiers. Protocol summary circuit benchmarks (C0–C7, user_data_encryption), artifacts verification gas totals, and integration test phase timings are refreshed with new measured values. Configuration parameters (λ, node count) and aggregate tracked job wall times are also updated.
Small results file cleanup
circuits/benchmarks/results_secure_agg_small/crisp_verify_gas.json
Result file is removed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • gnosisguild/enclave#1512: Both PRs refresh benchmark configuration and regenerated secure benchmark report data (including circuits like user_data_encryption), so the changes in this PR's benchmark report and results files are directly related to the retrieved PR's benchmark bench additions and updates.

Suggested reviewers

  • ctrlc03

Poem

🐰 A rabbit hopped through cleanup code,
Found directories left on the road,
Moved the sweeping to one central place,
And benchmarks now show a brighter face—
Fresh timings gathered with careful grace! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: delete job_dir' accurately describes the main functional change across the pull request: removing job_dir cleanup calls from circuit accumulator files and adding explicit cleanup logic to prover.rs.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch delete/tmp

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
crates/zk-prover/src/prover.rs (1)

246-247: ⚡ Quick win

Consider logging cleanup failures for operational visibility.

Both cleanup calls use let _ = ... to silently ignore errors. If fs::remove_dir_all fails due to permissions, filesystem issues, or other I/O errors, disk usage will accumulate without visibility.

Consider logging cleanup errors to aid diagnosis:

🔍 Suggested logging for cleanup failures

For proof generation cleanup (line 246):

-        let _ = fs::remove_dir_all(&job_dir);
+        if let Err(e) = fs::remove_dir_all(&job_dir) {
+            warn!("Failed to clean up proof generation job_dir {}: {}", job_dir.display(), e);
+        }

For verification cleanup (line 398):

-        let _ = fs::remove_dir_all(&job_dir);
+        if let Err(e) = fs::remove_dir_all(&job_dir) {
+            warn!("Failed to clean up verification job_dir {}: {}", job_dir.display(), e);
+        }

Also applies to: 398-399

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/zk-prover/src/prover.rs` around lines 246 - 247, The silent cleanup
calls using let _ = fs::remove_dir_all(&job_dir) should log failures for
operational visibility; replace the ignore with error handling that captures the
Result from fs::remove_dir_all(&job_dir) and, on Err(e), emit a descriptive log
(e.g., tracing::error! or log::error!) including the job_dir value and the error
(e) for both the proof-generation cleanup and the verification cleanup locations
where fs::remove_dir_all(&job_dir) is invoked so administrators can diagnose
permission or I/O problems.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@circuits/benchmarks/results_secure_agg_medium/report.md`:
- Around line 5-6: The report's provenance lines in report.md currently claim
"Git Branch: main" and a commit hash that may not match this PR; either
regenerate the benchmark on the PR HEAD (branch delete/tmp) and update the "Git
Branch" and "Git Commit" fields in
circuits/benchmarks/results_secure_agg_medium/report.md to the actual PR branch
name and PR HEAD commit hash, or add an explicit note in that file explaining
why the benchmarks were intentionally run from main (including the exact commit
used) so provenance is unambiguous.

---

Nitpick comments:
In `@crates/zk-prover/src/prover.rs`:
- Around line 246-247: The silent cleanup calls using let _ =
fs::remove_dir_all(&job_dir) should log failures for operational visibility;
replace the ignore with error handling that captures the Result from
fs::remove_dir_all(&job_dir) and, on Err(e), emit a descriptive log (e.g.,
tracing::error! or log::error!) including the job_dir value and the error (e)
for both the proof-generation cleanup and the verification cleanup locations
where fs::remove_dir_all(&job_dir) is invoked so administrators can diagnose
permission or I/O problems.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bf23e454-97d1-4d59-9a11-4bf34b8018db

📥 Commits

Reviewing files that changed from the base of the PR and between f653c04 and ee70bac.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • circuits/benchmarks/results_secure_agg_medium/crisp_verify_gas.json
  • circuits/benchmarks/results_secure_agg_medium/integration_summary.json
  • circuits/benchmarks/results_secure_agg_medium/report.md
  • circuits/benchmarks/results_secure_agg_small/crisp_verify_gas.json
  • crates/keyshare/src/ext.rs
  • crates/zk-prover/src/circuits/aggregation/c3_accumulator.rs
  • crates/zk-prover/src/circuits/aggregation/nodes_fold_accumulator.rs
  • crates/zk-prover/src/prover.rs
💤 Files with no reviewable changes (3)
  • crates/zk-prover/src/circuits/aggregation/c3_accumulator.rs
  • circuits/benchmarks/results_secure_agg_small/crisp_verify_gas.json
  • crates/zk-prover/src/circuits/aggregation/nodes_fold_accumulator.rs

Comment thread circuits/benchmarks/results_secure_agg_medium/report.md
@0xjei 0xjei requested a review from ctrlc03 June 7, 2026 16:51
@0xjei 0xjei enabled auto-merge (squash) June 7, 2026 16:52

@ctrlc03 ctrlc03 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utACK

@0xjei 0xjei merged commit d65dedd into main Jun 7, 2026
34 checks passed
@github-actions github-actions Bot deleted the delete/tmp branch June 15, 2026 03:26
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.

2 participants