summaryrefslogtreecommitdiff
path: root/fe/e98fe2b33cba20dde0b580ac3a210a1dd69b57
blob: 24aa49e6028af8122dcb628dae4b34a961722829 (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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
Return-Path: <marcopon@gmail.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 87861990
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 11 Nov 2015 18:50:12 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com
	[209.85.217.177])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C42FE8C
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 11 Nov 2015 18:50:10 +0000 (UTC)
Received: by lbbcs9 with SMTP id cs9so21956997lbb.1
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 11 Nov 2015 10:50:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type;
	bh=pJdap6SZIjb+ayEcqzDYvqQxMY8AmuI2svS6qvcLYu4=;
	b=wyFUfb2sJBjB4bllOgpp6mIQ8JJ9LGftiyqSfBTIudKYkDHCZE3aorLcifS3CSMS5h
	fPJsvL3NdNIMXzsgF2yDCaNsLAx3zASzI6tP+86Cre3G0TFqWJrvqIWRwUjIJxxcoN3g
	jSex/Hnpmhs1yUjY9U5tH1ESKyDnG0krVlUcEeX4l89ql7u8Wa9cqK7L0gYTiJEN3NIg
	EIXeJGVkyExOCMKkxxoAT6V2kcpwiK7BiJtrXXljCkkAIsuM2W+xUimskxfS7R/IZqch
	5JDZcDitMiApFB+dgrm2wUHqy0cocqW6YgTwtafQDgkEgQ55VaopdLMzMorYrby39ujg
	q+8g==
X-Received: by 10.112.198.69 with SMTP id ja5mr5405945lbc.106.1447267808978;
	Wed, 11 Nov 2015 10:50:08 -0800 (PST)
MIME-Version: 1.0
Received: by 10.114.186.106 with HTTP; Wed, 11 Nov 2015 10:49:49 -0800 (PST)
In-Reply-To: <56438A55.2010604@gmail.com>
References: <5640F172.3010004@gmail.com> <20151109210449.GE5886@mcelrath.org>
	<CAL7-sS0Apm4O_Qi0FmY7=H580rEVD6DYjk2y+ACpZmKqUJTQwA@mail.gmail.com>
	<CALOxbZtTUrZwDfy_jTbs60n=K8RKDGg5X0gkLsh-OX3ikLf1FQ@mail.gmail.com>
	<CAE-z3OUB-se_HUvW2NLjWt=0d5sgMiPEciu0hLzr_HQN0m9fqQ@mail.gmail.com>
	<5642172C.701@gmail.com>
	<CAE-z3OXgWCHL_3CDR-ACc7ojbLi7EavyObNa3s7hPUMGj_V2+A@mail.gmail.com>
	<CADm_WcYAj9_r6tu8Be-U81LDwWvnv04PZJMmc-S4cY7+jxfzGw@mail.gmail.com>
	<56438A55.2010604@gmail.com>
From: Marco Pontello <marcopon@gmail.com>
Date: Wed, 11 Nov 2015 19:49:49 +0100
Message-ID: <CAE0pACK1-xQC4MsdbM46_Z0TQvZTrZKw4e8xFt3X=PmW7pmGJQ@mail.gmail.com>
To: Peter Tschipper <peter.tschipper@gmail.com>
Content-Type: multipart/alternative; boundary=001a11c2b582a62c890524484b40
X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW
	autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
X-Mailman-Approved-At: Wed, 11 Nov 2015 18:54:56 +0000
Cc: Bitcoin Dev <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] request BIP number for: "Support for Datastream
	Compression"
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Bitcoin Development 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, 11 Nov 2015 18:50:12 -0000

--001a11c2b582a62c890524484b40
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

A random thought: aren't most communication over a data link already
compressed, at some point?
When I used a modem, we had the V.42bis protocol. Now, nearly all ADSL
connections using PPPoE, surely are. And so on.
I'm not sure another level of generic, data agnostic kind of compression
will really give us some real-life practical advantage over that.

Something that could take advantage of of special knowledge of the specific
data, instead, would be an entirely different matter.

Just my 2c.

On Wed, Nov 11, 2015 at 7:35 PM, Peter Tschipper via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:

> Here are the latest results on compression ratios for the first 295,000
> blocks, compressionlevel=3D6.  I think there are more than enough datapoi=
nts
> for statistical significance.
>
> Results are very much similar to the previous test.   I'll work on gettin=
g
> a comparison between how much time savings/loss in time there is when
> syncing the blockchains: compressed vs uncompressed.  Still, I think it's
> clear that serving up compressed blocks, at least historical blocks, will
> be of benefit for those that have bandwidth caps on their internet
> connections.
>
> The proposal, so far is fairly simple:
> 1) compress blocks with some compression library: currently zlib but I ca=
n
> investigate other possiblities
> 2) As a fall back we need to advertise compression as a service.  That wa=
y
> we can turn off compression AND decompression completely if needed.
> 3) Do the compression at the datastream level in the code.  CDataStream i=
s
> the obvious place.
>
>
> Test Results:
>
> range =3D block size range
> ubytes =3D average size of uncompressed blocks
> cbytes =3D average size of compressed blocks
> ctime =3D average time to compress
> dtime =3D average time to decompress
> cmp_ratio% =3D compression ratio
> datapoints =3D number of datapoints taken
>
> range       ubytes    cbytes    ctime    dtime    cmp_ratio%    datapoint=
s
> 0-250b      215            189    0.001    0.000    12.40             912=
80
> 250-500b    438            404    0.001    0.000    7.85             1321=
7
> 500-1KB     761            701    0.001    0.000    7.86
> 11434
> 1KB-10KB    4149    3547    0.001    0.000      14.51             52180
> 10KB-100KB  41934    32604    0.005    0.001    22.25         82890
> 100KB-200KB 146303    108080    0.016    0.001    26.13    29886
> 200KB-300KB 243299    179281    0.025    0.002    26.31    25066
> 300KB-400KB 344636    266177    0.036    0.003    22.77    4956
> 400KB-500KB 463201    356862    0.046    0.004    22.96    3167
> 500KB-600KB 545123    429854    0.056    0.005    21.15    366
> 600KB-700KB 647736    510931    0.065    0.006    21.12    254
> 700KB-800KB 746540    587287    0.073    0.008    21.33    294
> 800KB-900KB 868121    682650    0.087    0.008    21.36    199
> 900KB-1MB   945747    726307    0.091    0.010    23.20    304
>
> On 10/11/2015 8:46 AM, Jeff Garzik via bitcoin-dev wrote:
>
> Comments:
>
> 1) cblock seems a reasonable way to extend the protocol.  Further wrappin=
g
> should probably be done at the stream level.
>
> 2) zlib has crappy security track record.
>
> 3) A fallback path to non-compressed is required, should compression fail
> or crash.
>
> 4) Most blocks and transactions have runs of zeroes and/or highly common
> bit-patterns, which contributes to useful compression even at smaller
> sizes.  Peter Ts's most recent numbers bear this out.  zlib has a
> dictionary (32K?) which works well with repeated patterns such as those y=
ou
> see with concatenated runs of transactions.
>
> 5) LZO should provide much better compression, at a cost of CPU
> performance and using a less-reviewed, less-field-tested library.
>
>
>
>
>
> On Tue, Nov 10, 2015 at 11:30 AM, Tier Nolan via bitcoin-dev <
> <bitcoin-dev@lists.linuxfoundation.org>
> bitcoin-dev@lists.linuxfoundation.org> wrote:
>
>>
>>
>> On Tue, Nov 10, 2015 at 4:11 PM, Peter Tschipper <
>> <peter.tschipper@gmail.com>peter.tschipper@gmail.com> wrote:
>>
>>> There are better ways of sending new blocks, that's certainly true but
>>> for sending historical blocks and seding transactions I don't think so.
>>> This PR is really designed to save bandwidth and not intended to be a h=
uge
>>> performance improvement in terms of time spent sending.
>>>
>>
>> If the main point is for historical data, then sticking to just blocks i=
s
>> the best plan.
>>
>> Since small blocks don't compress well, you could define a "cblocks"
>> message that handles multiple blocks (just concatenate the block message=
s
>> as payload before compression).
>>
>> The sending peer could combine blocks so that each cblock is compressing
>> at least 10kB of block data (or whatever is optimal).  It is probably wo=
rth
>> specifying a maximum size for network buffer reasons (either 1MB or 1 bl=
ock
>> maximum).
>>
>> Similarly, transactions could be combined together and compressed
>> "ctxs".  The inv messages could be modified so that you can request grou=
ps
>> of 10-20 transactions.  That would depend on how much of an improvement
>> compressed transactions would represent.
>>
>> More generally, you could define a message which is a compressed message
>> holder.  That is probably to complex to be worth the effort though.
>>
>>
>>
>>>
>>> On Tue, Nov 10, 2015 at 5:40 AM, Johnathan Corgan via bitcoin-dev <
>>> <bitcoin-dev@lists.linuxfoundation.org>
>>> bitcoin-dev@lists.linuxfoundation.org> wrote:
>>>
>>>> On Mon, Nov 9, 2015 at 5:58 PM, gladoscc via bitcoin-dev <
>>>> <bitcoin-dev@lists.linuxfoundation.org>
>>>> bitcoin-dev@lists.linuxfoundation.org> wrote:
>>>>
>>>>
>>>>> I think 25% bandwidth savings is certainly considerable, especially
>>>>> for people running full nodes in countries like Australia where inter=
net
>>>>> bandwidth is lower and there are data caps.
>>>>>
>>>>
>>>> =E2=80=8B This reinforces the idea that such trade-off decisions shoul=
d be be
>>>> local and negotiated between peers, not a required feature of the netw=
ork
>>>> P2P.=E2=80=8B
>>>>
>>>>
>>>> --
>>>> Johnathan Corgan
>>>> Corgan Labs - SDR Training and Development Services
>>>> <http://corganlabs.com>http://corganlabs.com
>>>>
>>>> _______________________________________________
>>>> bitcoin-dev mailing list
>>>> bitcoin-dev@lists.linuxfoundation.org
>>>> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>>>>
>>>>
>>>
>>>
>>> _______________________________________________
>>> bitcoin-dev mailing listbitcoin-dev@lists.linuxfoundation.orghttps://li=
sts.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>>>
>>>
>>>
>>
>> _______________________________________________
>> bitcoin-dev mailing list
>> bitcoin-dev@lists.linuxfoundation.org
>> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>>
>>
>
>
> _______________________________________________
> bitcoin-dev mailing listbitcoin-dev@lists.linuxfoundation.orghttps://list=
s.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
>
>
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
>


