Author

Topic: Easy Way To Detect Bitcoin Fork? (Read 3840 times)

hero member
Activity: 616
Merit: 500
Firstbits.com/1fg4i :)
April 19, 2011, 06:12:39 PM
#9
Perhaps with should be talking about short term and long term forks
full member
Activity: 238
Merit: 100
April 19, 2011, 04:53:39 PM
#8
Detecting the split while it is happening and after the forks are being merged are two different things

Not very much unless the fork is hidden and grown independently of the network. If you have a well connected bitcoin daemon, it usually receives information about both the forking blocks from the network. It's now just a matter of checking ancestry of the blocks.
hero member
Activity: 616
Merit: 500
Firstbits.com/1fg4i :)
April 19, 2011, 04:34:20 PM
#7
Detecting the split while it is happening and after the forks are being merged are two different things
full member
Activity: 238
Merit: 100
April 19, 2011, 02:51:18 PM
#6
You can run bitcoin -printblocktree then look in debug.log to see any chain splits your client observed. My copy has seen three throughout its lifetime, all of them only a single block long.

It seems low. All invalid blocks are a single block splits. Whenever such a block is deemed invalid by the bitcoin program (because an alternative forked tree grew longer) and transactions are merged into the current tree, bitcoin prints "REORGANIZE" into debug.log. I grepped 4 such instances in April only. There should have been been more because my deamon may have picked the "correct" tree and didn't need to reorganize anything.
legendary
Activity: 1526
Merit: 1134
April 19, 2011, 02:09:57 PM
#5
You can run bitcoin -printblocktree then look in debug.log to see any chain splits your client observed. My copy has seen three throughout its lifetime, all of them only a single block long.
legendary
Activity: 1708
Merit: 1010
April 19, 2011, 01:34:41 PM
#4
I hear about this all the time...the chain forking...what's the easiest way to detect a fork?  Can someone develop this and put it on a website?

What kind of fork?  If you mean a network split, a seperate 'watchdog' process can detect when the intervel between blocks suddenly doubles, and issue a warning.  Each successive block that is over 80% longer than the prior average increases the certainty that a network split has occurred, and that you are likely on the wrong side of it.  If you are on the majority side, it doesn't really matter.

If you mean a blockchain split, then such a event can be detected by the clients because some of the clients will receive two valid blocks, and has to keep both until the next block is created, which then breaks the tie by being built off of one or the other.  The loser is discarded.
administrator
Activity: 5222
Merit: 13032
April 19, 2011, 12:57:11 PM
#3
With network segmentation, blocks will be produced more slowly. There will also be a large reorg after the network recombines, which is detectable.
hero member
Activity: 489
Merit: 505
April 19, 2011, 11:35:52 AM
#2
A fork is not easy to detect. It is the consequence of a network partition which can be caused by ad luck or a connectivity problem (chinas firewall blocks bitcoin traffic => fork). If a fork happens the networks might rejoin again later, discarding the shorter chain (probably the smaller partition).
Structuring the network might be a first step towards a partition tolerant network but currently there's no easy way.
legendary
Activity: 1304
Merit: 1015
April 19, 2011, 10:15:50 AM
#1
I hear about this all the time...the chain forking...what's the easiest way to detect a fork?  Can someone develop this and put it on a website?
Jump to: