Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1R4BYe-00039m-23 for bitcoin-development@lists.sourceforge.net; Thu, 15 Sep 2011 13:00:48 +0000 X-ACL-Warn: Received: from sulfur.webpack.hosteurope.de ([217.115.142.104]) by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1R4BYZ-0000C7-7F for bitcoin-development@lists.sourceforge.net; Thu, 15 Sep 2011 13:00:47 +0000 Received: from 84-72-69-153.dclient.hispeed.ch ([84.72.69.153] helo=[192.168.0.21]); authenticated by sulfur.webpack.hosteurope.de running ExIM with esmtpsa (TLSv1:AES256-SHA:256) id 1R4BYT-00054e-3t; Thu, 15 Sep 2011 15:00:37 +0200 Message-ID: <4E71F6D6.2090208@justmoon.de> Date: Thu, 15 Sep 2011 15:00:06 +0200 From: Stefan Thomas User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 To: bitcoin-development@lists.sourceforge.net References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------030802040906090000080302" X-bounce-key: webpack.hosteurope.de;moon@justmoon.de;1316091643;f76c5950; X-Spam-Score: 1.0 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 1.0 HTML_MESSAGE BODY: HTML included in message X-Headers-End: 1R4BYZ-0000C7-7F Subject: Re: [Bitcoin-development] Request review: drop misbehaving peers 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: Thu, 15 Sep 2011 13:00:48 -0000 This is a multi-part message in MIME format. --------------030802040906090000080302 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit A few thoughts: Should the DoS protection auto-disable if the node has less than a minimum number of connections? The idea being that if our node seems to be kicking /everybody /off the roster maybe there is something wrong with the protections. It would be nice if the node sent a message to the banned peer with a code indicating the reason for the ban, specifically the offense that put Bitcoin over the edge. Logging the reason is probably fine for most cases, but I wanted to put the idea out there, because it might make debugging easier if there are some weird bans happening in the wild and we can't figure out why. Should sending lots of messages that don't pass the protocol-level checksum test be a bannable offense? Or generally sending garbage data? The attacks I'm thinking of are cross-protocol attacks. So as rough example: The attacker puts an iframe on a website with a url like http://victim.com:8333 so lots of people's browsers connect to it. Maybe he could even use something like [magic-bytes]tx\0[...][valid orphan transaction] in the URL, so the browser would send GET /[magic-bytes] etc. and the Bitcoin node would interpret it. kjj wrote: > A few non-standard transactions are probably legitimate. A whole bunch > of them are probably not. I would think that assigning a point or two > of badness to a peer sending one is pretty reasonable, with the > understanding that we would need to adjust that as the network evolves. Strongly disagree. What is a non-standard transaction today may /be /a standard transaction tomorrow. On 9/15/2011 2:25 PM, Gavin Andresen wrote: > Thanks Mike, that's exactly the kind of detailed review I was looking > for. I think you're right an all points. > > I'll simplify: I'll add a -banscore option (default 100), and if a > node accumulates more than -banscore misbehavior points it'll get > dropped and banned for -bantime (default 60*60*24) seconds. > > I'll make bad signatures a banning offense, and I'll remove the > number-of-sigops and non-standard-transaction penalties. > > I used a mutable field with const setter to avoid modifying a bunch of > methods to take non-const blocks/transactions instead of const; I > think it is appropriate because a block/transaction's DoS score is > really meta-data and not part of it's state. > > I'll make GetTime() unit-test friendly as you suggest. > --------------030802040906090000080302 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit A few thoughts:

Should the DoS protection auto-disable if the node has less than a minimum number of connections? The idea being that if our node seems to be kicking everybody off the roster maybe there is something wrong with the protections.

It would be nice if the node sent a message to the banned peer with a code indicating the reason for the ban, specifically the offense that put Bitcoin over the edge. Logging the reason is probably fine for most cases, but I wanted to put the idea out there, because it might make debugging easier if there are some weird bans happening in the wild and we can't figure out why.

Should sending lots of messages that don't pass the protocol-level checksum test be a bannable offense? Or generally sending garbage data? The attacks I'm thinking of are cross-protocol attacks. So as rough example: The attacker puts an iframe on a website with a url like http://victim.com:8333 so lots of people's browsers connect to it. Maybe he could even use something like [magic-bytes]tx\0[...][valid orphan transaction] in the URL, so the browser would send GET /[magic-bytes] etc. and the Bitcoin node would interpret it.

kjj wrote:

A few non-standard transactions are probably legitimate.  A whole bunch 
of them are probably not.  I would think that assigning a point or two 
of badness to a peer sending one is pretty reasonable, with the 
understanding that we would need to adjust that as the network evolves.

Strongly disagree. What is a non-standard transaction today may be a standard transaction tomorrow.


On 9/15/2011 2:25 PM, Gavin Andresen wrote:
Thanks Mike, that's exactly the kind of detailed review I was looking
for.  I think you're right an all points.

I'll simplify:  I'll add a -banscore option (default 100), and if a
node accumulates more than -banscore misbehavior points it'll get
dropped and banned for -bantime (default 60*60*24) seconds.

I'll make bad signatures a banning offense, and I'll remove the
number-of-sigops and non-standard-transaction penalties.

I used a mutable field with const setter to avoid modifying a bunch of
methods to take non-const blocks/transactions instead of const; I
think it is appropriate because a block/transaction's DoS score is
really meta-data and not part of it's state.

I'll make GetTime() unit-test friendly as you suggest.


--------------030802040906090000080302--