--=20
Try the Online TrID File Identifier
http://mark0.net/onlinetrid.aspx

--001a11c2b582a62c890524484b40
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">A random thought: aren&#39;t most communication over a dat=
a link already compressed, at some point?<br><div>When I used a modem, we h=
ad the V.42bis protocol. Now, nearly all ADSL connections using PPPoE, sure=
ly are. And so on.</div><div>I&#39;m not sure another level of generic, dat=
a agnostic kind of compression will really give us some real-life practical=
 advantage over that.</div><div><br></div><div>Something that could take ad=
vantage of of special knowledge of the specific data, instead, would be an =
entirely different matter.</div><div><br></div><div>Just my 2c.</div></div>=
<div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Wed, Nov 11, 2=
015 at 7:35 PM, Peter Tschipper via bitcoin-dev <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=3D"_blank">bitco=
in-dev@lists.linuxfoundation.org</a>&gt;</span> wrote:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">
    <div>Here are the latest results on
      compression ratios for the first 295,000 blocks,
      compressionlevel=3D6.=C2=A0 I think there are more than enough datapo=
ints
      for statistical significance.=C2=A0 <br>
      <br>
      Results are very much similar to the previous test.=C2=A0=C2=A0 I&#39=
;ll work on
      getting a comparison between how much time savings/loss in time
      there is when syncing the blockchains: compressed vs
      uncompressed.=C2=A0 Still, I think it&#39;s clear that serving up
      compressed blocks, at least historical blocks, will be of benefit
      for those that have bandwidth caps on their internet connections.<br>
      <br>
      The proposal, so far is fairly simple:<br>
      1) compress blocks with some compression library: currently zlib
      but I can investigate other possiblities<br>
      2) As a fall back we need to advertise compression as a service.=C2=
=A0
      That way we can turn off compression AND decompression completely
      if needed.<br>
      3) Do the compression at the datastream level in the code.=C2=A0
      CDataStream is the obvious place.<br>
      <br>
      <br>
      Test Results:<span class=3D""><br>
      <br>
      range =3D block size range<br>
      ubytes =3D average size of uncompressed blocks<br>
      cbytes =3D average size of compressed blocks<br>
      ctime =3D average time to compress<br>
      dtime =3D average time to decompress<br>
      cmp_ratio% =3D compression ratio<br>
      datapoints =3D number of datapoints taken<br>
      <br>
      range=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ubytes=C2=A0=C2=A0=C2=A0 cb=
