Skip to content

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

Open
avi-starkware wants to merge 1 commit into
avi/prover-v3/middleware-macrofrom
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
avi/prover-v3/middleware-macrofrom
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

Medium Risk
Changes the public HTTP edge and OHTTP envelope handling; privacy depends on keeping this ID out of inner/content correlation, and mis-layering in future PRs could weaken unlinkability.

Overview
Adds envelope-level HTTP observability to starknet_transaction_prover: a new outermost tower RequestLogLayer logs one structured line per request (event="http_request", request_id, method, path, status, latency_ms), accepts or mints x-request-id (UUID v4 after validation), echoes it on the response, and never reads bodies. Incoming IDs are capped and restricted to safe printable ASCII; logged paths are truncated.

The shared prover_http_middleware! stack is updated so RequestLogLayer sits above HealthLayer on both HTTP and HTTPS paths, with docs noting this ID is outer-envelope only and must not be propagated into decapsulated/OHTTP content logs (inner correlation left to a follow-up). Workspace uuid dependency is wired in; unit tests cover echo, generation, and hostile IDs.

Several root-level HTML design notes document middleware deduplication options and OHTTP request-id privacy tradeoffs (explanatory, not runtime behavior).

Reviewed by Cursor Bugbot for commit fd81285. 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
@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
@avi-starkware avi-starkware force-pushed the avi/prover-v3/request-logs branch from 278ffaa to 6a64324 Compare May 27, 2026 10:01
@avi-starkware avi-starkware force-pushed the avi/prover-v3/request-logs branch 4 times, most recently from b232a8e to b74ee13 Compare May 27, 2026 14:04
@avi-starkware avi-starkware force-pushed the avi/prover-v3/request-logs branch from b74ee13 to 49a7855 Compare May 27, 2026 14:20
@avi-starkware avi-starkware changed the base branch from main to graphite-base/14165 May 31, 2026 10:23
@avi-starkware avi-starkware force-pushed the avi/prover-v3/request-logs branch from 49a7855 to 112d26d Compare May 31, 2026 10:23
@avi-starkware avi-starkware changed the base branch from graphite-base/14165 to main-v0.14.3 May 31, 2026 10:23
@avi-starkware avi-starkware force-pushed the avi/prover-v3/request-logs branch from 112d26d to fef476a Compare June 1, 2026 08:17
Adds `RequestLogLayer`, the outermost middleware that emits one
`event="http_request"` log line per request (request_id, method, path,
status, latency_ms) and echoes the id on the response. The id is accepted
from `x-request-id` when it is a short printable-ASCII token, otherwise a
UUID v4 is generated; hostile inputs are dropped to prevent header
smuggling and log-field explosion.

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 main-v0.14.3 to graphite-base/14165 June 1, 2026 11:18
@avi-starkware avi-starkware force-pushed the avi/prover-v3/request-logs branch from fef476a to fd81285 Compare June 1, 2026 11:18
@avi-starkware avi-starkware force-pushed the graphite-base/14165 branch from 5e85929 to f81df1e Compare June 1, 2026 11:18
@avi-starkware avi-starkware changed the base branch from graphite-base/14165 to avi/prover-v3/middleware-macro June 1, 2026 11:18
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 fd81285. Configure here.


</div>
</body>
</html>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Four HTML design documents accidentally committed to repo root

Medium Severity

Four HTML files (middleware_stack_alternatives.html, request_id_pr757_fix.html, request_id_scope.html, request_id_tradeoff.html) are committed to the repository root. These are richly-styled design analysis documents with embedded SVG diagrams that were clearly used as working notes during development. The repository has no other HTML files anywhere, and these reference internal PRs and architectural alternatives — they're development artifacts, not production code.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fd81285. Configure here.

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