[go: up one dir, main page]

Baker: Create a `--without-dal` option and fail if no DAL endpoint is provided.

What

Create a --without-dal option. When one launches a baker daemon without it, an error is triggered if no DAL node is associated. Furthermore, checks are performed and a warning is raised if the associated DAL node is not responding, or if the associated DAL node is not healthy.

Why

To make the launch of a DAL opt out. See associated milestone.

How

Add the checks in the baking_commands.ml file, before actual run of the baker daemon.

Manually testing the MR

In a first terminal run

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

Open another terminal and run

eval `./src/bin_client/octez-init-sandboxed-client.sh 1`
octez-activate-alpha
octez-baker-alpha run with local node /tmp/tezos-node.*/ --dal-node 1.1.1.1:1000 >> /tmp/log_$(date "+%Hh%M") 2>&1

It will create a file /tmp/log_11h14 (of course, the displayed time depends of when the commands are launched), containing:

Dec 20 11:14:37.429: reading votes file: /tmp/tezos-tmp-client.PQNlk9Ur/per_block_votes.json
Dec 20 11:14:37.430: read liquidity baking toggle vote = pass
Dec 20 11:14:37.430: read adaptive issuance vote = pass
Dec 20 11:14:37.430: The DAL node cannot be reached on endpoint: 1.1.1.1:1000.
Dec 20 11:14:37.430: Please check your
Dec 20 11:14:37.430:   DAL node and possibly restart it.

The warning on the last 3 lines is new. Note that a baker daemon is launched nevertheless and logs every 2 seconds that it cannot connect to the DAL node.

When running the same experiment without --dal-node 1.1.1.1:1000, then log file is:

Dec 20 11:16:39.633: reading votes file: /tmp/tezos-tmp-client.PQNlk9Ur/per_block_votes.json
Dec 20 11:16:39.633: read liquidity baking toggle vote = pass
Dec 20 11:16:39.633: read adaptive issuance vote = pass
Error:
  DAL node cannot be completely omitted anymore. Please connect a running DAL node using '--dal-node <endpoint>'. If you do not want to run dal node, you have to opt-out using '--without-dal'.

This last line is new.

Adding the --without-dal option, the baker is running as expected and the beginning of the log is:

Dec 20 11:17:04.881: reading votes file: /tmp/tezos-tmp-client.PQNlk9Ur/per_block_votes.json
Dec 20 11:17:04.881: read liquidity baking toggle vote = pass
Dec 20 11:17:04.881: read adaptive issuance vote = pass
Dec 20 11:17:04.882: No DAL node endpoint has been provided!
Dec 20 11:17:04.882: It will soon be required to launch a
Dec 20 11:17:04.882:   DAL node before running a baker. (To run it, see
Dec 20 11:17:04.882:   https://docs.tezos.com/tutorials/join-dal-baker).

The warning on the last 4 lines is new.

Edited by Guillaume Genestier

Merge request reports

Loading