summaryrefslogtreecommitdiff
path: root/4d/85da10ebb01ea73920c913b2a237633b16c81d
blob: b548f58f78d593e51f9f59be9dd874ce958f25c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
Return-Path: <james.obeirne@gmail.com>
Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 3EEE9C000B
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 17 Feb 2022 18:18:25 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by smtp2.osuosl.org (Postfix) with ESMTP id 25B5E403E7
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 17 Feb 2022 18:18:25 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level: 
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5
 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
 autolearn=ham autolearn_force=no
Authentication-Results: smtp2.osuosl.org (amavisd-new);
 dkim=pass (2048-bit key) header.d=gmail.com
Received: from smtp2.osuosl.org ([127.0.0.1])
 by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id pOUUXPIok5PS
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 17 Feb 2022 18:18:24 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.8.0
Received: from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com
 [IPv6:2607:f8b0:4864:20::1129])
 by smtp2.osuosl.org (Postfix) with ESMTPS id D217140223
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 17 Feb 2022 18:18:23 +0000 (UTC)
Received: by mail-yw1-x1129.google.com with SMTP id
 00721157ae682-2d07ae0b1c5so41315857b3.5
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 17 Feb 2022 10:18:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=kQSFI4ywqYUHiUb1kmYxsEgtRTgQWjHMj0hm3cOxtYc=;
 b=QV0ze6dsI+SWoH9x8lcJRKpHriRVre6y0JRIHwkAKmlHw5TDGp/EuuGL4ts6zB3R3+
 eD63Lrhjc0rkXk6oyu+beQQg694gKvtn3ihMJoeN++Zme3/xndnwy4QUQZI5JZyVDMT7
 1XwSuecpUpHe4SuL8234AC+1QYc5kCHgH0P5dttfWN4LVGv+Ua5z7AjLByijZ75KWX2O
 ZoNUxP66S2gM22Q7o39kk6HOH8UXMD31ezluUFwYml21+n1nqd4uoN2B2BujAwKo3Q5w
 2rDA8U+B0oApvFvjwpF3tg6+KlM20r8IaICDVKMjzHT+IK7iHymfp35GSsRU0zuwIjxp
 6E0A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=kQSFI4ywqYUHiUb1kmYxsEgtRTgQWjHMj0hm3cOxtYc=;
 b=Yl63xlbEM+vUsknrOJHf6Zp03EYCy5y20G0TJD6OUCCF3kjcnMGV2HsWbHhxNaSjDu
 Vfe1Hm8NDe49qz1QoFlyKwH6UhrzjWI8Y8+Hj9gf+gDE4hK5EzhkHG/qGIyeGkDZkDSB
 4bTn2bCLSpG6MhtReYPz1a3o0QsOpM4FXUafPvluSQEVmnOMqGGhdMNFtbB5FhYiwBy3
 RiYvDDYphcDjlTQqE3Iaw1KgF2cBjVZPnvpzxJVJsdhdBIuk8goOIvOyJesnmLl9Ti3n
 UhQ4Shu0l0H1C1x+XRREnAGsigKpFETW2lokKNVcNIvfhg5CGrMIYX12XsVcvfd/MTm2
 5ECQ==
X-Gm-Message-State: AOAM533+lygNZE8MVl3TCijoHZgSlZzYfgBas8ixWlxnZBYwfvluhiCd
 NYAWtHLXX0TfkwV6iMpSwDIvdX5/eML6Lqj03uJZbz3S+PxvBg==
X-Google-Smtp-Source: ABdhPJyiA9WhkA0H1zj9Op++N4BmNkq6XkymJrcBa3knsS+sWP9czSXPNmp0aDTTIA/8OYGMaE57iIWi8au8u8iHRt0=
X-Received: by 2002:a81:3d8c:0:b0:2d1:de9a:c86e with SMTP id
 k134-20020a813d8c000000b002d1de9ac86emr3652703ywa.459.1645121902638; Thu, 17
 Feb 2022 10:18:22 -0800 (PST)
MIME-Version: 1.0
References: <9Vw6LCkr2d2uOBanXeIuGxA1fUGGOeV1OHlgBifbmij1Afs0ISjfKK-vmcnRZfBG4GwJhIVLMisjvS_zohS-cW0FkzZaCKa6Mn7VWolznJs=@protonmail.com>
 <8be86b19-04eb-af12-a54c-e1140ac62e3f@mattcorallo.com>
 <20220217143225.GB1429@erisian.com.au>
In-Reply-To: <20220217143225.GB1429@erisian.com.au>
From: "James O'Beirne" <james.obeirne@gmail.com>
Date: Thu, 17 Feb 2022 13:18:11 -0500
Message-ID: <CAPfvXfLRBdk5-pgX3z+azO+z5DAiGhcR+JRWizhXw9TcYnPhsw@mail.gmail.com>
To: Anthony Towns <aj@erisian.com.au>
Content-Type: multipart/alternative; boundary="0000000000009e7c2b05d83acab7"
Cc: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] Thoughts on fee bumping
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Thu, 17 Feb 2022 18:18:25 -0000

