0

I have a node which I use to send transactions to the network. Those transactions are really important. They must go through at all cost.

If I simply send the transactions, there is a chance that one of them get stuck which would break all further transactions, because the nonce chain is broken.

To remediate the problem above, is there a service of some kind or a technique which can guarantee the integrity of my transactions?

1
  • 1
    Can your service simply verify the transaction was accepted into a block (using the transaction hash)? If not, send it again... Commented Sep 24, 2018 at 0:23

2 Answers 2

2

Short answer is there is no way to guarantee that your transactions will be included in a block. But you can check whether your transaction is included in a block.

So a reasonable approach is to fire off a single transaction, wait for it to be mined (web3 / truffle allow you to fire callbacks based on the transaction being mined) then submit the next transaction with an incremented nonce.

This won't be much slower than submitting them all at once as they will always be considered in nonce order anyway.

0

Just to add to the existing answer.

Even if your transaction is mined in a block it does not necessarily mean it will stay in the canonical chain. It will probably be in the canonical chain at some point but it's impossible to know when.

If the block is not part of the canonical chain it will basically be reverted - which will not hurt your subsequent transactions as a reverted transaction is still a valid transaction. But if it's imperative for you that the transactions are seen as mined in a certain order you have to wait for X confirmations before sending the next transaction (where X is a number of your choice). A confirmation here means a block on top of the transaction in question.

In theory all transactions in the current Ethereum blockchain may be reverted some day but the more confirmations there are for a given block, the less likely the event is. This is also why exchanges require X amount of confirmations for a transaction before accepting it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.