A fork choice rule is part of the blockchain consensus mechanism and it is used to find out the canonical chain for adding new blocks.
Fork choice rule becomes relevant when there is a fork caused by network partition or two blocks being produced at the same time. A fork could also happen when there are dishonest validators in the network.
When validators produce new blocks, they need to identify which block should be the parent of the block being produced. To find the parent block, validators have to run a function to find out the longest chain. This function is called the fork choice rule.
Depending on the blockchain consensus rules, the fork choice rule takes as input the current chain, the votes or attestations on finalized or seen blocks, and other relevant consensus data.
Share this post