Skip to content

starknet_transaction_prover: add /health endpoint via HealthLayer#14163

Open
avi-starkware wants to merge 1 commit into
avi/prover-v3/log-formatfrom
avi/prover-v3/health
Open

starknet_transaction_prover: add /health endpoint via HealthLayer#14163
avi-starkware wants to merge 1 commit into
avi/prover-v3/log-formatfrom
avi/prover-v3/health

Conversation

@avi-starkware
Copy link
Copy Markdown
Collaborator

Adds a tower middleware that short-circuits GET /health ahead of
jsonrpsee (which would 405 a GET) and returns {"status":"ok"}. Wired
outermost in both the HTTP and HTTPS middleware chains so load balancers
can probe before any per-request work runs.

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

Adds a tower middleware that short-circuits `GET /health` ahead of
jsonrpsee (which would 405 a GET) and returns `{"status":"ok"}`. Wired
outermost in both the HTTP and HTTPS middleware chains so load balancers
can probe before any per-request work runs.

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

Low Risk
Isolated middleware with a static JSON response; no auth, RPC, or proving logic changes.

Overview
Adds a Tower HealthLayer that answers GET /health with 200 and {"status":"ok"} before jsonrpsee (which would reject GET). HealthLayer is wired outermost on both plain HTTP and HTTPS middleware stacks so probes skip CORS, OHTTP, and compression. HEALTH_PATH is re-exported from the server module; unit tests cover the happy path and fall-through for non-GET or other paths.

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

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 c26d49f. Configure here.

// Always ready: the health fast-path doesn't need the inner service.
// Inner backpressure is driven on demand by `inner.call` below.
Poll::Ready(Ok(()))
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Inner service called without poll_ready violating tower contract

Medium Severity

poll_ready unconditionally returns Poll::Ready(Ok(())) without propagating to the inner service, yet call directly invokes self.inner.call(request) for non-health requests. This violates the tower Service contract — call may only be invoked after the service's own poll_ready has returned ready. The sibling OhttpService in crates/tower_ohttp/src/layer.rs handles this correctly by cloning the inner service and calling inner.oneshot(request) which internally polls readiness. If a backpressure-sensitive layer (e.g., ConcurrencyLimit or Buffer) is ever added to the middleware chain, this could cause panics or dropped requests.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c26d49f. Configure here.

Copy link
Copy Markdown
Collaborator Author

@avi-starkware avi-starkware left a comment

Choose a reason for hiding this comment

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

@avi-starkware resolved 1 discussion.
Reviewable status: 0 of 4 files reviewed, all discussions resolved.

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