1

I am learning the Tezos economic protocol self-amending feature and I've gone through a lot of well-done documentation, like:

and many other online resources here and there.

I have understood the role and the responsibility of the economic protocol (I would summaryze it as the blockchain consensus layer) and I found also the governance process very clear and neat, going through the 5 periods of proposal, exploration, cooldown, promotion and eventually adoption.

What I am still struggling to get is the very final step of the economic protocol self-amending. The documentation states "Adoption period: On-chain nothing specific happens during this period except on the very last block (see below). Off-chain the developers release tools that include support for the soon-to-be activated protocol, other actors (bakers, indexers, etc.) update their infrastructure to support the newly released tools, smart-contract developers start working with soon-to-be-available features, etc. At the very end of the period, the proposal is activated. This means that the last block of the period is still interpreted by the current economic protocol, but the first block after the period is interpreted by the new economic protocol (the one that was voted in).".

But how does a node actually upgrades, at a low level?

  • Are binary files for the new economic protocol downloaded? Or is source code downloaded and compiled? If yes, where is this downloaded from?
  • Who/what triggers this upgrade activity? Is this a manual user operation, or is it the shell?
  • Given a new economic protocol XYZ being active, what are the steps my node go through to get it actually running on my machine?

I'd like to have a basic description of how this final part of the upgrade is performed, possibly with some documentation link for additional reference.

Thanks,

1 Answer 1

2
+50

Are binary files for the new economic protocol downloaded? Or is source code downloaded and compiled? If yes, where is this downloaded from?

Typically binary files are included in a newer Octez release that contains the next protocol proposal (for example, right now v17.0-rc1 contains the Nairobi protocol proposal).

But the peer-to-peer network of tezos supports transmitting tezos protocols. They are then automatically compiled by octez-protocol-compiler and loaded by the node.

Most of the times, a new protocol requires a new version of the environment and therefore relying on the peer-to-peer network for upgrades is not enough. But in at least one case, a protocol upgrade did not require a new environment and thus would have worked even if the baker did not upgrade the software.

Who/what triggers this upgrade activity? Is this a manual user operation, or is it the shell?

The upgrade rules are embedded within the protocol itself. Concretely, every block header contains a next_protocol field indicating which protocol should process the next block. When the governance rules dictate that an upgrade should occur, this field would indicate the next protocol that was approved by governance. The next block is then evaluated by this protocol. At the moment, this happens at the end of the last cycle of period 5.

There is no manual user operation required, but the software needs to be up-to-date and bakers need to run the baking daemon for the old & new protocols altogether for a smooth transition.

For more information, please see this article:

How Tezos Self-Amendment Works by Marigold

2
  • This is very clear, thanks a lot! There is no risk of double baking/endorsing when running the baker daemons of each protocol verion in parralel? I'm asking as TezosAgora clearly says "Never use the same account on two daemons." opentezos.com/baking/cli-baker
    – Shlublu
    Jun 8, 2023 at 5:18
  • 1
    No risk of double endorsing when running the baker daemons of each protocol version in parallel, since a baker daemon will only bake if next_protocol corresponds to its own protocol. Jun 9, 2023 at 22:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.