summaryrefslogtreecommitdiff
path: root/d5/0c744b66fdbc8cacaece51ec923b68dd0de6ef
blob: 4a73c17eace5532bdeb7f685110ee33f2920c71c (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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
Return-Path: <laolu32@gmail.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id F024FE43
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Sat, 19 May 2018 02:57:26 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 37D00B0
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Sat, 19 May 2018 02:57:26 +0000 (UTC)
Received: by mail-wm0-f53.google.com with SMTP id n10-v6so18146762wmc.1
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Fri, 18 May 2018 19:57:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:references:in-reply-to:from:date:message-id:subject:to
	:cc; bh=PoSv9QDfw4KeNGqOzJVNkj1IMINLrtEsiP4fqlEdiAY=;
	b=QyagduV+KXSSjKpSk5L/Z8/uUWiR1y7ox2iUPijajFvpBeZAF+Df84+1stjTq6GfTe
	bHFIIUQhQyjkMcSXSK4SWZt03/iGqKPWLC6UyOqnK1cHFEUmrTlGSBPJMtgqC7dKEiMl
	IyL9851cdQxZEGBQszqo3tuv8BP3oKQ45/m30IqnsNaUWObHpau/+42HemILBfEuqTCO
	7PReXv6OWtc3Y6TI4oiJ1hOPWL/EqPKro7PqoOmsbAIR51FHkTvd4A/8BiHkTL0raczC
	HeaNiY5hQ/zg8+FzNM0aDzcM55pBfJhwlgyCn5qvp8gofEUdm5pMTgYKSbq809r+izEE
	mQew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:references:in-reply-to:from:date
	:message-id:subject:to:cc;
	bh=PoSv9QDfw4KeNGqOzJVNkj1IMINLrtEsiP4fqlEdiAY=;
	b=cHWuvWY0T4qu08pqhycJkDXC6EfoaRZw9nuvZuG1/+MhVv1XkDSxInA/WszU9wX1BG
	upIRovSpQOB0WPvtMMGVCJH9f7nCyojaka4mlTe+W8Cq0egS82UCYvYSUlyXsBR6OSRV
	4PG0Jk6FiNsd0/IqNZo+q+Y7rLpECl2emj1VFM+TXAcIff0RD4FigDX62X1SgGwhXi3i
	iDnPFBjuWo/88aMBjo048HT2SnbgKiaJlFckllaVUnX62ADGgi1NVB97/xgtVh0EGmb7
	dKbHOsee6MfD289n8bRtf9HVcdI/dwKxz3KsitU79ftafaMW9Rv0xuuuwkkxshNOdW6C
	uUXQ==
X-Gm-Message-State: ALKqPwethl/75ytWFGkyM4PXJBCm+Re1X+7zsvOFUHzA9x8XiT6+c/NT
	h190zMCg6fDRv7oDkUTneGUpZiVOrL0RNPyE7a4=
X-Google-Smtp-Source: AB8JxZpYqtKQ7/BnzutL/1tD25dkKdZYtsBP3g2F8qnqFe6duZcZZKnryA2JXRHKNBjDMFvjk48u+mSdBrw56/hCqAo=
X-Received: by 2002:a50:d311:: with SMTP id
	g17-v6mr14246037edh.160.1526698644812; 
	Fri, 18 May 2018 19:57:24 -0700 (PDT)
MIME-Version: 1.0
References: <d43c6082-1b2c-c95b-5144-99ad0021ea6c@mattcorallo.com>
	<CAAS2fgRF-MhOvpFY6c_qAPzNMo3GQ28RExdSbOV6Q6Oy2iWn1A@mail.gmail.com>
In-Reply-To: <CAAS2fgRF-MhOvpFY6c_qAPzNMo3GQ28RExdSbOV6Q6Oy2iWn1A@mail.gmail.com>
From: Olaoluwa Osuntokun <laolu32@gmail.com>
Date: Fri, 18 May 2018 19:57:12 -0700
Message-ID: <CAO3Pvs8DaphZjZUp8_Og+SMmYrrgFi3HyWTZb5J1mGVEcmkn8A@mail.gmail.com>
To: Gregory Maxwell <greg@xiph.org>, 
	Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Content-Type: multipart/alternative; boundary="00000000000067373c056c863ad9"
X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,
	HTML_MESSAGE,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
Subject: Re: [bitcoin-dev] BIP 158 Flexibility and Filter Size
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: Sat, 19 May 2018 02:57:27 -0000

--00000000000067373c056c863ad9
Content-Type: text/plain; charset="UTF-8"

Greg wrote:
> What about also making input prevouts filter based on the scriptpubkey
being
> _spent_?  Layering wise in the processing it's a bit ugly, but if you
> validated the block you have the data needed.

AFAICT, this would mean that in order for a new node to catch up the filter
index (index all historical blocks), they'd either need to: build up a
utxo-set in memory during indexing, or would require a txindex in order to
look up the prev out's script. The first option increases the memory load
during indexing, and the second requires nodes to have a transaction index
(and would also add considerable I/O load). When proceeding from tip, this
doesn't add any additional load assuming that your synchronously index the
block as you validate it, otherwise the utxo set will already have been
updated (the spent scripts removed).

I have a script running to compare the filter sizes assuming the regular
filter switches to include the prev out's script rather than the prev
outpoint itself. The script hasn't yet finished (due to the increased I/O
load to look up the scripts when indexing), but I'll report back once it's
finished.

