Skip to content

starknet_transaction_prover,tower_ohttp: OHTTP-unlinkable request-id for decapsulated content - #14222

Merged
avi-starkware merged 2 commits into
main-v0.14.3from
avi/prover-v3/content-id
Jul 9, 2026
Merged

starknet_transaction_prover,tower_ohttp: OHTTP-unlinkable request-id for decapsulated content#14222
avi-starkware merged 2 commits into
main-v0.14.3from
avi/prover-v3/content-id

Conversation

@avi-starkware

@avi-starkware avi-starkware commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Tags downstream content logs with a request-id via a new RequestSpanLayer
placed below the OHTTP layer. For plaintext it reuses the envelope id from
RequestLogLayer; for an OHTTP-decapsulated request (marked with a new
tower_ohttp::Decapsulated extension) it mints a FRESH UUID. Any
client-supplied inner x-request-id is stripped by tower_ohttp at
decapsulation time, so the property holds even if the marker is ever lost
(fail-closed).

The fresh inner id is never echoed back, so the relay-visible envelope id and
the gateway's content-log id share no join key — preserving OHTTP
unlinkability while still giving every request's downstream logs a
correlatable id. Both integration tests exercise the production
prover_http_middleware! chain, so a layer reorder that reverts either
property fails CI.

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

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@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 force-pushed the avi/prover-v3/content-id branch 2 times, most recently from 4055121 to bfa94e0 Compare 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 marked this pull request as ready for review May 31, 2026 10:38
@cursor

cursor Bot commented May 31, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes OHTTP privacy behavior and HTTP middleware ordering on the transaction prover entry path; mistakes could leak join keys between relay and gateway logs, though stripping at decapsulation and new CI tests mitigate that.

Overview
Adds RequestSpanLayer below OHTTP in prover_http_middleware! so downstream http_request tracing uses a correlatable id without linking relay-visible envelope traffic to gateway content logs.

tower_ohttp strips inner x-request-id when rebuilding BHTTP requests, tags decapsulated inner dispatches with a Decapsulated extension, and documents that stripping is the fail-closed unlinkability guarantee if the marker is lost.

For plaintext, the span reuses the id from RequestLogLayer; for OHTTP-decapsulated requests it mints a fresh UUID on the inner request (discarding any client inner id) so it never matches the envelope id echoed on the outer response.

Integration tests run the real prover_http_middleware! chain (compression ordering and envelope vs inner id unlinkability); OHTTP integration tests share OHTTP_JSONRPSEE_BODY_BUILDER instead of duplicating the middleware stack.

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

@Yoni-Starkware Yoni-Starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

:lgtm:

@Yoni-Starkware reviewed 8 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on einat-starkware).

@avi-starkware
avi-starkware force-pushed the avi/prover-v3/request-logs branch from 58b61a0 to 92df5fe Compare July 8, 2026 10:52
@avi-starkware
avi-starkware force-pushed the avi/prover-v3/content-id branch 2 times, most recently from 1acd1f3 to 9480b1d Compare July 9, 2026 08:08
@avi-starkware
avi-starkware force-pushed the avi/prover-v3/request-logs branch from 92df5fe to 3f40886 Compare July 9, 2026 08:08
avi-starkware and others added 2 commits July 9, 2026 13:35
…for decapsulated content

Tags downstream content logs with a request-id via a new `RequestSpanLayer`
placed below the OHTTP layer. For plaintext it reuses the envelope id from
`RequestLogLayer`; for an OHTTP-decapsulated request (marked with a new
`tower_ohttp::Decapsulated` extension) it mints a FRESH UUID and discards any
client-supplied inner id.

The fresh inner id is never echoed back, so the relay-visible envelope id and
the gateway's content-log id cannot be joined — preserving OHTTP unlinkability
while still giving every request's downstream logs a correlatable id.

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

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@avi-starkware
avi-starkware changed the base branch from avi/prover-v3/request-logs to graphite-base/14222 July 9, 2026 11:37
@avi-starkware
avi-starkware force-pushed the avi/prover-v3/content-id branch from 9480b1d to d2ec166 Compare July 9, 2026 11:39
@avi-starkware
avi-starkware force-pushed the graphite-base/14222 branch from 3f40886 to 59b1e1f Compare July 9, 2026 11:39
@avi-starkware
avi-starkware changed the base branch from graphite-base/14222 to main-v0.14.3 July 9, 2026 11:39
@avi-starkware
avi-starkware added this pull request to the merge queue Jul 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 9, 2026
@avi-starkware
avi-starkware added this pull request to the merge queue Jul 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 9, 2026
@avi-starkware
avi-starkware added this pull request to the merge queue Jul 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 9, 2026
@avi-starkware
avi-starkware added this pull request to the merge queue Jul 9, 2026
Merged via the queue into main-v0.14.3 with commit f7dd6e1 Jul 9, 2026
24 of 45 checks passed

Copy link
Copy Markdown
Contributor

Security scan complete — no issues detected.


Generated by Claude Code

ron-starkware added a commit that referenced this pull request Jul 26, 2026
Resolve the 20 conflicts from merging main-v0.14.3 into main, plus two
skews the conflict markers did not surface:

- proof.bin is binary, so the merge picked main's version with no marker
  while its companion proof_facts.json stayed conflicted. Both are now
  regenerated together.
- tower_ohttp moved its inline tests to a sibling layer_test.rs on main
  (#14559) while main-v0.14.3 added a test to the inline block (#14222);
  taking either side alone drops one of the two changes.

The merged genesis state differs from both sides, so the proof-flow
fixtures were regenerated rather than taken from either branch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

4 participants