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
251
252
253
254
|
Delivery-date: Tue, 28 Jan 2025 15:09:50 -0800
Received: from mail-qt1-f185.google.com ([209.85.160.185])
by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
(Exim 4.94.2)
(envelope-from <bitcoindev+bncBDRYHVHZTUGRBNGH4W6AMGQECASEXPA@googlegroups.com>)
id 1tcuiL-0007jX-Nf
for bitcoindev@gnusha.org; Tue, 28 Jan 2025 15:09:50 -0800
Received: by mail-qt1-f185.google.com with SMTP id d75a77b69052e-467919046fbsf3814861cf.0
for <bitcoindev@gnusha.org>; Tue, 28 Jan 2025 15:09:49 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1738105783; cv=pass;
d=google.com; s=arc-20240605;
b=gj11XNJOUUaY252plysnO8JMYJnW0QRxtrqmWfV8UZfrfWvoO4tFahrolZpIsSuQnR
n5pCqT+hGgNESlJ5MnWLYHz4CNsg29zjRWRfC6XDlZYv0HKY2RoCZOgdlOKGXazEcQ2U
WxDNShn864jsoqGyCa/X6ClKm7T/z240ZnyvF8hc0MOmzeeWs1N8bMLuYaPeXqgZHnf6
7ppHC6GeLqdrLuGt7tk2hqLaNyBT9yoB6Qqrv7p2d1l/vwb7NVfg48U5Dvvu5mhegskP
3P1T1K/S2ua4AgQjoA7oMQAnZ817yEE+7h0X3pt5jROfEPw52HBxwPMiZrDQ2paEwmcn
fyDQ==
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:content-disposition:mime-version
:message-id:subject:to:from:date:feedback-id:sender:dkim-signature;
bh=2HsBJb/jD/1mzVtd/lpo6n5TDlFcHuquBJbtFvKT5ug=;
fh=uN9bHO+j1MgPCf8EziQpxFpPRwW95qsP/zl3pfJcAxE=;
b=NcI7iR5kMeN8Hh77hZ86g4hhgTQ4pO9XI1qNdC2zADPhLXhUzkx/3Ebqgj7k70J3vT
Q60Y6YBbvom5GxkkwKVNf6KDezMwRvSUK83HdklgwD4UO+6Si5zW4eFxJ7rdEcZmF97D
moj14F9f05ReTY6bHMKCyvAH7rygV06zb+AMcygEVyWT0XAI5P/ZMdNWjWMyIB5jG+MC
lstwCpeEgDzKH3Q5YuDxLl/KSFEk9fCbn+ue0tYUmNKkf+QOQEquwlmjFLKl/NWquWIc
GaoQGwGWd3P49ZVrMRVXvQxpwMljO99jS7YIXh6xjCYGDoT41a0qXhPTIJRTdTSHEqnP
wubA==;
darn=gnusha.org
ARC-Authentication-Results: i=2; gmr-mx.google.com;
dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=TSSCl88W;
spf=pass (google.com: domain of pete@petertodd.org designates 202.12.124.156 as permitted sender) smtp.mailfrom=pete@petertodd.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=googlegroups.com; s=20230601; t=1738105783; x=1738710583; darn=gnusha.org;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:x-original-authentication-results
:x-original-sender:content-disposition:mime-version:message-id
:subject:to:from:date:feedback-id:sender:from:to:cc:subject:date
:message-id:reply-to;
bh=2HsBJb/jD/1mzVtd/lpo6n5TDlFcHuquBJbtFvKT5ug=;
b=OP7ChSFs7Hqy35wpl7Fzg4tL5Cc3R0w4PzSPjNbwSPQJLYp5/B2zhF7vo4/EGis2qW
z/NhwSQYo8jf6Qqd8oV+KzWfwV4G7KwAJSoJn8Y9ap3tZRkZMhYtJKm/8pM9mQX0Lpjr
MxU95tR/Ms2Mx21KsjKW9fzbzdeHJNglyW6C0elTVCLyjrHQCQ1PfPkUopktyDTp0WbM
oswoDseXVloqzwFJDQea0mJpNYKUBxgZ7xqfGJeCJVxQRGrk+JDG87MgwB7xL2fv5ybs
kXXtedekMaw4Y0l7Vt1Y2L7rul6jP0cGUkP0REplagPegnP5gU+BsjzUXYdEy8fltuc9
pR2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1738105783; x=1738710583;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:x-original-authentication-results
:x-original-sender:content-disposition:mime-version:message-id
:subject:to:from:date:feedback-id:x-beenthere:x-gm-message-state
:sender:from:to:cc:subject:date:message-id:reply-to;
bh=2HsBJb/jD/1mzVtd/lpo6n5TDlFcHuquBJbtFvKT5ug=;
b=RbnsBArG249y8HXiumbTnR9bJX4GD1wFnCHtN7DwT3Y1mBx5tAjbK9Dwii0oPz4U2m
tgcfgelJJW/SyDfNXpFqKq+kpV1YL98TouZtSwtfPbIzNNHV0FwuuYQJLucE11e0ypAA
zCSMNf+/IwIr6mbBK1KoHtbno1yIN43jWdYU+ed/lVL4JXYRi2DAZcwOinvnn83/4NbL
GdPphykmrwWHQyU1kIkpamiC4YhZtCxuSwWaxOErGVzT6+QW/yeYBPaQPwCQmQVJSLcR
SLG+o4iLVgAkSaAVs3JINob026G5ipqncQ0fiHUKeVwq3MhynrSqf0LAX9OWVqlx3TXm
g6nw==
Sender: bitcoindev@googlegroups.com
X-Forwarded-Encrypted: i=2; AJvYcCXuSM4hHAxD8iFdyWP9+AUi4Kro7ee4NteDCOWTv9dhD1J8A492gh8zjManBqRR0f9/3tdGW2xJbFa9@gnusha.org
X-Gm-Message-State: AOJu0YwdsIqkSQJIrkZYgZPnT5Q8tewzq1eRUgVGApPEFoOPJo2yHCX9
cGTVaBEEOc0BGdMx804Z78ktwBEWcRl/f9MLdCPBeaCRZ7eYk06J
X-Google-Smtp-Source: AGHT+IHPiT9T2q/rsjMmlfzLpebaldDEZxUauJ3B5bDrxsLUsRBcRl82MQzUxbC37OavNkgPGv0lwQ==
X-Received: by 2002:a05:622a:259b:b0:46e:2d0b:e1bf with SMTP id d75a77b69052e-46fc49a94d2mr79123591cf.11.1738105783629;
Tue, 28 Jan 2025 15:09:43 -0800 (PST)
X-BeenThere: bitcoindev@googlegroups.com
Received: by 2002:a05:622a:a00a:b0:469:63f:ce07 with SMTP id
d75a77b69052e-46e5b3e8d30ls31705571cf.0.-pod-prod-00-us; Tue, 28 Jan 2025
15:09:40 -0800 (PST)
X-Received: by 2002:a05:620a:2551:b0:7b6:d51b:819a with SMTP id af79cd13be357-7bff3f5c023mr774247085a.5.1738105780494;
Tue, 28 Jan 2025 15:09:40 -0800 (PST)
Received: by 2002:a05:620a:8220:b0:7b6:67a8:4fcd with SMTP id af79cd13be357-7bffc990de5ms85a;
Tue, 28 Jan 2025 14:25:58 -0800 (PST)
X-Received: by 2002:a05:6214:2686:b0:6e1:715f:cdf5 with SMTP id 6a1803df08f44-6e243aa4688mr15482436d6.15.1738103157472;
Tue, 28 Jan 2025 14:25:57 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1738103157; cv=none;
d=google.com; s=arc-20240605;
b=XOdcPT91Zk+0h8QFbM9BqsmTWyf/j1R0xgniN/JallGwmm7JFIXTYAlusI16iruql9
i3sufV/uszuX6PhpqAJXisrJPGUrElsS+A4uzjS8WMwRQpZ28nycWmHZ+R5JWez0ECED
VEFZcNMk88xn4/Zv8N43RRdtA/jPulvgpv+B/8v179EjB4pLby2eMDXCr3AtkPIHkLGl
m07cxOz6jCpRgMbB5AMm394iV6jNKAK+c0r2+H5eTEau4uASbp44GeLjFSnYDX1K45yC
nJ8sUZLFWQVH7T6IORFRY463sHVGheqFkYg9+no10axkLnPWh0ZJTOJ2K5yf5AaQlc2e
7PiA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
h=content-disposition:mime-version:message-id:subject:to:from:date
:feedback-id:dkim-signature;
bh=gh9B+Vgl1IKwYRN5ZGcVzvWGq8Qt67/ii8w0B3QWymU=;
fh=VcGcg+Zjs9gw1uDcHbxsAILhBAcecnbJzZRdxgKVDIc=;
b=BhByQsgJaxhrW5dguOucBqDo4V1rBdEewKC6vAwtdgyIhmhInct+mR+KBGIYVKpSjL
FDu2gmeqLouNJB86KRHO+aJHffSZgiLMwcetLvVBDo7O9X6UJdtvNAqPX44lSs0fiw6g
KQKWCfaJyLNIT3m2LJon+LMNytRzSylmUbzll3F2rpcvNIOHN5eJIPiSdrOvXYkUs2lX
QE8Ya3AV/DzMDV9XoK7yHJMwjuJ1hcNLVHOp8/KDxcaNblJebyc0/Xpy7pKE+E3EsHfC
xkPf+A4OPBt3K2GmHZSufpMoD4dKtdt9+QPSUz1rlVdlQMKQhDaWJ+HWRhPwIbpSuys/
6/Iw==;
dara=google.com
ARC-Authentication-Results: i=1; gmr-mx.google.com;
dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=TSSCl88W;
spf=pass (google.com: domain of pete@petertodd.org designates 202.12.124.156 as permitted sender) smtp.mailfrom=pete@petertodd.org
Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com. [202.12.124.156])
by gmr-mx.google.com with ESMTPS id 6a1803df08f44-6e2047b14f4si2972186d6.0.2025.01.28.14.25.57
for <bitcoindev@googlegroups.com>
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Tue, 28 Jan 2025 14:25:57 -0800 (PST)
Received-SPF: pass (google.com: domain of pete@petertodd.org designates 202.12.124.156 as permitted sender) client-ip=202.12.124.156;
Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48])
by mailfhigh.stl.internal (Postfix) with ESMTP id F1BA9254017A
for <bitcoindev@googlegroups.com>; Tue, 28 Jan 2025 17:25:56 -0500 (EST)
Received: from phl-mailfrontend-01 ([10.202.2.162])
by phl-compute-08.internal (MEProxy); Tue, 28 Jan 2025 17:25:57 -0500
X-ME-Sender: <xms:dFmZZ6WtYUwoB5yuuzPqxQjKkRpqs9iNnEXCKboB4yMD4cbIJMzNqQ>
<xme:dFmZZ2lJq7leoSrOTfrCnENcYeKyQGqLtCnBeWWaTnVcj7txYuqrLg66LdybMBET4
UqBbbXaAK7p8J7SxVg>
X-ME-Received: <xmr:dFmZZ-bvDqSGEkI9olSI_eEttERxV-wVUP56fG7JAbCG0YrkmRlxt7LWCw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvdekucetufdoteggodetrfdotf
fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu
rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuf
fkgggtugesghdtreertddtvdenucfhrhhomheprfgvthgvrhcuvfhougguuceophgvthgv
sehpvghtvghrthhouggurdhorhhgqeenucggtffrrghtthgvrhhnpeelfeejgefhhfegke
ejffeuudelgfdvvedvheejfedtledvffdtheeufeeltefhieenucffohhmrghinhepghhi
thhhuhgsrdgtohhmpdhsthgrtghkvghrrdhnvgifshdpphgvthgvrhhtohguugdrohhrgh
enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvght
vgesphgvthgvrhhtohguugdrohhrghdpnhgspghrtghpthhtohepuddpmhhouggvpehsmh
htphhouhhtpdhrtghpthhtohepsghithgtohhinhguvghvsehgohhoghhlvghgrhhouhhp
shdrtghomh
X-ME-Proxy: <xmx:dFmZZxU10CYFHaMfgQTYkBi-wf-cuxQB_mlTWy6kc6y65CMo4c76VQ>
<xmx:dFmZZ0k89_fdHI4zWcfJuJ19vKIc5PzHxq61GlYCJQFMbwFIPuKkVQ>
<xmx:dFmZZ2fdoBYhAG5c2RGuyXB1NkMIczxlFDaOrrSRjV1G3TJAhLvn4w>
<xmx:dFmZZ2Fg-gimUaY4XzfsIa1P3LaykK5qKd_CfWiN-ed1TniIAzxnQQ>
<xmx:dFmZZ1A6GSyFbGHWV24PxON8KhgG3-tOv0Bc68hiKnxCorGn977bcbyC>
Feedback-ID: i525146e8:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA for
<bitcoindev@googlegroups.com>; Tue, 28 Jan 2025 17:25:56 -0500 (EST)
Received: by localhost (Postfix, from userid 1000)
id 48D1B9FC5E; Tue, 28 Jan 2025 22:25:55 +0000 (UTC)
Date: Tue, 28 Jan 2025 22:25:55 +0000
From: Peter Todd <pete@petertodd.org>
To: bitcoindev@googlegroups.com
Subject: [bitcoindev] Transaction expiration should be based on the most
recent transaction in a group, not the first
Message-ID: <Z5lZc28t9-tCxdHN@petertodd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
protocol="application/pgp-signature"; boundary="Hj9tucSajlRuErux"
Content-Disposition: inline
X-Original-Sender: pete@petertodd.org
X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass
header.i=@messagingengine.com header.s=fm3 header.b=TSSCl88W; spf=pass
(google.com: domain of pete@petertodd.org designates 202.12.124.156 as
permitted sender) smtp.mailfrom=pete@petertodd.org
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: -0.8 (/)
--Hj9tucSajlRuErux
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
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.
In Bitcoin Core, mempool expiration is done by:
int CTxMemPool::Expire(std::chrono::seconds time)
{
AssertLockHeld(cs);
indexed_transaction_set::index<entry_time>::type::iterator it = mapTx.get<entry_time>().begin();
setEntries toremove;
while (it != mapTx.get<entry_time>().end() && it->GetTime() < time) {
toremove.insert(mapTx.project<0>(it));
it++;
}
setEntries stage;
for (txiter removeit : toremove) {
CalculateDescendants(removeit, stage);
}
RemoveStaged(stage, false, MemPoolRemovalReason::EXPIRY);
return stage.size();
}
https://github.com/bitcoin/bitcoin/blob/b432e367427f1f9fe0f0a5800e31e496f00cd38d/src/txmempool.cpp#L1086
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.
There's at least three problems with this:
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.
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.
3) Expiration could maybe be leveraged in transaction cycling attacks:
https://stacker.news/items/866680
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?
--
https://petertodd.org 'peter'[:-1]@petertodd.org
--
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/bitcoindev/Z5lZc28t9-tCxdHN%40petertodd.org.
--Hj9tucSajlRuErux
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEE0RcYcKRzsEwFZ3N5Lly11TVRLzcFAmeZWXEACgkQLly11TVR
LzehsBAAu8SAEAN65zj5sl7Vi9EX6sVvmFJ1/V3shVXFrajZfkBG8d8l03KT0e2c
23RkOqXyVprOtVuk6IY+o8PsfgMUEQwcjX9bP6FOHCnJzJ5SXUmalZkpDOFA9x8X
JIELTB4szMM7OGJ/SWZ2yCcc5RwYz5x/bmlaEjRUS8nZzwqnv2tsIPxorJPnHw6U
pfwm6BNqyhzWxGspkL9kkKhlb7x7myozDL9Up5AwiUir71XZh8uQ/Zbx7nfYMFIh
QPC3NeJ1j+r3fjo90CkWhyZKm/YExcNg90kBDCvlZp5tOsg+Y4WmmWQTa1NzKyEe
2NOqO2FkL73uV2QExJNXl7P+X513PDffOIuD1ydac6jeR3yQIaqKDCZRw7qmBxev
uoHW0cQoVdBrfM9KG8/drYFjGpWI4eR7Hf829fXJwwBNFdatqvg82aa1fZYzMUIs
RXm7rfmFYdsmylNYS8OgFUzGtwR1/wdSPCKo6OGWbiWqStiOCu119WynfWVuk3XU
YRGFOfOcV05PYFBHJTrQ1qOBKTTYcAmWNZSUxrn8oFp2kEJaQh6KVa1wttZqy8HQ
Hutt33nK/IFcaZg4l0eDwijXH4u+7oq0ZEyr3G1BaxFvlRyaa43w1ZcGn6yZvjOd
AHfBoGwcCAq9vywF+o3nDlZxR0fss9Tuy24AkEY2h+zcqoUt5+k=
=Kx8H
-----END PGP SIGNATURE-----
--Hj9tucSajlRuErux--
|