-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
review parent weight #4540
Conversation
@@ -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. |
There was a problem hiding this comment.
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.
if syncer.store.GetHeaviestTipSet().ParentWeight().GreaterThan(maybeHead.ParentWeight()) { | ||
return nil | ||
} | ||
|
There was a problem hiding this comment.
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.
Test failing because |
Incorporating #4192 to avoid the self-bypass and follow a single path. |
This PR exceeded its original purpose and will require some more design consideration. |
First in a series of small boring PRs about the sync logic.