-
Notifications
You must be signed in to change notification settings - Fork 13
F3-245: API proposal for ReceiveFinalityCertificate #296
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #296 +/- ##
==========================================
- Coverage 85.66% 85.15% -0.51%
==========================================
Files 14 14
Lines 1458 1469 +11
==========================================
+ Hits 1249 1251 +2
- Misses 130 138 +8
- Partials 79 80 +1
|
|
@anorth, would really appreciate your early feedback here to see if this makes sense to you and to see what are you suggested next steps (maybe to start with the host integration of finality certificates)? Thanks! |
anorth
left a comment
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.
It looks like this won't be too tricky to pull off, thanks. I think we can simplify a bit from this initial proposal.
|
Thank you for your feedback and the additional context, @anorth. I think I addressed all your comments. Please let me know if there is any outstanding issue or it is good to merge. |
anorth
left a comment
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.
Thanks. Looks like this will work well, nearly there.
gpbft/participant.go
Outdated
| // the start of the first instance. | ||
| // This way we handle in an homogeneous way the start of | ||
| // new instances | ||
| func (p *Participant) Start() { |
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.
Please restore the panic handler on all exploded methods.
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.
Restored. Would you mind elaborating a bit on why this is needed? I think I may have misunderstood the purpose of that code. I was assuming it would be handled by the alarm handler. Thanks!
gpbft/participant.go
Outdated
| } | ||
|
|
||
| // Triggers the start to the instance defined as an argument. | ||
| func (p *Participant) SkipToInstance(i uint64) { |
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.
Please add a panic handler here too.
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.
I was trying to add an error that covered the error handling here and I don't think it is possible for SkipToInstance to ever return an error (unless I am missing something). Am I missing something? I am wondering if I should remove the error and panic handling here.
masih
left a comment
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.
LGTM 👍
Closes #245
This PR:
SkipToInstanceinterface implemented byReceiverthat can be used to force progress into a specific instance determined by a finality certificate.Participant.Start()to leverageSkipToInstanceunder the hood to trigger the beginning of new instances.SkipToInstancespawns a new instance asynchronously by setting an alarm fortime.Now()so it is immediately picked up by the host, and the instance is started.Start()under other hand calledbeginInstanceasynchronously and had a lot of redundant code withReceiveAlarm. By usingSkipToInstanceinStartwe deduplicate some code and handle for all cases the beginning of new instances in the same way.Notes:
FinalityInfowe may be able to just pass the instance number we want to skip provided by the latest finality certificate.ReceiveFinalityCertificateas part of theReceiverapi if we decide we won't use it for testings, it may be a public function from the participant consumed by the host.Future Work
ReceiveFinality