starknet_transaction_prover: bump prover_panics_total on panic hook fire#14170
starknet_transaction_prover: bump prover_panics_total on panic hook fire#14170avi-starkware wants to merge 1 commit into
Conversation
PR SummaryLow Risk Overview The global panic hook now increments that counter first (before backtrace capture and structured Reviewed by Cursor Bugbot for commit ac98d86. Bugbot is set up for automated code reviews on this repo. Configure here. |
cbd1def to
e503ebd
Compare
51ebd37 to
6c02d2b
Compare
e503ebd to
db503b7
Compare
2af08ad to
47068b1
Compare
db503b7 to
1da27e9
Compare
Bumps the new `prover_panics_total` counter from the panic hook before constructing the backtrace, so dashboards can alert on panic rate without log search. The pre-registered zero observation in `install_exporter` keeps the series visible at scrape time even before the first panic. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
47068b1 to
eea5655
Compare
1da27e9 to
ac98d86
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ac98d86. Configure here.
|
|
||
| let after = counter_value(&handle.render(), PANICS_TOTAL); | ||
| assert_eq!(after - before, 1.0); | ||
| } |
There was a problem hiding this comment.
Two tests race on the global panic hook
Medium Severity
The previous code deliberately kept all panic-hook tests in a single #[test] to avoid racing on the process-global panic hook (the old comment explicitly said "must run serially"). Splitting into two separate #[test] functions introduces a race: Rust runs tests in parallel by default, and the take_hook/set_hook save-restore pattern is not atomic. If both tests interleave, one test can steal the other's installed hook, causing extracts_static_str_and_formatted_payloads to fire the real panic_hook instead of its capture closure, or panic_hook_bumps_panics_total_counter to fire a stale hook that doesn't increment the counter. Either test can then fail non-deterministically.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit ac98d86. Configure here.



Bumps the new
prover_panics_totalcounter from the panic hook beforeconstructing the backtrace, so dashboards can alert on panic rate without
log search. The pre-registered zero observation in
install_exporterkeeps the series visible at scrape time even before the first panic.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com