summaryrefslogtreecommitdiff
path: root/e3/3a71bb31f0a5238712cfb7e858ccaab5583251
blob: 6c3b1daaa5fc8e92cd9c21cdf090bb857ed28985 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
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
Return-Path: <eric@voskuil.org>
Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])
 by lists.linuxfoundation.org (Postfix) with ESMTP id C962EC002D
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 25 May 2022 20:52:12 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by smtp4.osuosl.org (Postfix) with ESMTP id B1DC0410BD
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 25 May 2022 20:52:12 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level: 
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5
 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001]
 autolearn=ham autolearn_force=no
Authentication-Results: smtp4.osuosl.org (amavisd-new);
 dkim=pass (2048-bit key) header.d=voskuil-org.20210112.gappssmtp.com
Received: from smtp4.osuosl.org ([127.0.0.1])
 by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id FLgWKRdU10zA
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 25 May 2022 20:52:08 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.8.0
Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com
 [IPv6:2607:f8b0:4864:20::42f])
 by smtp4.osuosl.org (Postfix) with ESMTPS id CF46940761
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 25 May 2022 20:52:08 +0000 (UTC)
Received: by mail-pf1-x42f.google.com with SMTP id j6so20225688pfe.13
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 25 May 2022 13:52:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=voskuil-org.20210112.gappssmtp.com; s=20210112;
 h=from:to:references:in-reply-to:subject:date:message-id:mime-version
 :content-transfer-encoding:content-language:thread-index;
 bh=PNZQ9+Ai2bh346c27Byk4TEhOPos7BrszswLDpxsvXg=;
 b=VqmWKOFbSqywTRnSLGdA752ZwqGONnKoWtPzmOPlipImb+fkGTaVNc/ddyAi2UtzbB
 qp4uJfCN33GtPCi3XAZ/CBg/7HMaJrH6VAEK4BWNGxlrI7YrI+/dJUZw70ZhpRvDtkoa
 acGXMae8sIoLYFqKDSjs50KNOzFEDFZ9UM+CSujZ0IQMX1ISTF70LoNUbXHn6vd5/WJD
 EnPGIPPRGYdPJsUA89JwG2eTSA9VpGz/8Lf0qcLCURQlGUHhDa0N7LUQIbCC1m6dSaJh
 xfQHXyhk/ueBnsDynK+H3Ecmk+REr6gIrVhtlGMmdOxf+NfTHP1wnQYxuQSNiXqld1Y0
 IA9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:references:in-reply-to:subject:date
 :message-id:mime-version:content-transfer-encoding:content-language
 :thread-index;
 bh=PNZQ9+Ai2bh346c27Byk4TEhOPos7BrszswLDpxsvXg=;
 b=oK9Hi5fsDUVV8PcUUCsIxNB6rvaOBAtl+A/PuLsv/em0ihwf0N6QH6dk+7xJvuHvOK
 VzUqje58eabhXx3SzenD8Vv94+hAeHMHflCRZfHy3KNXHxBNGi6KPZ+YIXrTcjUfIQAA
 ijD5VcVybh7aKGIhADgA9aM4ibEF61jq9SdACmcKtNjDl/NVI5d1M7RAqpqn48/4iBxE
 m+UP4UIUDT34Y8Gobg6UDtMZHbtatY1QDbZ/AP/3hqy+/pU0Zn/xyjmPskag3+j1VRi+
 MLynDRgtkai94Fw9n5gXaxscYy/gqB9T6scWTYu0hGugqgiZpu2RRyfwLNn2Xe744Zlj
 WQ0A==
X-Gm-Message-State: AOAM530GTJcUsyQTTN/KXfiiHkBpAEB9BSrFHlijsjVgBQlNGu8/e7uZ
 yKos6GYSHa7CcKu/HT8nYLYnig==
X-Google-Smtp-Source: ABdhPJwyC7luDrtnajXW1V1XE1ldVQDIneb4V2QUJvLnq7/hwQGaLAAaT/LzmThno6Q447neMb3R0g==
X-Received: by 2002:a63:6987:0:b0:3db:1c36:13aa with SMTP id
 e129-20020a636987000000b003db1c3613aamr30365034pgc.119.1653511928127; 
 Wed, 25 May 2022 13:52:08 -0700 (PDT)
Received: from ERICDESKTOP ([50.35.67.197]) by smtp.gmail.com with ESMTPSA id
 m10-20020a637d4a000000b003c14af505fcsm8778605pgn.20.2022.05.25.13.52.07
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 25 May 2022 13:52:07 -0700 (PDT)
From: <eric@voskuil.org>
To: "'Anthony Towns'" <aj@erisian.com.au>,
 "'Bitcoin Protocol Discussion'" <bitcoin-dev@lists.linuxfoundation.org>,
 "'Gloria Zhao'" <gloriajzhao@gmail.com>
References: <CAFXO6=JROe_9ih2h+_CCH-UbxehsM5RQ6YyNnPesEpveBEtdow@mail.gmail.com>
 <20220518003531.GA4402@erisian.com.au>
 <CAFXO6=LWM4eHM=zJhejw5981+8h7QHTbwpz0jEbWkrLOX0037Q@mail.gmail.com>
 <20220523213416.GA6151@erisian.com.au>
 <CAFXO6=KXToP2MFWQ1JVKX6jV++utw8E4Z13T4cH+mfgtyeUx_A@mail.gmail.com>
 <2B3D1901-901C-4000-A2B9-F6857FCE2847@erisian.com.au>
 <CAFXO6=K6FXNFwOZ3VyT6_RZY2F2BX+iTy+MyOshRBfNnn9Hqyg@mail.gmail.com>
 <8FFE048D-854F-4D34-85DA-CE523C16EEB0@erisian.com.au>
In-Reply-To: <8FFE048D-854F-4D34-85DA-CE523C16EEB0@erisian.com.au>
Date: Wed, 25 May 2022 13:52:07 -0700
Message-ID: <017501d87079$4c08f9c0$e41aed40$@voskuil.org>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-us
Thread-Index: AQIovTqWCntex56Gpr5DNDTNBglPqgKABWBKAZhodHoBKe+mXgGXgGG4Af/QDV4BmL8ksgJ05ADzrCgkFgA=
Subject: Re: [bitcoin-dev] Package Relay Proposal
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Wed, 25 May 2022 20:52:12 -0000

> From: bitcoin-dev <bitcoin-dev-bounces@lists.linuxfoundation.org> On
Behalf
> Of Anthony Towns via bitcoin-dev
> Sent: Wednesday, May 25, 2022 11:56 AM

> So the other thing is what happens if the peer announcing packages to us
is
> dishonest?
> 
> They announce pkg X, say X has parents A B C and the fee rate is garbage.
But
> actually X has parent D and the fee rate is excellent. Do we request the
> package from another peer, or every peer, to double check? Otherwise we're
> allowing the first peer we ask about a package to censor that tx from us?
> 
> I think the fix for that is just to provide the fee and weight when
announcing
> the package rather than only being asked for its info? Then if one peer
makes
> it sound like a good deal you ask for the parent txids from them, dedupe,
> request, and verify they were honest about the parents.

Single tx broadcasts do not carry an advertised fee rate, however the'
feefilter' message (BIP133) provides this distinction. This should be
interpreted as applicable to packages. Given this message there is no reason
to send a (potentially bogus) fee rate with every package. It can only be
validated by obtaining the full set of txs, and the only recourse is
dropping (etc.) the peer, as is the case with single txs. Relying on the
existing message is simpler, more consistent, and more efficient.

> >> Is it plausible to add the graph in?
> 
> Likewise, I think you'd have to have the graph info from many nodes if
you're
> going to make decisions based on it and don't want hostile peers to be
able to
> trick you into ignoring txs.
> 
> Other idea: what if you encode the parent txs as a short hash of the wtxid
> (something like bip152 short ids? perhaps seeded per peer so collisions
will
> be different per peer?) and include that in the inv announcement? Would
> that work to avoid a round trip almost all of the time, while still giving
you
> enough info to save bw by deduping parents?

As I suggested earlier, a package is fundamentally a compact block (or
block) announcement without the header. Compact block (BIP152) announcement
is already well-defined and widely implemented. A node should never be
required to retain an orphan, and BIP152 ensures this is not required.

Once a validated set of txs within the package has been obtained with
sufficient fee, a fee-optimal node would accept the largest subgraph of the
package that conforms to fee constraints and drop any peer that provides a
package for which the full graph does not.

Let us not reinvent the wheel and/or introduce accidental complexity. I see
no reason why packaging is not simply BIP152 without the 'header' field, an
updated protocol version, and the following sort of changes to names:

sendpkg
MSG_CMPCT_PKG
cmpctpkg
getpkgtxn
pkgtxn

> > For a maximum 25 transactions,
> >23*24/2 = 276, seems like 36 bytes for a child-with-parents package.
> 
> If you're doing short ids that's maybe 25*4B=100B already, then the above
is
> up to 36% overhead, I guess. Might be worth thinking more about, but maybe
> more interesting with ancestors than just parents.
> 
> >Also side note, since there are no size/count params,

Size is restricted in the same manner as block and transaction broadcasts,
by consensus. If the fee rate is sufficient there would be no reason to
preclude any valid size up to what can be mined in one block (packaging
across blocks is not economically rational under the assumption that one
miner cannot expect to mine multiple blocks in a row). Count is incorporated
into BIP152 as 'shortids_length'.

> > wondering if we
> >should just have "version" in "sendpackages" be a bit field instead of
> >sending a message for each version. 32 versions should be enough right?

Adding versioning to individual protocols is just a reflection of the
insufficiency of the initial protocol versioning design, and that of the
various ad-hoc changes to it (including yet another approach in this
proposal) that have been introduced to compensate for it, though I'll
address this in an independent post at some point.

Best,
e

> Maybe but a couple of messages per connection doesn't really seem worth
> arguing about?
> 
> Cheers,
> aj
> 
> 
> --
> Sent from my phone.
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev