[go: up one dir, main page]

Baker: move most of CLI logic in agnostic library

What

This merge request changes the agnostic baker, instead of calling the protocol's CLI main function, it calls the protocol's delegate main function. The main difference is that dynamic checks are done in the protocol's CLI main function, for instance the dal option is checked dynamically. Now, these checks are done outside of the protocol, therefore the behaviour is the same for all supported protocols.

Previous: !17997 (merged)

Why

For instance it's legal to have quebec running without any information about the DAL, but when Rio gets activated it crashes with:

Error:
  Error in the underlying baker process
  Please connect a running DAL node using '--dal-node <endpoint>'. If you do not want to run a DAL node, you have to opt-out using '--without-dal'.

We want to fix that by detecting as soon as possible the issue. The agnostic baker should be able to start all protocols bakers without any issue.

How

Everything that I've incrementally moved to the agnostic baker is now used to replicate the CLI's function.

Manually testing the MR

Run a node

./src/bin_node/octez-sandboxed-node.sh 1 --connections 1

Run a baker without DAL information

./octez-baker -E <endpoint> run remotely --liquidity-baking-toggle-vote off --node-version-check-bypass tmp

Activates Quebec

eval `./src/bin_client/octez-init-sandboxed-client.sh 1`
octez-activate-021-PsQuebec

You'll see that it'll make the baker crash, even thought it's not necessary for Quebec.

Error:
  Error in the underlying baker process
  Please connect a running DAL node using '--dal-node <endpoint>'. If you do not want to run a DAL node, you have to opt-out using '--without-dal'.

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.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Valentin Chaboche

Merge request reports

Loading