Transaction missing on one node (using sendwithmetadata and listaddresstransactions)

+2 votes
Hi MultiChain Team,

We are testing a small network with few nodes on Amazon Linux 2 to send some transactions (using sendwithmetadata), and found that sometimes a transaction is missing on one of the nodes (using listaddresstransactions). For example, node X only contains 99 transactions, while all other nodes contain 100 transactions. We have tried both v2.0.1 and v1.0.8 and found the same situation. We have also tested on Ubuntu and did not observe this situation. Just wondering if there may be any configuration that we can adjust to avoid the transaction lost?

Thank you very much!
asked May 14, 2019 by Tsung-Ting Kuo

1 Answer

+2 votes
 
Best answer

That is very strange - are you able to check that the nodes that are giving answers are fully synchronized with each other in terms of the blockchain? You can check using the getblockchaininfo API on all the nodes – they should have the same getbestblockhash.

Also I'm assuming that all nodes are tracking this address using importaddress (or perhaps importprivkey), and then when you used that command, you kept the rescan parameter on its default value of true? If not, some nodes will not have checked the blockchain from the start for transactions relating to that address, and that would explain the discrepancy you see in the output from listaddresstransactions.

answered May 15, 2019 by MultiChain
selected May 16, 2019 by Tsung-Ting Kuo
1) 5 seconds should be fine

2) No external network access is required
The problem still occur in several trials, and we found that the transactions from node 2 are no longer included in the blocks (while the transactions from other nodes are still included in the blocks) after certain time point. We also confirmed that the nodes are still synchronized (with the same "getbestblockhash" value).

As for the conflicting transactions, how can we detect it since we are using amount = 0 (i.e., only storing metadata)?

Also, even if there are some conflicting transactions, will they cause a node (e.g., node 1) to never accept transactions from another node (e.g., node 2) thereafter?
You cannot send transactions simultaneously from two nodes using the same address - this will lead to conflicts. This is true even if the transactions are not transferring assets. See 'Approaches for writing' on this page: https://www.multichain.com/developers/clustering-high-availability/
Many thanks, just another update: after the situation (i.e., node 1 not receiving transactions from node 2) happened again, we tried to restart only node 1 and 2 (with -rescan=1 runtime parameter), and MultiChain seemed continue to work properly. Just wondering if this may provide additional information regarding the root cause of the issue?
This is expected, because the content of each node's wallet is regenerated from the blockchain, i.e. from transactions that were actually confirmed. The root cause of the issue is that you cannot send transactions simultaneously from two nodes using the same address – that's all there is to it.
...