Out of order mempool TX

1

I notice that mempool messages result in multiple tx messages, usually completely out of order.

What I generally do is re-queue the message until the parent is processed, however that doesn't seem to be the right approach. If the parent can't be verified, shouldn't it be discarded immediately?

In a hostile scenario I could receive an unsolicited tx that relies on an unseen parent. What are the best practices here? Just wait up until N seconds and then discard?

Matt

Posted 2015-07-11T03:21:06.990

Reputation: 520

If you are attempting to replicate Bitcoin Core behavior, look into how the orphan pool operates.Anonymous 2015-07-11T03:46:33.390

This thread seems to illuminate the issue, https://github.com/bitcoin/bitcoin/issues/3566 It still seems odd that a high percentage of transactions on a mempool sync would go into the orphan map first instead of being ordered by the relaying node.

Matt 2015-07-11T04:20:00.750

Answers

0

If the parent can't be verified, shouldn't it be discarded immediately?

Then you risk needing to redownload that transaction.

What are the best practices here? Just wait up until N seconds and then discard?

I think what bitcoin does, adding it to a size-limited cache, works well in practice. You just have to make sure that when you receive the parent you broadcast invs for both the parent and the child (assuming the child is still in the size-limited cache).

morsecoder

Posted 2015-07-11T03:21:06.990

Reputation: 12 624