<p>The Blockchain is never changed only extended.</p>

<p>As I understand it, nodes do not explicitly check or care whether other nodes have identical copies. They just verify what they receive against what they already have in their copy of the Blockchain.</p>

<p>Synchronisation isn't exactly the right word to describe what happens but it effectively occurs as a consequence of nodes applying the same "consensus" rules. Nodes follow the longest chain, the one with most proof of work. </p>

CC BY-SA 4.0
2019-01-01T18:35:25.620Z
Thanks. How do the nodes discover the 'longest chain'?
Andrew
CC BY-SA 4.0
2018-12-30T22:07:32.977Z
2018-12-30T22:07:32.977Z
RedGrittyBrick
<p>The blockchain is an append-only data structure.  The only changes that happen are appending to an existing chain or rolling back blocks to switch onto a better chain that forks off earlier.</p>

<p>Nodes always attempt to be on the valid chain with the most proof of work.</p>

<p>To accomplish this they synchronize block headers with their peers.  Synchronization of headers uses locator messages:  You send your peer a list of block IDs that you know going back to the initial block, and your peer finds the highest point in the list that they know and sends you headers after that point-- which you probably don't know.  To make this efficient, the space between headers in the locator list doubles every entry after the first few. This causing the header synchronization process to be O(log n).</p>

<p>Once the node has a connected set of new headers that are a candidate for the most-work chain it starts fetching blocks along that chain of headers-- from peers that claim to have those block according to their header announcements-- and validating them.  If it encounters an invalid block, disconnects the origin, marks it and all headers in the chain after that block as invalid, and figures out where the new most work tip would be disregarding all the headers for invalid blocks and begins fetching and validating blocks towards that new best tip.</p>

CC BY-SA 4.0
2019-01-01T18:38:18.603Z
Thanks. How many pees does a node have? How does a node discover them?
Andrew
CC BY-SA 4.0
2019-01-01T18:51:13.477Z
Correction: pees = peers
Andrew
CC BY-SA 4.0
2019-01-01T21:14:13.683Z
Nodes usually make 8 outbound connections and normally have up to 125 connections in total.  They find out about them from other existing peers, from dns servers that they can query if they are having trouble finding any peers, and from a built in list.
G. Maxwell
CC BY-SA 4.0
2018-12-31T09:47:09.377Z
2018-12-31T09:47:09.377Z
G. Maxwell
<p>Beginner questions...</p>

<p>I understand that everybody has their own copy of the blockchain. </p>

<p>If one person makes a change, for example a transaction, I assume that it has to propagate to all other nodes. How long does this take?</p>

<p>How does a node know that the update process is complete throughout the blockchain?</p>

<p>What algorithm is used to synchronize and what is its order (O())?</p>

<synchronization>
How long does it take to update all nodes that have the blockchain so that they are identical?
Andrew
# How long does it take to update all nodes that have the blockchain so that they are identical?

(Asked by: username_0 on 2018-12-30)

Beginner questions...

I understand that everybody has their own copy of the blockchain.

If one person makes a change, for example a transaction, I assume that it has to propagate to all other nodes. How long does this take?

How does a node know that the update process is complete throughout the blockchain?

What algorithm is used to synchronize and what is its order (O())?

**Tags:** synchronization


---

## 2 answers

### Answer by username_1 on 2018-12-30. Score: 1

The Blockchain is never changed only extended.

As I understand it, nodes do not explicitly check or care whether other nodes have identical copies. They just verify what they receive against what they already have in their copy of the Blockchain.

Synchronisation isn't exactly the right word to describe what happens but it effectively occurs as a consequence of nodes applying the same "consensus" rules. Nodes follow the longest chain, the one with most proof of work.

> **Comments:**
> **username_0**: Thanks. How do the nodes discover the 'longest chain'?  

---

### Answer by username_2 on 2018-12-31. Score: 1

The blockchain is an append-only data structure. The only changes that happen are appending to an existing chain or rolling back blocks to switch onto a better chain that forks off earlier.

Nodes always attempt to be on the valid chain with the most proof of work.

To accomplish this they synchronize block headers with their peers. Synchronization of headers uses locator messages: You send your peer a list of block IDs that you know going back to the initial block, and your peer finds the highest point in the list that they know and sends you headers after that point-- which you probably don't know. To make this efficient, the space between headers in the locator list doubles every entry after the first few. This causing the header synchronization process to be O(log n).

Once the node has a connected set of new headers that are a candidate for the most-work chain it starts fetching blocks along that chain of headers-- from peers that claim to have those block according to their header announcements-- and validating them. If it encounters an invalid block, disconnects the origin, marks it and all headers in the chain after that block as invalid, and figures out where the new most work tip would be disregarding all the headers for invalid blocks and begins fetching and validating blocks towards that new best tip.

> **Comments:**
> **username_0**: Thanks. How many pees does a node have? How does a node discover them?  
> **username_0**: Correction: pees = peers  
> **username_2**: Nodes usually make 8 outbound connections and normally have up to 125 connections in total.  They find out about them from other existing peers, from dns servers that they can query if they are having trouble finding any peers, and from a built in list.  

---

