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

feat(driver): Turn get_value into an asynchronous step within the state machine #65

Merged
merged 15 commits into from
Nov 24, 2023

Conversation

romac
Copy link
Member

@romac romac commented Nov 14, 2023

When a new round starts and we are the proposer, this PR allows the consensus engine to both schedule a propose timeout and ask the context for a value to propose. Either the timeout or the value to propose can then be fed back into the driver asynchronously as an input event.

TODO

  • Adapt Quint specification spec: Sync between driver/consensus and code #81
  • Remove the value to propose from RoundEvent::NewRoundProposer
  • Add a new input event to both the driver and the round state machine: ProposeValue(Cox::Value) to feed them a value to propose
  • Add a new output message to both the round state machine and the driver: GetValueAndScheduleTimeout(Round, Timeout) to ask the context for a value to be asynchronously fed back into the driver via the new ProposeValue event
  • In the driver, when a new round starts and we are the proposer, send NewRoundProposer (now without a value) to the round state machine and emit the resulting message (ie. the new GetValueAndScheduleTimeout message)
  • Remove Env::get_value
  • Remove Error::NoValueToPropose
  • Update tests

@romac romac changed the title feat(driver): Turn get_value into an asynchronous step within the state machine feat(driver): Turn get_value into an asynchronous step within the state machine Nov 14, 2023
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (2a7862b) 87.44% compared to head (1822913) 87.16%.
Report is 2 commits behind head on main.

Files Patch % Lines
Code/round/src/state_machine.rs 74.00% 13 Missing ⚠️
Code/driver/src/driver.rs 86.84% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #65      +/-   ##
==========================================
- Coverage   87.44%   87.16%   -0.28%     
==========================================
  Files          30       29       -1     
  Lines        1346     1371      +25     
==========================================
+ Hits         1177     1195      +18     
- Misses        169      176       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@romac romac requested review from cason and ancazamfir November 14, 2023 14:55
@romac romac force-pushed the async-get-value-new-event branch from f42fba3 to 240216a Compare November 14, 2023 15:38
@romac romac force-pushed the async-get-value-new-event branch from 240216a to 7c2ef99 Compare November 16, 2023 08:25
@romac romac force-pushed the async-get-value-new-event branch from 8beba35 to 89b4ec0 Compare November 23, 2023 10:15
Copy link
Collaborator

@ancazamfir ancazamfir left a comment

Choose a reason for hiding this comment

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

Looks good! thanks @romac

@ancazamfir ancazamfir merged commit a755b7b into main Nov 24, 2023
6 of 7 checks passed
@ancazamfir ancazamfir deleted the async-get-value-new-event branch November 24, 2023 14:21
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.

2 participants