@@ -43,14 +43,76 @@ infrastructure projects.
4343meeting, highlighting some of the important questions and answers. Click on a
4444question below to see a summary of the answer from the meeting.*
4545
46- FIXME: intro
46+ [ Use legacy relaying to download blocks in blocks-only mode] [ review club #22340 ]
47+ is a PR by Niklas Gögge to make blocksonly nodes always use legacy block relay
48+ for downloading blocks. The review club compared legacy block download with
49+ BIP152 compact block download, and why blocksonly nodes don't benefit from
50+ the latter.
4751
4852{% include functions/details-list.md
4953
50- q0="FIXME"
51- a0="FIXME"
52- a0link="https://bitcoincore.reviews/12345#l-123FIXME "
53-
54+ q0="What sequence of messages is used in legacy block relaying?"
55+ a0="Nodes (except those running versions earlier than v0.10) [ sync
56+ headers-first] [ headers first pr ] . A node first learns about a block and its
57+ block hash through a block header or ` inv ` message. It can then request the full
58+ block by sending a ` getdata(MSG_BLOCK, blockhash) ` message to a peer that
59+ announced it, and they respond with a ` block ` message containing the full
60+ block."
61+ a0link="https://bitcoincore.reviews/22340#l-49 "
62+
63+ q1="What sequence of messages is used in BIP152 low bandwidth compact block relaying?"
64+ a1="Peers indicate that they want to use compact block relay by sending
65+ ` sendcmpct ` at the start of the connection. Low bandwidth compact block relay is
66+ very similar to legacy block relay: the node syncs headers first, requests a
67+ compact block from its peer using ` getdata(MSG_CMPCT_BLOCK, blockhash) ` , and
68+ receives a ` cmpctblock ` in response. The node can use the compact block shortids
69+ to look for the block transactions in its mempool and cache of extra
70+ transactions. If any transactions are still unknown, it can request them from
71+ a peer using ` getblocktxn ` and receive ` blocktxn ` messages in response."
72+ a1link="https://bitcoincore.reviews/22340#l-56 "
73+
74+ q2="What sequence of messages is used in BIP152 high bandwidth compact block relaying?"
75+ a2="A node can request high bandwidth compact blocks from a peer when first
76+ establishing the connection by sending ` sendcmpct(1) ` at the start of the
77+ connection. This means the peer can send a ` cmpctblock ` immediately, without
78+ sending headers first or waiting for a ` getdata ` request for the block. If
79+ needed, the node can download any unknown block transactions using ` getblocktxn `
80+ and ` blocktxn ` , identically to low bandwidth compact block relay."
81+ a2link="https://bitcoincore.reviews/22340#l-59 "
82+
83+ q3="Why does compact block relay waste bandwidth for blocksonly nodes during
84+ block download? How much bandwidth is wasted?"
85+ a3="Compact block relay reduces bandwidth usage for nodes that have a mempool
86+ because they don't need to re-download the majority of block transactions.
87+ However, nodes in blocksonly mode don't participate in transaction relay and
88+ typically have empty mempools, which means they need to download all of the
89+ transactions anyway. The shortids, ` getblocktxn ` and ` blocktxn ` overhead [ add up
90+ to approximately 38kB per block] [ aj calculations ] of wasted bandwidth, and the
91+ extra round trip for ` getblocktxn ` and ` blocktxn ` messages also increases the
92+ time it takes to download the block."
93+ a3link="https://bitcoincore.reviews/22340#l-82 "
94+
95+ q4="Does a node in blocksonly mode keep a mempool?"
96+ a4="While blocksonly nodes don't participate in transaction relay, they still
97+ have a mempool and it may contain transactions for a few different reasons. For
98+ example, if the node was in normal mode, then restarted in blocksonly mode, the
99+ mempool is persisted across the restart. Also, any transactions submitted
100+ through the wallet and client interfaces are validated and relayed using the
101+ mempool."
102+ a4link="https://bitcoincore.reviews/22340#l-97 "
103+
104+ q5="What is the difference between blocksonly and block-relay-only? Should
105+ these changes be applied for block-relay-only connections as well?"
106+ a5="Blocksonly mode is a node setting, while block-relay-only is an attribute
107+ of a peer connection. When a node is started in blocksonly mode, the node sends
108+ ` fRelay=false ` in the version handshake with all peers and disconnects peers that
109+ send any transaction-related messages. Whether or not in blocksonly mode, a node
110+ may have block-relay-only connections on which they ignore incoming transaction
111+ and addr messages. As such, the existence of block-relay-only connections has no
112+ relation to a node's mempool contents and ability to reconstruct blocks from
113+ compact block messages, so these changes shouldn't be applied to
114+ block-relay-only connections."
115+ a5link="https://bitcoincore.reviews/22340#l-111 "
54116%}
55117
56118## Preparing for taproot #12 : Vaults with taproot
@@ -123,7 +185,7 @@ BOLTs][bolts repo].*
123185## Footnotes
124186
125187{% include references.md %}
126- {% include linkers/issues.md issues="22009,1907,1910,1143,847,880,824,1867,5669,4616" %}
188+ {% include linkers/issues.md issues="22009,1907,1910,1143,847,880,824,1867,5669,4616,22340 " %}
127189[ bitcoin core 22.0 ] : https://bitcoincore.org/bin/bitcoin-core-22.0/
128190[ bitcoin core 0.21.2 ] : https://bitcoincore.org/bin/bitcoin-core-0.21.2/
129191[ news115 anchor fees ] : /en/newsletters/2020/09/16/#stealing-onchain-fees-from-ln-htlcs
@@ -136,3 +198,5 @@ BOLTs][bolts repo].*
136198[ gray bip ] : https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019390.html
137199[ braidpool paper ] : https://github.com/pool2win/braidpool/raw/main/proposal/proposal.pdf
138200[ pool2win post ] : https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-August/019371.html
201+ [ aj calculations ] : https://github.com/bitcoin/bitcoin/pull/22340#issuecomment-872723147
202+ [ headers first pr ] : https://github.com/bitcoin/bitcoin/pull/4468
0 commit comments