-
Notifications
You must be signed in to change notification settings - Fork 90
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
core/infosync: implement infosync priority protocol use case #1385
Conversation
Will add tests in next PR |
Codecov ReportBase: 54.10% // Head: 53.61% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1385 +/- ##
==========================================
- Coverage 54.10% 53.61% -0.49%
==========================================
Files 144 145 +1
Lines 17804 17985 +181
==========================================
+ Hits 9632 9643 +11
- Misses 6847 7016 +169
- Partials 1325 1326 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
||
// signMsg returns a copy of the proto message with a populated signature signed by the provided private key. | ||
func signMsg(msg *pbv1.PriorityMsg, privkey *ecdsa.PrivateKey) (*pbv1.PriorityMsg, error) { | ||
clone := proto.Clone(msg).(*pbv1.PriorityMsg) |
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.
what if msg is nil? clone.Signature
would panic
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.
nil checks are not required in golang, one assumes valid data is being passed in 99% of cases
@@ -72,13 +73,14 @@ func (d DutyType) String() string { | |||
DutySyncMessage: "sync_message", | |||
DutyPrepareSyncContribution: "prepare_sync_contribution", | |||
DutySyncContribution: "sync_contribution", | |||
DutyInfoSync: "info_sync", |
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.
what is this duty for?
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.
we prioritise "cluster-agreed-upon-supported-version" every epoch. This is used to decide to upgrade or not.
@@ -213,7 +212,7 @@ func (c *Component) Propose(ctx context.Context, duty core.Duty, data core.Unsig | |||
|
|||
// ProposePriority participants in a consensus instance proposing the provided priority message. |
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.
// ProposePriority participants in a consensus instance proposing the provided priority message. | |
// ProposePriority participants in a consensus instance proposing the provided priority result. |
Co-authored-by: Abhishek Kumar <[email protected]>
Adds the
infosync
component that prioritised cluster supported versions. Also add thepriority.Component
that wraps the prioritiser to hide protobuf types and do signing.category: feature
ticket: #1380