Skip to content

Fix stale provider cache after transaction broadcast - #5166

Open
programmaman wants to merge 1 commit into
ethers-io:mainfrom
programmaman:main
Open

Fix stale provider cache after transaction broadcast#5166
programmaman wants to merge 1 commit into
ethers-io:mainfrom
programmaman:main

Conversation

@programmaman

@programmaman programmaman commented Jul 29, 2026

Copy link
Copy Markdown

Fixes #5165

Summary

Clears AbstractProvider's short-lived _perform cache after a successful,
hash-validated transaction broadcast.

This prevents follow-up reads, including getTransactionCount(address, "pending") and estimateGas, from reusing pre-broadcast state.

Failed broadcasts leave the cache unchanged.

Tests

  • npm run build
  • test-providers-fallback: 6/6 passed

programmaman added a commit to programmaman/d402 that referenced this pull request Jul 31, 2026
the actual cause is a hidden ethers cache set to 250ms, I've pushed the code change and asked for a PR in ethers here: ethers-io/ethers.js#5166

May need to document this in a new document that contains little tricks and tidbits I've discovered to help integrators

The payment action changes I had previously created would prevent too many valid usecases.
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.

AbstractProvider reuses stale cached reads after successful broadcast

1 participant