@@ -98,18 +98,84 @@ release candidates.*
9898meeting, highlighting some of the important questions and answers. Click on a
9999question below to see a summary of the answer from the meeting.*
100100
101- FIXME: LarryRuane
102-
103- [ Don't download witnesses for assumed-valid blocks when running in prune mode] [ review club 27050 ]
104- is a PR by Niklas Gögge (dergoegge) that improves the performance of Initial Block Download
105- (IBD) by not downloading witness data on nodes that are configured to both
106- [ prune block data] [ docs pruning ] and use [ assumevalid] [ docs assume valid ] . This
107- optimization was discussed in a recent [ stack exchange question] [ se117057 ] . {% assign timestamp="43:42" %}
101+ [ Add getprioritisationmap, delete a mapDeltas entry when delta==0] [ review club 27501 ]
102+ is a PR by Gloria Zhao (glozow) that improves the Bitcoin Core
103+ feature that allows miners to modify the effective mempool fee, and
104+ thus the mining priority (higher or lower), of particular transactions
105+ (see the [ prioritisetransaction RPC] [ ] ).
106+ The fee increment (if positive) or decrement (if negative) is called
107+ the _ fee delta_ . Transaction prioritization values are persisted to
108+ disk within the ` mempool.dat ` file and are restored on node restart.
109+
110+ One reason a miner might prioritize a transaction is to account for an
111+ out-of-band transaction fee payment; the affected transaction will be
112+ treated as if it has a higher fee when choosing which transactions to
113+ include in the miner's block template.
114+
115+ The PR adds a new RPC, ` getprioritisationmap ` , that returns the set of
116+ prioritized transactions. The PR also removes unnecessary prioritization
117+ entries, which can arise if the user sets deltas back to zero.
108118
109119{% include functions/details-list.md
110- q0=""
111- a0=""
112- a0link="https://bitcoincore.reviews/27050#FIXMEl-31 "
120+ q0="What is the [ mapDeltas] [ ] data structure, and why is it needed?"
121+ a0="It's where the per-transaction prioritization values are stored.
122+ These values affect local mining and eviction decisions, as well
123+ as the ancestor and descendant feerate calculations."
124+ a0link="https://bitcoincore.reviews/27501#l-26 "
125+
126+ q1="Do transaction prioritizations affect the fee estimation algorithm?"
127+ a1="No. Fee estimation needs to accurately predict
128+ the expected decisions of miners (in this case, _ other_ miners),
129+ and these miners don't have the same prioritizations that we do,
130+ since those are local."
131+ a1link="https://bitcoincore.reviews/27501#l-31 "
132+
133+ q2="How is an entry added to ` mapDeltas ` ? When is it removed?"
134+ a2="It's added by the ` prioritisetransaction ` RPC, and also when the
135+ node restarts, due to an entry in ` mempool.dat ` .
136+ They are removed when a block containing the transaction is
137+ added to the chain, or when the transaction is [ replaced] [ topic rbf ] ."
138+ a2link="https://bitcoincore.reviews/27501#l-34 "
139+
140+ q3="Why shouldn’t we delete a transaction’s entry from ` mapDeltas ` when
141+ it leaves the mempool (because, for example, it has expired or been
142+ evicted due to feerate dropping below the minimum feerate)?"
143+ a3="The transaction may come back into the mempool. If its ` mapDeltas ` entry
144+ had been removed, the user would have to re-prioritize the transaction."
145+ a3link="https://bitcoincore.reviews/27501#l-84 "
146+
147+ q4="If a transaction is removed from ` mapDeltas ` because it's included in
148+ a block, but then the block is re-orged out, won't the transaction's
149+ priority have to be reestablished?"
150+ a4="Yes, but reorgs are expected to be rare. Also, the out-of-band payment
151+ may actually be in the form of a Bitcoin transaction, and so it may
152+ need to be redone as well."
153+ a4link="https://bitcoincore.reviews/27501#l-90 "
154+
155+ q5="Why should we allow prioritizing a transaction that isn’t present in
156+ the mempool?"
157+ a5="Because the transaction may not be in the mempool _ yet_ . And it may
158+ not even be able to enter the mempool in the first place on its own
159+ fee (without the prioritization)."
160+ a5link="https://bitcoincore.reviews/27501#l-89 "
161+
162+ q6="What is the problem if we don't clean up ` mapDeltas ` ?"
163+ a6="The main problem is wasteful memory allocation."
164+ a6link="https://bitcoincore.reviews/27501#l-107 "
165+
166+ q7="When is ` mempool.dat ` (including ` mapDeltas ` ) written from memory to
167+ disk?"
168+ a7="On clean shutdown, and by running the ` savemempool ` RPC."
169+ a7link="https://bitcoincore.reviews/27501#l-114 "
170+
171+ q8="Without the PR, how do miners clean up ` mapDeltas ` (that is,
172+ remove entries with a zero prioritization value)?"
173+ a8="The only way is to restart the node, since zero-value
174+ prioritizations are not loaded into ` mapDeltas ` during restart.
175+ With the PR, the ` mapDeltas ` entry is deleted as soon as its
176+ value is set to zero. This has the additional beneficial effect
177+ that zero-value prioritizations aren't written to disk."
178+ a8link="https://bitcoincore.reviews/27501#l-127 "
113179%}
114180
115181## Notable code and documentation changes
@@ -222,3 +288,6 @@ publish the next 250 newsletters.
222288[ news188 phantom ] : /en/newsletters/2022/02/23/#ldk-1199
223289[ founding sponsors ] : /about/#founding-sponsors
224290[ financial supporters ] : /#members
291+ [ review club 27501 ] : https://bitcoincore.reviews/27501
292+ [ prioritisetransaction rpc ] : https://developer.bitcoin.org/reference/rpc/prioritisetransaction.html
293+ [ mapDeltas ] : https://github.com/bitcoin/bitcoin/blob/fc06881f13495154c888a64a38c7d538baf00435/src/txmempool.h#L450
0 commit comments