--0000000000009e7c2b05d83acab7
Content-Type: text/plain; charset="UTF-8"

> Is it really true that miners do/should care about that?

De facto, any miner running an unmodified version of bitcoind doesn't
care about anything aside from ancestor fee rate, given that the
BlockAssembler as-written orders transactions for inclusion by
descending ancestor fee-rate and then greedily adds them to the block
template. [0]

If anyone has any indication that there are miners running forks of
bitcoind that change this behavior, I'd be curious to know it.

Along the lines of what AJ wrote, optimal transaction selection is
NP-hard (knapsack problem). Any time that a miner spends deciding how
to assemble the next block is time not spent grinding on the nonce, and
so I'm skeptical that miners in practice are currently doing anything
that isn't fast and simple like the default implementation: sorting
fee-rate in descending order and then greedily packing.

But it would be interesting to hear evidence to the contrary.

---

You can make the argument that transaction selection is just a function
of mempool contents, and so mempool maintenance criteria might be the
thing to look at. Mempool acceptance is gated based on a minimum
feerate[1].  Mempool eviction (when running low on space) happens on
the basis of max(self_feerate, descendant_feerate) [2]. So even in the
mempool we're still talking in terms of fee rates, not absolute fees.

That presents us with the "is/ought" problem: just because the mempool
*is* currently gating only on fee rate doesn't mean that's optimal. But
if the whole point of the mempool is to hold transactions that will be
mined, and if there's good reason that txns are chosen for mining based
on fee rate (it's quick and good enough), then it seems like fee rate
is the approximation that should ultimately prevail for txn
replacement.


[0]:
https://github.com/bitcoin/bitcoin/blob/master/src/node/miner.cpp#L310-L320
[1]:
https://github.com/bitcoin/bitcoin/blob/master/src/txmempool.cpp#L1106
[2]:
https://github.com/bitcoin/bitcoin/blob/master/src/txmempool.cpp#L1138-L1144

--0000000000009e7c2b05d83acab7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt; Is it really true that miners do/should care about th=
at?<br><br>De facto, any miner running an unmodified version of bitcoind do=
esn&#39;t<br>care about anything aside from ancestor fee rate, given that t=
he<br>BlockAssembler as-written orders transactions for inclusion by<br>des=
cending ancestor fee-rate and then greedily adds them to the block<br>templ=
ate. [0]<br><br>If anyone has any indication that there are miners running =
forks of<br>bitcoind that change this behavior, I&#39;d be curious to know =
it.<br><br>Along the lines of what AJ wrote, optimal transaction selection =
is<br>NP-hard (knapsack problem). Any time that a miner spends deciding how=
<br>to assemble the next block is time not spent grinding on the nonce, and=
<br>so I&#39;m skeptical that miners in practice are currently doing anythi=
ng<br>that isn&#39;t fast and simple like the default implementation: sorti=
ng<br>fee-rate in descending order and then greedily packing. <br><br>But i=
t would be interesting to hear evidence to the contrary.<br><br>---<br><br>=
You can make the argument that transaction selection is just a function<br>=
of mempool contents, and so mempool maintenance criteria might be the<br>th=
ing to look at. Mempool acceptance is gated based on a minimum<br>feerate[1=
].=C2=A0 Mempool eviction (when running low on space) happens on<br>the bas=
is of max(self_feerate, descendant_feerate) [2]. So even in the<br>mempool =
we&#39;re still talking in terms of fee rates, not absolute fees. <br><br>T=
hat presents us with the &quot;is/ought&quot; problem: just because the mem=
pool<br>*is* currently gating only on fee rate doesn&#39;t mean that&#39;s =
optimal. But<br>if the whole point of the mempool is to hold transactions t=
hat will be<br>mined, and if there&#39;s good reason that txns are chosen f=
or mining based<br>on fee rate (it&#39;s quick and good enough), then it se=
ems like fee rate<br>is the approximation that should ultimately prevail fo=
r txn<br>replacement.<br><br><br>[0]:<br><a href=3D"https://github.com/bitc=
oin/bitcoin/blob/master/src/node/miner.cpp#L310-L320">https://github.com/bi=
tcoin/bitcoin/blob/master/src/node/miner.cpp#L310-L320</a><br>[1]:<br><a hr=
ef=3D"https://github.com/bitcoin/bitcoin/blob/master/src/txmempool.cpp#L110=
6">https://github.com/bitcoin/bitcoin/blob/master/src/txmempool.cpp#L1106</=
a><br>[2]:<br><a href=3D"https://github.com/bitcoin/bitcoin/blob/master/src=
/txmempool.cpp#L1138-L1144">https://github.com/bitcoin/bitcoin/blob/master/=
src/txmempool.cpp#L1138-L1144</a><br></div>

--0000000000009e7c2b05d83acab7--