Testing sourdough rolls baked for different lengths of time - Juergen Krauss, The Fresh Loaf
The first potential amendments to the Tezos protocol have been submitted, and delegates are upvoting the amendment(s) they are most interested in promoting to mainnet. Our most recent post described how delegates can securely vote on prospective protocols throughout the amendment process using the Tezos Wallet app for the Ledger Nano S. This post covers how bakers can bake and endorse on a test chain operating with the prospective Tezos protocol using the newly released version 2.0.0 of Tezos Baking, now available on Github and in Develop Mode of Ledger Live.
Testing Tezos Amendments
During the third period of the Tezos amendment process, a test chain forks from the network's main chain with the prospective protocol. This test chain gives network participants the opportunity to observe the prospective protocol under realistic conditions so they can make an informed decision about whether they should vote to promote it to mainnet (for a full description of the Tezos amendment process, see Amending Tezos). This test chain begins at a given block level, runs for 48 hours, and has the same baking and endorsing rights as the main chain. For instance, if a baker has rights to bake at block level 393217 (the block level the first Test Period may prospectively begin), they have rights to bake that block on both the main chain and the test chain.
While the Tezos node tracks both the main and test chains, the baker and endorser only work for a given protocol. As a result, delegates need to run a separate baker and endorser on the test chain to create test conditions as similar to the main network as possible.
This can pose a challenge for signing solutions like Tezos Baking for the Ledger Nano S or cloud-based HSMs that utilize a high water mark (HWM) feature to prevent double baking or double endorsing. In Tezos Baking, the HWM keeps a record of the highest block level it has signed. If it is asked to sign a block or endorsement below that block level (the HW), it automatically rejects signing it. When baking on a single chain, this feature can act as a last line of defense. However, when baking on two chains at the same time, the HWM will prevent you from baking on the second chain on which you are asked to sign.
Introducing Tezos Baking v2.0.0
Tezos Baking v.2.0.0 now keeps a record of two independent high water marks: the first applies to the main chain (
NetXdQprcVkpaWu for mainnet) while the second corresponds to all other chains the ledger device is asked to sign on. If the Ledger device signs on any chain ID other than not the main chain ID, the second HWM is updated. Under this configuration, bakers won't have to make any adjustments to their ledger to participate in each new proposal, as test chains that run for different amendments will have different chain IDs.
Using the App
In addition to this new version of Tezos Baking, we've also made adjustments to Tezos commands used to interact with the ledger device. Bakers will need to have an updated version of Tezos (git hash e7612c5ffa46570cdcc612f7bcead771edc24283 or later, made available on February 26, 2019) to use them.
The new 'setup' command for Tezos Baking v2.0.0
authorize ledger to bake for <ALIAS> is deprecated. If you try to use it with the new app,
tezos-client will direct you to the new command:
tezos-client setup ledger to bake for
<ALIAS> is the alias you chose for your delegate's PKH when you imported its secret key.
--main-chain-id is the ID of the main chain the Ledger device should sign on. Conveniently, if you don't provide one, tezos-client asks the node for it!
--main-hwm is the HWM you'd like to start with on the main chain. By default, it checks what the previous HWM was and preserves it.
--test-hwm is the HWM you'd like to start with on the test chain. By default, it checks what the previous HWM was and preserves it.
We've also made adjustments to
set ledger high water mark commands so they get and set the HWMs for both chains, but the commands themselves have not changed. Detailed examples of all changes made can be found on the merge request which introduced them.
Instructions for Upgrading
Since there's been a change in the commands used to set up your Ledger Nano S for baking, we wanted to provide clear instructions for the steps delegates should take when upgrading to v2.0.0:
- Make sure you are running the most recent version of Tezos mentioned above.
- Install Tezos Baking on your Ledger Nano S. If you are using Ledger live, go to Settings -> Toggle 'Developer Mode' on. Then, go to Manager and install 'Tezos Baking'.
- Open the Tezos Baking app on your ledger device.
- Run the
setupcommand while also setting the main chain HWM to the head block level of the network on which you are baking. We recommend adding the
--main-hwmparameter to ensure your HWM is never lower than a block or endorsement you've already signed. For example, if you are baking on mainnet and the head block level is, 340,000, you'd run:
tezos-client setup ledger to bake for
5. Confirm the setup on your ledger device.
That's it, you're back to baking! When you start the baker and endorser on the test chain, you won't need to take any additional steps to bake on the test chain.
Happy (test chain) baking!