Bitcoin Forum
September 27, 2018, 11:14:05 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Time it takes to accept new chain and reorganize blocks  (Read 836 times)
btcrich
Sr. Member
****
Offline Offline

Activity: 302
Merit: 250


Any store can buy, sell, and accept Crypto


View Profile
July 07, 2013, 09:40:48 AM
 #1

When broadcasting a new chain to the network that would reorganize perhaps only the 10 last blocks, the network accepts it within the next 1-2 next blocks.

However, when I broadcast a chain that reorganizes the last 300 or so blocks, it takes significantly longer for the network to finally accept this chain.

Why does it take longer when reorganizing a larger number of blocks?

██████████████████████████████████████████████████████████████████▄   ▄
███████████████████████████████████████████████████████████████████▀▄▀
██████████████████████████████████████████████████████████████████▄▀ ▀▄

  ▄▄▄▄▄▄▄▄      ▄▄▄        ▄▄▄  ▄▄▄           ▄▄▄  ▄▄▄▄▄▄▄▄▄       ▄▄▄
  ██████████▄   ███        ███  ████▄         ███  ███████████▄    ███
  ███     ▀███  ███        ███  ██████▄       ███  ███      ▀███   ███
  ███      ███  ███        ███  ███ ▀███▄     ███  ███        ███  ███
  ███     ▄███  ███        ███  ███   ▀███▄   ███  ███        ███  ███
  ██████████▀   ███▄      ▄███  ███     ▀███▄ ███  ███       ▄███  ███
  ███▀▀▀▀▀       ███▄▄▄▄▄▄███   ███       ▀██████  ███▄▄▄▄▄▄███▀   ███
  ███             ▀████████▀    ███         ▀████  █████████▀▀     ███
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
.
Whitepaper   Twitter   Facebook
Telegram     Medium    Youtube
1538090045
Hero Member
*
Offline Offline

Posts: 1538090045

View Profile Personal Message (Offline)

Ignore
1538090045
Reply with quote  #2

1538090045
Report to moderator
1538090045
Hero Member
*
Offline Offline

Posts: 1538090045

View Profile Personal Message (Offline)

Ignore
1538090045
Reply with quote  #2

1538090045
Report to moderator
1538090045
Hero Member
*
Offline Offline

Posts: 1538090045

View Profile Personal Message (Offline)

Ignore
1538090045
Reply with quote  #2

1538090045
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1538090045
Hero Member
*
Offline Offline

Posts: 1538090045

View Profile Personal Message (Offline)

Ignore
1538090045
Reply with quote  #2

1538090045
Report to moderator
TierNolan
Legendary
*
Offline Offline

Activity: 1190
Merit: 1001


View Profile
July 07, 2013, 10:04:52 AM
 #2

Why does it take longer when reorganizing a larger number of blocks?

More data needs to be sent, possibly.

The way the system works is that clients only forward blocks when they are added to the main chain.

So, if the chain was

A1 <- B1 <- C1 <- D1

and the client received B2, then it just stores B2 in RAM and doesn't forward it.  If you then send C2, that is again not forwarded.

Once you finally send E2, the alt chain becomes the longest.  This means B2, C2, D2 and E2 are all added to the main block chain and the client broadcasts all blocks to its neighbours.

They then have to do the same thing.

The effect is that you have to send all 300 blocks to all peers before any of them will forward any of them.

With enough blocks the other client might even run out of RAM, so not store all 300.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
btcrich
Sr. Member
****
Offline Offline

Activity: 302
Merit: 250


Any store can buy, sell, and accept Crypto


View Profile
July 07, 2013, 10:59:26 AM
 #3

Interesting.  This makes sense but I'm assuming there's a little more to it.

I believe this implies that the peer does not calculate the sum of all difficulties of the new chain until it has downloaded it completely?  Although not very efficient, I imagine a malicious user could take down peers this way.

██████████████████████████████████████████████████████████████████▄   ▄
███████████████████████████████████████████████████████████████████▀▄▀
██████████████████████████████████████████████████████████████████▄▀ ▀▄

  ▄▄▄▄▄▄▄▄      ▄▄▄        ▄▄▄  ▄▄▄           ▄▄▄  ▄▄▄▄▄▄▄▄▄       ▄▄▄
  ██████████▄   ███        ███  ████▄         ███  ███████████▄    ███
  ███     ▀███  ███        ███  ██████▄       ███  ███      ▀███   ███
  ███      ███  ███        ███  ███ ▀███▄     ███  ███        ███  ███
  ███     ▄███  ███        ███  ███   ▀███▄   ███  ███        ███  ███
  ██████████▀   ███▄      ▄███  ███     ▀███▄ ███  ███       ▄███  ███
  ███▀▀▀▀▀       ███▄▄▄▄▄▄███   ███       ▀██████  ███▄▄▄▄▄▄███▀   ███
  ███             ▀████████▀    ███         ▀████  █████████▀▀     ███
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
.
Whitepaper   Twitter   Facebook
Telegram     Medium    Youtube
TierNolan
Legendary
*
Offline Offline

Activity: 1190
Merit: 1001


View Profile
July 07, 2013, 12:21:12 PM
 #4

I believe this implies that the peer does not calculate the sum of all difficulties of the new chain until it has downloaded it completely?  Although not very efficient, I imagine a malicious user could take down peers this way.

I am not sure.  It might forward block headers (80 bytes) once the headers prove the longest chain.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
gmaxwell
Moderator
Legendary
*
qt
Offline Offline

Activity: 2520
Merit: 1514



View Profile
July 07, 2013, 05:22:03 PM
 #5

Can you elaborate a little more on exactly how and what you're testing here?

Bitcoin will not be compromised
btcrich
Sr. Member
****
Offline Offline

Activity: 302
Merit: 250


Any store can buy, sell, and accept Crypto


View Profile
July 07, 2013, 06:09:25 PM
 #6

Can you elaborate a little more on exactly how and what you're testing here?


I am experimenting with reorganizing past blocks in a chain.  I've noticed that the time it takes for my chain to be accepted by the network increases with the number of blocks I try to reorganize.  Obviously I'm testing this on a private chain of which I'm connected to 3-4 peers out of a total of about 10 peers on the network.  I have ~70% of the network hash rate.

██████████████████████████████████████████████████████████████████▄   ▄
███████████████████████████████████████████████████████████████████▀▄▀
██████████████████████████████████████████████████████████████████▄▀ ▀▄

  ▄▄▄▄▄▄▄▄      ▄▄▄        ▄▄▄  ▄▄▄           ▄▄▄  ▄▄▄▄▄▄▄▄▄       ▄▄▄
  ██████████▄   ███        ███  ████▄         ███  ███████████▄    ███
  ███     ▀███  ███        ███  ██████▄       ███  ███      ▀███   ███
  ███      ███  ███        ███  ███ ▀███▄     ███  ███        ███  ███
  ███     ▄███  ███        ███  ███   ▀███▄   ███  ███        ███  ███
  ██████████▀   ███▄      ▄███  ███     ▀███▄ ███  ███       ▄███  ███
  ███▀▀▀▀▀       ███▄▄▄▄▄▄███   ███       ▀██████  ███▄▄▄▄▄▄███▀   ███
  ███             ▀████████▀    ███         ▀████  █████████▀▀     ███
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
.
Whitepaper   Twitter   Facebook
Telegram     Medium    Youtube
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!