Skip to content

fix(polymarket): take the EOA withdrawal nonce from the write endpoint - #206

Merged
VickyXAI merged 2 commits into
mainfrom
fix/withdraw-nonce-write-endpoint
Oct 8, 2026
Merged

VickyXAI merged 2 commits into
mainfrom
fix/withdraw-nonce-write-endpoint

Conversation

@VickyXAI

@VickyXAI VickyXAI commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The EOA withdraw path read its nonce from the public reader, a fallback list of read RPCs, then broadcast through the write RPC. The two can see different pending pools.
  • With a reader nonce, the withdrawal could collide with a transaction only the write node has seen. That collision either replaces the other transaction, or gets a nonce too low, which leaves the withdraw guard blocking.
  • prepareTransactionRequest now fills the nonce through the wallet's own transport, and that nonce is the one persisted.

Same fix as blockrun-mcp#174, found by an independent review there.

Test plan

  • npm test: 847/847
  • The withdraw test asserts the nonce comes from the write transport, and that the public reader's getTransactionCount is never called.
  • Mutation-checked: putting the reader nonce back makes 5 withdraw tests fail.

1bcMax added 2 commits October 8, 2026 10:06
The fallback public readers and the write RPC can disagree on the pending
pool; a reader nonce could collide with a transaction only the write node
has seen and then wedge the withdraw guard behind a 'nonce too low'.
prepareTransactionRequest now fills the nonce through the wallet's own
transport, and that nonce is what gets persisted.
@VickyXAI
VickyXAI merged commit 0775a63 into main Oct 8, 2026
6 checks passed
@VickyXAI
VickyXAI deleted the fix/withdraw-nonce-write-endpoint branch October 8, 2026 02:53
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