ytes=C2=A0=C2=A0=C2=A0 ctime=C2=A0=C2=A0=C2=A0 dtime=C2=A0=C2=A0=C2=A0 cmp_=
ratio%=C2=A0=C2=A0=C2=A0
      datapoints<br></span>
      0-250b=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 215=C2=A0=C2=A0=C2=A0 =C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 189=C2=A0=C2=A0=C2=A0 0.001=C2=A0=C2=A0=
=C2=A0 0.000=C2=A0=C2=A0=C2=A0 12.40=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0
      =C2=A0 =C2=A0 91280<br>
      250-500b=C2=A0=C2=A0=C2=A0 438=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 404=C2=A0=C2=A0=C2=A0 0.001=C2=A0=C2=A0=C2=A0 0.00=
0=C2=A0=C2=A0=C2=A0 7.85=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
      =C2=A0 13217<br>
      500-1KB=C2=A0=C2=A0=C2=A0=C2=A0 761=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 701=C2=A0=C2=A0=C2=A0 0.001=C2=A0=C2=A0=C2=A0 0=
.000=C2=A0=C2=A0=C2=A0
      7.86=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 11434<br>
      1KB-10KB=C2=A0=C2=A0=C2=A0 4149=C2=A0=C2=A0=C2=A0 3547=C2=A0=C2=A0=C2=
=A0 0.001=C2=A0=C2=A0=C2=A0 0.000=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 14.51=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
      52180<br>
      10KB-100KB=C2=A0 41934=C2=A0=C2=A0=C2=A0 32604=C2=A0=C2=A0=C2=A0 0.00=
5=C2=A0=C2=A0=C2=A0 0.001=C2=A0=C2=A0=C2=A0 22.25=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0
      82890<br>
      100KB-200KB 146303=C2=A0=C2=A0=C2=A0 108080=C2=A0=C2=A0=C2=A0 0.016=
=C2=A0=C2=A0=C2=A0 0.001=C2=A0=C2=A0=C2=A0 26.13=C2=A0=C2=A0=C2=A0 29886<br=
>
      200KB-300KB 243299=C2=A0=C2=A0=C2=A0 179281=C2=A0=C2=A0=C2=A0 0.025=
=C2=A0=C2=A0=C2=A0 0.002=C2=A0=C2=A0=C2=A0 26.31=C2=A0=C2=A0=C2=A0 25066<br=
>
      300KB-400KB 344636=C2=A0=C2=A0=C2=A0 266177=C2=A0=C2=A0=C2=A0 0.036=
=C2=A0=C2=A0=C2=A0 0.003=C2=A0=C2=A0=C2=A0 22.77=C2=A0=C2=A0=C2=A0 4956<br>
      400KB-500KB 463201=C2=A0=C2=A0=C2=A0 356862=C2=A0=C2=A0=C2=A0 0.046=
=C2=A0=C2=A0=C2=A0 0.004=C2=A0=C2=A0=C2=A0 22.96=C2=A0=C2=A0=C2=A0 3167<br>
      500KB-600KB 545123=C2=A0=C2=A0=C2=A0 429854=C2=A0=C2=A0=C2=A0 0.056=
=C2=A0=C2=A0=C2=A0 0.005=C2=A0=C2=A0=C2=A0 21.15=C2=A0=C2=A0=C2=A0 366<br>
      600KB-700KB 647736=C2=A0=C2=A0=C2=A0 510931=C2=A0=C2=A0=C2=A0 0.065=
=C2=A0=C2=A0=C2=A0 0.006=C2=A0=C2=A0=C2=A0 21.12=C2=A0=C2=A0=C2=A0 254<br>
      700KB-800KB 746540=C2=A0=C2=A0=C2=A0 587287=C2=A0=C2=A0=C2=A0 0.073=
=C2=A0=C2=A0=C2=A0 0.008=C2=A0=C2=A0=C2=A0 21.33=C2=A0=C2=A0=C2=A0 294<br>
      800KB-900KB 868121=C2=A0=C2=A0=C2=A0 682650=C2=A0=C2=A0=C2=A0 0.087=
=C2=A0=C2=A0=C2=A0 0.008=C2=A0=C2=A0=C2=A0 21.36=C2=A0=C2=A0=C2=A0 199<br>
      900KB-1MB=C2=A0=C2=A0 945747=C2=A0=C2=A0=C2=A0 726307=C2=A0=C2=A0=C2=
=A0 0.091=C2=A0=C2=A0=C2=A0 0.010=C2=A0=C2=A0=C2=A0 23.20=C2=A0=C2=A0=C2=A0=
 304<span class=3D""><br>
      <br>
      On 10/11/2015 8:46 AM, Jeff Garzik via bitcoin-dev wrote:<br>
    </span></div><div><div class=3D"h5">
    <blockquote type=3D"cite">
      <div dir=3D"ltr">Comments:
        <div><br>
        </div>
        <div>1) cblock seems a reasonable way to extend the protocol.=C2=A0
          Further wrapping should probably be done at the stream level.</di=
v>
        <div><br>
        </div>
        <div>2) zlib has crappy security track record.</div>
        <div><br>
        </div>
        <div>3) A fallback path to non-compressed is required, should
          compression fail or crash.</div>
        <div><br>
        </div>
        <div>4) Most blocks and transactions have runs of zeroes and/or
          highly common bit-patterns, which contributes to useful
          compression even at smaller sizes.=C2=A0 Peter Ts&#39;s most rece=
nt
          numbers bear this out. =C2=A0zlib has a dictionary (32K?) which
          works well with repeated patterns such as those you see with
          concatenated runs of transactions.</div>
        <div><br>
        </div>
        <div>5) LZO should provide much better compression, at a cost of
          CPU performance and using a less-reviewed, less-field-tested
          library.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      <div class=3D"gmail_extra"><br>
        <div class=3D"gmail_quote">On Tue, Nov 10, 2015 at 11:30 AM, Tier
          Nolan via bitcoin-dev <span dir=3D"ltr">&lt;<a href=3D"mailto:bit=
coin-dev@lists.linuxfoundation.org" target=3D"_blank"></a><a href=3D"mailto=
:bitcoin-dev@lists.linuxfoundation.org" target=3D"_blank">bitcoin-dev@lists=
.linuxfoundation.org</a>&gt;</span>
          wrote:<br>
          <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex">
            <div dir=3D"ltr"><br>
              <div class=3D"gmail_extra"><br>
                <div class=3D"gmail_quote"><span>On Tue, Nov 10,
                    2015 at 4:11 PM, Peter Tschipper <span dir=3D"ltr">&lt;=
<a href=3D"mailto:peter.tschipper@gmail.com" target=3D"_blank"></a><a href=
=3D"mailto:peter.tschipper@gmail.com" target=3D"_blank">peter.tschipper@gma=
il.com</a>&gt;</span>
                    wrote:<br>
                    <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <span></span><span></span>There are better ways of
                      sending new blocks, that&#39;s certainly true but for
                      sending historical blocks and seding transactions
                      I don&#39;t think so.=C2=A0 This PR is really designe=
d to
                      save bandwidth and not intended to be a huge
                      performance improvement in terms of time spent
                      sending.<span><br>
                      </span></blockquote>
                    <div><br>
                    </div>
                  </span>
                  <div>If the main point is for historical data, then
                    sticking to just blocks is the best plan.<br>
                    <br>
                  </div>
                  <div>Since small blocks don&#39;t compress well, you coul=
d
                    define a &quot;cblocks&quot; message that handles multi=
ple
                    blocks (just concatenate the block messages as
                    payload before compression).=C2=A0 <br>
                    <br>
                    The sending peer could combine blocks so that each
                    cblock is compressing at least 10kB of block data
                    (or whatever is optimal).=C2=A0 It is probably worth
                    specifying a maximum size for network buffer reasons
                    (either 1MB or 1 block maximum).<br>
                    <br>
                  </div>
                  <div>Similarly, transactions could be combined
                    together and compressed &quot;ctxs&quot;.=C2=A0 The inv=
 messages
                    could be modified so that you can request groups of
                    10-20 transactions.=C2=A0 That would depend on how much
                    of an improvement compressed transactions would
                    represent. <br>
                    <br>
                  </div>
                  <div>More generally, you could define a message which
                    is a compressed message holder.=C2=A0 That is probably =
to
                    complex to be worth the effort though.<br>
                  </div>
                  <span>
                    <div><br>
                      =C2=A0</div>
                    <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div bgcolor=3D"#FFFFFF" text=3D"#000000"><span>
                          <blockquote type=3D"cite">
                            <div class=3D"gmail_extra"><br>
                              <div class=3D"gmail_quote">On Tue, Nov 10,
                                2015 at 5:40 AM, Johnathan Corgan via
                                bitcoin-dev <span dir=3D"ltr">&lt;<a href=
=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=3D"_blank"></a><a =
href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=3D"_blank">bit=
coin-dev@lists.linuxfoundation.org</a>&gt;</span>
                                wrote:<br>
                                <blockquote class=3D"gmail_quote" style=3D"=
margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                  <div dir=3D"ltr"><span>
                                      <div style=3D"font-size:small">On
                                        Mon, Nov 9, 2015 at 5:58 PM,
                                        gladoscc via bitcoin-dev <span dir=
=3D"ltr">&lt;<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" targe=
t=3D"_blank"></a><a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" t=
arget=3D"_blank">bitcoin-dev@lists.linuxfoundation.org</a>&gt;</span>
                                        wrote:<br>
                                      </div>
                                    </span>
                                    <div class=3D"gmail_extra">
                                      <div class=3D"gmail_quote"><span>
                                          <div>=C2=A0</div>
                                          <blockquote class=3D"gmail_quote"=
 style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                            <div dir=3D"ltr">I think 25%
                                              bandwidth savings is
                                              certainly considerable,
                                              especially for people
                                              running full nodes in
                                              countries like Australia
                                              where internet bandwidth
                                              is lower and there are
                                              data caps.</div>
                                          </blockquote>
                                          <div><br>
                                          </div>
                                        </span>
                                        <div>
                                          <div style=3D"font-size:small;dis=
play:inline">=E2=80=8B
                                            This reinforces the idea
                                            that such trade-off
                                            decisions should be be local
                                            and negotiated between
                                            peers, not a required
                                            feature of the network P2P.=E2=
=80=8B</div>
                                          =C2=A0</div>
                                      </div>
                                      <span>
                                        <div><br>
                                        </div>
                                        -- <br>
                                        <div>
                                          <div dir=3D"ltr">
                                            <div>
                                              <div dir=3D"ltr">
                                                <div dir=3D"ltr">
                                                  <div dir=3D"ltr">
                                                    <div dir=3D"ltr">
                                                      <div dir=3D"ltr">
                                                        <div>Johnathan
                                                          Corgan<br>
                                                          Corgan Labs -
                                                          SDR Training
                                                          and
                                                          Development
                                                          Services</div>
                                                        <div><a href=3D"htt=
p://corganlabs.com" style=3D"font-size:12.8px" target=3D"_blank"></a><a hre=
f=3D"http://corganlabs.com" target=3D"_blank">http://corganlabs.com</a><br>
                                                        </div>
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </span></div>
                                  </div>
                                  <br>
_______________________________________________<br>
                                  bitcoin-dev mailing list<br>
                                  <a href=3D"mailto:bitcoin-dev@lists.linux=
foundation.org" target=3D"_blank">bitcoin-dev@lists.linuxfoundation.org</a>=
<br>
                                  <a href=3D"https://lists.linuxfoundation.=
org/mailman/listinfo/bitcoin-dev" rel=3D"noreferrer" target=3D"_blank">http=
s://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
                                  <br>
                                </blockquote>
                              </div>
                              <br>
                            </div>
                            <br>
                            <fieldset></fieldset>
                            <br>
                            <pre>__________________________________________=
_____
bitcoin-dev mailing list
<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=3D"_blank">=
bitcoin-dev@lists.linuxfoundation.org</a>
<a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" =
target=3D"_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoi=
n-dev</a>
</pre>
                          </blockquote>
                          <br>
                        </span></div>
                    </blockquote>
                  </span></div>
                <br>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            bitcoin-dev mailing list<br>
            <a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=
=3D"_blank">bitcoin-dev@lists.linuxfoundation.org</a><br>
            <a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/b=
itcoin-dev" rel=3D"noreferrer" target=3D"_blank">https://lists.linuxfoundat=
ion.org/mailman/listinfo/bitcoin-dev</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
bitcoin-dev mailing list
<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=3D"_blank">=
bitcoin-dev@lists.linuxfoundation.org</a>
<a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" =
target=3D"_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoi=
n-dev</a>
</pre>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.=
linuxfoundation.org</a><br>
<a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" =
rel=3D"noreferrer" target=3D"_blank">https://lists.linuxfoundation.org/mail=
man/listinfo/bitcoin-dev</a><br>
<br></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div cla=
ss=3D"gmail_signature">Try the Online TrID File Identifier<br><a href=3D"ht=
tp://mark0.net/onlinetrid.aspx" target=3D"_blank">http://mark0.net/onlinetr=
id.aspx</a></div>
</div>

--001a11c2b582a62c890524484b40--