-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Remove NonceManager #1326
base: master
Are you sure you want to change the base?
fix: Remove NonceManager #1326
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try this and monitor; I'm not 100% sure it will increase stability. Indeed Marble's implementation (note: Marble is an asynchronous resilient persistance layer implementation for RequestNetwork, developped at Request Finance) does not allow multiple transactions to happen simultenaously.
Agreed! I wasn't sure on this one either. I'll be ready to roll back if needed. |
Actually I think I'll hold off merging this and do more local testing first. |
PR needs more work.
Description of the changes
NonceManager
from the Request NodeMotivation
(Copied from https://github.com/RequestNetwork/marble/pull/105 written by @alexandre-abrioux)
The
NonceManager
does not handle catching errors from the RPC.When the RPC refuses a transaction, because for instance:
; then an error is thrown and not handled by the
NonceManager
. In that case, theNonceManager
still increases its internal counter.Since the initial transaction was never persisted on-chain, the following transactions are never picked up by the network because their nonce is too high.
More sources:
In ethers.js documentation https://docs.ethers.org/v5/api/experimental/#experimental-noncemanager
In ethers.js code (latest version, v6, not the version we use): https://github.com/ethers-io/ethers.js/blob/v6.9.0/src.ts/providers/signer-noncemanager.ts#L82
there is this comment:
This is the code for the currently used version of ethers.js (v5): https://github.com/ethers-io/ethers.js/blob/v5.5.1/packages/experimental/src.ts/nonce-manager.ts
Additionally, I suspect that the "OldNonce" error was also caused by the
NonceManager
.Fixes #1292