aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_runner.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-10-01 08:15:34 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-10-01 08:16:54 +0200
commit4e1de1fc59057c5f6fe15a02acd922e158e91292 (patch)
treebea8b829ef09eed1763fb8e2b2408eb14f24d7ca /test/functional/test_runner.py
parent33b0696d3106646d5251ceebbeaee53bc8765e3a (diff)
parent18c5b23a0f7adf9a08bcaa967ed800badf62d90a (diff)
downloadbitcoin-4e1de1fc59057c5f6fe15a02acd922e158e91292.tar.xz
Merge bitcoin/bitcoin#22340: p2p: Use legacy relaying to download blocks in blocks-only mode
18c5b23a0f7adf9a08bcaa967ed800badf62d90a [test] Test that -blocksonly nodes still serve compact blocks. (Niklas Gögge) a79ad65fc2c31a2b1132a6aab389d0197a95c395 [test] Test that getdata(CMPCT) is still sent on regular low bandwidth connections. (Niklas Gögge) 5e231c116ba8165e9d8c795b85ca2833238aed54 [test] Test that -blocksonly nodes do not send getdata(CMPCT) on a low bandwidth connection. (Niklas Gögge) 5bf658745782eb571215d6c1e5fe3c655edb55b3 [test] Test that -blocksonly nodes do not request high bandwidth mode. (Niklas Gögge) 0dc8bf5b925ca876c0b1a100e426056d741aafde [net processing] Dont request compact blocks in blocks-only mode (Niklas Gögge) Pull request description: A blocks-only node does not participate in transaction relay to reduce its own bandwidth usage and therefore does not have a mempool. The use of compact blocks is not beneficial to such a node since it will always have to download full blocks. In both high- and low-bandwidth relaying the `cmpctblock` message is sent. This represent a bandwidth overhead for blocks-only nodes because the `cmpctblock` message is several times larger in the average case than the equivalent `headers` or `inv` announcement. ![compact blocks](https://raw.githubusercontent.com/bitcoin/bips/master/bip-0152/protocol-flow.png) >**Example:** >A block with 2000 txs results in a `cmpctblock` with 2000*6 bytes in short ids. This is several times larger than the equivalent 82 bytes for a `headers` message or 37 bytes for an `inv`. ## Approach This PR makes blocks-only nodes always use the legacy relaying to download new blocks. It does so by making blocks-only nodes never initiate a high-bandwidth block relay connection by disabling the sending of `sendcmpct(1)`. Additionally a blocks-only node will never request a compact block using `getdata(CMPCT)`. A blocks-only node will continue to serve compact blocks to its peers in both high- and low-bandwidth mode. ACKs for top commit: naumenkogs: ACK 18c5b23a0f7adf9a08bcaa967ed800badf62d90a rajarshimaitra: tACK https://github.com/bitcoin/bitcoin/pull/22340/commits/18c5b23a0f7adf9a08bcaa967ed800badf62d90a jnewbery: reACK 18c5b23a0f theStack: re-ACK 18c5b23a0f7adf9a08bcaa967ed800badf62d90a 🥛 Tree-SHA512: 0c78804aa397513d41f97fe314efb815efcd852d452dd903df9d4749280cd3faaa010fa9b51d7d5168b8a77e08c8ab0a491ecdbdb3202f2e9cd5137cddc74624
Diffstat (limited to 'test/functional/test_runner.py')
-rwxr-xr-xtest/functional/test_runner.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py
index 2c2aaf6020..bb84962b75 100755
--- a/test/functional/test_runner.py
+++ b/test/functional/test_runner.py
@@ -98,6 +98,7 @@ BASE_SCRIPTS = [
'rpc_fundrawtransaction.py --legacy-wallet',
'rpc_fundrawtransaction.py --descriptors',
'p2p_compactblocks.py',
+ 'p2p_compactblocks_blocksonly.py',
'feature_segwit.py --legacy-wallet',
# vv Tests less than 2m vv
'wallet_basic.py --legacy-wallet',