Return-Path: Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 401A1C002D for ; Thu, 27 Oct 2022 20:30:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 055B040105 for ; Thu, 27 Oct 2022 20:30:03 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 055B040105 Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=f/ezXC2D X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: 0.101 X-Spam-Level: X-Spam-Status: No, score=0.101 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, MANY_SPAN_IN_TEXT=2.199, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=no autolearn_force=no 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 1LYf3c5PWK3y for ; Thu, 27 Oct 2022 20:29:59 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 566CC400C4 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by smtp2.osuosl.org (Postfix) with ESMTPS id 566CC400C4 for ; Thu, 27 Oct 2022 20:29:59 +0000 (UTC) Received: by mail-io1-xd2f.google.com with SMTP id b79so2774114iof.5 for ; Thu, 27 Oct 2022 13:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=RC+aQRR++H7gSngMBv76hBLp59fibCH4UO6/eSSVyQU=; b=f/ezXC2DRogHL2K8rM731QZLEjaikUjoWRmlg8gERMhAH8MrZgUzjQwj5B9xP82a92 Po+K4J9XMrdRoeYTBzel3xTBJueKurq7zqddE0ljEctojtumvO82WcOe384RsR/dvP/9 W4v7JfeF1VLhVIsEMBMDfjF2UfKeJmVKXGk8HkiLANwkgC/e3kR5r4bkygcBtL8w4r7v L8nLQ4ZX6DOFAka/S2TcWKMTkGPF7ctngDtFFtx/QQAOHlGhbeD6KLFfAMPv9euf2FB1 FB5NydQ1WgRXLlZ/qGVLmC3titpDdRlb1fY1gNAizIx1byi2FuewRhelgMnov8dYOF3c H1gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RC+aQRR++H7gSngMBv76hBLp59fibCH4UO6/eSSVyQU=; b=TFvwArJiPNxjRfm0oJfhjsY0+NA6Lpy6Nk9+3NanEkJhYPJmGyB4u4WmMc88krtR+J nKG9y9CYnAwhM5ckTj+ERBOyx41bcL92FGhFOQyrxrbcgwOKTO+kpSM5vYqHFgUtU1hs eQIgkXvdTtJ9L9H2U9+Q0zc4aFF1YZUB+D+a/k7Nekq/r7r4IMKmF/t5mj4QqCzXfQQA Yb24lw46yErrBCtCSsjZ/huXRs8+ZBLWFMCCL2I50rlUbAjbPJ+Q0g1yUdsx8GHlXEn1 +Qnhv28ztbP5JPIi59Akumw8/IrqodheTgG2Sjo+A2839dF7ARpP9dvwY9uD6wS7YECL 7UoQ== X-Gm-Message-State: ACrzQf1B5Xo+c3nRbaF6x+4WoeIpCMXUVBBFF4UlkCtl44HaeNE3ogQU P7ri3+MsIBTvObAml11oZMki6Y/18JgDs3HMxFpZV1bYM/A= X-Google-Smtp-Source: AMsMyM5v8mJrsdmmBfxtfgjvnEiWmyMP2RN/u5NRnoJvcuHYDGyFa3qzpk3FQB5aP3bazhzSE2ZyLwIFh/qBXmQbG98= X-Received: by 2002:a05:6638:164c:b0:365:c390:3eb5 with SMTP id a12-20020a056638164c00b00365c3903eb5mr33313161jat.302.1666902598071; Thu, 27 Oct 2022 13:29:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Antoine Riard Date: Thu, 27 Oct 2022 21:29:47 +0100 Message-ID: To: Anthony Towns , Bitcoin Protocol Discussion Content-Type: multipart/alternative; boundary="0000000000003bbb3605ec0a01c2" X-Mailman-Approved-At: Thu, 27 Oct 2022 20:32:46 +0000 Subject: Re: [bitcoin-dev] On mempool policy consistency X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2022 20:30:03 -0000 --0000000000003bbb3605ec0a01c2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi AJ, Let's take the contra. I would say the current post describes the state of Bitcoin Core and beyond policy rules with a high-degree of exhaustivity and completeness, though itt what is, mostly a description. While I think it ends with a set of recommendations on what could be the relations between miners, devs and node operators w.r.t adopting policy rules, to me it doesn't explore enough the hard part of the subject. What should be actually the design goals and principles of Core's transaction-relay propagation rules of which mempool accepts ones is a subset ? By such design goals, I'm thinking either, a qualitative framework, like attacks game for a concrete application ("Can we prevent pinning against multi-party Coinjoin ?"). Or a quantitative approach, e.g how fast should be transaction-relay throughput for a given topology, or how much accurate is the block template against usual blocks [0] Assuming we would have technical principles and goals guiding our development process, of which the discussion and revision should be an inherent part of the process itself, I believe we would come up with a second-order observation. That we might not be able to satisfy every use-case with the standard set of policy rules. E.g, a contracting protocol could look for package size beyond the upper bound anti-Dos limit. Or even = the global ressources offered by the network of full-nodes are not high enough to handle some application event. E.g a Lightning Service Provider doing a liquidity maintenance round of all its counterparties, and as such force-closing and broadcasting more transactions than can be handled at the transaction-relay layer due to default MAX_PEER_TX_ANNOUNCEMENTS value. My personal take on those subjects, we might have to realize we're facing an heterogeneity of Bitcoin applications and use-cases [1]. And this sounds like a long-term upward trend, akin to the history of the Internet: mail clients, web browser, streaming applications, etc, all with different service-level requirements in terms of latency, jitters and bandwidth. We m= ight observe that Bitcoin actors might adopt individual strategies for the consumption of it. E.g a multi-party contracting protocol with asymmetric states, a counterparty could "front-run" the others at the transaction-relay to avoid encumbering the RBF penalty in case of concurrent broadcast. Or they could deploy an additive layer of communication channels, like private transaction-relay to miners, e.g a LN node broadcasting a HTLC-preimage and restraining the odds of mapping to an off-chain payment path. Those additive layers of communication can be also seen as mitigations against components failure risks, e.g a transaction-relay censorship vector in the p2p stack. To put it simply, some advanced Bitcoin applications might have to outgrow the "mempool policy rules" game, as we're currently defining it to satisfy to a higher degree their security and operational models. I think this has been historically the case with some miners deciding to join FIBER, to improve their view of mined blocks. While I still think we can come up with clear policy rules for some ideal or reasonable use-case (let's say the Bitcoin hobbyist aiming to strong censorship-resistance of its payment). And I hold the belief we can improve on that front, as we've done during the past years by formalizing a subset of policy rules in Bitcoin Core documentation. In parallel, we might acknowledge the heterogeneity of use-cases, and that we cannot offer the same level of censorship-resistance, privacy or cost-effectiveness (And that might be okay if we remember that e.g censorship-resistance between a simple Bitcoin payment and a Lightning HTLC isn't defined the same, due to the usage of timelocks by the latter). What I'm expressing is a long-term perspective, and we might be too early in the evolutionary process that is Bitcoin Core development to abandon yet the "one-size-fits-all" policy rules conception that I understand from your post. Though to me, as we progress on modularity and flexibility of the Core codebase, we might have to envision a Bitcoin ecosystem where configuring a client is on the same bar as the kernel Kconfig (hopefully not because no drivers/ but still..). Of course, you can have "blessed" config to avoid the complexity turning away node operators and users, though at the price of increasing the trust in your vendors. More concretely, about the issue of today, full-rbf, I think the lack of design heuristic in the sense of what should be the reasonable or average use-case supported by the Bitcoin base-layer transaction-relay rules. Should we favor the historical ones (0confs) or the new incumbent (contracting protocols) ? There is always the "First, do not harm" principle in lack of clear guidelines in any area of Bitcoin protocol development. Though when we're facing risk arbitrage like the current one, I don't think as protocol devs we have any strong reasoning framework. Deferring the decision to the node operators as the approach is with #25353 + #25000, did acknowledge the uncharted territory we're in with policy rules deprecation or novation. Qualifying the gradual approach of "worst" sounds to me that every policy rule will ever have to design or deploy will suffer from the same trade-off= of full-rbf. A gradual approach could be a really realistic way to move forwar= d with some experimental package formats or Dandelion-like transaction dissemination strategy. Such gradual approach of full-rbf deployment was also aiming to set the precedent that in a situation of risk arbitrage, with irreconcilable views between class of use-cases operators, the decision shouldn't be in the scope of Bitcoin Core. Hopefully, with a renewed effort of communication in the case of full-rbf, we can accommodate the maximum of use-cases risks model and move towards a coordinated approach, offering a visible and predictable timeline. Though if we fail to reach "consensus" there, we might have to fallback on the "gradual" approach, stating the full-rbf case is beyond the responsibility = of scope of Bitcoin Core. Overall, many thanks for this thoughtful post. Good for me to uplift the level of the discussion when we're hitting some bottleneck in our development process. Best, Antoine [0] https://github.com/bitcoin/bitcoin/issues/19820 [1] To be clear, this the opposite view I did express in : https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-July/018063.ht= ml After exposure and exploration of more Bitcoin use-cases and applications, and even among the different requirement among types of use-cases nodes (e.g LN mobile vs LSP), I believe more heterogeneity in the policy rules usage makes more sense Le jeu. 27 oct. 2022 =C3=A0 00:52, Anthony Towns via bitcoin-dev < bitcoin-dev@lists.linuxfoundation.org> a =C3=A9crit : > Hi *, > > TLDR: Yes, this post is too long, and there's no TLDR. If it's any > consolation, it took longer to write than it does to read? > > On Tue, Jun 15, 2021 at 12:55:14PM -0400, Antoine Riard via bitcoin-dev > wrote: > > Subject: Re: [bitcoin-dev] Proposal: Full-RBF in Bitcoin Core 24.0 > > I'm writing to propose deprecation of opt-in RBF in favor of full-RBF > > > If there is ecosystem agreement on switching to full-RBF, but 0.24 soun= ds > > too early, let's defer it to 0.25 or 0.26. I don't think Core has a > > consistent deprecation process w.r.t to policy rules heavily relied-on = by > > Bitcoin users, if we do so let sets a precedent satisfying as many folk= s > as > > we can. > > One precedent that seems to be being set here, which to me seems fairly > novel for bitcoin core, is that we're about to start supporting and > encouraging nodes to have meaningfully different mempool policies. From > what I've seen, the baseline expectation has always been that while > certainly mempools can and will differ, policies will be largely the same= : > > Firstly, there is no "the mempool". There is no global mempool. Rather > each node maintains its own mempool and accepts and rejects transaction > to that mempool using their own internal policies. Most nodes have > the same policies, but due to different start times, relay delays, > and other factors, not every node has the same mempool, although they > may be very similar. > > - > https://bitcoin.stackexchange.com/questions/98585/how-to-find-if-two-tran= sactions-in-mempool-are-conflicting > > Up until now, the differences between node policies supported by differen= t > nodes running core have been quite small, with essentially the following > options available: > > -minrelaytxfee, -maxmempool - changes the lowest fee rate you'll accept > > -mempoolexpiry - how long to keep txs in the mempool > > -datacarrier - reject txs creating OP_RETURN outputs > > -datacarriersize - maximum size of OP_RETURN data > > -permitbaremultisig - prevent relay of bare multisig > > -bytespersigop - changes how SIGOP accounting works for relay and > mining prioritisation > > as well as these, marked as "debug only" options (only shown with > -help-debug): > > -incrementalrelayfee - make it easier/harder to spam txs by only > slightly bumping the fee; marked as a "debug only" option > > -dustrelayfee - make it easier/harder to create uneconomic utxos; > marked as a "debug only" option > > -limit{descendant,ancestor}{count,size} - changes how large the > transaction chains can be; marked as a "debug only" option > > and in theory, but not available on mainnet: > > -acceptnonstdtxn - relay/mine non standard transactions > > There's also the "prioritisetransaction" rpc, which can cause you to keep > a low feerate transaction in your mempool longer than you might otherwise= . > > I think that -minrelaytxfee, -maxmempool and -mempoolexpiry are the only > ones of those options commonly set, and those only rarely result in any > differences in the txs at the top of the mempool. > > There are also quite a few parameters that aren't even runtime > configurable: > > - MAX_STANDARD_TX_WEIGHT > - MIN_STANDARD_TX_NONWITNESS_SIZE (see also #26265) > - MAX_P2SH_SIGOPS (see also #26348) > - MAX_STANDARD_TX_SIGOPS_COST > - MAX_STANDARD_P2WSH_STACK_ITEMS > - MAX_STANDARD_P2WSH_STACK_ITEM_SIZE > - MAX_STANDARD_TAPSCRIPT_STACK_ITEM_SIZE > - MAX_STANDARD_P2WSH_SCRIPT_SIZE > - MAX_STANDARD_SCRIPTSIG_SIZE > - EXTRA_DESCENDANT_TX_SIZE_LIMIT > - MAX_REPLACEMENT_CANDIDATES > > And other plausible options aren't configurable even at compile time > -- eg, core doesn't implement BIP 125's inherited signalling rule so > there's no way to enable it; core doesn't allow opting out of BIP 125 > rule 3 ratchet on absolute fee; core doesn't allow CPFP carveout with > more than 1 ancestor; core doesn't allow opting out of LOW_S checks > (even via -acceptnonstdtxn); etc. > > We also naturally have different mempool policies between different > releases: eg, expansions of policy, such as allowing OP_RETURN or > expanding it from 40 to 80 bytes or new soft forks where old nodes won't > relay transactions that use the new; and also occassional restrictions > in policy, such as the LOW_S requirement. > > > While supporting and encouraging different mempool polices might be new > for core, it's not new for knots: knots changes some of these defaults > (-permitbaremultisig defaults to false, -datacarriersize is reduced to > 42), allows the use of -acceptnonstdtxn on mainnet, and introduces new > options including -spkreuse and -mempoolreplacement (giving the latter > full rbf behaviour by default). Knots also includes a `-corepolicy` > option to make it easy to get a configuration matching core's defaults. > > > I think gmaxwell's take from Feb 2015 (in the context of how restrictive > policy on OP_RETURN data should be) was a reasonable description for > core's approach up until now: > > There is also a matter of driving competent design rather than lazy > first thing that works. E.g. In stealth addresses the early proposals > use highly inefficient single ECDH point per output instead of simply > pooling them. Network behavior is one of the few bits of friction > driving good technical design rather than "move fast, break things, and > force everyone else onto my way of doing thing rather than discussing > the design in public". No one wants to be an outright gatekeeper, > but the network is a shared resource and it's perfectly reasonable > node behavior to be stingy about the perpetual storage impact of the > transactions they're willing to process, especially when it comes to > neutral technical criteria like the amount of network irrelevant data > stuffed in transactions. > > There is also a very clear pattern we've seen in the past where > people take anything the system lets them do as strong evidence that > they have a irrevocable right to use the system in that way, and that > their only responsibility-- and if their usage harms the system it's > the responsibility of the system to not permit it. [... > ...] For mitigating these risks it's optimal if transactions > seem as uniform and indistinguishable as reasonably possible. > > - https://github.com/bitcoin/bitcoin/pull/5286#issuecomment-72564175 > > Perhaps see also sdaftuar in Nov 2015, > > To me the most important question is, is priority something that miners > want to use? > > If a non-negligible amount of hashpower intends to use it in their > transaction selection, then I think it makes sense for nodes to use it > too, because it's generally helpful to have your mempool predict the > UTXO as much as possible, and for nodes to be able to have reasonable > fee and priority estimates (which won't happen unless they track the > priority transactions somehow -- I'm presuming that miners run with > much bigger mempools than regular nodes). > > If the answer is no, then that's fine and I don't see a reason to push > in this direction. I sort of assumed there was enough hashpower mining > with priority, since last time I checked estimatepriority was still > giving meaningful results for low-ish blockheights, but I haven't done > any kind of real analysis. > > - https://github.com/bitcoin/bitcoin/pull/6992#issuecomment-155969455 > > or in June 2019, > > What this PR is proposing is to get rid of a command-line option that i= s > (a) a footgun for users and (b) does not reflect what I believe to be > the understanding most users have, which is that [X txs] are expected > to propagate well on the network. > > .. > > I don't think this rises to the level that Luke is concerned about, > namely a prelude to forcing a common relay policy on all nodes. In > particular I do agree it makes sense that we offer some ways of > customizing policy parameters (eg the mempool size, min relay fee, > etc). Instead, I think the justification for this change is that we > should not support behaviors we think are harmful to the ecosystem > overall and have no legitimate use-case, and we should eliminate ways > that users might inadvertently shoot themselves in the foot. > > - https://github.com/bitcoin/bitcoin/pull/16171#issuecomment-500393271 > > (or see discussion in https://github.com/bitcoin/bitcoin/pull/7219) > > I don't mean to imply the above are saying "there's one way to do > things and it's this way", or that the old way of doing things should > necessarily be the way we keep doing things. Just that previously core > has tended towards designing a single policy that works as well as it > can for everyone and the ecosystem as a whole. (I'm also not saying that > fullrbf can't work well for everyone or the ecosystem as a whole) > > > By contrast, I think the most common response to pushback against the > full rbf option has been along the lines of "it's just an option, we > don't want to force people", eg: > > Blaming the default false -mempoolfullrbf option for a full RBF network > would be holding Bitcoin Core developers responsible for the decisions > of individual node operators and miners. I don't think having the > option (again, default false) can directly cause a full RBF network, > and likewise, I don't think removing this option removes the "risk" > of a full RBF network. > - glozow > https://github.com/bitcoin/bitcoin/pull/26287#issuecomment-127494940= 0 > > NACK. This is a default false option. > - achow101 > https://github.com/bitcoin/bitcoin/pull/26287#issuecomment-127495320= 4 > > Erecting artificial barriers to prevent or make it difficult for users > to do what they want to do, is not appropriate behaviour. > - luke-jr > https://github.com/bitcoin/bitcoin/pull/26287#issuecomment-129072190= 5 > > I'm in general against removing options. > - instagibbs > https://github.com/bitcoin/bitcoin/pull/26287#issuecomment-129203070= 0 > > I think this differs from what core has done in the past, in that > previously we've tried to ensure a new policy is good for everyone (or as > nearly as it can be), and then enabled it as soon as it's implemented. > Any options that have been added have either been to control resource > usage in ways that don't significantly effect tx propagation, to > allow people to revert to the old behaviour when the new behaviour is > controversial (eg the -mempoolreplacement=3D0 option from 0.12 to 0.18), > and to make it easier to test/debug the implementation. > > Giving people a new relay behaviour they can opt-in to when we aren't > confident enough to turn on by default doesn't match the approach I've > seen core take in the past. > > > If this is going to be an ongoing shift in how core sees relay/mempool > policy, I think that's significant and worth paying attention to. > > I don't think it's necessary to have that shift to roll out full rbf. > The other approach would be either: > > * set -mempoolfullrbf=3Dtrue as the default for 24.0, and just have the > command line param there in case people want to do a > "UserRejectedMempoolPolicy" campaign to get everyone to opt-out > > * revert it for now because we don't think mainnet is ready for fullrbf > yet, and introduce it as default true for 25.0 or 26.0 or 27.0 or > to activate at some scheduled date in that timeframe (potentially > backporting it to previous releases to help with adoption too, > whatever). same effect as the previous option, just with a bit more > advanced notice and time to prepare > > I don't think anyone's proposed the first (which I interpret as "most of > us don't think mainnet is ready for fullrbf today"), but the comments > above are all pushback by people arguing against (the first step of) > the second approach, and they seem to be winning the day. > > It's also possible that this is something of a one time thing: full rbf > has been controversial for ages, but widely liked by devs, and other > attempts (eg making it available in knots) haven't actually achieved > much of a result in practice. So maybe this is just a special case and > not a precedent, and when people propose other default false options, > there will be substantially more resistance to them being merged, > despite all the talk about users having options that's going on right now= . > > > Assuming it is the change of direction it appears to be -- and all of > the above is really just justification for that assumption -- then like > I said, I think it's worth seriously considering what it means for people > to choose their own relay/mempool policies and for you to expect to have > different mempool policies to many or most of your potential peers. > > > One thing maybe worth noting is that is that you can still only choose > your policy from options that people write code for -- if it wasn't > something you could get by running knots or compiling a rejected PR > yourself, it won't magically become more possible now. Presumably it > would mean that once a PR is written, it might get better review (rather > than being dismissed as not suitable for everyone), and there would be > less maintenance burden than if it had to be manually rebased every > release, though (or at least the maintenance burden would be shared > across everyone working on the codebase). > > > The second thing is that whatever your relay policy is, you still > need a path all the way to miners through nodes that will accept your > transaction at every step. If you're making your mempool more restrictive > (eg -permitbaremultisig=3D0, -datacarrier=3D0), that's easy for you (thou= gh > you're making life more difficult for people who do create those sorts > of txs); but if you want a more permissive policy (package relay, > version-3-rbf, full-rbf), you might need to do some work. > > The cutoff for that is probably something like "do 30% of listening > nodes have a compatible policy"? If they do, then you'll have about a > 95% chance of having at least one of your outbound peers accept your tx, > just by random chance. If erlay allows increasing your outbound count to > 12 connections instead of 8; that might reduce down to needing just 20% > of listening nodes (~93%). > > But for cases where less than 30% (20%) of network supports your preferre= d > policy, you probably need to do something cleverer. > > One approach is to set a service bit and preferentially peer with other > nodes that advertise that service bit; knots does the first half of this > for fullrbf, and both halves have been proposed for core in #25600. > Preferential peering was previously done for the segwit deployment, > though in that case it was necessary not just for tx propogation but > also for ensuring block propogation, making it effectively a consensus > critical issue. > > Another approach is having a separate relay network -- eg, lightning node= s > already have a gossip network, and might want to help their own ecosystem > by ensuring unilateral channel closes and justice transactions are quickl= y > relayed. Using their own gossip network to relay the transaction around, > and each lightning node adding it to their local bitcoind's mempool and > allowing it to propogate (or not) from there as normal, would also be a > way of allowing transactions to propogate well. It does mean that miners > would either need to also participate in lightning gossip directly, or > that miners would need to connect to *many* peers to be confident of > seeing those transactions (eg, if only 2% of the network would see a > tx, you'd need to make 228 connections to have a 99% chance of seeing > the tx). You can't currently do something like this, because all the > relay policies are also applied when adding txs to the mempool via RPC, > and there's no convenient way to remove txs from the mempool. > > A case where something like that might occur is in preventing L2 > transactions from pinning attacks -- so you might have a high-fee, > low-feerate transaction that's been widely propogated, sitting in the > bottom of people's mempools, and you want to replace it with a smaller, > higher-feerate transaction, but don't want to pay a higher absolute fee, > and are thus blocked by BIP 125 rule 3. Perhaps 98% of the network is > unwilling to deviate from BIP 125 rule 3 for you; because that would > make it easy for random griefers to spam their mempool with large txs > then delete them while only paying a small fee; but your L2 peers may be > able to decode your replacement transaction and be sure that you aren't > going to spam them, and thus will happily relay it. > > From a technical point-of-view, that's largely fine; the downside is it > increases the centralisation pressure on mining: whether that's by having > to connect to substantially more nodes, or having to parse through more > spam, you can't just run your mining operation off a standard install > of bitcoin core anymore, but need to actively opt-in to find all the > weird unusual ways people are sending transactions around in order to > actually collect as much in fees as your competitors are. > > That's probably moderately bad for privacy as well -- if lightning or > coinjoins need special relay rules that most nodes haven't opted into, > it's potentially easy to use that to find the bitcoin nodes on the > network that are participating in those protocols, and from there to > either identify the operator, or run a DoS attack to make it hard for you > to keep doing what you want. Obviously if you're setting a service bit to > get better routing, you've given up that privacy already. Likewise if the > government or random vandals are opposed to bitcoin mining, and miners > have to have special configuration on their nodes that distinguish them > from regular users, then perhaps that makes it easier to find or shut > down their operations. > > There are a few efficiencies to be gained from similar mempool policies a= s > well: more reliable compact block reconstruction (if you're not missing > any transactions, you avoid a round-trip) and presumably more efficient > set reconstruction with erlay. You'll also waste less bandwidth sending > transactions that the other node is only going to reject. Both those > depend on how many transactions are going to rely on unusual mempool > policies in the first place though. > > ariard wrote: > > I know I've advocated in the past to turn RBF support by default in > the past. Though after gathering a lot of feedbacks, this approach > of offering the policy flexiblity to the interested users only and > favoring a full-rbf gradual deployment sounds better to me. > > - https://github.com/bitcoin/bitcoin/pull/25353#issuecomment-1157137026 > > I guess all the above leads me to think that gradual deployments of > mempool policies are likely the worse approach: even when they're not > hurting anyone, it makes them hard to use during the gradual phase, > and getting around that comes with worrying compromises on privacy and > centralisation; and when they are problematic for some, the indeterminate > nature of a gradual deployment means it's hard to plan for when that > risk is going to eventuate. > > > Theoretically, one way to recover the good parts of core deciding on > what's good for the network might be for people outside of core to > recommend a mempool configuration; then core can just have an option > to make that easy, similar to "-std=3Dc++17" for a C++ compiler, and much > the same as knots' "-corepolicy" option. > > Presuming anyone actually wants to take on that job, and listen to the > concerns of zeroconf businesses, lightning and coinjoin devs, miners, etc= ; > and can come up with something that keeps most of them happy, and that > 70% or 90% of the network ends up just following those recommendations > because it's easy, it works, and it's recommended by all the apps they > want to use, then that could work great: > > * miners don't need to do anything special, so there's no new > mining centralisation pressure > * miners and users don't reveal what they're doing with bitcoin by the w= ay > they configure their nodes, so there's no privacy problems > * devs can be fairly confident in how they have to design their apps > in order to get their transactions to most hashpower > * devs don't have to add new p2p layers to make it happen > * at least there's someone to talk to when you're trying to figure out > how to make some new project possible when it's inhibited by current > relay policies and you don't have to try to convince everyone to > upgrade on your own > * core devs just provide options, and don't have to worry about being > seen as gatekeepers > > The "downside" in that scenario is that users/dev aren't making much > actual use of all the choices core is offering by making different > options available; but the upside is that that choice is at least readily > available should whoever is coming up with these policy become out of > step with what people actually want. > > One thing that might make an approach like that difficult is that core > has historically been happy to remove options that don't seem useful > anymore: eg the ability to turn of BIP 125 support (#16171), and priority > transactions (#9602). Perhaps that's fine if you're trying to actively > craft a single mempool/relay policy that's good enough for almost everyon= e > (after all, it makes the code simpler and more efficient, and reduces > the number of footguns); all you're doing is leaving a minority of people > who want weird things to run a fork, and that's going to happen anyway. > > But if people are following policy developed outside of core, core > might well disagree with them and decide "no that's a stupid policy, > no one should do that" and remove some feature that others thing should > continue to be normal. Beyond the examples above, there's already talk of > removing the ability to disable fullrbf support in #26305, for instance. > If that happens, then the people maintaining the policy will instead > end up maintaining an entire fork of bitcoin core, and all we've done > is transition to people running software from a different repo, and a > different set of maintainers. > > If we're really going to a world where core's eager to add new options, > and reluctant to remove them, at least if anyone at all finds them > interesting, that's presumably a non-issue, though. > > Cheers, > aj > _______________________________________________ > bitcoin-dev mailing list > bitcoin-dev@lists.linuxfoundation.org > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev > --0000000000003bbb3605ec0a01c2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi AJ,


Let's take the contra.


I would say the current post describes the state of = Bitcoin Core and beyond=C2=A0policy rules with a high-degree of exhaustivity and completene= ss, though itt what is,= mostly a description. While I think it ends with a set of recommendations= =C2=A0on what could be = the relations between miners, devs and node operators w.r.t=C2=A0adopting policy rules, to me it doesn't explore enough th= e hard part of the subject.=C2=A0What should be actually the design goals and principles of= Core's transaction-relay propagation rules

of which mempool accepts ones is a subset ? By such = design goals, I'm thinking=C2=A0either, a qualitative framework, like attacks game for = a concrete application ("Can

we prevent pinning against multi-party Coinjoin ?&qu= ot;). Or a quantitative approach, e.g=C2=A0how fast should be transaction-relay throughput = for a given topology, or how much=C2=A0accurate is the block template against usual blocks [0]


Assuming we would have technical principles and goal= s guiding our development process, of which the discussion and revision should be an inhere= nt part of the process itself,=C2=A0=C2=A0I believe we would come up with a second-= order observation. That we might not be able=C2=A0to satisfy every use-case with the standard set = of policy rules. E.g, a= contracting=C2=A0proto= col could look for package size beyond the upper bound anti-Dos limit. Or e= ven=C2=A0the global res= sources offered by the network of full-nodes are not high enough to handle= =C2=A0some application = event. E.g a Lightning = Service Provider doing a liquidity maintenance=C2=A0round of all its counterparties, and as such f= orce-closing and broadcasting more transactions=C2=A0than can be handled at the transaction-relay = layer due to default MAX_PEER_TX_ANNOUNCEMENTS=C2=A0value.


My personal take on those subjects, we might have to= realize we're facing an heterogeneity of Bitcoin applications and use-cases [1]. And t= his sounds like a long-term upward trend, akin=C2=A0to the history of the Internet: mail clients, = web browser, streaming applications, etc, all=C2=A0with different service-level requirements in te= rms of latency, jitters and bandwidth. We=C2=A0might observe that Bitcoin actors might adopt indiv= idual strategies for the consumption of it.=C2=A0E.g a multi-party contracting protocol with asymmetric states, a counter= party could "front-run"=C2=A0the others at the transaction-relay to avoid encumbering th= e RBF penalty in case of concurrent=C2=A0broadcast. Or they could deploy an additive layer of comm= unication channels, like private=C2=A0transaction-relay to miners, e.g a LN node broadcasting a HT= LC-preimage and restraining=C2=A0the odds of mapping to an off-chain payment path. Those additive = layers of communication=C2=A0can be also seen as mitigations against components failure risks, e.g= a transaction-relay

censorship vector in the p2p stack. To put it simply= , some advanced Bitcoin applications=C2=A0might have to outgrow the "mempool policy ru= les" game, as we're currently defining it to=C2=A0satisfy to a higher degree their securi= ty and operational models. I think this has been=C2=A0historically the case with some miners decid= ing to join FIBER, to improve their view of=C2=A0mined blocks.


While I still think we can come up with clear policy= rules for some ideal or reasonable=C2=A0use-case (let's say the Bitcoin hobbyist aimin= g to strong censorship-resistance of its

payment). And I hold the belief we can improve on th= at front, as we've done during the=C2=A0past years by formalizing a subset of policy ru= les in Bitcoin Core documentation. In

parallel, we might acknowledge the heterogeneity of = use-cases, and that we cannot offer=C2=A0the same level of censorship-resistance, privacy o= r cost-effectiveness (And that might=C2=A0be okay if we remember that e.g censorship-resistance be= tween a simple Bitcoin payment=C2=A0and a Lightning HTLC isn't defined the same, due to the us= age of timelocks by the latter).


What I'm expressing is a long-term perspective, = and we might be too early in the=C2=A0evolutionary process that is Bitcoin Core development= to abandon yet the "one-size-fits-all"

policy rules conception that I understand from your = post. Though to me, as we progress=C2=A0on modularity and flexibility of the Core codebase,= we might have to envision a Bitcoin=C2=A0ecosystem where configuring a client is on the same bar = as the kernel Kconfig (hopefully=C2=A0not because no drivers/ but still..). Of course, you can hav= e "blessed" config to=C2=A0avoid the complexity turning away node operators and users, t= hough at the price of=C2=A0increasing the trust in your vendors.


More concretely, about the issue of today, full-rbf,= I think the lack of design=C2=A0heuristic in the sense of what should be the reasonable or= average use-case

supported by the Bitcoin base-layer transaction-rela= y rules. Should we favor the=C2=A0historical ones (0confs) or the new incumbent (contractin= g protocols) ? There=C2=A0is always the "First, do not harm" principle in lack of clear = guidelines in any=C2=A0= area of Bitcoin protocol development. Though when we're facing risk arb= itrage=C2=A0like the current one, I don't think= as protocol devs we have any strong reasoning=C2=A0framework. Deferring the decision to th= e node operators as the approach is with=C2=A0#25353 + #25000, did acknowledge the uncharted terri= tory we're in with policy rules=C2=A0deprecation or novation. Qualifying the gradual approach = of "worst" sounds to me that=C2=A0every policy rule will ever have to design or deploy w= ill suffer from the same trade-off=C2=A0of full-rbf. A gradual approach could be a really realisti= c way to move forward w= ith=C2=A0some experimen= tal package formats or Dandelion-like transaction dissemination strategy.=C2=A0Such gradual approach of full-rbf deploym= ent was also aiming to set the precedent=C2=A0that in a situation of risk arbitrage, with i= rreconcilable views between cl= ass of use-cases=C2=A0o= perators, the decision shouldn't be in the scope of Bitcoin Core.


Hopefully, with a renewed effort of communication in= the case of full-rbf, we can accommodate the=C2=A0maximum of use-cases risks model and mov= e towards a coordinated approach, offering a visible=C2=A0and predic= table timeline. Though if we f= ail to reach "consensus" there, we might have to=C2=A0fallback on the "gradual"= ; approach, stating the full-rbf case is beyond the responsibility=C2=A0of scope of Bitcoin Core.<= /span>


=

Overall, many thanks for = this thoughtful post. Good for me to uplift the level of the discussion whe= n we're hitting some bottleneck in our development process.


Best,

Antoine


[0]=C2=A0https://= github.com/bitcoin/bitcoin/issues/19820


[1] To be clear, this the opposite view I did expres= s in :=C2=A0After exposure and exploration of more Bitcoin use-c= ases and applications, and even among=C2=A0the different requirement among types of use-cas= es nodes (e.g LN mobile vs LSP), I believe=C2=A0more heterogeneity in the policy rules usage makes= more sense



Hi *,

TLDR: Yes, this post is too long, and there's no TLDR. If it's any<= br> consolation, it took longer to write than it does to read?

On Tue, Jun 15, 2021 at 12:55:14PM -0400, Antoine Riard via bitcoin-dev wro= te:
> Subject: Re: [bitcoin-dev] Proposal: Full-RBF in Bitcoin Core 24.0
> I'm writing to propose deprecation of opt-in RBF in favor of full-= RBF

> If there is ecosystem agreement on switching to full-RBF, but 0.24 sou= nds
> too early, let's defer it to 0.25 or 0.26. I don't think Core = has a
> consistent deprecation process w.r.t to policy rules heavily relied-on= by
> Bitcoin users, if we do so let sets a precedent satisfying as many fol= ks as
> we can.

One precedent that seems to be being set here, which to me seems fairly
novel for bitcoin core, is that we're about to start supporting and
encouraging nodes to have meaningfully different mempool policies. From
what I've seen, the baseline expectation has always been that while
certainly mempools can and will differ, policies will be largely the same:<= br>
=C2=A0 Firstly, there is no "the mempool". There is no global mem= pool. Rather
=C2=A0 each node maintains its own mempool and accepts and rejects transact= ion
=C2=A0 to that mempool using their own internal policies. Most nodes have =C2=A0 the same policies, but due to different start times, relay delays, =C2=A0 and other factors, not every node has the same mempool, although the= y
=C2=A0 may be very similar.

=C2=A0 - https://bitcoin.stackexchange.com/questions/98585/how-to-f= ind-if-two-transactions-in-mempool-are-conflicting

Up until now, the differences between node policies supported by different<= br> nodes running core have been quite small, with essentially the following options available:

=C2=A0-minrelaytxfee, -maxmempool - changes the lowest fee rate you'll = accept

=C2=A0-mempoolexpiry - how long to keep txs in the mempool

=C2=A0-datacarrier - reject txs creating OP_RETURN outputs

=C2=A0-datacarriersize - maximum size of OP_RETURN data

=C2=A0-permitbaremultisig - prevent relay of bare multisig

=C2=A0-bytespersigop - changes how SIGOP accounting works for relay and
=C2=A0mining prioritisation

as well as these, marked as "debug only" options (only shown with=
-help-debug):

=C2=A0-incrementalrelayfee - make it easier/harder to spam txs by only
=C2=A0slightly bumping the fee; marked as a "debug only" option
=C2=A0-dustrelayfee - make it easier/harder to create uneconomic utxos;
=C2=A0marked as a "debug only" option

=C2=A0-limit{descendant,ancestor}{count,size} - changes how large the
=C2=A0transaction chains can be; marked as a "debug only" option<= br>
and in theory, but not available on mainnet:

=C2=A0-acceptnonstdtxn - relay/mine non standard transactions

There's also the "prioritisetransaction" rpc, which can cause= you to keep
a low feerate transaction in your mempool longer than you might otherwise.<= br>
I think that -minrelaytxfee, -maxmempool and -mempoolexpiry are the only ones of those options commonly set, and those only rarely result in any
differences in the txs at the top of the mempool.

There are also quite a few parameters that aren't even runtime
configurable:

=C2=A0- MAX_STANDARD_TX_WEIGHT
=C2=A0- MIN_STANDARD_TX_NONWITNESS_SIZE (see also #26265)
=C2=A0- MAX_P2SH_SIGOPS (see also #26348)
=C2=A0- MAX_STANDARD_TX_SIGOPS_COST
=C2=A0- MAX_STANDARD_P2WSH_STACK_ITEMS
=C2=A0- MAX_STANDARD_P2WSH_STACK_ITEM_SIZE
=C2=A0- MAX_STANDARD_TAPSCRIPT_STACK_ITEM_SIZE
=C2=A0- MAX_STANDARD_P2WSH_SCRIPT_SIZE
=C2=A0- MAX_STANDARD_SCRIPTSIG_SIZE
=C2=A0- EXTRA_DESCENDANT_TX_SIZE_LIMIT
=C2=A0- MAX_REPLACEMENT_CANDIDATES

And other plausible options aren't configurable even at compile time -- eg, core doesn't implement BIP 125's inherited signalling rule s= o
there's no way to enable it; core doesn't allow opting out of BIP 1= 25
rule 3 ratchet on absolute fee; core doesn't allow CPFP carveout with more than 1 ancestor; core doesn't allow opting out of LOW_S checks
(even via -acceptnonstdtxn); etc.

We also naturally have different mempool policies between different
releases: eg, expansions of policy, such as allowing OP_RETURN or
expanding it from 40 to 80 bytes or new soft forks where old nodes won'= t
relay transactions that use the new; and also occassional restrictions
in policy, such as the LOW_S requirement.


While supporting and encouraging different mempool polices might be new
for core, it's not new for knots: knots changes some of these defaults<= br> (-permitbaremultisig defaults to false, -datacarriersize is reduced to
42), allows the use of -acceptnonstdtxn on mainnet, and introduces new
options including -spkreuse and -mempoolreplacement (giving the latter
full rbf behaviour by default). Knots also includes a `-corepolicy`
option to make it easy to get a configuration matching core's defaults.=


I think gmaxwell's take from Feb 2015 (in the context of how restrictiv= e
policy on OP_RETURN data should be) was a reasonable description for
core's approach up until now:

=C2=A0 There is also a matter of driving competent design rather than lazy<= br> =C2=A0 first thing that works. E.g. In stealth addresses the early proposal= s
=C2=A0 use highly inefficient single ECDH point per output instead of simpl= y
=C2=A0 pooling them. Network behavior is one of the few bits of friction =C2=A0 driving good technical design rather than "move fast, break thi= ngs, and
=C2=A0 force everyone else onto my way of doing thing rather than discussin= g
=C2=A0 the design in public". No one wants to be an outright gatekeepe= r,
=C2=A0 but the network is a shared resource and it's perfectly reasonab= le
=C2=A0 node behavior to be stingy about the perpetual storage impact of the=
=C2=A0 transactions they're willing to process, especially when it come= s to
=C2=A0 neutral technical criteria like the amount of network irrelevant dat= a
=C2=A0 stuffed in transactions.

=C2=A0 There is also a very clear pattern we've seen in the past where<= br> =C2=A0 people take anything the system lets them do as strong evidence that=
=C2=A0 they have a irrevocable right to use the system in that way, and tha= t
=C2=A0 their only responsibility-- and if their usage harms the system it&#= 39;s
=C2=A0 the responsibility of the system to not permit it. [...
=C2=A0 ...] For mitigating these risks it's optimal if transactions
=C2=A0 seem as uniform and indistinguishable as reasonably possible.

=C2=A0 - https://github.com/bitcoi= n/bitcoin/pull/5286#issuecomment-72564175

Perhaps see also sdaftuar in Nov 2015,

=C2=A0 To me the most important question is, is priority something that min= ers
=C2=A0 want to use?

=C2=A0 If a non-negligible amount of hashpower intends to use it in their =C2=A0 transaction selection, then I think it makes sense for nodes to use = it
=C2=A0 too, because it's generally helpful to have your mempool predict= the
=C2=A0 UTXO as much as possible, and for nodes to be able to have reasonabl= e
=C2=A0 fee and priority estimates (which won't happen unless they track= the
=C2=A0 priority transactions somehow -- I'm presuming that miners run w= ith
=C2=A0 much bigger mempools than regular nodes).

=C2=A0 If the answer is no, then that's fine and I don't see a reas= on to push
=C2=A0 in this direction. I sort of assumed there was enough hashpower mini= ng
=C2=A0 with priority, since last time I checked estimatepriority was still<= br> =C2=A0 giving meaningful results for low-ish blockheights, but I haven'= t done
=C2=A0 any kind of real analysis.

=C2=A0 - https://github.com/bitco= in/bitcoin/pull/6992#issuecomment-155969455

or in June 2019,

=C2=A0 What this PR is proposing is to get rid of a command-line option tha= t is
=C2=A0 (a) a footgun for users and (b) does not reflect what I believe to b= e
=C2=A0 the understanding most users have, which is that [X txs] are expecte= d
=C2=A0 to propagate well on the network.

=C2=A0 ..

=C2=A0 I don't think this rises to the level that Luke is concerned abo= ut,
=C2=A0 namely a prelude to forcing a common relay policy on all nodes. In =C2=A0 particular I do agree it makes sense that we offer some ways of
=C2=A0 customizing policy parameters (eg the mempool size, min relay fee, =C2=A0 etc). Instead, I think the justification for this change is that we<= br> =C2=A0 should not support behaviors we think are harmful to the ecosystem =C2=A0 overall and have no legitimate use-case, and we should eliminate way= s
=C2=A0 that users might inadvertently shoot themselves in the foot.

=C2=A0 - https://github.com/bitc= oin/bitcoin/pull/16171#issuecomment-500393271

(or see discussion in https://github.com/bitcoin/bitcoin= /pull/7219)

I don't mean to imply the above are saying "there's one way to= do
things and it's this way", or that the old way of doing things sho= uld
necessarily be the way we keep doing things. Just that previously core
has tended towards designing a single policy that works as well as it
can for everyone and the ecosystem as a whole. (I'm also not saying tha= t
fullrbf can't work well for everyone or the ecosystem as a whole)


By contrast, I think the most common response to pushback against the
full rbf option has been along the lines of "it's just an option, = we
don't want to force people", eg:

=C2=A0 Blaming the default false -mempoolfullrbf option for a full RBF netw= ork
=C2=A0 would be holding Bitcoin Core developers responsible for the decisio= ns
=C2=A0 of individual node operators and miners. I don't think having th= e
=C2=A0 option (again, default false) can directly cause a full RBF network,=
=C2=A0 and likewise, I don't think removing this option removes the &qu= ot;risk"
=C2=A0 of a full RBF network.
=C2=A0 =C2=A0- glozow
=C2=A0 =C2=A0 =C2=A0https://git= hub.com/bitcoin/bitcoin/pull/26287#issuecomment-1274949400

=C2=A0 NACK. This is a default false option.
=C2=A0 =C2=A0- achow101
=C2=A0 =C2=A0 =C2=A0https://git= hub.com/bitcoin/bitcoin/pull/26287#issuecomment-1274953204

=C2=A0 Erecting artificial barriers to prevent or make it difficult for use= rs
=C2=A0 to do what they want to do, is not appropriate behaviour.
=C2=A0 =C2=A0- luke-jr
=C2=A0 =C2=A0 =C2=A0https://git= hub.com/bitcoin/bitcoin/pull/26287#issuecomment-1290721905

=C2=A0 I'm in general against removing options.
=C2=A0 =C2=A0- instagibbs
=C2=A0 =C2=A0 =C2=A0https://git= hub.com/bitcoin/bitcoin/pull/26287#issuecomment-1292030700

I think this differs from what core has done in the past, in that
previously we've tried to ensure a new policy is good for everyone (or = as
nearly as it can be), and then enabled it as soon as it's implemented.<= br> Any options that have been added have either been to control resource
usage in ways that don't significantly effect tx propagation, to
allow people to revert to the old behaviour when the new behaviour is
controversial (eg the -mempoolreplacement=3D0 option from 0.12 to 0.18), and to make it easier to test/debug the implementation.

Giving people a new relay behaviour they can opt-in to when we aren't confident enough to turn on by default doesn't match the approach I'= ;ve
seen core take in the past.


If this is going to be an ongoing shift in how core sees relay/mempool
policy, I think that's significant and worth paying attention to.

I don't think it's necessary to have that shift to roll out full rb= f.
The other approach would be either:

=C2=A0* set -mempoolfullrbf=3Dtrue as the default for 24.0, and just have t= he
=C2=A0 =C2=A0command line param there in case people want to do a
=C2=A0 =C2=A0"UserRejectedMempoolPolicy" campaign to get everyone= to opt-out

=C2=A0* revert it for now because we don't think mainnet is ready for f= ullrbf
=C2=A0 =C2=A0yet, and introduce it as default true for 25.0 or 26.0 or 27.0= or
=C2=A0 =C2=A0to activate at some scheduled date in that timeframe (potentia= lly
=C2=A0 =C2=A0backporting it to previous releases to help with adoption too,=
=C2=A0 =C2=A0whatever). same effect as the previous option, just with a bit= more
=C2=A0 =C2=A0advanced notice and time to prepare

I don't think anyone's proposed the first (which I interpret as &qu= ot;most of
us don't think mainnet is ready for fullrbf today"), but the comme= nts
above are all pushback by people arguing against (the first step of)
the second approach, and they seem to be winning the day.

It's also possible that this is something of a one time thing: full rbf=
has been controversial for ages, but widely liked by devs, and other
attempts (eg making it available in knots) haven't actually achieved much of a result in practice. So maybe this is just a special case and
not a precedent, and when people propose other default false options,
there will be substantially more resistance to them being merged,
despite all the talk about users having options that's going on right n= ow.


Assuming it is the change of direction it appears to be -- and all of
the above is really just justification for that assumption -- then like
I said, I think it's worth seriously considering what it means for peop= le
to choose their own relay/mempool policies and for you to expect to have different mempool policies to many or most of your potential peers.


One thing maybe worth noting is that is that you can still only choose
your policy from options that people write code for -- if it wasn't
something you could get by running knots or compiling a rejected PR
yourself, it won't magically become more possible now.=C2=A0 Presumably= it
would mean that once a PR is written, it might get better review (rather than being dismissed as not suitable for everyone), and there would be
less maintenance burden than if it had to be manually rebased every
release, though (or at least the maintenance burden would be shared
across everyone working on the codebase).


The second thing is that whatever your relay policy is, you still
need a path all the way to miners through nodes that will accept your
transaction at every step. If you're making your mempool more restricti= ve
(eg -permitbaremultisig=3D0, -datacarrier=3D0), that's easy for you (th= ough
you're making life more difficult for people who do create those sorts<= br> of txs); but if you want a more permissive policy (package relay,
version-3-rbf, full-rbf), you might need to do some work.

The cutoff for that is probably something like "do 30% of listening nodes have a compatible policy"? If they do, then you'll have abou= t a
95% chance of having at least one of your outbound peers accept your tx, just by random chance. If erlay allows increasing your outbound count to 12 connections instead of 8; that might reduce down to needing just 20%
of listening nodes (~93%).

But for cases where less than 30% (20%) of network supports your preferred<= br> policy, you probably need to do something cleverer.

One approach is to set a service bit and preferentially peer with other
nodes that advertise that service bit; knots does the first half of this for fullrbf, and both halves have been proposed for core in #25600.
Preferential peering was previously done for the segwit deployment,
though in that case it was necessary not just for tx propogation but
also for ensuring block propogation, making it effectively a consensus
critical issue.

Another approach is having a separate relay network -- eg, lightning nodes<= br> already have a gossip network, and might want to help their own ecosystem by ensuring unilateral channel closes and justice transactions are quickly<= br> relayed. Using their own gossip network to relay the transaction around, and each lightning node adding it to their local bitcoind's mempool and=
allowing it to propogate (or not) from there as normal, would also be a
way of allowing transactions to propogate well. It does mean that miners would either need to also participate in lightning gossip directly, or
that miners would need to connect to *many* peers to be confident of
seeing those transactions (eg, if only 2% of the network would see a
tx, you'd need to make 228 connections to have a 99% chance of seeing the tx). You can't currently do something like this, because all the relay policies are also applied when adding txs to the mempool via RPC,
and there's no convenient way to remove txs from the mempool.

A case where something like that might occur is in preventing L2
transactions from pinning attacks -- so you might have a high-fee,
low-feerate transaction that's been widely propogated, sitting in the bottom of people's mempools, and you want to replace it with a smaller,=
higher-feerate transaction, but don't want to pay a higher absolute fee= ,
and are thus blocked by BIP 125 rule 3. Perhaps 98% of the network is
unwilling to deviate from BIP 125 rule 3 for you; because that would
make it easy for random griefers to spam their mempool with large txs
then delete them while only paying a small fee; but your L2 peers may be able to decode your replacement transaction and be sure that you aren't=
going to spam them, and thus will happily relay it.

From a technical point-of-view, that's largely fine; the downside is it=
increases the centralisation pressure on mining: whether that's by havi= ng
to connect to substantially more nodes, or having to parse through more
spam, you can't just run your mining operation off a standard install of bitcoin core anymore, but need to actively opt-in to find all the
weird unusual ways people are sending transactions around in order to
actually collect as much in fees as your competitors are.

That's probably moderately bad for privacy as well -- if lightning or coinjoins need special relay rules that most nodes haven't opted into,<= br> it's potentially easy to use that to find the bitcoin nodes on the
network that are participating in those protocols, and from there to
either identify the operator, or run a DoS attack to make it hard for you to keep doing what you want. Obviously if you're setting a service bit = to
get better routing, you've given up that privacy already. Likewise if t= he
government or random vandals are opposed to bitcoin mining, and miners
have to have special configuration on their nodes that distinguish them
from regular users, then perhaps that makes it easier to find or shut
down their operations.

There are a few efficiencies to be gained from similar mempool policies as<= br> well: more reliable compact block reconstruction (if you're not missing=
any transactions, you avoid a round-trip) and presumably more efficient
set reconstruction with erlay. You'll also waste less bandwidth sending=
transactions that the other node is only going to reject. Both those
depend on how many transactions are going to rely on unusual mempool
policies in the first place though.

ariard wrote:

=C2=A0 I know I've advocated in the past to turn RBF support by default= in
=C2=A0 the past. Though after gathering a lot of feedbacks, this approach =C2=A0 of offering the policy flexiblity to the interested users only and =C2=A0 favoring a full-rbf gradual deployment sounds better to me.

=C2=A0 - https://github.com/bit= coin/bitcoin/pull/25353#issuecomment-1157137026

I guess all the above leads me to think that gradual deployments of
mempool policies are likely the worse approach: even when they're not hurting anyone, it makes them hard to use during the gradual phase,
and getting around that comes with worrying compromises on privacy and
centralisation; and when they are problematic for some, the indeterminate nature of a gradual deployment means it's hard to plan for when that risk is going to eventuate.


Theoretically, one way to recover the good parts of core deciding on
what's good for the network might be for people outside of core to
recommend a mempool configuration; then core can just have an option
to make that easy, similar to "-std=3Dc++17" for a C++ compiler, = and much
the same as knots' "-corepolicy" option.

Presuming anyone actually wants to take on that job, and listen to the
concerns of zeroconf businesses, lightning and coinjoin devs, miners, etc;<= br> and can come up with something that keeps most of them happy, and that
70% or 90% of the network ends up just following those recommendations
because it's easy, it works, and it's recommended by all the apps t= hey
want to use, then that could work great:

=C2=A0* miners don't need to do anything special, so there's no new=
=C2=A0 =C2=A0mining centralisation pressure
=C2=A0* miners and users don't reveal what they're doing with bitco= in by the way
=C2=A0 =C2=A0they configure their nodes, so there's no privacy problems=
=C2=A0* devs can be fairly confident in how they have to design their apps<= br> =C2=A0 =C2=A0in order to get their transactions to most hashpower
=C2=A0* devs don't have to add new p2p layers to make it happen
=C2=A0* at least there's someone to talk to when you're trying to f= igure out
=C2=A0 =C2=A0how to make some new project possible when it's inhibited = by current
=C2=A0 =C2=A0relay policies and you don't have to try to convince every= one to
=C2=A0 =C2=A0upgrade on your own
=C2=A0* core devs just provide options, and don't have to worry about b= eing
=C2=A0 =C2=A0seen as gatekeepers

The "downside" in that scenario is that users/dev aren't maki= ng much
actual use of all the choices core is offering by making different
options available; but the upside is that that choice is at least readily available should whoever is coming up with these policy become out of
step with what people actually want.

One thing that might make an approach like that difficult is that core
has historically been happy to remove options that don't seem useful anymore: eg the ability to turn of BIP 125 support (#16171), and priority transactions (#9602). Perhaps that's fine if you're trying to activ= ely
craft a single mempool/relay policy that's good enough for almost every= one
(after all, it makes the code simpler and more efficient, and reduces
the number of footguns); all you're doing is leaving a minority of peop= le
who want weird things to run a fork, and that's going to happen anyway.=

But if people are following policy developed outside of core, core
might well disagree with them and decide "no that's a stupid polic= y,
no one should do that" and remove some feature that others thing shoul= d
continue to be normal. Beyond the examples above, there's already talk = of
removing the ability to disable fullrbf support in #26305, for instance. If that happens, then the people maintaining the policy will instead
end up maintaining an entire fork of bitcoin core, and all we've done is transition to people running software from a different repo, and a
different set of maintainers.

If we're really going to a world where core's eager to add new opti= ons,
and reluctant to remove them, at least if anyone at all finds them
interesting, that's presumably a non-issue, though.

Cheers,
aj
_______________________________________________
bitcoin-dev mailing list
= bitcoin-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mail= man/listinfo/bitcoin-dev
--0000000000003bbb3605ec0a01c2--