public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Stefan Thomas <moon@justmoon•de>
To: bitcoin-development@lists•sourceforge.net
Subject: Re: [Bitcoin-development] Request review: drop misbehaving peers
Date: Thu, 15 Sep 2011 15:00:06 +0200	[thread overview]
Message-ID: <4E71F6D6.2090208@justmoon.de> (raw)
In-Reply-To: <CABsx9T0Eowp6_mTcggCz3tivRL0NsqyyxqingmPzZ2qkJnU9EA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2389 bytes --]

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.
>


[-- Attachment #2: Type: text/html, Size: 3006 bytes --]

  reply	other threads:[~2011-09-15 13:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-15  1:57 Gavin Andresen
2011-09-15  2:06 ` Luke-Jr
2011-09-15 10:43   ` Christian Decker
2011-09-15 12:56   ` kjj
2011-09-15 15:36     ` Luke-Jr
2011-09-15 16:04       ` kjj
2011-09-15 16:41         ` solar
2011-09-15 17:29         ` Luke-Jr
2011-09-15 16:19       ` Gavin Andresen
2011-09-15 17:41         ` Douglas Huff
     [not found]           ` <CABsx9T3HCVAn5ECuPWfAyZ4zt3WCbyKPF-7DV1HY2j2TKjavrg@mail.gmail.com>
2011-09-15 18:36             ` Douglas Huff
2011-09-15 19:07               ` Gavin Andresen
2011-09-15 11:45 ` Mike Hearn
2011-09-15 12:25   ` Gavin Andresen
2011-09-15 13:00     ` Stefan Thomas [this message]
2011-09-15 14:06       ` Gavin Andresen
2011-09-15 14:21         ` Gregory Maxwell
2011-09-15 16:21         ` Mike Hearn
2011-09-16 12:57         ` Joel Joonatan Kaartinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E71F6D6.2090208@justmoon.de \
    --to=moon@justmoon$(echo .)de \
    --cc=bitcoin-development@lists$(echo .)sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox