Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id D37A5D69 for ; Wed, 13 Jun 2018 15:32:14 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-ot0-f178.google.com (mail-ot0-f178.google.com [74.125.82.178]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 21586466 for ; Wed, 13 Jun 2018 15:32:14 +0000 (UTC) Received: by mail-ot0-f178.google.com with SMTP id 101-v6so3446559oth.4 for ; Wed, 13 Jun 2018 08:32:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:in-reply-to:references:mime-version:date:message-id:subject:to; bh=u+RVc3ii9P1rLIZHAllXe0EdxcySYxASvxvoiu5wOE0=; b=ZLLr/spKra7cBxePG5UfNb/7oBfjSQq3cf2dcDuJ8PoPTRHsPXPIwxA3tSQ+XDVN2v z8PwbZJriebuFmzqJcbcsSa+6UiKJPmGZqYQI8egfqDVNu7lxf2kxsptUV0NqPx3I2TY jCStstIizYjKHMu3l24TYqQ5HsEVnBBNZARsTqVK4N6fXqaCQQdaPT6PWaMDTsBc//Ts A8bHGJrYLu8ZYozVhnjdchREEDElSvTqej5dH9kuU+0ujuKrqPQ+eWT/+cdZI2fICBRl xR2O38uV0WPfOTZY2LNjBcO5OQR1sl/vW5clYElrVA08qIKD87kRy0codDQ7GzZKVSDb YOjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to; bh=u+RVc3ii9P1rLIZHAllXe0EdxcySYxASvxvoiu5wOE0=; b=KRiOc2tdXM2AkZ7GxQIpTJAul5uoIwIwM0GiKdFbff9lQTmz55X5DP0CNRFW+tOwzv sSEi9yRdqpVy+afw+ZVRESmyuc+ZE/B2mTJCk3PjUTJ0ISvhVcK2HtxEkGbpqY7x+fVE xChyIKIjw7qpwiAf5+yQox5Lzwn/1XKT7NK9OWPyxQX3RdsgzW0GizGmWY+ZthP1zLLK KfMwNjDLtpPBqYSV/7rsWzHWTDTqr0+uKEmZWL8TI4OlYDxtJpA5tKaI4aRiDnHse7M6 QdLWPquBxTWzHhexvX/RZ4oX6OjTYtxhSXaAe1VEhCENAekpkY6hmKZNUb/4yjmNQNOO 5fMg== X-Gm-Message-State: APt69E2gGQGIH+Qnw9zhIyA+hfU6g/e7b7q+/pwbGrinwvGgy4BeBkh1 hOc6Pws03UbUCVMsEhRZrfEkcAqcflNtqc7aCM0= X-Google-Smtp-Source: ADUXVKLTbiaIMBI75+2D1XJbdEmO/dZP3Wb6dk2iU9DN+fZk/AQ28NOatgjBnP3ZP9CpavgqHPC2h0m+q4XTwjo8cLE= X-Received: by 2002:a9d:5774:: with SMTP id x49-v6mr3207892oti.50.1528903933182; Wed, 13 Jun 2018 08:32:13 -0700 (PDT) Received: from 1058052472880 named unknown by gmailapi.google.com with HTTPREST; Wed, 13 Jun 2018 08:32:11 -0700 From: Brian Lockhart In-Reply-To: <87fu1qdd5e.fsf@gmail.com> References: <0cc0a7249708ad26a7cbef702370b234.squirrel@boosthardware.com> <87fu1qdd5e.fsf@gmail.com> X-Mailer: Airmail (481) MIME-Version: 1.0 Date: Wed, 13 Jun 2018 08:32:11 -0700 Message-ID: To: Kulpreet Singh , Christian Decker , Bitcoin Protocol Discussion , Patrick Shirkey Content-Type: multipart/alternative; boundary="000000000000d54900056e87afe8" 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, UNPARSEABLE_RELAY 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, 13 Jun 2018 15:55:29 +0000 Subject: Re: [bitcoin-dev] Why not archive the backend of Bitcoin blockchain? 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 Jun 2018 15:32:14 -0000 --000000000000d54900056e87afe8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Somewhat related question - In the interest of avoiding running multiple bitcoind full nodes - is there a method to allow a Lightning node to point to / access a separate already-existing node, vs. requiring it to have its own dedicated local instance of bitcoind running? I.e. if I already have a full bitcoin node running, could I use RPC calls or something to tell my Lightning node to use that node, instead of spinning up *another* full node? I=E2=80=99m currently minimizing the netwo= rk thrashing by whitelisting my LN bitcoind node to only point to my existing full node for updates, but if I could just point my whole LN node at it, that=E2=80=99s save on disk storage etc. etc. etc. Apologies if this is already in there (or has been added) and I missed it because I haven=E2=80=99t kept up with release notes=E2=80=A6 On June 13, 2018 at 6:35:49 AM, Christian Decker via bitcoin-dev ( bitcoin-dev@lists.linuxfoundation.org) wrote: Kulpreet Singh via bitcoin-dev writes: > But if I understand correctly, lightning nodes need to check if a > counterparty is broadcasting an old channel state and in response > broadcast a penalty/justice transaction. Does that mean lightning > nodes only need to watch for transactions that come after the funding > transaction? Is that the only reason lightning needs to run bitcoind > with txindex? Yes, Lightning nodes need to monitor the network for transactions that they need to react to. This is basically tailing the blockchain and looking for anything suspicious. The `bitcoind` sitting next to the lightning node however does not need to keep an index of the transactions, at least for c-lightning, because we just ask for the full block that then gets scanned for transactions of interest and then we discard the rest of the block. We never ask for a specific transaction from `bitcoind` and therefore we don't need to run with `-txindex`. > If that is the case, and a lightning node only needs to query > transactions broadcast after the funding transaction, then a pruned > bitcoind instance with txindex might be a bit handy. Pruned nodes should work, as long as the current blockchain head that the lightning node has seen does not fall into the pruned range, since in that case it won't be able to fetch and process the blocks anymore. > Also from [1] it seems that indexing pruned nodes is not supported > because it doesn't make sense, not that it was infeasible. Now with > the lightning requirements, does an indexed pruned node start to make > sense? I don't think we should ever require `-txindex` to run a lightning node (I know some implementations did in the past), since that'd be a very onerous requirement to run a lightning node. Tailing the blockchain is more than sufficient to get the necessary data, and hopefully we can get our reliance on `bitcoind` down to a minimum in the future. > Once again, please forgive my naive understanding of some of the issues > involved and thanks for your patience. Absolutely no problem, it is a common misconception that `-txindex` is required to run a lightning node in all cases :-) Cheers, Christian _______________________________________________ bitcoin-dev mailing list bitcoin-dev@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev --000000000000d54900056e87afe8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable = Somewhat related que= stion -=C2=A0

In the = interest of avoiding running multiple bitcoind full nodes - is there a meth= od to allow a Lightning node to point to / access a separate already-existi= ng node, vs. requiring it to have its own dedicated local instance of bitco= ind running?
=
I.e. if = I already have a full bitcoin node running, could I use RPC calls or someth= ing to tell my Lightning node to use that node, instead of spinning up *ano= ther* full node? I=E2=80=99m currently minimizing the network thrashing by = whitelisting my LN bitcoind node to only point to my existing full node for= updates, but if I could just point my whole LN node at it, that=E2=80=99s = save on disk storage etc. etc. etc.


Apologies if this is already in there (or has been added) and I miss= ed it because I haven=E2=80=99t kept up with release notes=E2=80=A6




On June 13, 2018 at 6:35:49 AM, Christian Decker via bitcoin-de= v (bitcoin-dev@lis= ts.linuxfoundation.org) wrote:

Kulpreet Singh via bitcoin-dev <bitcoin-dev@lists.linu= xfoundation.org>
writes:
> But if I understand correctly, lightning nodes need to check if a
> counterparty is broadcasting an old channel state and in response
> broadcast a penalty/justice transaction. Does that mean lightning
> nodes only need to watch for transactions that come after the fund= ing
> transaction? Is that the only reason lightning needs to run bitcoi= nd
> with txindex?

Yes, Lightning nodes need to monitor the network for transactions that
they need to react to. This is basically tailing the blockchain and
looking for anything suspicious. The `bitcoind` sitting next to the
lightning node however does not need to keep an index of the
transactions, at least for c-lightning, because we just ask for the ful= l
block that then gets scanned for transactions of interest and then we
discard the rest of the block. We never ask for a specific transaction
from `bitcoind` and therefore we don't need to run with `-txindex`.

> If that is the case, and a lightning node only needs to query
> transactions broadcast after the funding transaction, then a prune= d
> bitcoind instance with txindex might be a bit handy.

Pruned nodes should work, as long as the current blockchain head that
the lightning node has seen does not fall into the pruned range, since
in that case it won't be able to fetch and process the blocks anymo= re.

> Also from [1] it seems that indexing pruned nodes is not supported
> because it doesn't make sense, not that it was infeasible. Now= with
> the lightning requirements, does an indexed pruned node start to m= ake
> sense?

I don't think we should ever require `-txindex` to run a lightning = node
(I know some implementations did in the past), since that'd be a ve= ry
onerous requirement to run a lightning node. Tailing the blockchain is
more than sufficient to get the necessary data, and hopefully we can ge= t
our reliance on `bitcoind` down to a minimum in the future.

> Once again, please forgive my naive understanding of some of the i= ssues
> involved and thanks for your patience.

Absolutely no problem, it is a common misconception that `-txindex` is
required to run a lightning node in all cases :-)

Cheers,
Christian
_______________________________________________
bitcoin-dev mailing list
bitcoin-dev@li= sts.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
--000000000000d54900056e87afe8--