Transaction broadcast issue on infura node

We are using infura node to broadcast ethereum transaction on ethereum mainnet . We observe that some transactions are not been posted on ethereum blockchain . Some of example transaction which we done and havent posted on ethereum blockchain are as follows

Can anyone explain what can be issue it is ? Does infura broadcast transaction in batches or wait for sometime before posting on blockchain

Hi @Mohammad_Obaid. We route transactions immediately to Ethereum nodes to be broadcast to the network. This issue you are experiencing can occur if the transactions you are sending get sent to nodes with nonces out of order. Depending on the number of transactions in-flight on the Ethereum network, you may run into issues like the one you are seeing. 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. Let me know if this is relevant to your implementation. Feel free to share a code snippet if you can.

We are working on changes to our infrastructure to abstract this nuance of remote node APIs but that work is still in progress.

Hi @egalano thanks for your reply . So here is my code snippet where I construct raw transaction and send it to infura node

web3js.eth.getTransactionCount(myAddress, 'pending').then(function(v){
             count = v+1;
             var transfer =  contract.methods.createdegree(uniquekey);
             var encodedABI = transfer.encodeABI();
             const rawTransaction = {
                            "nonce": count,
                            "from": "xxx",
                            "to": "xxx",
                            "value": 0,
                            "gas": 566540,
                            "data": encodedABI,
                            "chainId": 1

           var transaction = new Tx(rawTransaction);
           var signedtx = '0x'+transaction.serialize().toString('hex');
           var transactionidfinal = new Tx(signedtx).hash().toString('hex');
           var transactionidfinaldated = '0x'+transactionidfinal;
           var transactionarray = [transactionidfinaldated,signedtx];



I incremented nonce value by 1 but still I am seeing the same issue . I send around 27 transactions in quick succession out of which 7-8 transaction face such issue and couldnt reach to mining pool . Here is contract address where it is currently showing only 1 pending transaction while it should show around 7 .

Hi @egalano you mean to say I should store nonce value in my local database and increment each by one before sending raw transaction ?

Not in a local database, just in a variable in your code if you are going to be sending multiple transactions in your code, look up your nonce once and then increment before sending each transaction. If you are instead running this script multiple times, you are going to run into issues properly tracking what nonce to use depending on the state of the global transaction pool. I’d have to know more about what you are trying to accomplish to make a recommendation. This blog post outlines one solution someone had for their app

  • raw

0 voters


0xDD5b216328E36eBAAEb239BF63165B7CFd3D0bB8[poll type=regular results=always public=true chartType=bar groups=admins]

  • transfer