-
Notifications
You must be signed in to change notification settings - Fork 176
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
feat: Make the communicate_with_quorum grace period configurable #3075
base: main
Are you sure you want to change the base?
Conversation
end_time = Some(Instant::now() + start_time.elapsed().mul_f64(GRACE_PERIOD)); | ||
// If it becomes clear that no key can reach a quorum, break early. | ||
if highest_key_score + remaining_votes < committee.quorum_threshold() { | ||
break 'vote_wait; |
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.
cc @afck for reviewing this part
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.
Makes sense to me. 👍
(An alternative would be to set end_time
to now()
, but maybe the break
is cleaner.)
Thanks @huitseeker for the PR!
|
024925d
to
82b4f4e
Compare
|
82b4f4e
to
3e15b10
Compare
Ah, yeah, i had not noticed this was public. I would actually advise switching this low level function to |
- Renamed `GRACE_PERIOD` to `DEFAULT_GRACE_PERIOD` and altered its value, - added grace period argument in communicate with quorum, - Refactored the `end_time` setting logic in the `communicate_with_quorum` function to improve the handling of unreachable quorum on any key,
3e15b10
to
4eb98d2
Compare
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.
Looks good to me, but it doesn't actually make it configurable yet, i.e. add a config option.
end_time = Some(Instant::now() + start_time.elapsed().mul_f64(GRACE_PERIOD)); | ||
// If it becomes clear that no key can reach a quorum, break early. | ||
if highest_key_score + remaining_votes < committee.quorum_threshold() { | ||
break 'vote_wait; |
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.
Makes sense to me. 👍
(An alternative would be to set end_time
to now()
, but maybe the break
is cleaner.)
4eb98d2
to
31fdf88
Compare
…ption Added grace_perio option to the `ChainClientOptions`, and allowed its setting through the `Client` builder.
31fdf88
to
bf02eb5
Compare
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; but that still doesn't make it user-configurable: It doesn't add a CLI option yet. (I think that needs to be added to client_options.rs
.)
5050e24
to
7e13f49
Compare
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.
No blockers from my side!
68e5f41
to
aa760e1
Compare
GRACE_PERIOD
toDEFAULT_GRACE_PERIOD
and altered its value,ChainClientOptions
and threaded through theClient
builder,end_time
setting logic in thecommunicate_with_quorum
function to improve the handling of unreachable quorum on any key,also corrects a handful of typos (in comments and error messages) as I was reading in the areaFixes #2836. /cc @afck for review @Twey for context