Skip to content

Commit 59ce537

Browse files
committed
Merge #16152: Disable bloom filtering by default.
bead32e Add release notes for DEFAULT_BLOOM change (Matt Corallo) f27309f Move DEFAULT_PEERBLOOMFILTERS from validation.h to net_processing.h (Matt Corallo) 5efcb77 Disable bloom filtering by default. (Matt Corallo) Pull request description: BIP 37 bloom filters have been well-known to be a significant DoS target for some time. However, in order to provide continuity for SPV clients relying on it, the NODE_BLOOM service flag was added, and left as a default, to ensure sufficient nodes exist with such a flag. NODE_BLOOM is, at this point, well-established and, as long as there exist 0.18 nodes with default config (which I'd anticipate will be true for many years), will be available from some peers. By that time, the continued slowdown of BIP 37-based filtering will likely have rendered it useless (though this is already largely the case). Further, BIP 37 was deliberately never updated to support witness-based filtering as newer wallets are expected to migrate to some yet-to-be-network-exposed filters. ACKs for top commit: jnewbery: ACK bead32e kallewoof: ACK bead32e Tree-SHA512: ecd901898e8efe1a7c82b471af0acc2373c2282ac633eb58d9aae7c35deda1999d0f79fb0485e6cecbda7246aeda00206cd82c7fa36866e2ac64705ba93f9390
2 parents 89d7229 + bead32e commit 59ce537

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
P2P Changes
2+
-----------
3+
- The default value for the -peerbloomfilters configuration option (and, thus, NODE_BLOOM support) has been changed to false.
4+
This resolves well-known DoS vectors in Bitcoin Core, especially for nodes with spinning disks. It is not anticipated that
5+
this will result in a significant lack of availability of NODE_BLOOM-enabled nodes in the coming years, however, clients
6+
which rely on the availability of NODE_BLOOM-supporting nodes on the P2P network should consider the process of migrating
7+
to a more modern (and less trustful and privacy-violating) alternative over the coming years.

src/net_processing.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
1919
static const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100;
2020
/** Default for BIP61 (sending reject messages) */
2121
static constexpr bool DEFAULT_ENABLE_BIP61{false};
22+
static const bool DEFAULT_PEERBLOOMFILTERS = false;
2223

2324
class PeerLogicValidation final : public CValidationInterface, public NetEventsInterface {
2425
private:

src/validation.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ static const unsigned int MAX_BLOCKS_TO_ANNOUNCE = 8;
126126
/** Maximum number of unconnecting headers announcements before DoS score */
127127
static const int MAX_UNCONNECTING_HEADERS = 10;
128128

129-
static const bool DEFAULT_PEERBLOOMFILTERS = true;
130-
131129
/** Default for -stopatheight */
132130
static const int DEFAULT_STOPATHEIGHT = 0;
133131

test/functional/p2p_node_network_limited.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
and that it responds to getdata requests for blocks correctly:
99
- send a block within 288 + 2 of the tip
1010
- disconnect peers who request blocks older than that."""
11-
from test_framework.messages import CInv, msg_getdata, msg_verack, NODE_BLOOM, NODE_NETWORK_LIMITED, NODE_WITNESS
11+
from test_framework.messages import CInv, msg_getdata, msg_verack, NODE_NETWORK_LIMITED, NODE_WITNESS
1212
from test_framework.mininode import P2PInterface, mininode_lock
1313
from test_framework.test_framework import BitcoinTestFramework
1414
from test_framework.util import (
@@ -55,7 +55,7 @@ def setup_network(self):
5555
def run_test(self):
5656
node = self.nodes[0].add_p2p_connection(P2PIgnoreInv())
5757

58-
expected_services = NODE_BLOOM | NODE_WITNESS | NODE_NETWORK_LIMITED
58+
expected_services = NODE_WITNESS | NODE_NETWORK_LIMITED
5959

6060
self.log.info("Check that node has signalled expected services.")
6161
assert_equal(node.nServices, expected_services)
@@ -83,7 +83,7 @@ def run_test(self):
8383

8484
node1.wait_for_addr()
8585
#must relay address with NODE_NETWORK_LIMITED
86-
assert_equal(node1.firstAddrnServices, 1036)
86+
assert_equal(node1.firstAddrnServices, expected_services)
8787

8888
self.nodes[0].disconnect_p2ps()
8989
node1.wait_for_disconnect()

test/functional/test_framework/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
NODE_NETWORK = (1 << 0)
4646
# NODE_GETUTXO = (1 << 1)
47-
NODE_BLOOM = (1 << 2)
47+
# NODE_BLOOM = (1 << 2)
4848
NODE_WITNESS = (1 << 3)
4949
NODE_NETWORK_LIMITED = (1 << 10)
5050

0 commit comments

Comments
 (0)