Skip to content

fix(ci): authenticate live E2E RPC requests - #984

Merged
max-digi merged 2 commits into
mainfrom
centaur/authenticated-rpc-ci-1791952355
Oct 14, 2026
Merged

max-digi merged 2 commits into
mainfrom
centaur/authenticated-rpc-ci-1791952355

Conversation

@decofe

@decofe decofe commented Oct 14, 2026

Copy link
Copy Markdown
Member

Live demo E2E tests currently use the anonymous Moderato RPC pool, where rate limits can block docs CI. Forward their HTTP RPC requests from the Playwright runner using the optional TEMPO_RPC_API_KEY Actions secret, and block anonymous WebSocket fallback when the key is present.

The key stays out of the site build and browser requests. Node fetch avoids recording the authenticated URL in Playwright traces, and upstream fetch exceptions are sanitized. Tests without a key retain public RPC access. The deployed public demo is unchanged.

Setup: add a dedicated Moderato RPC key as the TEMPO_RPC_API_KEY repository Actions secret. This PR wires the secret; it does not provision one.

Validation: four browser transport checks pass, covering authenticated forwarding, upstream rate limits, sanitized failures, and WebSocket fallback. Browser network traces contain no test key. Repository type checks, targeted E2E type checks, Biome, and Playwright discovery (277 tests) pass. A real authenticated live run still requires the secret.

Prompted by: @Zygimantass

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
tempo-docs Ready Ready Preview Oct 14, 2026 5:05am UTC

Request Review

@snario

snario commented Oct 14, 2026

Copy link
Copy Markdown
Member

TEMPO_RPC_API_KEY was configured today (key tempoxyz/docs live E2E (Moderato RPC), scope rpc-relay:read). With it, live tests failed on GitHub-hosted runners: receipts never confirmed and balances stayed 0 in pay-with-ousd-fees, faucet, manage-stablecoin, and mint-stablecoins. #995 stops passing the key, and the secret stays configured.

A probe from a GitHub runner using the secret (key never printed) showed:

  • The relay itself is fresh. Block numbers match the public RPC, a faucet receipt is visible in ~0.9s through the keyed URL (public ~1.0s), and balances agree.
  • The key does not lift the per-IP limit. eth_blockNumber bursts from one runner:
Burst Keyed Public
60 41 × 200, 19 × 429 40 × 200, 20 × 429
180 57 × 200, 123 × 429 60 × 200, 120 × 429

Keyed 429s return both rate limited, try again in 17ms and too many connections from this IP.

The proxy in e2e/rpc.ts makes this worse. Chromium sends a page's RPC calls over one multiplexed connection, but route → fetch opens Node connections per concurrent request, so a page load hits the per-IP connection cap and receipt polling gets 429s.

Two changes would make the key useful:

  1. The relay limits keyed requests per key instead of per IP. Depot's shared egress IPs exceed the anonymous per-IP limit, which is why we wanted the key for E2E on Depot (ci: run E2E shards on Depot with live RPC through the Tempo API #994).
  2. e2e/rpc.ts forwards through one pooled HTTP/2 agent (undici Agent({ allowH2: true, connections: 1 })) so it doesn't multiply connections.

snario added a commit that referenced this pull request Oct 14, 2026
#984 appended TEMPO_RPC_API_KEY to rpc.moderato.tempo.xyz, but that load
balancer does not know Tempo API keys. Requests counted as anonymous and
hit the per-IP connection limit, and from one IP the Node proxy's many
connections broke live tests even on GitHub runners.

api.tempo.xyz/rpc/:chainId takes the key as a Bearer token with the
`data:read` scope and reaches Moderato as an authenticated client, which
the per-IP limit does not apply to. From one runner it served 180
concurrent requests without a 429; the public RPC rejected 123.

The Verify workflow passes the key to Playwright again.

Co-Authored-By: Liam Horne <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
snario added a commit that referenced this pull request Oct 14, 2026
* ci: run E2E shards on Depot with authenticated Moderato RPC

TEMPO_RPC_API_KEY is now configured, so live tests reach Moderato through
an authenticated relay instead of the anonymous per-IP pool that Depot's
shared egress IPs exhausted. The shards move to the same 8-core Depot
runners as the build and run six Playwright workers.

Co-Authored-By: Liam Horne <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(e2e): send live Moderato RPC through the Tempo API proxy

#984 appended TEMPO_RPC_API_KEY to rpc.moderato.tempo.xyz, but that load
balancer does not know Tempo API keys. Requests counted as anonymous and
hit the per-IP connection limit, and from one IP the Node proxy's many
connections broke live tests even on GitHub runners.

api.tempo.xyz/rpc/:chainId takes the key as a Bearer token with the
`data:read` scope and reaches Moderato as an authenticated client, which
the per-IP limit does not apply to. From one runner it served 180
concurrent requests without a 429; the public RPC rejected 123.

The Verify workflow passes the key to Playwright again.

Co-Authored-By: Liam Horne <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Liam Horne <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 844b4e55 Deployed Oct 14, 2026 by vercel[bot]
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