Skip to content

fix(tempo): randomize expiring nonce hashes#4858

Merged
jxom merged 2 commits into
wevm:mainfrom
decofe:randomize-sponsored-expiring-nonce
Jul 18, 2026
Merged

fix(tempo): randomize expiring nonce hashes#4858
jxom merged 2 commits into
wevm:mainfrom
decofe:randomize-sponsored-expiring-nonce

Conversation

@decofe

@decofe decofe commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Tempo expiring transactions currently default to the same nonceKey, nonce, validAfter, and validBefore. Identical calldata prepared within the same second therefore produces the same expiring nonce hash, which can leave subsequent sponsored requests blocked behind an in-flight transaction.

This sets a random, already-valid validAfter when Viem selects an expiring nonce, while preserving an explicitly supplied value. The regression test uses deterministic randomness to verify otherwise-identical sponsored requests receive distinct values.

Validation:

  • biome check src/tempo/chainConfig.ts src/tempo/chainConfig.test.ts .changeset/random-lions-smile.md
  • Targeted Vitest execution was unavailable from the GitHub source archive because its ox submodule build is not included; CI will exercise the regression test in the complete checkout.

Prompted by: @jxom

@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

@decofe is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0addb10

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

Comment thread .changeset/random-lions-smile.md Outdated
'viem': patch
---

Randomize `validAfter` for Tempo expiring-nonce transactions to prevent otherwise-identical transactions from sharing a nonce hash.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is this not "randomize validAfter if not set"?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I odn't think we are providing a global jitter

@jxom jxom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

.

@jxom jxom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The sponsored integration regression now exercises distinct hashes and successful receipts without mocking randomness.

@jxom
jxom merged commit 1de66e7 into wevm:main Jul 18, 2026
11 of 25 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 18, 2026
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.

3 participants