Skip to content

fix(tempo): skip getKey read before access key sends - #5411

Merged
jxom merged 2 commits into
mainfrom
jxom/skip-key-read-first-send-acf7c0
Nov 4, 2026
Merged

jxom merged 2 commits into
mainfrom
jxom/skip-key-read-first-send-acf7c0

Conversation

@jxom

@jxom jxom commented Nov 4, 2026

Copy link
Copy Markdown
Member

Attaches pending key authorizations without a getKey read and retries eth_fillTransaction once without one the node refuses with KeyAlreadyExists. Also skips the decimals read for TIP-20 insufficient balance errors, removing two RPC round trips before failed or first sends.

jxom added 2 commits November 4, 2026 15:33
Adds an `afterFillTransactionError` chain hook phase that retries `eth_fillTransaction` once. Tempo drops a pending key authorization the node refuses with `KeyAlreadyExists` and fills again.
@vercel

vercel Bot commented Nov 4, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
viem Building Building Preview Nov 4, 2026 4:34am UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7c2ed4c

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 4, 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-04T04:36:56.653676Z 7c2ed4c 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.

@jxom
jxom merged commit 3708ffc into main Nov 4, 2026
37 of 40 checks passed
@jxom
jxom deleted the jxom/skip-key-read-first-send-acf7c0 branch November 4, 2026 04:36

@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: 7c2ed4c00e

ℹ️ 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 thread src/tempo/chainConfig.ts
Comment on lines +105 to +106
const pending = refused ? await getPending(request) : undefined
if (!pending) return undefined

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Retry stale authorizations even after another request removes them

When concurrent sends share an access key whose authorization is still pending locally but already registered on-chain, both requests can attach the authorization before either fill completes. The first KeyAlreadyExists response removes the manager entry; if the second response arrives afterward, getPending(request) returns undefined, so that request never retries without its stale authorization. The fallback also requires the pending entry before stripping the authorization, leaving the second send to fail during gas estimation instead. Base the retry decision on the authorization attached to the failed request, independently of whether another request has already cleared the shared manager entry.

Useful? React with 👍 / 👎.

This branch had an error being deployed

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

1 participant