Note: this is specific to my setup with minikube and podman, written down here as a reference for myself.
Checkout the branch.
Start minikube with podman minikube start
Load podman-remote env vars eval $(minikube podman-env)
In tezos Makefile, replace @docker
with podman-remote
Build docker container with make docker-image
The containers will be built and accessible with minikube.
Then we are deploying tezos-k8s with a values file (see below) with:
- 2 bakers (the first one is the dictator)
- short cycle times (32 blocks)
- cycles per voting period is set to 1
- consequently, we change voting period every 32 blocks
The test regime is as follows:
We attempt to update to a protocol. The easiest is to update from alpha to ithaca (since we have the ithaca binaries available in the test environment). Actual upgrade fails. It is normal, and does not matter: what matters is the upgrade is triggered as predicted.
- open a shell to non-dictator baker with k9s
- submit proposal:
tezos-client submit proposals for archive-baking-node-1 Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A
- see the goverance status with
tezos-client show voting period
- then at next cycle, submit ballot:
tezos-client submit ballot for archive-baking-node-1 Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A yay
- then 2 cycles later, submit ballow again for adoption
- at 2 cycles later, observe the transition to the new protocol (it fails)
│ Jul 5 21:42:56.079 - validator.block: pre-application of block at level 128 failed │
│ Jul 5 21:42:56.079 - validator.block: Request pushed on 2022-07-05T21:42:56.051-00:00, treated in 21.450us, completed in 27.490ms , │
│ Jul 5 21:42:56.079 - validator.block: Invalid block BKiHLREqU3Jk │
│ Jul 5 21:42:56.079 - validator.block: Transition from protocol environment version V6 to V4 is not allowed.
This tests that the non-dictator governance works properly.
Now, repeat the same steps on dictator baker
- submit proposal:
tezos-client submit proposals for archive-baking-node-0 Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A
Observe that the proposal is now set to Adoption:
~ $ tezos-client show voting period
Current period: "adoption"
Blocks remaining until end of period: 3
Current proposal: Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A
Observe that at the end of the cycle, protocol upgrade immediately happens:
│ Jul 5 21:46:07.071 - validator.block: pre-application of block at level 16 failed │
│ Jul 5 21:46:07.071 - validator.block: Request pushed on 2022-07-05T21:46:07.046-00:00, treated in 14.178us, completed in 24.820ms , │
│ Jul 5 21:46:07.071 - validator.block: Invalid block BKiHLREqU3Jk │
│ Jul 5 21:46:07.071 - validator.block: Transition from protocol environment version V6 to V4 is not allowed.
This shows that the dictator is able to effectively bypass governance.
- try to submit a proposal when the dictator key has no baking rights. Result:
There is an issue with the submission:
* Public-key-hash `tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv` from account
`test` does not appear to have voting rights.
Fatal error:
Submission failed because of invalid proposals.
This is as expected.
Submit:
~ $ tezos-client submit proposals for archive-baking-node-0 PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY
Warning:
This is NOT the Tezos Mainnet.
Do NOT use your fundraiser keys on this network.
All proposals are valid.
Node is bootstrapped.
Operation successfully injected in the node.
Operation hash is 'onos9jajdgacrXpzf2dQ6xJyM9A5pUwEFPZyuaV2Mw8UJ2Xe5iu'
NOT waiting for the operation to be included.
Use command
tezos-client wait for onos9jajdgacrXpzf2dQ6xJyM9A5pUwEFPZyuaV2Mw8UJ2Xe5iu to be included --confirmations 1 --branch BKjkF8QPTNmjUg3MAGdu1FTyUsT3Cmt5fDqXLFmAmz3TgqzVMw9
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Proposals:
From: tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv
Period: 0
Protocols:
PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY
Verify period:
~ $ tezos-client show voting period
Warning:
This is NOT the Tezos Mainnet.
Do NOT use your fundraiser keys on this network.
Current period: "adoption"
Blocks remaining until end of period: 7
Current proposal: PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY
Then cancel with --force
:
~ $ tezos-client submit proposals for archive-baking-node-0 --force
Warning:
This is NOT the Tezos Mainnet.
Do NOT use your fundraiser keys on this network.
Not in a proposal period
There is an issue with the submission:
* Empty proposal list.
Some proposals are not valid, but `--force` was used.
Node is bootstrapped.
Operation successfully injected in the node.
Operation hash is 'opaSfWgmfUAAg33mcGAH7GpkULEfDCL4Gxjjgar3kJL2DHA4Jyp'
NOT waiting for the operation to be included.
Use command
tezos-client wait for opaSfWgmfUAAg33mcGAH7GpkULEfDCL4Gxjjgar3kJL2DHA4Jyp to be included --confirmations 1 --branch BLapp5cvp5y6xMYUdK927m5siqeHuFfjP91An1QNFtfuwfqhcYJ
and/or an external block explorer to make sure that it has been included.
This sequence of operations was run:
Proposals:
From: tz1TAFTxbfhdxmMbQcoVPDekr5rqPmoREncv
Period: 0
Protocols:
Verify we are back in proposal:
~ $ tezos-client show voting period
Warning:
This is NOT the Tezos Mainnet.
Do NOT use your fundraiser keys on this network.
Current period: "proposal"
Blocks remaining until end of period: 4
Current proposals: