summaryrefslogtreecommitdiff
path: root/46/397d30e6f9a7c60df85337d134201c7a022dc6
blob: 1ace04ad9e1e821b4acafee4cbf7d96b197d9496 (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
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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
Return-Path: <jlrubin@mit.edu>
Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])
 by lists.linuxfoundation.org (Postfix) with ESMTP id EFD91C0051
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Fri, 21 Aug 2020 21:08:50 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by silver.osuosl.org (Postfix) with ESMTP id B144F2309D
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Fri, 21 Aug 2020 21:08:50 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from silver.osuosl.org ([127.0.0.1])
 by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id YuuSFIXTIQXi
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Fri, 21 Aug 2020 21:08:48 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6
Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])
 by silver.osuosl.org (Postfix) with ESMTPS id 717F223086
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Fri, 21 Aug 2020 21:08:48 +0000 (UTC)
Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com
 [209.85.218.49]) (authenticated bits=0)
 (User authenticated as jlrubin@ATHENA.MIT.EDU)
 by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 07LL8jT2024788
 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT)
 for <bitcoin-dev@lists.linuxfoundation.org>; Fri, 21 Aug 2020 17:08:46 -0400
Received: by mail-ej1-f49.google.com with SMTP id qc22so4033420ejb.4
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Fri, 21 Aug 2020 14:08:46 -0700 (PDT)
X-Gm-Message-State: AOAM5318ogsXWvU3M0ibYNbrk3A1x00mak7BlJKPmGvMBF1UEL5VaEn+
 8IgtLMIC8t9z12faXQaBLc7yxkKGFDSxGpCwe8w=
X-Google-Smtp-Source: ABdhPJx7y0EiyoB80zD62Yn9uCRUdGnnv+NHOVkfacYI/dumDl6KppiXXvZU4mnN4CRKBXbdtVTRC4m6p9j7TCTPoeM=
X-Received: by 2002:a17:907:20db:: with SMTP id
 qq27mr4927419ejb.550.1598044125620; 
 Fri, 21 Aug 2020 14:08:45 -0700 (PDT)
MIME-Version: 1.0
References: <A26FA2BC-50E5-4635-95E4-56AAA969C9DA@mattcorallo.com>
 <B514142F-382B-4D49-B68D-0115ECBD1D79@voskuil.org>
 <CAD5xwhi9zVp3nOhFy3Hia_Md++Gdz+F5Kat_bbbZwBcmPhMGZA@mail.gmail.com>
 <b6198e1a-c30b-358a-9673-247a7c305913@mattcorallo.com>
In-Reply-To: <b6198e1a-c30b-358a-9673-247a7c305913@mattcorallo.com>
From: Jeremy <jlrubin@mit.edu>
Date: Fri, 21 Aug 2020 14:08:33 -0700
X-Gmail-Original-Message-ID: <CAD5xwhhrz8SMQ4bA6eD2VRwqmMEzVv7NmrD8kDnPfqJy092bKQ@mail.gmail.com>
Message-ID: <CAD5xwhhrz8SMQ4bA6eD2VRwqmMEzVv7NmrD8kDnPfqJy092bKQ@mail.gmail.com>
To: Matt Corallo <lf-lists@mattcorallo.com>
Content-Type: multipart/alternative; boundary="00000000000071765605ad69a4c2"
Cc: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] Generalizing feature negotiation when new p2p
 connections are setup
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: Fri, 21 Aug 2020 21:08:51 -0000

--00000000000071765605ad69a4c2
Content-Type: text/plain; charset="UTF-8"

Actually we already have service bits (which are sadly limited) which allow
negotiation of non bilateral feature support, so this would supercede that.
--
@JeremyRubin <https://twitter.com/JeremyRubin>
<https://twitter.com/JeremyRubin>


On Fri, Aug 21, 2020 at 1:45 PM Matt Corallo <lf-lists@mattcorallo.com>
wrote:

> This seems to be pretty overengineered. Do you have a specific use-case in
> mind for anything more than simply continuing
> the pattern we've been using of sending a message indicating support for a
> given feature? If we find some in the future,
> we could deploy something like this, though the current proposal makes it
> possible to do it on a per-feature case.
>
> The great thing about Suhas' proposal is the diff is about -1/+1 (not
> including tests), while still getting all the
> flexibility we need. Even better, the code already exists.
>
> Matt
>
> On 8/21/20 3:50 PM, Jeremy wrote:
> > I have a proposal:
> >
> > Protocol >= 70016 cease to send or process VERACK, and instead use
> HANDSHAKEACK, which is completed after feature
> > negotiation.
> >
> > This should make everyone happy/unhappy, as in a new protocol number
> it's fair game to change these semantics to be
> > clear that we're acking more than version.
> >
> > I don't care about when or where these messages are sequenced overall,
> it seems to have minimal impact. If I had free
> > choice, I slightly agree with Eric that verack should come before
> feature negotiation, as we want to divorce the idea
> > that protocol number and feature support are tied.
> >
> > But once this is done, we can supplant Verack with HANDSHAKENACK or
> HANDSHAKEACK to signal success or failure to agree
> > on a connection. A NACK reason (version too high/low or an important
> feature missing) could be optional. Implicit NACK
> > would be disconnecting, but is discouraged because a peer doesn't know
> if it should reconnect or the failure was
> > intentional.
> >
> > ------
> >
> > AJ: I think I generally do prefer to have a FEATURE wrapper as you
> suggested, or a rule that all messages in this period
> > are interpreted as features (and may be redundant with p2p message types
> -- so you can literally just use the p2p
> > message name w/o any data).
> >
> > I think we would want a semantic (which could be based just on message
> names, but first-class support would be nice) for
> > ACKing that a feature is enabled. This is because a transcript of:
> >
> > NODE0:
> > FEATURE A
> > FEATURE B
> > VERACK
> >
> > NODE1:
> > FEATURE A
> > VERACK
> >
> > It remains unclear if Node 1 ignored B because it's an unknown feature,
> or because it is disabled. A transcript like:
> >
> > NODE0:
> > FEATURE A
> > FEATURE B
> > FEATURE C
> > ACK A
> > VERACK
> >
> > NODE1:
> > FEATURE A
> > ACK A
> > NACK B
> > VERACK
> >
> > would make it clear that A and B are known, B is disabled, and C is
> unknown. C has 0 support, B Node 0 should support
> > inbound messages but knows not to send to Node 1, and A has full
> bilateral support. Maybe instead it could a message
> > FEATURE SEND A and FEATURE RECV A, so we can make the split explicit
> rather than inferred from ACK/NACK.
> >
> >
> > ------
> >
> > I'd also propose that we add a message which is SYNC, which indicates
> the end of a list of FEATURES and a request to
> > send ACKS or NACKS back (which are followed by a SYNC). This allows
> multi-round negotiation where based on the presence
> > of other features, I may expand the set of features I am offering. I
> think you could do without SYNC, but there are more
> > edge cases and the explicitness is nice given that this already
> introduces future complexity.
> >
> > This multi-round makes it an actual negotiation rather than a pure
> announcement system. I don't think it would be used
> > much in the near term, but it makes sense to define it correctly now.
> Build for the future and all...
> >
> >
> >
> > --
> > @JeremyRubin <https://twitter.com/JeremyRubin><
> https://twitter.com/JeremyRubin>
>

--00000000000071765605ad69a4c2
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:arial,he=
lvetica,sans-serif;font-size:small;color:#000000">Actually we already have =
service bits (which are sadly limited) which allow negotiation of non bilat=
eral feature support, so this would supercede that.<br clear=3D"all"></div>=
<div><div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_sig=
nature"><div dir=3D"ltr">--<br><a href=3D"https://twitter.com/JeremyRubin" =
target=3D"_blank">@JeremyRubin</a><a href=3D"https://twitter.com/JeremyRubi=
n" target=3D"_blank"></a></div></div></div><br></div><br><div class=3D"gmai=
l_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Aug 21, 2020 at 1:45=
 PM Matt Corallo &lt;<a href=3D"mailto:lf-lists@mattcorallo.com">lf-lists@m=
