-
Notifications
You must be signed in to change notification settings - Fork 724
Show operation execution status #3562
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
3900c0f to
c9263cf
Compare
|
Nice job ! Can you fix the CI and place the PR "ready for review" when you want to get a review ? :) |
7112ddb to
79aad0c
Compare
79aad0c to
429ea9c
Compare
AurelienFT
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.
Nice work ! 💯 I think few simplifications could be done.
a8772ac to
9e42a7d
Compare
Signed-off-by: Jean-François Morcillo <[email protected]>
9e42a7d to
aceae52
Compare
AurelienFT
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.
Very nice job ! Will help the community a lot !
3489: Testnet 20 r=AurelienFT a=AurelienFT Merged in this testnet: - #3475 - #3549 - #3562 - #3462 - #3492 - #3502 - #3495 - #3556 - #3511 - #3498 - #3566 - #3557 - #3576 - #3579 - #3507 - #3585 - #3587 - #3580 - #3590 - #3549 - #3455 - #3601 - #3602 - #3606 - #3588 - #3603 - #3554 Co-authored-by: AurelienFT <[email protected]> Co-authored-by: Ben PHL <[email protected]> Co-authored-by: Modship <[email protected]> Co-authored-by: Ben <[email protected]> Co-authored-by: Eitu33 <[email protected]> Co-authored-by: Sydhds <[email protected]> Co-authored-by: modship <[email protected]> Co-authored-by: Moncef AOUDIA <[email protected]> Co-authored-by: Moncef AOUDIA <[email protected]>
| /// Executed operations btreemap with slot as index for better pruning complexity | ||
| pub sorted_ops: BTreeMap<Slot, PreHashSet<OperationId>>, | ||
| /// Executed operations only for better insertion complexity | ||
| pub ops: PreHashSet<OperationId>, |
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.
how about just changing this into a PreHashMap<OperationId, Result<(), String>> that will contain the outcome of an operation execution (and the error message if any), instead of having another container that we must not forget to update/clear ?
| pub fn get_op_exec_status(&self) -> HashMap<OperationId, bool> { | ||
| self.0 | ||
| .iter() | ||
| .flat_map(|exec_output| exec_output.state_changes.executed_ops_changes.clone()) | ||
| .map(|(op_id, (status, _))| (op_id, status)) | ||
| .collect() | ||
| } |
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.
/// Check the outcome of the execution of an operation
pub fn get_op_exec_status(&self, operation_id: &OperationId) -> HistorySearchResult<Result<(), String>> {
for item in self.0.iter() {
if let Some((outcome, _slot)) = item.state_changes.executed_ops_changes.get(operation_id) {
return HistorySearchResult::Present(outcome.clone());
}
}
HistorySearchResult::NoInfo
}| pub fn get_op_exec_status(&self) -> (HashMap<OperationId, bool>, HashMap<OperationId, bool>) { | ||
| ( | ||
| self.active_history.read().get_op_exec_status(), | ||
| self.final_state.read().executed_ops.op_exec_status.clone(), | ||
| ) | ||
| } |
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.
/// (final, active)
pub fn get_op_exec_status(&self, operation_id: &OperationId) -> (Option<Result<(), String>>, Option<Result<(), String>>) {
if let Some(outcome) = self.final_state.read().get_op_exec_status(operation_id) {
return (Some(outcome.clone()), Some(outcome.clone()));
}
if let HistorySearchResult::Present(outcome) = self.active_history.read().get_op_exec_status(operation_id) {
return (None, Some(outcome.clone()));
}
(None, None)
}
Uh oh!
There was an error while loading. Please reload this page.