-
Notifications
You must be signed in to change notification settings - Fork 545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New protocol version #14227
New protocol version #14227
Conversation
!ci-build-me |
!ci-build-me |
!ci-build-me |
!ci-build-me |
!ci-build-me |
!ci-build-me |
!ci-build-me |
!ci-build-me |
!ci-build-me |
!ci-build-me |
module V1 = struct | ||
type t = A.V1.t = { major : int; minor : int; patch : int } | ||
module V2 = struct | ||
type t = A.V2.t = { transaction : int; network : int } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably keep the patch
in place, for information purposes only. It could be useful in the future for activating features within a soft fork that require a certain threshold of the network to support it before enabling (eg networking changes that today we can only ship as hard forks can sometimes be shipped as soft forks using this approach). We will only check or otherwise utilize the transaction and network versions for now though.
|
||
let compatible_with_daemon current_protocol_version = | ||
Int.equal current_protocol_version.major (get_current ()).major | ||
let current = of_string_exn current_string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we just inject the transaction and network versions separately as integers, instead of parsing it on bootup everytime, and crashing if it is misconfigured.
[%%versioned | ||
module Stable = struct | ||
module V1 = struct | ||
type t = A.V1.t = { api : int; patch : int; tag : string option } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer not to add this for now. @mrmr1993 discussed doing something like this on the original RFC, but we did not come to a final decision, and resolved to decide whether or not to do something like this later. We do need to figure this out, but let's have the discussion first for now.
@@ -273,7 +273,7 @@ let verify_transition ~context:(module Context : CONTEXT) ~trust_system | |||
(Mina_block.header transition) | |||
|> Protocol_version.to_string ) ) | |||
; ( "daemon_current_protocol_version" | |||
, `String Protocol_version.(get_current () |> to_string) ) | |||
, `String Protocol_version.(current |> to_string) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: pipes from single args to single functions read poorly. Prefer Protocol_version.(to_string current)
in this case.
!ci-build-me |
!approved-for-mainnet |
!ci-build-me |
!ci-build-me |
!approved-for-mainnet |
Implementation of RFC 0049 (in #13993).
Some ancillary changes:
current-protocol-version
daemon CLI flag is removed (the current version is hard-coded)protocol_versions
table in the archive db is updatedThe protocol version type gets bumped to
V2
, but that did not require bumping any other versioned types, which are all types not in mainnet.The implementation version is kept as a separate type, so that the proposed protocol version doesn't have to mention the implementation.
The config has separate items for the protocol version and implementation version. I put some numbers there: reviewer, please suggest better ones, if appropriate.
New daemon log:
Tested
advanced chain-id-inputs
with a local seed daemon:The version linter failures are expected.
Closes #14143.
CI nightly run https://buildkite.com/o-1-labs-2/mina-end-to-end-nightlies/builds/555