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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
|
Delivery-date: Fri, 31 Jan 2025 04:09:23 -0800
Received: from mail-qv1-f56.google.com ([209.85.219.56])
by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
(Exim 4.94.2)
(envelope-from <bitcoindev+bncBAABB2P26K6AMGQEKPCEYLA@googlegroups.com>)
id 1tdppq-0007NY-Dx
for bitcoindev@gnusha.org; Fri, 31 Jan 2025 04:09:23 -0800
Received: by mail-qv1-f56.google.com with SMTP id 6a1803df08f44-6d8e6046f0fsf29722416d6.2
for <bitcoindev@gnusha.org>; Fri, 31 Jan 2025 04:09:22 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1738325356; cv=pass;
d=google.com; s=arc-20240605;
b=lcVGqFdj4Bu3CR/OqOD3BdToKqLlIIHXW1jg7p85TZlPnH6LwFaqtkbVRBKTouSNas
JPR8BxKd7JzgaKir8M9ol+dNQ304TXgVjSi6GeH2X37AztE3uN4ALApwaeZgxekxDO9v
EnmtP/UM8VzgAjCX5Zz4rkCKgQInzFIOIcwdfzlt5FhBUZXgRzlrfwxzENgrRzOS1MZH
f71yWXl6Y9uVGfdRomX0zZvARcQdjNuXl7Ai943zD2p3UX5DNZP9oMWNhCouoObLwl4u
6m/83eJFfgH1K0Tfya2dHcVLIQSHYmjYBnQLv1wqbgT21/D1/0YFmIM6DpP6XrT8N8Rq
l8fQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:reply-to:content-transfer-encoding
:mime-version:feedback-id:references:in-reply-to:message-id:subject
:from:to:date:dkim-signature;
bh=hx9HtIBMcj4R5h8iuy3F0sC+vsBTX2RPVWUFUMem4/Y=;
fh=I0faLV3XTEaLWFozCds9Tc/bJFpP0aLZhXtRpNq9lTI=;
b=HqB/hzlDGxZkh6G3CsGgXICEPArU7omupHCzAU4SPoyevkzXlLBBlTirk+zbeCjQRZ
2po9We/28GhiSzkjzXorOxg0zoMNBn2wAPnkOVwWa8BJxwvYtZO8a5tHplw443Y/nH0v
R6Y747GhUWlTnNGHA+HaJhEYp3sBiIZL7bHAKWNTXmu6TOV/foZzskC7oiZHB7PMTsyt
jiCgiUlkvCcsEQqabFcMOYZwG+GhLlI3SM1QJlRSbvsAyrHVBJ0GyL/mP3eGy3vJQPsu
h3SEWL9IEsMF5FuCEzCyW8Hlit53BGbmp4F+JRRA4APUi7RIWN69aRPJdkpu2mKZyE2o
jwhw==;
darn=gnusha.org
ARC-Authentication-Results: i=2; gmr-mx.google.com;
dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=XZxMUCHI;
spf=pass (google.com: domain of armchaircryptologist@protonmail.com designates 185.70.40.133 as permitted sender) smtp.mailfrom=ArmchairCryptologist@protonmail.com;
dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=googlegroups.com; s=20230601; t=1738325356; x=1738930156; darn=gnusha.org;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:reply-to
:x-original-authentication-results:x-original-sender
:content-transfer-encoding:mime-version:feedback-id:references
:in-reply-to:message-id:subject:from:to:date:from:to:cc:subject:date
:message-id:reply-to;
bh=hx9HtIBMcj4R5h8iuy3F0sC+vsBTX2RPVWUFUMem4/Y=;
b=asIzr9Q9BRsliixTcg0Ow5hFRlc0VNsSY97J25/OqPCAYzGyJ6xs7TroWpR7SswV4n
cOsnlVGuX1QK9dZFz1MBmpcvTyi1gydckIOs37bs97X0K9L0PBI6y9s5gLegxQkwxkhO
biNr8Du0IA96zm/iuuEFvYxRyEcnV65zEIf0gl65RMXrN3SyCXD4+dbQ4ONHoK/NNs9i
9CK4Q6NhRYCYnkeg3UYSLvJj6f9uLEDW6Bkn5lVnljxFvdT0O9WRUK2s6+XzJl1vNDs+
dSc9Ala2U69hc4YnZR/LstTvanl4vDt8/i2QCbE4NgY1aNm8q1iM12qdE3D86LpQNAwa
qqJw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1738325356; x=1738930156;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:reply-to
:x-original-authentication-results:x-original-sender
:content-transfer-encoding:mime-version:feedback-id:references
:in-reply-to:message-id:subject:from:to:date:x-beenthere
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=hx9HtIBMcj4R5h8iuy3F0sC+vsBTX2RPVWUFUMem4/Y=;
b=Pn0QV/iFeiOX86lsSB7kcUfD3j6RCQyqYCrTnIWUZ0Mw0oCFMCH2Pf0xLZTJ1tQX4V
LOtqFNgKuB0MAw4VxVcVvVxHTwi67fEeeJE751pn3Jjni4u3PXhqva4JCjtS/8BSDrCl
3ZsBZeMAvNrBvZFoOp98HiJmYTYOHjcCZgOiB+w5G0Bn9b8j5tkIqJxHI2cj+Cy24Imu
GQ+82IVEKqC/lFZt5xjx3de1x3Ec2Dv9Zjd5HRtSNSJfdpw9wKcDcag5ZTztI0J24JMv
B6dMORILpaI8H44zxyp6CVTwcPMSJBtwaGo1luqxd3YuWdD0YOTsS5pjPVk7bddnKq1I
2rAQ==
X-Forwarded-Encrypted: i=2; AJvYcCWsEUR8qz39o5r21sCYXl2mKzZHbgcktxSgosbx6IZHKxlbvffsat7WebPIn+q2iXXfT4NSVz8lJcY3@gnusha.org
X-Gm-Message-State: AOJu0Yy3ogE64f9lFiw9OQBS02ngaFnmSbulGESe/XwjP9QWMypOntSO
QeJTK6XLnLdxsWqC+E4BkqSUlIc+C07yt21HfY8ZAxMn6YB6S72T
X-Google-Smtp-Source: AGHT+IGPWfg8sXmyCslSjMvr94TXh1lnsoqzfsywOJYa1l52qQQdIDphy9syefAjt6t4efHMnXnCvQ==
X-Received: by 2002:a05:622a:410:b0:46c:79a4:5574 with SMTP id d75a77b69052e-46fd0a7fdb4mr153663451cf.4.1738325356129;
Fri, 31 Jan 2025 04:09:16 -0800 (PST)
X-BeenThere: bitcoindev@googlegroups.com
Received: by 2002:ac8:6d0a:0:b0:466:a845:1c92 with SMTP id d75a77b69052e-46fdcf6d4d9ls8549921cf.1.-pod-prod-07-us;
Fri, 31 Jan 2025 04:09:13 -0800 (PST)
X-Received: by 2002:a05:620a:8084:b0:7b6:67a6:5adb with SMTP id af79cd13be357-7bffcce1d80mr1776758885a.21.1738325353094;
Fri, 31 Jan 2025 04:09:13 -0800 (PST)
Received: by 2002:a05:620a:8518:b0:7b6:dcc4:6708 with SMTP id af79cd13be357-7c00acf8b44ms85a;
Fri, 31 Jan 2025 04:03:05 -0800 (PST)
X-Received: by 2002:a05:6402:3589:b0:5dc:1f35:552 with SMTP id 4fb4d7f45d1cf-5dc5efad96emr9669433a12.1.1738324983620;
Fri, 31 Jan 2025 04:03:03 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1738324983; cv=none;
d=google.com; s=arc-20240605;
b=QMGq3JWOKoEt8h+B3tmugbvXAUE3ATytjPG7iEhYuE5Lk+rJ6CgiULtcMk0eYIKJci
x2yYEpQFjhjrGmmTASFV6wZym9Yc4sjoiFCDTEEElTwQOO/9hO7DLot3W/umrPIQH1dF
fTB5Zt3SB86yWJxMLxKr9rv7af0+9xxHDo7VFLb8Gd/JGtQRKmcioria/GUwbfOT0GtG
HrmoKXLgCp81EOaO8BAC0wlT11cgdojCspriFTy6clN4MHJbIPDwXZPyQ4CsZA+I0x3v
XtX3mqNmqVxlUBbaq/CroZS1FI79jOut4hnNhCyfyyRKtaR7N7fJIktyntyIUo22b7AH
+iVw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
h=content-transfer-encoding:mime-version:feedback-id:references
:in-reply-to:message-id:subject:from:to:date:dkim-signature;
bh=Y/STmggVYwfKa0t7ywlKs02BMbrtXM0X+02z7+HEIcw=;
fh=VcGcg+Zjs9gw1uDcHbxsAILhBAcecnbJzZRdxgKVDIc=;
b=lyrXJTV5lODConMlkoPCqmvL58lTXjMxyGER+KcjlnPYlpctkik1mq4+HnM5VZ14tG
kbq2QhUeKwh9BdiUvEt8snZ8yidbUbUCnhOHvD2necTn7F40c+OHvfJohdntNPOvRO6Y
nM5gZWyUFaxP6gmfRLghiQqNCn75uS+TdCrsd2pbYW2vFqVPXw63tHLuvpTk2ELT9Ago
uRcnKgH2d114aVORNmDR0vcvasHszC+73VDsbZuL0gi3Ll6D4U9HI8d73JYfqN7OKy00
0QoZp4rIXqpcMrfxZoaoVW9eWIKSRCzV1Wzq+cZUQNYJM5xEhdY+8IH5X2UHS6o2XVrh
+DOw==;
dara=google.com
ARC-Authentication-Results: i=1; gmr-mx.google.com;
dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=XZxMUCHI;
spf=pass (google.com: domain of armchaircryptologist@protonmail.com designates 185.70.40.133 as permitted sender) smtp.mailfrom=ArmchairCryptologist@protonmail.com;
dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com
Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch. [185.70.40.133])
by gmr-mx.google.com with ESMTPS id 4fb4d7f45d1cf-5dc723d249esi106008a12.1.2025.01.31.04.03.03
for <bitcoindev@googlegroups.com>
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Fri, 31 Jan 2025 04:03:03 -0800 (PST)
Received-SPF: pass (google.com: domain of armchaircryptologist@protonmail.com designates 185.70.40.133 as permitted sender) client-ip=185.70.40.133;
Date: Fri, 31 Jan 2025 12:02:56 +0000
To: bitcoindev@googlegroups.com
From: "'ArmchairCryptologist' via Bitcoin Development Mailing List" <bitcoindev@googlegroups.com>
Subject: Re: [bitcoindev] Transaction expiration should be based on the most
recent transaction in a group, not the first
Message-ID: <rqLkuDekAhYC8mO9BMrqXGQjv-Oq1a1jA2EDLdiohq9kHIQpE-MpzqFjqY15Cc5flU_GUrE7NoSxB_4wgkQg8Mv8IQdtzlXLtuxK76n7YRQ=@protonmail.com>
In-Reply-To: <Z5lZc28t9-tCxdHN@petertodd.org>
References: <Z5lZc28t9-tCxdHN@petertodd.org>
Feedback-ID: 24244585:user:proton
X-Pm-Message-ID: f7f289391c0a2808aed7028f9382b877735f51ae
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Original-Sender: armchaircryptologist@protonmail.com
X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass
header.i=@protonmail.com header.s=protonmail3 header.b=XZxMUCHI;
spf=pass (google.com: domain of armchaircryptologist@protonmail.com
designates 185.70.40.133 as permitted sender) smtp.mailfrom=ArmchairCryptologist@protonmail.com;
dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com
X-Original-From: ArmchairCryptologist <ArmchairCryptologist@protonmail.com>
Reply-To: ArmchairCryptologist <ArmchairCryptologist@protonmail.com>
Precedence: list
Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com
List-ID: <bitcoindev.googlegroups.com>
X-Google-Group-Id: 786775582512
List-Post: <https://groups.google.com/group/bitcoindev/post>, <mailto:bitcoindev@googlegroups.com>
List-Help: <https://groups.google.com/support/>, <mailto:bitcoindev+help@googlegroups.com>
List-Archive: <https://groups.google.com/group/bitcoindev
List-Subscribe: <https://groups.google.com/group/bitcoindev/subscribe>, <mailto:bitcoindev+subscribe@googlegroups.com>
List-Unsubscribe: <mailto:googlegroups-manage+786775582512+unsubscribe@googlegroups.com>,
<https://groups.google.com/group/bitcoindev/subscribe>
X-Spam-Score: -1.0 (-)
Is expiration-based mempool eviction necessary or even desirable anymore? I=
'm consistently seeing unconfirmed transactions from months ago being rebro=
adcast and (now that the mempool is draining) eventually confirming, withou=
t anyone even trying to exploit anything. So from what I can tell, the only=
thing this really accomplishes is wasting CPU cycles and bandwidth evictin=
g and later re-accepting the transactions in question.
You were never able to rely on unconfirmed transactions ever going away wit=
hout double-spending one of the inputs in the first place, and full-RBF is =
even a thing now, so this will always be possible.
The mempool is capped by size anyway, so while I may be missing something, =
I cannot honestly see any good reasons to keep this mechanism at all, espec=
ially if it can be used as a vector for attacks.
The only drawback I can think of is that abandontransaction currently does =
not work if a transaction is in the mempool, but it would probably be bette=
r to improve it so it actually evicts the transaction from the mempool of t=
he local node if necessary.
--
Best,
ArmchairCryptologist
On Tuesday, January 28th, 2025 at 11:25 PM, Peter Todd <pete@petertodd.org>=
wrote:
> Disclaimer: I haven't actually tested this. So there is a chance I'm
> understanding the code entirely wrong. If so, feel free to make fun of
> me for being too lazy to actually test this.
>=20
>=20
> In Bitcoin Core, mempool expiration is done by:
>=20
> int CTxMemPool::Expire(std::chrono::seconds time)
> {
> AssertLockHeld(cs);
> indexed_transaction_set::index<entry_time>::type::iterator it =3D mapTx.g=
et<entry_time>().begin();
>=20
> setEntries toremove;
> while (it !=3D mapTx.get<entry_time>().end() && it->GetTime() < time) {
>=20
> toremove.insert(mapTx.project<0>(it));
>=20
> it++;
> }
> setEntries stage;
> for (txiter removeit : toremove) {
> CalculateDescendants(removeit, stage);
> }
> RemoveStaged(stage, false, MemPoolRemovalReason::EXPIRY);
> return stage.size();
> }
>=20
> https://github.com/bitcoin/bitcoin/blob/b432e367427f1f9fe0f0a5800e31e496f=
00cd38d/src/txmempool.cpp#L1086
>=20
> This function is expiring transactions based on their entry time into
> the mempool, a value that is set once and never changed. Transactions
> are removed unconditionally on expiration, whether or not they have
> descendents. That means that if you broadcast A, wait just prior to A's
> expiration, and broadcast B, a transaction spending an output of A, B
> will be evicted immediately when A's expiration time is reached.
>=20
> There's at least three problems with this:
>=20
> 1) It's dumb. If I do a CPFP on an old transaction, I want that
> transaction to get mined and am willing to pay money. It's silly to make
> me jump through the hoop of rebroadcasting it again when it expires.
>=20
> 2) It's a free-relay DoS attack: just prior to A expiring, I could
> broadcast B, a very large transaction, and use up bandwidth for "free".
> Frankly, I'm not very concerned about this. But if you care, you
> should fix this.
>=20
> 3) Expiration could maybe be leveraged in transaction cycling attacks:
> https://stacker.news/items/866680
>=20
> Personally, I'm not convinced that transaction expiration is actually a
> good idea. The best argument for it IMO is in the case of some
> soft-fork-style screwup where you're allowing stuff into your mempool
> that will never get mined. But that means something is seriously wrong
> to begin with - you probably should fix that. Otherwise, it's not
> uncommon for transactions that are months old to eventually get mined.
> Do we really need to waste bandwidth re-relaying them in the meantime?
>=20
> --
> https://petertodd.org 'peter'[:-1]@petertodd.org
>=20
> --
> You received this message because you are subscribed to the Google Groups=
"Bitcoin Development Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it, send an=
email to bitcoindev+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/bitcoinde=
v/Z5lZc28t9-tCxdHN%40petertodd.org.
--=20
You received this message because you are subscribed to the Google Groups "=
Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to bitcoindev+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/=
rqLkuDekAhYC8mO9BMrqXGQjv-Oq1a1jA2EDLdiohq9kHIQpE-MpzqFjqY15Cc5flU_GUrE7NoS=
xB_4wgkQg8Mv8IQdtzlXLtuxK76n7YRQ%3D%40protonmail.com.
|