Skip to content

starknet_transaction_prover: global panic hook + graceful SIGTERM shutdown#14166

Open
avi-starkware wants to merge 1 commit into
avi/prover-v3/request-logsfrom
avi/prover-v3/panic-shutdown
Open

starknet_transaction_prover: global panic hook + graceful SIGTERM shutdown#14166
avi-starkware wants to merge 1 commit into
avi/prover-v3/request-logsfrom
avi/prover-v3/panic-shutdown

Conversation

@avi-starkware
Copy link
Copy Markdown
Collaborator

Installs a process-wide panic hook that emits one structured event=panic
tracing event with location and backtrace, and bridges SIGTERM/SIGINT into
ServerHandle::stop so container teardown becomes visible in logs and
in-flight proofs get to finish. A second signal forces exit(1) to work
around tokio-rs/tokio#7905.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

…tdown

Installs a process-wide panic hook that emits one structured `event=panic`
tracing event with location and backtrace, and bridges SIGTERM/SIGINT into
`ServerHandle::stop` so container teardown becomes visible in logs and
in-flight proofs get to finish. A second signal forces `exit(1)` to work
around tokio-rs/tokio#7905.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented May 24, 2026

PR Summary

Medium Risk
Changes long-running process lifecycle (signal handling and forced exit) for the proving server; low security impact but affects production teardown and incident visibility.

Overview
Improves operability of the Starknet transaction prover binary: panics and container shutdown now show up as structured logs instead of ad-hoc stderr output.

After tracing is initialized, the process installs a global panic hook that logs a single event=panic error with message, source location, and a forced backtrace (without changing default abort-on-panic behavior). Dependencies gain tracing-subscriber’s json feature so this lines up with existing JSON log format.

SIGTERM and SIGINT are wired into jsonrpsee’s ServerHandle::stop, with shutdown_started / shutdown_complete (and warnings on stop failures). Handler registration is best-effort per signal; a second termination signal triggers force_exit and exit(1) so operators can escape a stuck graceful shutdown (documented Tokio signal quirk).

Unit tests cover panic payload extraction for common panic! forms.

Reviewed by Cursor Bugbot for commit 63d34df. Bugbot is set up for automated code reviews on this repo. Configure here.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

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