summaryrefslogtreecommitdiff
path: root/2f/f65eecac8cf6de827101e6473a795a67227da9
blob: 512b64e7587235889926771eb39c7f566885c052 (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
Return-Path: <laanwj@gmail.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 89FDF14C6
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Fri, 18 Sep 2015 00:07:24 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com
	[209.85.212.169])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id EFB8E161
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Fri, 18 Sep 2015 00:07:23 +0000 (UTC)
Received: by wicge5 with SMTP id ge5so11438524wic.0
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Thu, 17 Sep 2015 17:07:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-type:content-disposition:in-reply-to;
	bh=wpfbw4b9m9q4a2xnINrq0K7KAE3RjFdYWF5suUZLdTI=;
	b=R/1+KiyPtzRHL0clrLPD+lA3obxu91cj9spCSJnsKYPRx/MvrXeEM6JgB8oAMzKDEh
	hKq+rVdXjalBeTCJ37pfLvdhETRv8lUm66n43pm4RRlg0zrd49viRaPxZAp61NQ0a2CZ
	ZHi3fKWe1BWWptuYhqKOhIDjjcaFaYAZvjefI2UVNhwYhNqAisBYeIPJoJtOzfAqecFp
	Gf4/aCwvPDnzIEVTuRREHjmHmGDNDqR8FGMMTe1gkiU1eM2y96DxfpPKOVT/vwGu9QRU
	bKDJq+MM0JnCRWH1bh4oj+Vfp4oOKxvZRxgvkfQfNDcAWubM3ed4js9aVeKb7gotPUe+
	QMDA==
X-Received: by 10.194.60.115 with SMTP id g19mr3138605wjr.29.1442534842596;
	Thu, 17 Sep 2015 17:07:22 -0700 (PDT)
Received: from amethyst.visucore.com (dhcp-089-098-228-253.chello.nl.
	[89.98.228.253])
	by smtp.gmail.com with ESMTPSA id uq5sm5919665wjc.3.2015.09.17.17.07.21
	(version=TLSv1.2 cipher=RC4-SHA bits=128/128);
	Thu, 17 Sep 2015 17:07:21 -0700 (PDT)
Date: Fri, 18 Sep 2015 02:07:20 +0200
From: "Wladimir J. van der Laan" <laanwj@gmail.com>
To: Peter Todd <pete@petertodd.org>
Message-ID: <20150918000718.GA5251@amethyst.visucore.com>
References: <CADm_WcY8Vy+k+5BaBS+jV6D6tmSXrok8rAxoPxxKOzUhyPWgMg@mail.gmail.com>
	<20150916222928.GC32688@muck>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20150916222928.GC32688@muck>
X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM,
	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
Cc: Bitcoin development mailing list <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] libconsensus and bitcoin development process
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: Fri, 18 Sep 2015 00:07:24 -0000

On Wed, Sep 16, 2015 at 06:29:28PM -0400, Peter Todd via bitcoin-dev wrote:

> I've run into a number of cases where companies were maintaining forks
> of Bitcoin Core unnecessarily, where a different, loosely coupled,
> architecture could do what they needed to do without including the new
> logic in the codebase itself.

This is the same point I have been making to Jeff privately.

Refactors are a means to an end: a more modular, reusable and maintainable codebase. This goal is that new functionality can be plugged in more easily, and rebase work for e.g. functionality built on top can go down, not up, if it just hooks into well-defined interfaces here and there.

Although there has been a lot of progress, bitcoind's design is still too monolithic. To add a more involved feature, like say a new index over the block chain data, code needs to be touched all over the place. This change interacts with all other functionality, potentially breaking the base node functionality - risk for users that do NOT use the functionality. This increases risk and review time.

- *If possible* functionality should be built without changing bitcoind's code at all. An external process should be able to keep up to date with the chain, notice reorgs, and process block data accordingly. If bitcoind's interface does not allow that, or it is too difficult, that is what should be fixed. 
- *if not possible* then a change should at least touch the code in as few places as possible, and integrate with e.g. signal notification.

To name an example of it done right, IMO: Monero's 'simplewallet'. It is a command-line utility wallet that communicates with the node software, and remembers where it was in the chain, and processes changes to the chain state since its last invocation when it 'refreshes'. 
What is nice is that one can run an arbitary number of simplewallets against one node daemon, and unlike bitcoind's wallet it doesn't need to run as always-on daemon itself. It can be invoked when the user wants to do something with the wallet, or see if there are new transactions.

An index could be implemented entirely externally in a similar way, while still fully handling reorgs.

What one needs for that, I think, is a library that communicate with the node, and which offers functionality abstractly be similar to 'git pull': give me the tree path from my current known tip to the best tip, and supply the block hashes (and block data) along the way. 

My long-term vision of bitcoind is a P2P node with validation and blockchain store, with a couple of data sources that can be subscribed to or pulled from.

Wladimir