summaryrefslogtreecommitdiff
path: root/61/0b1decdd0064b03fe8172e4501225da36c020d
blob: b8d4625d09a1cdd50dc67ffb778f953790c31c64 (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
Return-Path: <gmaxwell@gmail.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 35EEAC01
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 13 Dec 2017 00:12:47 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-vk0-f54.google.com (mail-vk0-f54.google.com
	[209.85.213.54])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A4BBDE5
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 13 Dec 2017 00:12:46 +0000 (UTC)
Received: by mail-vk0-f54.google.com with SMTP id l187so416464vke.5
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Tue, 12 Dec 2017 16:12:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:sender:in-reply-to:references:from:date:message-id
	:subject:to:cc;
	bh=kNIP/lcOO7wV044OcXyXlmrNBkulOBSP1RtlLWD8wJk=;
	b=cyPZfNerqLK3kvQUNNQnvHzmvwlvrnzxHyiRWeooESsblwJvhoGhjuWQ1LiCeDUnE5
	ko/5rI68eovU7/jlGTFbJPDOybZwaCT9EPfGjEUngRhQJckvGOUg0oP3Cqfi+8V8TWs+
	TPt/g6D2MEb3dUTdmDAZc7/b65jtrpSSCPgjXBL8J0oilpmg0QFT1yUa/BE68YOQ4F7t
	imx8twLL8riIOmZBrbTE/9QgepBh+DEGY9iHqsxlsrsw8SgqedbT9OKaRXloT2rZnEPG
	hX7RA0Pe2kszgvzXvg15TzYtfrQVzNlrmjCbEeJOS0afwVtulCEwsFs8Tsyt0DfZVBke
	UtrA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
	:date:message-id:subject:to:cc;
	bh=kNIP/lcOO7wV044OcXyXlmrNBkulOBSP1RtlLWD8wJk=;
	b=F+ZNzYOblRXWE8ciLYKvbUE1pBeoKF9+Ob7p6qHfm9Hgb68CykdZhydJOIjXDI6q6D
	8HqEgoRfdS9W09oeoGstQifYKjHMnavcKl91MnceIFXa/rCs0pP6xxy11w+FPst6y/IP
	j5T5aBsjhxvAbMjy54ZTfgQXpaPVZKrhwBu197nZmRhOemlJCQtTl+Mt7l9jatg3n3Ub
	2oJ3/joI7ERcwGJmgMp2BW6sg1LOakq61Iy4y2HqEIr7mycPcmAMRQSBsUrM5y/Q0s/O
	zNcZcHEpTmOrmZ1M83Fbktt2IzFAlKw6Zwk6athhzAP98z4FiyU6uPo8PoPnleo9O8fG
	50OQ==
X-Gm-Message-State: AKGB3mIl3jOHbHTIg2Klg6ztoE/P4IMCOhBoQwguaciPNW8G9+v3fqZz
	4YleUTESgN7YNXfajFUSwtV1FvA/XGxWEAxHil+foA==
X-Google-Smtp-Source: ACJfBovYir88TGSp2N7EWyTE9t/mN14NpAw29oIJG6hsLcwFT+zzTqPFW0VxEjVwJEbufkkepdIpv20MsRtRjtF9jhA=
X-Received: by 10.31.5.66 with SMTP id 63mr5985981vkf.15.1513123965807; Tue,
	12 Dec 2017 16:12:45 -0800 (PST)
MIME-Version: 1.0
Sender: gmaxwell@gmail.com
Received: by 10.103.85.148 with HTTP; Tue, 12 Dec 2017 16:12:45 -0800 (PST)
In-Reply-To: <CAFp6fsHwdAbcYVdPzuDdD1OV7ibCN-ebMBi113m5-JOoJtccPQ@mail.gmail.com>
References: <CADZtCShywq_s9ZK3oBBTUdCgjrTxbyeb-p7QrhJJ3mwRAECCMA@mail.gmail.com>
	<CAAS2fgROykenGH43_FXun+q4u+=94tKqnRW=kQQ2AQFeXKdW=Q@mail.gmail.com>
	<CAFp6fsHwdAbcYVdPzuDdD1OV7ibCN-ebMBi113m5-JOoJtccPQ@mail.gmail.com>
From: Gregory Maxwell <greg@xiph.org>
Date: Wed, 13 Dec 2017 00:12:45 +0000
X-Google-Sender-Auth: mbtzL_mYQRxNhj8BgAc7BXDYCJ8
Message-ID: <CAAS2fgQiicyUO31qJP7_xxAwRvp3rx8fHN+W+0jwq1Py=7+sFg@mail.gmail.com>
To: Suhas Daftuar <sdaftuar@gmail.com>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID, FREEMAIL_FROM,
	RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
Cc: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] "Compressed" headers stream
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.12
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, 13 Dec 2017 00:12:47 -0000

On Tue, Dec 12, 2017 at 9:07 PM, Suhas Daftuar <sdaftuar@gmail.com> wrote:
> I agree with this.  Specifically the way I envisioned this working is that
> we could introduce a new 'cmpctheaders'/'getcmpcthdrs' message pair for
> syncing using this new message type, while leaving the existing
> 'headers'/'getheaders' messages unchanged.  So when communicating with
> upgraded peers, we'd never use 'getheaders' messages, and we'd only use
> 'headers' messages for potentially announcing new blocks.

The question becomes there-- how should it work.

In an ideal world, we'd decide what peers to fetch headers from based
on a compact proof of the total work in their chains... but we cannot
construct such proofs in Bitcoin today.

I think that instead of that a weak heuristic is to fetch first from
the peers with the tip at the highest difficulty. Then work backwards.

See: https://en.bitcoin.it/wiki/User:Gmaxwell/Reverse_header-fetching_sync

Which is the inspiration for the current headers first sync, but
without the reverse part because the protocol didn't permit it: you
can't request a linear wad of headers that come before a header. This
is the thing I was mostly thinking of when I mentioned that we may
want to change the interface.