-
Notifications
You must be signed in to change notification settings - Fork 490
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
Change legacy rando geth fork choice to be deterministic #871
Conversation
Is it about selfish mining? http://www.cs.cornell.edu/~ie53/publications/btcProcFC.pdf |
Codecov ReportAll modified lines are covered by tests ✅
... and 684 files with indirect coverage changes 📢 Thoughts on this report? Let us know!. |
Will this change enable validators to win a fork by mining blocks with lower hash value? |
The history of this implementation is related to concerns about selfish mining / hash-grinding attacks. But it's important to note that it has always been the final 'tie breaker' after other fork choice rules have been applied, so difficulty still dominates the choice. |
It might be that yhis change willbe safe and useful after introducing finality. |
This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
) Based on maticnetwork/bor#871 in bor, this PR handles import of same difficulty chains (tie breaker conditions) based on their height and hash. This PR also modifies an existing test to check different types of side-chain import and how the canonical is decided.
Opening for discussion.
ReorgNeeded
is part of the legacy geth-based fork choice rules but I assume it's still what's used. If so, it has this strange coin-flip last tie breaker rule. Not sure how often this is fired but if it is it would contribute to unnecessary forks and re-orgs. Trivial and safe to change and does not require a HF.Change was safe / successfully at previous company FWIW.
Description
Please provide a detailed description of what was done in this PR
Changes
Breaking changes
Please complete this section if any breaking changes have been made, otherwise delete it
Nodes audience
In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)
Checklist
Cross repository changes
Testing
Manual tests
Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it
Additional comments
Please post additional comments in this section if you have them, otherwise delete it