Baker: move [check_dal_node] in agnostic library
What & Why
Instead of copy pasting the logic, moves the [check_dal_node] in the agnostic baker. This is a preliminary refactoring to move all the CLI logic in the agnostic baker to avoid inconsistency between protocol-bakers.
The merge request contains only one commit as these refactoring are painful to review. I'm splitting in as many merge requests as possible so you don't have to spend hours reviewing stupid changes.
For this change in particular it's a bit trickier as it's the root issue that caused all this refactoring. Checking the DAL node is different based on the protocol. In this merge request I have moved the logic of alpha only, and then haven't backported the changes to other protocols. A legitimate question is do we move Rio's code and then integrate diff w.r.t to alpha or do we move alpha's code directly? I had a look at what's the difference between Rio and Alpha, and it's very minor. In Alpha there's a last_check_successful in the check_dal_node's closure. It helps emitting events when needed, i.e. the event healthy_dal_node is emitted only when it was previously considered unhealthy, it avoids redundant events. So you can please double check that, but backporting Alpha makes more sense in my opinion here.
Next: !18013 (merged)
Previous: !17979 (merged)
Manually testing the MR
I would hope it's something covered by the tests but you can always test the difference between the different versions based on what is refactored.
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR