Skip to content

fix(tempo): send each attempt of withRelay's inner transports once - #5427

Merged
jxom merged 1 commit into
mainfrom
jxom/with-relay-retries
Nov 6, 2026
Merged

jxom merged 1 commit into
mainfrom
jxom/with-relay-retries

Conversation

@jxom

@jxom jxom commented Nov 6, 2026

Copy link
Copy Markdown
Member

withRelay(defaultTransport, relayTransport) and withFeePayer pass their config to both inner transports unchanged, then wrap them in createTransport with the default retryCount of 3. Each inner http() also retries 3 times, so the retries nest. A failed request goes out 4 × 4 = 16 times. Against a relay that responds with a 503, one eth_fillTransaction sent 16 requests and took 5.3 s. http() alone sends 4 requests in 1.1 s.

This change calls the inner transports with retryCount: 0, as fallback does. The proxy retries with the client's retryCount, which defaults to 3. A transport that sets its own retryCount, such as http(url, { retryCount: 5 }), keeps it, as it does inside fallback.

The new test in src/tempo/Transport.test.ts fails without the fix (12 requests for each inner transport at retryCount: 2) and passes with it (3).

Validation: the tempo project of Transport.test.ts, Client.test.ts, e2e.test.ts, and internal/relay/* gave 141 passed. The suites that import contracts/generated.js could not load, because this environment has no forge. tsc -p src/tsconfig.json and pnpm check pass.


Generated by Claude Code

@vercel

vercel Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
viem Error Error Nov 6, 2026 4:51am UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d8543c3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T04:49:45.725341Z d8543c3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d8543c3e4b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +305 to +309
custom({
async request() {
defaultRequests++
throw new RpcResponse.InternalError({ message: 'Node failed.' })
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Replace the fake providers with real ephemeral RPC servers

The new regression test supplies two fake providers whose request methods only increment counters and throw canned errors. This violates the explicit “No mocks, ever” requirement in AGENTS.md, which requires exercising the configured test chain or real ephemeral servers. It also leaves the HTTP failure path motivating this fix untested. Rework the test to use http() against ephemeral RPC servers that return retryable failures, and verify observable behavior rather than fake-provider invocation counts.

AGENTS.md reference: AGENTS.md:L154-L157

Useful? React with 👍 / 👎.

@jxom
jxom merged commit 2b9026d into main Nov 6, 2026
40 of 41 checks passed
@jxom
jxom deleted the jxom/with-relay-retries branch November 6, 2026 04:53

This branch had an error being deployed

1 failed deployment
Preview — d8543c3e Deployed Nov 6, 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.

2 participants