ouroboros-network
ouroboros-network copied to clipboard
Improve the process of updating protocol versions
We need a clear write-up of:
- Which kinds of protocol versions exist?
- Protocol version inside the block header that is used to indicate readiness for a HF, which is configured in consensus.
- MaxMajorProtocol version, which indicates the highest version of the protocol the node can support.
- The actual protocol version, which is maintained by the ledger inside the protocol parameters.
- What is the meaning of each protocol version?
- Where are they set (hard-coded)?
- How intra-era hardforks interact with versions? See this 5 to 7 jump in versions due to an intra-era hardfork.
- When should
NodeToNode
versions be changed and why?
We should hide the constructor of MaxMajorProtVer
so that issues like this one can be prevented from happening in the future.
The protocol versions documentation should live in cardano-node
, and other upstream repositories such as ouroboros-network
and cardano-ledger
should refer to it and include key pieces of information about this topic.
It would be very helpful to have some easy to find documentation about how the max major protocol version is configured, perhaps a document in docs. We might also include some documentation about its use and how it relates to the protocol version listed inside the block header. Since the header version is configured in the node (see here), we might consider placing the documentation about these values in the node repository.
In order to avoid mistakes in the future, we could consider not exporting the constructor for MaxMajorProtVer
so that we can relying on the type system to prevent mistakes like this one.
One last random comment, I couldn't figure out why this line of code was setting the max major protocol version to something with Alonzo in the name: https://github.com/input-output-hk/ouroboros-network/blob/470ee82d9dfb1e07f55e6600d50de6aa60cf8a5c/ouroboros-consensus-cardano/src/Ouroboros/Consensus/Cardano/Node.hs#L581-L582
(PR #4111 is a small contribution to this Issue.)
FTR: One possible next step in this process is sketched in https://github.com/input-output-hk/ouroboros-network/pull/4111#discussion_r1005815258, and in more detail, in #4115.