Skip to content

Conversation

@odysseus0
Copy link
Contributor

Stage 2: Header Forwarding for protect-rpc Integration

Status: ⚠️ Depends on #4 (Stage 1) - Review in parallel, merge after Stage 1

Deployment: 🚫 Blocked by Redis architecture decision in flashbots/devops#1643

Overview

Stage 2 introduces header forwarding for clean integration with the new protect-rpc service on Sepolia testnet.

Key Change: Removes buildBackendURL() URL forwarding in favor of HTTP headers (X-Original-Path, X-Original-Query).

Changes

  • Header forwarding: Added X-Original-Path and X-Original-Query headers
  • Removed URL forwarding: Cleaner architecture without URL manipulation
  • Backend routing: Routes to protect-rpc service (not legacy rpc-endpoint)

Related PRs

Architecture

Traffic → proxyd → protect-rpc
              ↓
      X-Original-Path: /fast
      X-Original-Query: hint=xyz

Testing

  • ✅ Full test suite passing (including integration tests)
  • ✅ Image built and pushed: 845745288226.dkr.ecr.us-east-2.amazonaws.com/proxyd:0cf80d4

Deployment Plan

Target: Sepolia testnet only (after Redis decision)

  1. Wait for Stage 1 merge
  2. Resolve Redis architecture decision (devops#1643)
  3. Deploy to Sepolia for 1-week validation

odysseus0 and others added 3 commits October 8, 2025 14:07
- Remove buildBackendURL() function entirely (~25 lines removed)
- Replace with clean header forwarding approach (~10 lines added)
- Forward X-Original-Path and X-Original-Query headers for all methods
- Keep backend URL unchanged (no path/query modification)
- Remove obsolete TestBackendURLBuilding test

This is the clean approach for proxyd->protect-rpc communication:
- proxyd handles HTTP routing and forwards context via headers
- protect-rpc reads ONLY from headers, never from request URL
- No config changes needed (headers are automatically forwarded)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Test X-Original-Path and X-Original-Query header forwarding
- Verify headers are set correctly from context values
- Cover edge cases: root path, empty query, no context values
- Ensures proxyd->protect-rpc header conversion works correctly

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@odysseus0 odysseus0 force-pushed the stage1-legacy-compat branch 2 times, most recently from e53225d to 11b68d6 Compare October 8, 2025 06:24
Logs when X-Original-Path/Query headers are being forwarded to backends.
Enables end-to-end tracing of Stage 2 header-based URL forwarding.

Includes path, query, and req_id for CloudWatch correlation.
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.

1 participant