<p>When a fork exists with two equal-work branches, it is not unreasonable that the one we saw second will get extended.</p>

<p>There is little DoS risk in downloading both, as an attacker must spend an enormous amount of work to even make us do so.</p>

<p>At the same time, it is useful to be prepared for the blocks in a reorganization, as it reduces the time needed for such a block to propagate through the network.</p>

CC BY-SA 4.0
2018-11-11T09:28:58.253Z
Thank you Pieter. You say it is not unreasonable.Do you have any numbers to quantify the probability of the second block being later on longer chain? Intuitively, it seems to me that this would be a rather rare case and so I question whether it's worth to spend resources on downloading and partially checking the block. It's my intuition good or not? If it is a rare, let's say on the order of 5%, are you trying to say that the resources spent are negligible and so it is still worth?
Wapac
CC BY-SA 4.0
2018-11-11T17:52:42.560Z
The resources spent are negligable indeed, because it happens so infrequently (it's much less than 5%, closer to 0.1% in practice), and furthermore it is expensive for an attacker to raise that number (because they'd be literally wasting money to do so).
Pieter Wuille
CC BY-SA 4.0
2018-11-11T07:26:57.097Z
2018-11-11T07:26:57.097Z
Pieter Wuille
<p>net_processing.cpp contains</p>

<blockquote>
<pre><code>    // If this set of headers is valid and ends in a block with at least as
    // much work as our tip, download as much as possible.
</code></pre>
</blockquote>

<p>why are we interested in chain that's only equal in work to what we already have? would it make not better sense to download only when chain is better? what is the benefit in this <code>&lt;=</code> logic compared to if it was just <code>&lt;</code>?</p>

<bitcoin-core><synchronization>
Bitcoin Core chain download criterium
Wapac
# Bitcoin Core chain download criterium

(Asked by: username_0 on 2018-11-10)

net\_processing.cpp contains

> ```
>     // If this set of headers is valid and ends in a block with at least as
>     // much work as our tip, download as much as possible.
>
> ```

why are we interested in chain that's only equal in work to what we already have? would it make not better sense to download only when chain is better? what is the benefit in this `<=` logic compared to if it was just `<`?

**Tags:** bitcoin-core, synchronization


---

## 1 answers

### Answer by username_1 on 2018-11-11. Score: 1 | Accepted answer

When a fork exists with two equal-work branches, it is not unreasonable that the one we saw second will get extended.

There is little DoS risk in downloading both, as an attacker must spend an enormous amount of work to even make us do so.

At the same time, it is useful to be prepared for the blocks in a reorganization, as it reduces the time needed for such a block to propagate through the network.

> **Comments:**
> **username_0**: Thank you username_1. You say it is not unreasonable.Do you have any numbers to quantify the probability of the second block being later on longer chain? Intuitively, it seems to me that this would be a rather rare case and so I question whether it's worth to spend resources on downloading and partially checking the block. It's my intuition good or not? If it is a rare, let's say on the order of 5%, are you trying to say that the resources spent are negligible and so it is still worth?  
> **username_1**: The resources spent are negligable indeed, because it happens so infrequently (it's much less than 5%, closer to 0.1% in practice), and furthermore it is expensive for an attacker to raise that number (because they'd be literally wasting money to do so).  

---

