Transaction broadcast issue on infura node

Hey,
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
https://etherscan.io/tx/0xa8a47e5555b70a218b965c33c8b2721ef19928c44db0803d606936f3b0fff78c

https://etherscan.io/tx/0xc462ebc0a63de648a83ecd0bb32acf734728b049c736a74405857a53522a876e

https://etherscan.io/tx/0x2235a017930732b7fe7ecf38968f8f99602601e3af113e76c432257ed2a2665c

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;
             console.log("count",count);
             var transfer =  contract.methods.createdegree(uniquekey);
             var encodedABI = transfer.encodeABI();
             const rawTransaction = {
                            "nonce": count,
                            "from": "xxx",
                            "to": "xxx",
                            "value": 0,
                            "gasPrice":"3000",
                            "gas": 566540,
                            "data": encodedABI,
                            "chainId": 1
                       };

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

  });

 };

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 https://etherscan.io/address/0x2b515aa402de8ff7a37659591cb20451de540664 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 https://medium.com/quant-five/multiple-pending-txs-for-ethereum-blockchain-84cb96eb174e

  • raw

0 voters

0x9efC46B25920Ae5B202a6b0468D6590974126E72

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

  • transfer
    [/poll]