Skip to content

starknet_transaction_prover: per-request structured log with request-id#14165

Open
avi-starkware wants to merge 1 commit into
mainfrom
avi/prover-v3/request-logs
Open

starknet_transaction_prover: per-request structured log with request-id#14165
avi-starkware wants to merge 1 commit into
mainfrom
avi/prover-v3/request-logs

Conversation

@avi-starkware
Copy link
Copy Markdown
Collaborator

Adds RequestLogLayer that emits one event="http_request" log line per
request with request_id, method, path, status, and latency_ms. The id is
accepted from x-request-id or generated as a 128-bit random hex string,
and is echoed back on the response so callers can quote it. No request
body bytes are inspected (transaction calldata is private user data).

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
Observability-only middleware with validated header handling and no body inspection; no changes to proving or RPC business logic.

Overview
Adds RequestLogLayer as the outermost HTTP middleware on both plain HTTP and HTTPS JSON-RPC servers so each request gets one structured event="http_request" log line with request_id, method, path, status, and latency_ms.

The layer accepts a client x-request-id when it is a short printable ASCII token (rejects oversize, non-ASCII, and whitespace-bearing values) or generates a 32-character hex id via rand, sets it on the request for inner handlers, echoes it on the response, and never reads request bodies. rand is added as a workspace dependency; unit tests cover id propagation and hostile header cases.

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

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@avi-starkware avi-starkware force-pushed the avi/prover-v3/redact-banner branch from 948a1e9 to 88c5a6b Compare May 26, 2026 08:43
@avi-starkware avi-starkware force-pushed the avi/prover-v3/request-logs branch 2 times, most recently from 0ae3b31 to 2dcb716 Compare May 26, 2026 12:16
@avi-starkware avi-starkware force-pushed the avi/prover-v3/redact-banner branch from 88c5a6b to 0df4834 Compare May 26, 2026 12:16
@avi-starkware avi-starkware force-pushed the avi/prover-v3/request-logs branch from 2dcb716 to f83f30c Compare May 26, 2026 12:17
@avi-starkware avi-starkware force-pushed the avi/prover-v3/redact-banner branch 2 times, most recently from 1f5f854 to abc893a Compare May 26, 2026 12:58
@avi-starkware avi-starkware force-pushed the avi/prover-v3/request-logs branch from f83f30c to 53b6a1e Compare May 26, 2026 12:58
@avi-starkware avi-starkware force-pushed the avi/prover-v3/request-logs branch from 53b6a1e to 4645e9b Compare May 26, 2026 16:14
@avi-starkware avi-starkware force-pushed the avi/prover-v3/redact-banner branch from abc893a to 170c535 Compare May 26, 2026 16:14
Adds `RequestLogLayer` that emits one `event="http_request"` log line per
request with request_id, method, path, status, and latency_ms. The id is
accepted from `x-request-id` or generated as a 128-bit random hex string,
and is echoed back on the response so callers can quote it. No request
body bytes are inspected (transaction calldata is private user data).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avi-starkware avi-starkware changed the base branch from avi/prover-v3/redact-banner to graphite-base/14165 May 26, 2026 16:59
@avi-starkware avi-starkware force-pushed the graphite-base/14165 branch from 170c535 to 889c170 Compare May 26, 2026 16:59
@avi-starkware avi-starkware force-pushed the avi/prover-v3/request-logs branch from 4645e9b to 278ffaa Compare May 26, 2026 16:59
@avi-starkware avi-starkware changed the base branch from graphite-base/14165 to main May 26, 2026 16:59
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