-
Notifications
You must be signed in to change notification settings - Fork 41
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(node): new voting reactor state machine #1136
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: raulk <[email protected]>
Co-authored-by: raulk <[email protected]>
…/ipc into validator-gating
Co-authored-by: Karel Moravec <[email protected]>
…ard/ipc into collateral-sourcing
…at/topdown-enchancement
/// } | ||
/// TODO: Soft and Hard recovery mode to be added | ||
pub enum OperationStateMachine { | ||
Paused(PausedOperationMode), |
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 found the Paused
naming to be misleading, because it only relates to the state of the votes publishing (I assume), while other operations are still running. What about Sync
/Syncing
?
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.
Paused
could be triggered by many other condition, mostly not just in syncing. Just not implemented yet.
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 I mean is that Paused
isn't really idle, so this name is a bit confusing. I didn't refer to what triggers that mode, but to how it's best to describe it (given what it's doing).
} | ||
Err(mpsc::error::TryRecvError::Disconnected) => { | ||
tracing::warn!("voting reactor tx closed unexpected"); | ||
break; |
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.
break
will only break the batch loop, before re-entering. There's no shutdown / error handling mechanism.
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.
if there are error, we just log it or maybe raise an alert, but the loop should continue running. As for shutdown, I think we can add it in VoteReactorRequest
, should be pretty straightforward to do.
pub fn step(self) -> Self { | ||
match self { | ||
OperationStateMachine::Paused(p) => p.advance(), | ||
OperationStateMachine::Active(p) => p.advance(), |
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.
The rationale behind the sequential phases within a single advance()
, for both modes, is unclear. Can you elaborate more on that?
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.
sorry, I dont quite get the question.
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 can continue here: #1136 (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.
updated accordingly.
This PR is the start of in total 4 PRs that implements the new topdown flow. The implementation is broken down as follows:
Paused -> Active -> Paused
. The other two recovery modes are yet to be implemented.For this PR, the key changes are:
Active
andPaused
operation modeTopDownSyncEvent
The state machine is as follow: