Use new ethers.js NonceManager to handle transaction nonces #59
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "ethers-nonce-manager"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
So far we have failed to globally handle the transaction nonces.
The new ethers.js v5 comes with a NonceManager that helps us handling transaction nonces and automatically increases the nonce for each transaction.
We should first release: https://github.com/67P/kredits-contracts/pull/200
TODO:
I thought this is exactly what the nonce management would solve. We do wait for that long in all the other integrations and never had an issue with nonces as a result (only with warnings, but not with missing contribution records).
I just tried out this branch with the Gitea test repo/issues, but I'm getting a revert exception on the tx. Looks the same as when we get the chat notification, except it didn't create the contribution on my devchain (which it does on master even when it complains).
thanks for testing. does it work for you with the master branch?
wondering what causes the revert (error in the contract)... might be because no gas limit is set - we had seen this error various times on the devchain before.
yeah, the NonceManager keeps a track of the nonces...
normally ethers.js tries to get the pending transactions count to calculate the nonce before signing it. This can fail if more transactions are created in a short time. The NonceManager should solve this by keeping track of the number of created tranactions.
I just wanted to be super save here for the next deploy that it works. thus I kept that sleep in there.
Same on master when running locally, indeed.
But we really need to be able to run and develop with the devchain.
By the way, this his how you can easily run hal7000/hubot-kredits locally yourself:
npm link
npm link hubot-kredits
run.sh
: add local DAO address to env var near bottom of script./run.sh
andnpm run ngrok
(the former gives you an interactive console/chat room, the latter catches hooks tohubot-dev.kosmos.org
on your machine)That's pretty helpful. Shouldn't that go into the readme?
Good point. I added a new page to the wiki: https://wiki.kosmos.org/Kredits:Development
Please liberally add more information there!
zoom is a bit more annoying to test. so I'd suggest to take the risk and push this to production and handle any potential issues in new PRs.
Missing a kredits label for the PR to be ready to merge...