Problems using Rinkeby

I have been using Rinkeby successfully for a why but today when trying to deploy a new contract to Rinkeby via infura I always get the following errors:

"MyContract" received: nonce too low.
   * This error is common when Infura is under heavy network load.
   * Try: setting the 'confirmations' key in your network config
          to wait for several block confirmations between each deployment.

    at /Users/jamesmorgan/.nvm/versions/node/v8.9.4/lib/node_modules/truffle/build/webpack:/packages/truffle-deployer/src/deployment.js:364:1
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
Truffle v5.0.5 (core: 5.0.5)
Node v8.9.4

I know its a truffle error but the same migration worked yesterday. Also I dont see anything on the infura status page, just checking if there are rinkeby issues?

Cheers

James

Looks like an issue has been raised on truffle as well https://github.com/trufflesuite/truffle/issues/1762

This is happening again on the Rinkeby network for some contracts, whereas it was working just a few minutes before for the same operations. I haven’t changed any code, which leads me to believe Infura is the issue.

Hey @paypr, what version of truffle are you using? truffle version should let you know.

Also @paypr, is this repeatable? I.e. you’ve ran this multiple times after the error and still getting the error the first time?

You’re not using the same account/private key at the same time doing anything, correct? This could be on your phone/metamask/running truffle migrate in two places at the same time for the same account.

I’m not using the cli. I’m using Open Zeppelin for deploying contracts within my app, which is using web3@1.2.2 under the hood.

Yes, it was a repeatable failure that evening for several attempts, even after deploying other contracts successfully. I was later able to successfully execute the transaction on that one contract, but only after about 30 minutes.

I’m not worried about this so much in rinkeby during testing, but I’m concerned that this will happen in production on mainnet.

You’re not using the same account/private key at the same time doing anything, correct?

I’m not using the cli. I’m using Open Zeppelin for deploying contracts within my app, which is using web3@1.2.2 under the hood.

So to verify, you’re not actually using truffle when you see these errors?

I wasn’t doing anything else at that time. But in general, it’s possible that there are times that I was using the same account/private key for multiple transactions “at the same time”. Meaning, that the same account tried to do a couple of transactions, each of them waiting to complete. They would have been on completely independent contracts, so I would not expect that to be a problem. In other words, I expect the service to handle multiple transactions at the same time from the same account.

I am using the HDWalletProvider from truffle, but not the truffle CLI.

Hi @paypr if you are sending multiple transactions at the same time from the same account you need to ensure that the nonces is managed across the multiple transactions and not duplicated otherwise the transactions will collide.

Thank you. I hadn’t realized that the web3 library didn’t handle the nonce properly for parallel transactions. This is a pretty good description of the problem and some potential solutions: https://github.com/ethereum/web3.js/issues/1846