-- Laolu


On Thu, May 17, 2018 at 9:37 AM Gregory Maxwell via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:

> On Thu, May 17, 2018 at 3:25 PM, Matt Corallo via bitcoin-dev
> <bitcoin-dev@lists.linuxfoundation.org> wrote:
> > I believe (1) could be skipped entirely - there is almost no reason why
> > you'd not be able to filter for, eg, the set of output scripts in a
> > transaction you know about
>
> I think this is convincing for the txids themselves.
>
> What about also making input prevouts filter based on the scriptpubkey
> being _spent_?  Layering wise in the processing it's a bit ugly, but
> if you validated the block you have the data needed.
>
> This would eliminate the multiple data type mixing entirely.
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>

--00000000000067373c056c863ad9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Greg wrote:</div><div>&gt; What about also making inp=
ut prevouts filter based on the scriptpubkey being</div><div>&gt; _spent_?=
=C2=A0 Layering wise in the processing it&#39;s a bit ugly, but if you</div=
><div>&gt; validated the block you have the data needed.</div><div><br></di=
v><div>AFAICT, this would mean that in order for a new node to catch up the=
 filter</div><div>index (index all historical blocks), they&#39;d either ne=
ed to: build up a</div><div>utxo-set in memory during indexing, or would re=
quire a txindex in order to</div><div>look up the prev out&#39;s script. Th=
e first option increases the memory load</div><div>during indexing, and the=
 second requires nodes to have a transaction index</div><div>(and would als=
o add considerable I/O load). When proceeding from tip, this</div><div>does=
n&#39;t add any additional load assuming that your synchronously index the<=
/div><div>block as you validate it, otherwise the utxo set will already hav=
e been</div><div>updated (the spent scripts removed).</div><div><br></div><=
div>I have a script running to compare the filter sizes assuming the regula=
r</div><div>filter switches to include the prev out&#39;s script rather tha=
n the prev</div><div>outpoint itself. The script hasn&#39;t yet finished (d=
ue to the increased I/O</div><div>load to look up the scripts when indexing=
), but I&#39;ll report back once it&#39;s</div><div>finished.</div><div><br=
></div><div>-- Laolu</div><div><br></div><br><div class=3D"gmail_quote"><di=
v dir=3D"ltr">On Thu, May 17, 2018 at 9:37 AM Gregory Maxwell via bitcoin-d=
ev &lt;<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev=
@lists.linuxfoundation.org</a>&gt; wrote:<br></div><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex">On Thu, May 17, 2018 at 3:25 PM, Matt Corallo via bitcoin-dev<br>
&lt;<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=3D"_bla=
nk">bitcoin-dev@lists.linuxfoundation.org</a>&gt; wrote:<br>
&gt; I believe (1) could be skipped entirely - there is almost no reason wh=
y<br>
&gt; you&#39;d not be able to filter for, eg, the set of output scripts in =
a<br>
&gt; transaction you know about<br>
<br>
I think this is convincing for the txids themselves.<br>
<br>
What about also making input prevouts filter based on the scriptpubkey<br>
being _spent_?=C2=A0 Layering wise in the processing it&#39;s a bit ugly, b=
ut<br>
if you validated the block you have the data needed.<br>
<br>
This would eliminate the multiple data type mixing entirely.<br>
_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=3D"_blank">=
bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" =
rel=3D"noreferrer" target=3D"_blank">https://lists.linuxfoundation.org/mail=
man/listinfo/bitcoin-dev</a><br>
</blockquote></div></div>

--00000000000067373c056c863ad9--