[go: up one dir, main page]

Baker: check node version

What

Add a check of the node version when the baker is run. It can be by-passed, using the flag --node-version-check-bypass.

To be able to do this check a function to compare 2 versions when it make sens is added.

The MR includes some test of these contributions.

Fix #7359 (closed).

Future related MRs:

  • backport of this MR in older protocols
  • add a flag to the baker to accept a specific version of the node

Why

How

Manually testing the MR

In the first shell terminal:

  1. get latest release version of octez-node,
  2. get this MR version of octez-node,
  3. then run the latest release version of octez-node:
git checkout latest-release
# uncomment the line below if needed
# make build-dev-deps
make
cp ./octez-node ./octez-node-rc
git checkout vivien@baker_check-node-version
# uncomment the line below if needed
# make build-dev-deps
make
./octez-node-rc run --data-dir ./data-dir --rpc-addr localhost

In another terminal:

  1. run the baker
  • check that there is an error
  1. run the baker with the --node-version-check-bypass flag
  • check the warning log and that the baker run normally:
./octez-baker-alpha run with local node ./data-dir --liquidity-baking-toggle-vote pass
# The baker should fail with an error
./octez-baker-alpha run with local node ./data-dir --liquidity-baking-toggle-vote pass --node-version-check-bypass
# The baker should emit a warning log and run normally

Stop the baker and the node. In the first terimal, run this MR version node:

./octez-node run --data-dir ./data-dir --rpc-addr localhost

In the other terminal, run the bake without the flag:

./octez-baker-alpha run with local node ./data-dir --liquidity-baking-toggle-vote pass

It should run normally.

To run the unit and end-to-end tests:

dune exec src/lib_version/test/main.exe -- --file test_octez_node_version.ml
dune exec tezt/tests/main.exe -- --file baker_test.ml --test "Alpha: baker node version check bypass test"

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 Vivien Pelletier

Merge request reports

Loading