From mboxrd@z Thu Jan 1 00:00:00 1970 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 ) 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 ; 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 (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" Subject: Re: [bitcoindev] Transaction expiration should be based on the most recent transaction in a group, not the first Message-ID: In-Reply-To: References: 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 Reply-To: ArmchairCryptologist Precedence: list Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com List-ID: X-Google-Group-Id: 786775582512 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , 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 = 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::type::iterator it =3D mapTx.g= et().begin(); >=20 > setEntries toremove; > while (it !=3D mapTx.get().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.