From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1TwExw-0003I6-NM for bitcoin-development@lists.sourceforge.net; Fri, 18 Jan 2013 16:38:52 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.219.43 as permitted sender) client-ip=209.85.219.43; envelope-from=mh.in.england@gmail.com; helo=mail-oa0-f43.google.com; Received: from mail-oa0-f43.google.com ([209.85.219.43]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1TwExv-00081V-F9 for bitcoin-development@lists.sourceforge.net; Fri, 18 Jan 2013 16:38:52 +0000 Received: by mail-oa0-f43.google.com with SMTP id k1so4020643oag.2 for ; Fri, 18 Jan 2013 08:38:46 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.29.70 with SMTP id i6mr7685478oeh.38.1358527126140; Fri, 18 Jan 2013 08:38:46 -0800 (PST) Sender: mh.in.england@gmail.com Received: by 10.76.128.139 with HTTP; Fri, 18 Jan 2013 08:38:45 -0800 (PST) In-Reply-To: <1358348447.1048.0.camel@localhost.localdomain> References: <20121121151534.GA5540@vps7135.xlshosting.net> <1353523117.1085.14.camel@localhost.localdomain> <20121127211019.GA22701@vps7135.xlshosting.net> <1357876751.1740.4.camel@localhost.localdomain> <1358348447.1048.0.camel@localhost.localdomain> Date: Fri, 18 Jan 2013 17:38:45 +0100 X-Google-Sender-Auth: kv8G3Zve08PKkmrsfUXOj0DgQPo Message-ID: From: Mike Hearn To: Matt Corallo Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (mh.in.england[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1TwExv-00081V-F9 Cc: Bitcoin Dev Subject: Re: [Bitcoin-development] Draft BIP for Bloom filtering X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2013 16:38:52 -0000 I'm thinking we should actually make the change we talked about before and have the filtered block sent before the transaction data. For one, it's not intuitive (API wise) that you'd get a callback saying "new pending tx" immediately before another callback saying "tx was confirmed", but that's what the current setup makes most natural. To fix it we'd have to notice that a tx message wasn't requested by us, buffer it, and wait for the corresponding filteredblock message. It seems cleaner to receive a filteredblock and then for any tx that matches it, attach it to the FilteredBlock object and wait until it is full up, then pass it to the wallet code all at once. Another issue is that to risk analyze unconfirmed transactions you really have to download all dependencies. That has to be triggered by seeing an unconfirmed transaction. It's dumb to start this process for a tx that is actually in the chain, so you need to have some notion of whether it came from a filtered block anyway. I only realized this today. I think when we discussed this before, the justification for having it work the current way was that it was simpler to integrate with the SPV client code if it was done this way around. But I don't think it's really simpler. There are enough odd side effects of doing it this way, that I feel it'd be better to tweak the protocol now whilst we have the chance. On Wed, Jan 16, 2013 at 4:00 PM, Matt Corallo wrote: > Actually, there is one more minor algorithmic change I would like to > make to the way the hash function is computed really quick before it > gets merged, I'll have that finished up by the end of today. > > Matt > > On Wed, 2013-01-16 at 11:43 +0100, Mike Hearn wrote: >> Matts latest code has been tested by Andreas and seems to work >> correctly. He had to extend the client a bit to refresh the filter >> every 25k blocks because even with the extra flag, eventually the >> filter degrades into uselessness, but it did still improve the >> situation quite a bit. >> >> Because it's unit tested, been reviewed by me several times, has an >> interoperable implementation that has also been tested by Andreas in a >> build of his smartphone app, I'm going to ACK the current code and >> request that it be merged in to 0.8. What do you say Gavin? >> >> The next step after that would be profiling. It's a big performance >> improvement for SPV clients already, but not as much as I anticipated. >> I suspect there's a simple bottleneck or missed optimization >> somewhere. But that can obviously come post-0.8 > >