-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a tie breaker for forks of equal weight #22
Comments
This solution was part of the specs but was never implemented. |
@sa8 - what is the current chance of getting a tie? |
@momack2 I don't know, I'll need to ask Sentinel to check. I think that "small" forks happen quite often but don't have numbers. |
An example how a fork could get a tie: Let's suppose the network power keeps the same in certain time across several heights, when there is a network issue, perhaps propagation delay of something, there are
And then, at height |
A proposal of solution To compare the ticket value is one way to do it, but it looks a little complicated. Another way is to revise the weight algorithm which is already complex, to add in a bias, like adding the height number into the calculation.
H might be 2^8 or something. |
@steven004 I think it's quite obvious for everyone what a tie looks like... the question is given current network conditions how often this happens. |
I would think it's hard to get an answer, since it depends on a lot of things, network quality, number of miners, chain syncing performance, etc. What we could see is: the better the networker running, the less chance to get a tie. What I propose is to reduce the chance to almost 0, no matter how well the network is running. |
Thanks for the heads up @arajasek! |
@sa8 I don't think we necessarily want to prioritize bigger tipsets, this just felt cleaner to me in the unequal size case. Otherwise, we keep comparing the tickets until we reach the end of the smaller tipset (assuming they are all equal tickets) and then based on the spec, it's unclear to me what we should do. |
This is now FIP0023! |
Problem
The tie-breaker described in the spec for EC has never been implemented. Although not critical it would help miners converge more easily towards a common chain. This means that when two forks with the same weight occur all the miners that have received both forks will mine on the same one. Without a tie-breaker they would (randomly?) mine on both and may extend the forks for longer.
Proposed solution
For two tipsets of the same weight we choose the one with the smallest electionProof. In the case where two Tipsets of equal weight have the same min Election proof, the miner will compare the next smallest Election proof in the Tipset (and select the Tipset with the next smaller proof). This continues until one Tipset is selected.
Other solutions
Any solution that is both deterministic and non-biasable (i.e. an adversary may not make their chain more likely to be selected by the chain selection algorithm in the case of forks of equal weight) may work.
The ElectionProof is unbiasable and hence is a good candidate for tie-breaker. Any deterministic rule other than
minimum
would work just as fine.Draft FIP here: https://docs.google.com/document/d/1VHm_0rh9XCcjJsrnpbLtbFpLNRmOgkEoNTNlt0NHiOQ/edit?usp=sharing
The text was updated successfully, but these errors were encountered: