Batch Sending Transactions (nonce sequence) vs. Load Balancer


I was wondering whether we will run into any problems if we batch send multiple transactions via Infura all in one go using manual nonce management instead of sending them serially and waiting for each one to be mined first before sending the next one.

I have heard that Infura load balances its nodes and that there are known issues with batch sending transactions due to that. Apparently one such failure scenario is where e.g. TX-Nonce-1 and TX-Nonce-2 get load balanced to two different nodes and TX-Nonce-2 will be rejected because of an incorrect nonce. Is that a real issue or are there similar ones I should be aware of?

Or are we good to go and send


all at once to the network via Infura?

Hi @gitpusha - depending on the number of transactions in-flight on the Ethereum network, you may run into a situation where your nonces don’t get picked up. Our current recommendation is that you track your nonce in your code and manually increment it as you send out additional transactions instead of calling getTransactionCount multiple times.

Hi Leiya,

Thanks for this info. I already noticed that getTransactionCount was not reliable for sending multiple tx and we are already using a manual mechanism for transaction nonce setting.

My original question is explicitly asking whether there can be any issues with “manual nonce management”. For example, if I send 5 transactions all at once to Infura with TX-Nonce-1 to 5, is there any scenario where Infura nodes might reject a TX because it has a higher nonce than the current account nonce ?

Hi @gitpusha - yes, if you send all 5 transactions at once, there is the possibility that a later nonce will be accepted and the transaction completed before one with a lower nonce number