Skip to content

feat(privacy): org routing + route-all mode for external proxies#41

Merged
IvanBelyakoff merged 3 commits into
mainfrom
feat/privacy-org-routing
Jun 26, 2026
Merged

feat(privacy): org routing + route-all mode for external proxies#41
IvanBelyakoff merged 3 commits into
mainfrom
feat/privacy-org-routing

Conversation

@IvanBelyakoff

@IvanBelyakoff IvanBelyakoff commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Enables load-testing through a privacy proxy for multi-org users, and against an external (third-party) proxy.

Changes

  • /rpc/{org} routing — the proxy requires the org in the path for users in more than one org (e.g. its system default org + a loadtest org); a bare /rpc is ambiguous and denied (404). Org id comes from PRIVACY_ORG_ID (direct, takes precedence) or PRIVACY_ORG_ID_FILE (read lazily at test time, for setup-written files).
  • PRIVACY_ROUTE_ALL — routes all RPC (nonce/funding/sends/receipts/verification), not just sends, through the proxy with the Bearer token, built at startup. Makes the proxy the only RPC endpoint, so GasStorm can test an external proxy with just a URL + token. Preconf WS is left unconfigured (external proxies don't expose it; on-chain verification still confirms txs).
  • Shared privacyURL() / buildPrivacyClient() helpers.

Backward compatible: with PRIVACY_ROUTE_ALL unset and no org id, behaviour is unchanged (route only sends, reads direct, preconf WS).

Verification (against gasstorm op-reth + privacy proxy)

  • /rpc/{org} routing: POST / → 404, POST /rpc/{org} → 200; 200 TPS eth-transfer privacy run confirmed=1961, failed=0.
  • route-all: all RPC via /rpc/{org} (proxy 200s), failed=0, on-chain verification txCount=1766.

Paired with gateway-fm/gasstorm#48.

🤖 Generated with Claude Code

IvanBelyakoff and others added 2 commits June 25, 2026 12:37
Privacy mode posts to the bare PRIVACY_RPC_URL. The privacy proxy requires the
org in the path (/rpc/:org_id) for users that belong to more than one org — e.g.
its system 'default' org plus a load-test org — otherwise RBAC cannot resolve a
single org and denies every request (404).

Add an optional PRIVACY_ORG_ID_FILE: when set, the org id is read lazily at
privacy-test time (so a file written by external setup is available) and the
client routes to {PRIVACY_RPC_URL}/rpc/{orgID}. Unset = unchanged behaviour.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extends the org-routing support so GasStorm can load-test an external,
already-configured privacy proxy:

- PRIVACY_ORG_ID: direct org id (precedence over PRIVACY_ORG_ID_FILE) — static
  external config doesn't need a file.
- PRIVACY_ROUTE_ALL: route ALL RPC (nonce/funding/sends/receipts/verification)
  through the proxy with the Bearer token, built at startup, so the proxy is the
  only RPC endpoint. Preconf WS is simply left unconfigured (no preconf events
  against an external proxy; on-chain verification still confirms txs).

Shared privacyURL()/buildPrivacyClient() helpers; dev/bundled behaviour (route
only sends, reads direct, preconf WS) is unchanged when PRIVACY_ROUTE_ALL is off.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@IvanBelyakoff IvanBelyakoff changed the title feat(privacy): route RPC through /rpc/{org} via PRIVACY_ORG_ID_FILE feat(privacy): org routing + route-all mode for external proxies Jun 25, 2026
…ute-all

In route-all mode the privacy-routed builder/l2/sender clients were built once at
startup, so a token refreshed/pasted after startup wasn't picked up. Rebuild them
from the current token file at the top of runInitialization (before nonce init),
so each test uses the latest token without a restart. loadgen stays a pure
consumer of the token file.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@IvanBelyakoff IvanBelyakoff merged commit a00807a into main Jun 26, 2026
6 checks passed
@IvanBelyakoff IvanBelyakoff deleted the feat/privacy-org-routing branch June 26, 2026 13:50
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