Baker: add an argument to specify allowed node version
What
In the continuation of !14044 (merged), this MR add an argument to the baker binary to allow the bake to connect to a specific version of the node.
Why
How
Manually testing the MR
In the first shell terminal:
- get latest release version of
octez-node, - get this MR version of
octez-node, - 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:
- run the baker
- check that there is an error
- use the client to get the node version
- run the baker with the
--node-version-allowedargument
- 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-client rpc get version
{ "version":
{ "major": 9999, "minor": 9, "additional_info": { "beta_dev": 1 } },
"network_version":
{ "chain_name": "TEZOS_MAINNET", "distributed_db_version": 2,
"p2p_version": 1 },
"commit_info":
{ "commit_hash": "7be70efc773c1c53438237546fbfd5c212b7c32f",
"commit_date": "2024-07-22 18:40:32 +0200" } }
# adapt the value passed to the --node-version-allowed
./octez-baker-alpha run with local node ./data-dir --liquidity-baking-toggle-vote pass --node-version-allowed octez-v7894.789:1a991a03
# The baker run normally
To run the unit and end-to-end tests:
dune exec tezt/tests/main.exe -- --file baker_test.ml --test "Alpha: baker node version allowed 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.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
Edited by Victor Allombert