makerdao / auction-demo-keeper

Apache License 2.0
32 stars 19 forks source link

Replaying transactions does not use the same nonce #29

Closed hexonaut closed 3 years ago

hexonaut commented 3 years ago

Tested setting up a new account, and when the transaction took too long it attempted to retry with higher gas, but it used a higher nonce. You can see this in the recent txs for setup here: https://etherscan.io/address/0x3cb42106ecdfe3490648547448b2f96871298e8b

In particular tx1 and tx2 were executed in the same run with the keeper telling me it was executing tx2 as a replay to tx1 which was taking too long. As you can see the nonce has been incremented when it should have been the same.

liberuum commented 3 years ago

I've tried to replicate the issue on mainnet as well. This is the code that checks for replacement: https://github.com/makerdao/auction-demo-keeper/blob/main/src/transact.js#L140

The nonce is kept the same if it's not mined during the timeout. However, the exception was that when it's mined and the receipt has not yet been defined it's submitting a new tx with new nonce. I'll try to fix this. Thanks for bringing this up.

liberuum commented 3 years ago

issue been fixed https://github.com/makerdao/auction-demo-keeper/commit/6fcd6370712e997802102463fc413315dd4a86a4