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

review parent weight #4540

Closed
wants to merge 3 commits into from
Closed

Conversation

schomatis
Copy link
Contributor

@schomatis schomatis commented Oct 22, 2020

First in a series of small boring PRs about the sync logic.

@@ -16,6 +16,8 @@ import (

var zero = types.NewInt(0)

// Compute the weight of this `TipSet` based on its `ParentWeight()`
// and FIXME: COMPLETE THIS SENTENCE.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Insert suggestion here completing this doc.

Comment on lines -566 to -569
if syncer.store.GetHeaviestTipSet().ParentWeight().GreaterThan(maybeHead.ParentWeight()) {
return nil
}

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 already checked in InformNewHead and it depends on a value that is controlled by the sender so this extra check just adds a fake sense of security.

@schomatis
Copy link
Contributor Author

Test failing because SyncSubmitBlock currently counts on accessing the internal Sync logic directly. Working on refactoring it to go through the appropriate InformNewBlock path that the rest of the externally received blocks have to clear as well.

@schomatis
Copy link
Contributor Author

Incorporating #4192 to avoid the self-bypass and follow a single path.

@schomatis
Copy link
Contributor Author

This PR exceeded its original purpose and will require some more design consideration.

@schomatis schomatis closed this Oct 22, 2020
@Kubuxu Kubuxu deleted the schomatis/sync-review/parent-weight branch November 25, 2021 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant