Don't send full transactions with a merkleblock if already known#125
Don't send full transactions with a merkleblock if already known#125dgenr8 wants to merge 1 commit into
Conversation
|
Supporting thin blocks is important, but even a one-in-a-million chance of an SPV client not hearing about a transaction is annoying. How about doing this: ... so SPV clients end up getting extra data, but full nodes don't. |
c4b01ab to
5edcee5
Compare
|
I like the idea but the solution you propose will unfortunately not work for pruned nodes. Is there another way to signal that we want filtered merkleblocks? |
|
Right, you can be NODE_NETWORK and pruned and still wanna do the thin block thing... This morning I checked, and (at least) bitcoinj doesn't do the BIP130 'sendheaders' thing, so SPV clients don't have the fPreferHeaders flag set. But checking that feels like a hack. The right way is a new service bit for thin-block-preferring nodes-- and I think the thin blocks patch does have a new service bit, yes? |
|
Yes, there is a new service bit, but still the same problem. Node supports bloom, but does it support filtered bloom or unfiltered bloom (or both)? There should be sub-service bits :-) |
|
The service bit is for the "extreme" protocol changes. I think we're back to the SPV node being prepared to notice a txid being sent without the full tx. All it really needs to do is process merkleblocks from multiple peers, which it should be doing anyway to catch peers that withhold. |
|
If this is what you're thinking of @gavinandresen , then I'm happy with it. Not because it's a good solution but because it solves my problem :-) |
In merkleblock response, re-enable suppression of transmission of transactions already seen on the peer connection.
5edcee5 to
ab94afb
Compare
|
@dagurval Ok, no remote clients currently available will benefit from this, but we are working on one. Before this PR is updated, we have another question to answer -- how to best distinguish a classic peer (which has this fix) from peer which lacks it. |
|
With the superior Xthin protocol supported, it will be used by the only client that supported XT-style thinblocks anyway. Closing. |
|
Thanks dgenr8! |
…allowed This feature was intended to allow high priority txns to always propagate however there are issues with this as highlighted in issue bitcoinclassic#125 1) This feature is a magic number which is not a good idea to begin with 2) txns that have been floating around without getting mined for long periods of time end up rising in priority and avoiding getting rate limited which the consequence that our mempools are filling up much faster with un-mineable txns. 3) This value can and does override the minlimitertxfee value at times which makes it confusing for users who see that the minlimitertxfee is not being honoured.
In merkleblock response, don't include transactions if they were already seen on the peer connection.
This long-standing optimization was removed in bitcoin#7133. The reason for the removal was that tracking of inventory already known to the peer was expanded and converted to a bloom filter with false-positive rate of 1e-6, whereas previously it was a simple set.
The use of a bloom filter in the already-seen check introduces a 1e-6 chance that a transaction will not be sent along with the merkleblock, even when it has not actually been seen before. Nevertheless, the optimization should be reinstated for the following reasons:
RelayTransaction, which retains the optimizationI have corresponded with the maintainers of the most popular P2P SPV clients, here is a summary: