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 00908DEB for ; Mon, 11 Dec 2017 22:42:33 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 38884E7 for ; Mon, 11 Dec 2017 22:42:32 +0000 (UTC) Received: by mail-oi0-f53.google.com with SMTP id l6so12736106oih.11 for ; Mon, 11 Dec 2017 14:42:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=tQg/nJokEm9Jq7ZJTlon82+1i+xjfniy/n6DupnCYfE=; b=aC2jfyVkq596on6cRV/Y66XRNyBSUjEqC0J6is1upXV6HDV9TpxOYCukEYkYKI7GT7 Lv4isFP928PK/cSlWyf/ERazUEH5VIPgnA9cKMyzPKi5b/9+F0x1DvpFy58ZfH7iUS3I hKbqXFroFjV+V5Opgq+sVH0Uaw5IfY1yAOza+COlV67T8GuwCaE0vxt7DiTn17KBLvga XHB7m7votID4kqIYZjG3dUjQpPcuedG6s1hkr3jzXNE8yTrbXmxdsemNzkoYZyB1HbY+ 614xoXa9lX9uWzLazFsNya1A5jyXdeHiHyiP1zCM7UQ2/AzyZZbKqxiw6QR0Y3YCbAwy vcXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=tQg/nJokEm9Jq7ZJTlon82+1i+xjfniy/n6DupnCYfE=; b=cfJniy15L5nhlSd6ON3BF3yUFrFP4IVpQs8ccNvD1irK6kEEwqaAgOGPdD8lThRoUW +8wKGqv1WmfYhZxYX4fPrxJOpgJtrhPAO5eNneh/XGyuVCb2weRDGIRtRavgwzVKsCIF JiURfQwCY4OOPOSZVMCyPeD2EoUCcMqENSrmdtfDdYnnCWwEFY2k6l3iyAZMPibpGpx4 15lUdI5CqOC4+xpylebYzespjCo9BMt9at5yN9xO8scTfRNhOQvuv54Re+yeiSW709Pz aqmTqNn++u7CF75fYBEeAcfQACo32yjQ61lFUIGzkkZ92HJAG5jLekbYv4+OvHwApj5z zJAw== X-Gm-Message-State: AKGB3mJgvVn9kjCJvRKvbj23z1atMU8+Z6yY2lEKtbG3+3rnXp4WhwWb ckfQHgaoWEb0bXNySyCxCpaQLtoa2GxlVmdC/Y6wSacM X-Google-Smtp-Source: ACJfBotkFvEQblFV/FJVW0AAj2G04XTegA/qKvOXFdKA0IpsIVQ0Fi1J+GJOxFojC2pehuTBbuM8Nd2euAQPHAvusAo= X-Received: by 10.202.53.197 with SMTP id c188mr1516994oia.205.1513032151307; Mon, 11 Dec 2017 14:42:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.74.38.72 with HTTP; Mon, 11 Dec 2017 14:41:50 -0800 (PST) In-Reply-To: References: From: Tier Nolan Date: Mon, 11 Dec 2017 22:41:50 +0000 Message-ID: To: Bitcoin Protocol Discussion Content-Type: multipart/alternative; boundary="001a113cfb3ce99e710560183f58" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, HTML_MESSAGE, 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 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: Mon, 11 Dec 2017 22:42:33 -0000 --001a113cfb3ce99e710560183f58 Content-Type: text/plain; charset="UTF-8" On Mon, Dec 11, 2017 at 9:56 PM, Jim Posen via bitcoin-dev < bitcoin-dev@lists.linuxfoundation.org> wrote: > Omitting nBits entirely seems reasonable, I wrote up a possible > implementation here > . > The downside is that it is more complex because it leaks into the > validation code. The extra 4 byte savings is certainly nice though. > A compromise would be to have 1 byte indicating the difference since the last header. Since the exponent doesn't use the full range you could steal bits from there to indicate mode. - no change - mantissa offset (for small changes) - full difficulty This would support any nBits rule and you say 3 of the 4 bytes. > Can you elaborate on how parallel header fetching might work? getheaders > requests could probably already be pipelined, where the node requests the > next 2,000 headers before processing the current batch (though would make > sense to check that they are all above min difficulty first). > I suggest adding a message where you can ask for the lowest N hashes between 2 heights on the main chain. The reply is an array of {height, header} pairs for the N headers with the lowest hash in the specified range. All peers should agree on which headers are in the array. If there is disagreement, then you can at least narrow down on which segment there is disagreement. It works kind of like a cut and choose. You pick one segment of the ones he gave you recursively. You can ask a peer for proof for a segment between 2 headers of the form. - first header + coinbase with merkle branch - all headers in the segment This proves the segment has the correct height and that all the headers link up. There is a method called "high hash highway" that allows compact proofs of total POW. --001a113cfb3ce99e710560183f58 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Dec 11, 2017 at 9:56 PM, Jim Posen via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org> wrote:
=
Omitting nBits entirely seems reasonable, I wrote up a possible imple= mentation here. The downside is= that it is more complex because it leaks into the validation code. The ext= ra 4 byte savings is certainly nice though.

A compromise would be to have 1 byte indicating th= e difference since the last header.

Since the expo= nent doesn't use the full range you could steal bits from there to indi= cate mode.

- no change
- mantissa offset= (for small changes)
- full difficulty

T= his would support any nBits rule and you say 3 of the 4 bytes.
=C2=A0
=
Can you elaborate on how parall= el header fetching might work? getheaders requests could probably already b= e pipelined, where the node requests the next 2,000 headers before processi= ng the current batch (though would make sense to check that they are all ab= ove min difficulty first).

I su= ggest adding a message where you can ask for the lowest N hashes between 2 = heights on the main chain.

The reply is an arr= ay of {height, header} pairs for the N headers with the lowest hash in the = specified range.

All peers should agree on whi= ch headers are in the array.=C2=A0 If there is disagreement, then you can a= t least narrow down on which segment there is disagreement.

<= /div>
It works kind of like a cut and choose.=C2=A0 You pick one segmen= t of the ones he gave you recursively.

You can= ask a peer for proof for a segment between 2 headers of the form.

- first header + coinbase with merkle branch
- all headers in the segment

This proves the = segment has the correct height and that all the headers link up.
=
There is a method called "high hash highway" that = allows compact proofs of total POW.
--001a113cfb3ce99e710560183f58--