From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 35EEAC01 for ; 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 ; Wed, 13 Dec 2017 00:12:46 +0000 (UTC) Received: by mail-vk0-f54.google.com with SMTP id l187so416464vke.5 for ; 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: References: From: Gregory Maxwell Date: Wed, 13 Dec 2017 00:12:45 +0000 X-Google-Sender-Auth: mbtzL_mYQRxNhj8BgAc7BXDYCJ8 Message-ID: To: Suhas Daftuar 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Dec 2017 00:12:47 -0000 On Tue, Dec 12, 2017 at 9:07 PM, Suhas Daftuar 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.