Skip to content
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

headerdownload: handle tie breaker for forkchoice in pow networks #8616

Merged
merged 2 commits into from
Nov 7, 2023
Merged

headerdownload: handle tie breaker for forkchoice in pow networks #8616

merged 2 commits into from
Nov 7, 2023

Conversation

manav2401
Copy link
Contributor

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.

if td.Cmp(hi.localTd) >= 0 {
reorg := true

// TODO: Add bor check here if required
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something which I am not sure of. If no other chain is using the PoW flow, I think we don't need to wrap this with isBor check. If not, we might have to change the function signature for checking if we're running bor.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PoW flow is only used for Polygon.

@mh0lt mh0lt merged commit 97f00a1 into erigontech:devel Nov 7, 2023
7 checks passed
@manav2401 manav2401 deleted the manav/bor-fork-choice branch January 16, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants