Bitcoin Forum
January 24, 2022, 09:19:19 PM *
News: Latest Bitcoin Core release: 22.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Time it takes to accept new chain and reorganize blocks  (Read 880 times)
btcrich
Sr. Member
****
Offline Offline

Activity: 302
Merit: 250


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?
1643059159
Hero Member
*
Offline Offline

Posts: 1643059159

View Profile Personal Message (Offline)

Ignore
1643059159
Reply with quote  #2

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

Posts: 1643059159

View Profile Personal Message (Offline)

Ignore
1643059159
Reply with quote  #2

1643059159
Report to moderator
1643059159
Hero Member
*
Offline Offline

Posts: 1643059159

View Profile Personal Message (Offline)

Ignore
1643059159
Reply with quote  #2

1643059159
Report to moderator
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1009


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


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.
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1009


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
*
expert
Offline Offline

Activity: 3640
Merit: 5983



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?
btcrich
Sr. Member
****
Offline Offline

Activity: 302
Merit: 250


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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!