Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1SDxQ3-0000GH-Ba for bitcoin-development@lists.sourceforge.net; Sat, 31 Mar 2012 12:28:35 +0000 X-ACL-Warn: Received: from vps7135.xlshosting.net ([178.18.90.41]) by sog-mx-4.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1SDxQ2-0007Ai-Ew for bitcoin-development@lists.sourceforge.net; Sat, 31 Mar 2012 12:28:35 +0000 Received: by vps7135.xlshosting.net (Postfix, from userid 1000) id 8BBCA614C2; Sat, 31 Mar 2012 14:28:28 +0200 (CEST) Date: Sat, 31 Mar 2012 14:28:28 +0200 From: Pieter Wuille To: Michael =?iso-8859-1?Q?Gr=F8nager?= Message-ID: <20120331122827.GA15726@vps7135.xlshosting.net> References: <201203310003.18599.luke@dashjr.org> <20120331105401.GA14117@vps7135.xlshosting.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: X-PGP-Key: http://sipa.ulyssis.org/pubkey.asc User-Agent: Mutt/1.5.20 (2009-06-14) Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.2 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (pieter.wuille[at]gmail.com) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 1.2 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list X-Headers-End: 1SDxQ2-0007Ai-Ew Cc: bitcoin-development@lists.sourceforge.net Subject: Re: [Bitcoin-development] 0.7 merge recommendations/status 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: Sat, 31 Mar 2012 12:28:35 -0000 On Sat, Mar 31, 2012 at 01:16:56PM +0200, Michael Gr=F8nager wrote: > If you are interested, I could push libcoin to bitcoin (e.g. bitcoin/li= bcoin) and then you could build bitcoind bitcoin-qt on libcoin. >=20 > libcoin solved most of the problems you list below. And if you worry ab= out the copyright/license I am also willing to change that to make it fit= . Thanks for that - without a license change it would not be possible to me= rge anything. > libcoin have no global thread mutexes and and there is no blocking of t= he main thread due to rpc methods (except for a sendto), further, e.g. a = reorganize only locks the main thread for a split second while the final = commit is done.=20 Yes, I like its design and refactorings a lot, but at the same time it's = very large change to accept at once. In particular, I'm not entirely conv= inced yet about its thread-safety. For example, acceptblock is a public m= ethod, but it seems (i may be missing something) to grab no lock at all u= ntil setBestBlock or reorganize is called. Is it impossible to call accep= tBlock twice simultaneously? One may start with a bestblockindex value th= at gets modified a split second later by a simultaneous call. It may be t= he case that there are indeed no possibilities for this to happen because= of things I'm missing, but although I'm a big fan of well-encapsulated l= ocks and the use of reader-writer locks, it's hard to verify whether you = use them enough. My suggestion would be: make each publicly accessible me= thod of BlockChain grab either a reader lock (if it's a const function) o= r an upgradable lock, and take a writer lock in each method that actually= performs changes. > The libcoin rpc supports keep_alive and pipelining, runs in its own thr= ead (but can also run in the same thread as the node) and uses async oper= ation. Ipv6 is easy to implement in libcoin as the CAddress/Endpoint clas= s is implemented as a subclass of boost::endpoint, only thing holding bac= k is deciding on an ipv6 format on IRC, and, I then I would really like t= o reverse the order of the last 12 bytes in the address db (they are oppo= site to boost). Not sure what you mean: the serialized combination of the 32-bit IPv4 add= ress and 12 bytes padding in CAddress are exactly a bsd socket library in= 6_addr in network byte order. In 0.6.0, CAddress derives from CNetAddr, w= hich encapsulates these 16 bytes. --=20 Pieter