public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Pieter Wuille <pieter.wuille@gmail•com>
To: Bob McElrath <bob_bitcoin@mcelrath•org>
Cc: Bitcoin Dev <Bitcoin-development@lists•sourceforge.net>
Subject: Re: [Bitcoin-development] Synchronization: 19.5 % orphaned blocks at height 197'324
Date: Sun, 10 Aug 2014 20:07:54 +0200	[thread overview]
Message-ID: <CAPg+sBhPaO3oxXhuKN=YDZZZmW5pAaC2ay0uVHhTOB1UirUMaA@mail.gmail.com> (raw)
In-Reply-To: <20140810140719.GA20493@mcelrath.org>

On Sun, Aug 10, 2014 at 4:07 PM, Bob McElrath <bob_bitcoin@mcelrath•org> wrote:
> I had the same problem (repeatedly) which came down a hardware problem.

This is actually an independent problem (though something to be aware
of). Flaky hardware can make synchronization fail completely - as it
relies on being able to exactly assess the validity of everything in
the blockchain.

Stilll...

> mbde@bitwatch•co [mbde@bitwatch•co] wrote:
>> Hello all,
>>
>> I'm currently synchronizing a new node and right now, at a progress of a
>> height of 197'324 blocks, I count in my debug.log an aweful amount of
>> 38'447 orphaned blocks which is about 19.5 %.
>>
>> It has been I while since I watched the synchronization process closely,
>> but this number seems pretty high to me.

Orphan blocks during synchronization are unfortunately very common,
and the result of a mostly broken download logic in the client. They
are blocks that are further ahead in the chain than the point where
you're currently synchronized to, and thus can't be validated yet.
Note that 'orphan' here means 'we do not know the parent'; it doesn't
just mean 'not in the main chain'. They are blocks that are received
out of order.

As Jeff mentions, headers-first synchronization fixes this problem
(and many other download-logic related things), by first verifying the
headers in the chain (thus already having partially validated
everything), and then downloading the blocks (in not necessarily the
right order) anymore, from multiple peers in parallel. There is
currently a pull request for it, but it's not production ready
(#4468).

>> I'm wondering about the following: would it be possible for a malicious
>> party to generate chains of blocks with low difficulity which are not
>> part of the main chain to slow down the sync process?

Yes and no. While you're still synchronization, and don't actually
know the best chain, a peer could send you stale branches (with valid
proof of work), which you would accept, store and process. But it has
to be done very early, as once you learn of a good-enough chain, a
branch with more proof of work would be requires due to some
heuristics designed to exactly prevent such an attack.

-- 
Pieter



  reply	other threads:[~2014-08-10 18:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-10 13:42 mbde
2014-08-10 14:07 ` Bob McElrath
2014-08-10 18:07   ` Pieter Wuille [this message]
2014-08-10 14:20 ` Jeff Garzik

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='CAPg+sBhPaO3oxXhuKN=YDZZZmW5pAaC2ay0uVHhTOB1UirUMaA@mail.gmail.com' \
    --to=pieter.wuille@gmail$(echo .)com \
    --cc=Bitcoin-development@lists$(echo .)sourceforge.net \
    --cc=bob_bitcoin@mcelrath$(echo .)org \
    /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