chore: delete job_dir [skip-line-limit]#1585
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR refactors job directory cleanup in the proof system to centralize responsibility in ChangesJob Directory Cleanup Refactoring
Benchmark Results Refresh
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
crates/zk-prover/src/prover.rs (1)
246-247: ⚡ Quick winConsider logging cleanup failures for operational visibility.
Both cleanup calls use
let _ = ...to silently ignore errors. Iffs::remove_dir_allfails 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (8)
circuits/benchmarks/results_secure_agg_medium/crisp_verify_gas.jsoncircuits/benchmarks/results_secure_agg_medium/integration_summary.jsoncircuits/benchmarks/results_secure_agg_medium/report.mdcircuits/benchmarks/results_secure_agg_small/crisp_verify_gas.jsoncrates/keyshare/src/ext.rscrates/zk-prover/src/circuits/aggregation/c3_accumulator.rscrates/zk-prover/src/circuits/aggregation/nodes_fold_accumulator.rscrates/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
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
ThresholdKeyshareso, we are good to go!Summary by CodeRabbit
Release Notes
Tests
Chores