[JS SDK] 404 TX not Mined

Hey everybody.

We are hosting our own Aeternity node, and I’ve been experimenting with the nonce_offset parameter in order to increase parallel capacity for the transactions.

Once I set nonce_offset to 40 and send 20 parallel contract calls, some of them starting to fail with
error 404 Tx not mined error. This was never happening to me with 10 parallel transactions, for example. The interesting part that the transaction is actually mined after a while, and I can access it from http://localhost:3013/v2/transactions/th_L2rrxkcmxbtPCRWedXhXKpkbGLHGioLGVs6qYWoYrjCHX5FUn/info

Is there anything I can do to avoid this issue?
Also, I’ve found this thread Aeternal middleware concurrency?
Does this relevant to the JS SDK as well?

Hi @markin.io

A transaction can have a couple of different states according to its inclusion:

  • the transaction is not yet confirmed but it is still pending in the transaction pool. This is when you the the Tx not mined message
  • the transaction is included in a block - in your the case with contract calls - this is when the transaction has been executed on-chain and now has an info. This is what you want to get
  • the transaction is being rejected as an invalid one. If this was the case - you’d see a 404 with a message Transaction not found instead

Transactions have nonces. Those are monotonously incremental integer: 1, 2, 3, 4… Your transactions will be accepted in blocks only sequentially depending on their nonce. If you post 20 transactions - they will be included in blocks only in their right order. They will not be processed in parallel. Some of your transactions can be included in a single micro block but there is no guarantee for this. This is up to miners and block candidate generation algoritms which is outside of the protocol itself.

So to answer your question: it seems like none of your transactions got rejected and none of them failed. They simply were not included in a block yet. After a while - they were rightfully included.

Thank you Dimitar! This is more than clear.
The only problem is that JS SDK throws an error when such things happens. And, as you said, transaction getting included in the block after all.
I think I should create an issue in JS SDK Github repo, if such things happens again.

This sounds odd in this particular case. Please report an issue there so it can be fixed.