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:
Polygon official Amoy RPC → mint succeeded
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
Mint succeeded immediately.
Asked Opus why v6 worked, and it broke it down nicely:
| Version | maxPriorityFeePerGas | Amoy minimum |
|---|---|---|
| ethers v5 | ~1.5 Gwei |
25 Gwei |
| ethers v6 | ~35 Gwei |
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 .
One thing still unsolved though:
- ethers v6 + Amoy official RPC → works
- ethers v6 + Alchemy RPC → still times out when minting NFTs
- Alchemy works fine for:
- getting eth_chainId via curl
- sending native tokens using this tester app: https://rpc-tester.vercel.app (codebase: GitHub - letitcodedev/eth-rpc-tester-nextjs)
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
