feat(privacy): org routing + route-all mode for external proxies#41
Merged
Conversation
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>
…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>
mandrigin
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 systemdefaultorg + a loadtest org); a bare/rpcis ambiguous and denied (404). Org id comes fromPRIVACY_ORG_ID(direct, takes precedence) orPRIVACY_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).privacyURL()/buildPrivacyClient()helpers.Backward compatible: with
PRIVACY_ROUTE_ALLunset 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 runconfirmed=1961, failed=0./rpc/{org}(proxy 200s),failed=0, on-chain verificationtxCount=1766.Paired with gateway-fm/gasstorm#48.
🤖 Generated with Claude Code