attcorallo.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex">This seems to be pretty overengineered. Do you have a specifi=
c use-case in mind for anything more than simply continuing <br>
the pattern we&#39;ve been using of sending a message indicating support fo=
r a given feature? If we find some in the future, <br>
we could deploy something like this, though the current proposal makes it p=
ossible to do it on a per-feature case.<br>
<br>
The great thing about Suhas&#39; proposal is the diff is about -1/+1 (not i=
ncluding tests), while still getting all the <br>
flexibility we need. Even better, the code already exists.<br>
<br>
Matt<br>
<br>
On 8/21/20 3:50 PM, Jeremy wrote:<br>
&gt; I have a proposal:<br>
&gt; <br>
&gt; Protocol &gt;=3D 70016 cease to send or process VERACK, and instead us=
e HANDSHAKEACK, which is completed after feature <br>
&gt; negotiation.<br>
&gt; <br>
&gt; This should make everyone happy/unhappy, as in a new protocol number i=
t&#39;s fair game to change these semantics to be <br>
&gt; clear that we&#39;re acking more than version.<br>
&gt; <br>
&gt; I don&#39;t care about when or where these messages are sequenced over=
all, it seems to have minimal impact. If I had free <br>
&gt; choice, I slightly agree with Eric that verack should come before feat=
ure negotiation, as we want to divorce the idea <br>
&gt; that protocol number and feature support are tied.<br>
&gt; <br>
&gt; But once this is done, we can supplant Verack with HANDSHAKENACK or HA=
NDSHAKEACK to signal success or failure to agree <br>
&gt; on a connection. A NACK reason (version too high/low or an important f=
eature missing) could be optional. Implicit NACK <br>
&gt; would be disconnecting, but is discouraged because a peer doesn&#39;t =
know if it should reconnect or the failure was <br>
&gt; intentional.<br>
&gt; <br>
&gt; ------<br>
&gt; <br>
&gt; AJ: I think I generally do prefer to have a FEATURE wrapper as you sug=
gested, or a rule that all messages in this period <br>
&gt; are interpreted as features (and may be redundant with p2p message typ=
es -- so you can literally just use the p2p <br>
&gt; message name w/o any data).<br>
&gt; <br>
&gt; I think we would want a semantic (which could be based just on message=
 names, but first-class support would be nice) for <br>
&gt; ACKing that a feature is enabled. This is because a transcript of:<br>
&gt; <br>
&gt; NODE0:<br>
&gt; FEATURE A<br>
&gt; FEATURE B<br>
&gt; VERACK<br>
&gt; <br>
&gt; NODE1:<br>
&gt; FEATURE A<br>
&gt; VERACK<br>
&gt; <br>
&gt; It remains unclear if Node 1 ignored B because it&#39;s an unknown fea=
ture, or because it is disabled. A transcript like:<br>
&gt; <br>
&gt; NODE0:<br>
&gt; FEATURE A<br>
&gt; FEATURE B<br>
&gt; FEATURE C<br>
&gt; ACK A<br>
&gt; VERACK<br>
&gt; <br>
&gt; NODE1:<br>
&gt; FEATURE A<br>
&gt; ACK A<br>
&gt; NACK B<br>
&gt; VERACK<br>
&gt; <br>
&gt; would make it clear that A and B are known, B is disabled, and C is un=
known. C has 0 support, B Node 0 should support <br>
&gt; inbound messages but knows not to send to Node 1, and A has full bilat=
eral support. Maybe instead it could a message <br>
&gt; FEATURE SEND A and FEATURE RECV A, so we can make the split explicit r=
ather than inferred from ACK/NACK.<br>
&gt; <br>
&gt; <br>
&gt; ------<br>
&gt; <br>
&gt; I&#39;d also propose that we add a message which is SYNC, which indica=
tes the end of a list of FEATURES and a request to <br>
&gt; send ACKS or NACKS back (which are followed by a SYNC). This allows mu=
lti-round negotiation where based on the presence <br>
&gt; of other features, I may expand the set of features I am offering. I t=
hink you could do without SYNC, but there are more <br>
&gt; edge cases and the explicitness is nice given that this already introd=
uces future complexity.<br>
&gt; <br>
&gt; This multi-round makes it an actual negotiation rather than a pure ann=
ouncement system. I don&#39;t think it would be used <br>
&gt; much in the near term, but it makes sense to define it correctly now. =
Build for the future and all...<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; --<br>
&gt; @JeremyRubin &lt;<a href=3D"https://twitter.com/JeremyRubin" rel=3D"no=
referrer" target=3D"_blank">https://twitter.com/JeremyRubin</a>&gt;&lt;<a h=
ref=3D"https://twitter.com/JeremyRubin" rel=3D"noreferrer" target=3D"_blank=
">https://twitter.com/JeremyRubin</a>&gt;<br>
</blockquote></div>

--00000000000071765605ad69a4c2--