Hit a timeout minting NFTs on Polygon Amoy — turns out it was ethers v5 (mostly)

I ran into a weird timeout issue while minting an ERC-721 on Polygon Amoy and it took me a while to figure out what was actually wrong.

The codebase was old, using ethers v5 + Alchemy RPC.

I tried minting an ERC-721 multiple times — all failed.

First thought: RPC issue.

So I switched from Alchemy → Polygon official Amoy RPC .

Still timing out.

Since I was vibe-coding in Cursor, I asked Opus 4.5 what might be going on.

It pointed out something I totally overlooked: gas fee too low.

I manually set a higher gas fee:

  • :white_check_mark: Polygon official Amoy RPC → mint succeeded
  • :cross_mark: Alchemy RPC → still failed, even with the same gas settings

That confused me, because…

“Doesn’t ethers auto-estimate gas anyway?”

Asked Opus again, and the explanation was actually interesting:

  • Amoy testnet has very low traffic
  • Base fee stays super low
  • But Polygon validators enforce a minimum gas price (≈25 Gwei) to prevent spam
  • ethers v5 was estimating based on the low base fee → below validator minimum
  • Result: tx looks valid but just sits there and times out

So yeah… policy > estimation .

At this point I suspected ethers v5 might just be too old, so I:

  • Upgraded to ethers v6
  • Removed all my manual gas overrides
  • Used Polygon official Amoy RPC

:backhand_index_pointing_right: Mint succeeded immediately.

Asked Opus why v6 worked, and it broke it down nicely:

Version maxPriorityFeePerGas Amoy minimum
ethers v5 ~1.5 Gwei :cross_mark: 25 Gwei
ethers v6 ~35 Gwei :white_check_mark: 25 Gwei

ethers v6 has a much better getFeeData() implementation and returns values that actually meet Polygon’s minimums. v5 was basically underpricing every tx on Amoy.

That honestly surprised me.

Lesson learned: don’t use ethers v5 anymore if you can avoid it .


:warning: One thing still unsolved though:

So the failure only happens during contract minting, not basic RPC calls.

Probably need to dig deeper into Alchemy’s Amoy config or gas policy.

But at least the main blocker is gone

Edit: Alchemy also works fine switching to ethers v6. Same setup, same RPC — the upgrade alone fixed it.