nim-ethers/ethers/signers
Eric 765379a662
fix: nonce too high (#81)
* fix nonce issues by locking populate and send transaction

Concurrent asynchronous population of transactions cause issues with nonces not being in sync with the transaction count for an account on chain. This was being mitigated by tracking a "last seen" nonce and locking inside of `populateTransaction` so that the nonce could be populated in a concurrent fashion. However, if there was an async cancellation before the transaction was sent, then the nonce would become out of sync. One solution was to decrease the nonce if a cancellation occurred. The other solution, in this commit, is simply to lock the populate and sendTransaction calls together, so that there will not be concurrent nonce discrepancies. This removes the need for "lastSeenNonce" and is overall more simple.

* remove lastSeenNonce

Internal nonce tracking is no longer needed since populate/sendTransaction is now locked. Even if cancelled midway, the nonce will get a refreshed value from the number of transactions from chain.

* chronos v4 exception tracking

* Add tests
2024-10-25 15:08:00 +11:00
..
wallet Upgrade to `nim-json-rpc` v0.4.2 and chronos v4 (#64) 2024-02-19 16:50:46 +11:00
jsonrpc.nim Upgrade to `nim-json-rpc` v0.4.2 and chronos v4 (#64) 2024-02-19 16:50:46 +11:00
wallet.nim fix: nonce too high (#81) 2024-10-25 15:08:00 +11:00