What is the maximum known Ethereum fork length?
What is the maximum Ethereum fork length in theory?
Edit: please read fork length as maximum number of uncle blocks.
What is the maximum known Ethereum fork length?
What is the maximum Ethereum fork length in theory?
Edit: please read fork length as maximum number of uncle blocks.
Note that this question isn't about the number of uncle/orphan blocks that can be incorporated into a canonical block. That number is 2, as defined in the code.
This question is about the length of the side-chain created by an ephemeral fork, which happens when two miners find the PoW solution to a given block at the same time. It's then possible for these single-block forks to be built on, leading to longer chain forks...
What is the maximum Ethereum fork length in theory?
Probably infinite.
For example, if the main network was for some reason split in two - e.g. if the Great Firewall of China started to block Ethereum traffic - then the miners inside and outside of the wall would continue to create their own chains. If nothing was done to address this split, such as introducing a new chain ID for one side of the fork (not to be confused with network ID), then those forks would remain compatible.
If the Firewall was one day taken down, then the forks could recombine and the chains reorganise into a single canonical chain. After any significant length of time, this would probably be a bad thing.
What is the maximum known Ethereum fork length?
Not sure. Good question :-)
An old blog post from the early days of the network - Chain Reorganisation Depth Expectations - has some pretty high figures for fork lengths, but these likely don't apply now the network is more mature and better connected.
There used to be a visual, live representation of forks as they happened on the following page, but it's no longer active: http://fork.ethstats.net/
There's a "secret" EtherScan page that lists all the blocks that have been excluded due to chain reorgs, but again that doesn't really help show any chain lengths: https://etherscan.io/blocks_forked
(Note that this page is slightly confusing because it doesn't contain all the same entries as EtherScan's list of uncle blocks... : https://etherscan.io/uncles. All entries from the blocks_forked
page are on the uncles
page, but not vice versa.)
I'll defer the proper answer to someone who can do the clever analysis required to work out a maximum past fork length from historical data :-)
It's not infinite at all. In the code you can find a hard-coded constant of Epoch length, which is 90000 blocks. This is the theoretical value.
Maximum number of uncles is 2.
Source: consensus/ethash/consensus.go, line 41
maxUncles = 2 // Maximum number of uncles allowed in a single block
If you are asking what the length of the blockchain is now, it is currently 6440717 blocks high at the time of writing.
If you are asking what the longest possible length of a forked chain can be, the answer is infinite. Forked chains will continue for as long as there is at least one miner mining on that chain.
Take ETC for example. The block height of ETC (a fork of ETH) is 6,667,943 at the time of writing. ETC forked from ETH on block 1,920,001, meaning the current height of this fork (further than the ETH height at time of fork) is 4,747,942. This can go on for as long as miners will mine ETC.