Author

Topic: Time it takes to accept new chain and reorganize blocks (Read 927 times)

sr. member
Activity: 302
Merit: 250
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.
staff
Activity: 4326
Merit: 8951
Can you elaborate a little more on exactly how and what you're testing here?
legendary
Activity: 1232
Merit: 1094
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.
sr. member
Activity: 302
Merit: 250
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.
legendary
Activity: 1232
Merit: 1094
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.
sr. member
Activity: 302
Merit: 250
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?
Jump to: