Network version (nv) namespacing #589
Replies: 2 comments
-
Thanks for the write up! In general i like the idea.
im in favour of this, set a good pattern in case we add new network in the future. |
Beta Was this translation helpful? Give feedback.
-
There is already a first-class network name (string) present in the init actor's state. So a large amount of (2) is already done. A network version without attached name will still need clarification, though. One historical use of network versions is to trigger changes in behaviour within the built-in actors when the network reaches a certain point. This permits deployment of new actor code ahead of a change actually taking effect, with no need for a migration at that point in time. With true compiled actors we'd still need a migration just to install the actor code at some point before a network-version-triggered change, but we would have the ability to stage multiple behaviour changes in a single code upgrade in this way. This pattern was necessary when we didn't have actor code content-addressed. Now that we do, there's an alternative option of triggering change by replacing the actor code when the network version ticks over – i.e. triggering the changed behaviour externally to the built-in actors rather than from within. If network version numbers don't mean the same thing in different networks, it will be impractical to ever code a version-triggered change inside the actors. (We certainly wouldn't want to also encode knowledge of the different network names and version histories inside the actor code). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
We are soon launching Hyperspace (see #544). This is a non-resetting developer preview network. It will start on a beta version for nv18 (FEVM upgrade) and will upgrade over the next week towards more mature releases, eventually culminating with the final nv18. From then onwards, it will move on to subsequent preview iterations of future FVM releases.
Because this network conducts upgrades, every new release that gets deployed needs a new network version (nv). The network version is an incrementing ordinal that tracks the protocol version the network is running.
Because Hyperspace upgrades through several pre-production releases on every cycle, it is the first network that will have a diverging version lineage from mainnet by design, e.g. nv18 on Hyperspace is a version different to nv18 on mainnet.
If we don't do anything, we might end up with:
This outcome is confusing and ambiguous for all stakeholders (e.g. nv18 means something different in A or B) and we'd like to propose a way to solve for this so that network versions can be referred to univocally.
Options
Proposal
We propose to adopt option 3b, inspired by IP subnet masks, but simpler. We define a 16-bit bitmask (65536) over the highest bits (0xffff000000000000) of the full u64 network version to designate the namespace. The lowest 48 bits designate the version within that namespace. We thus overload the network version with new metadata.
The following networks versioning lines live under namespace 0x0000, which is fully backwards compatible with existing network versions in the history of these networks:
The following network versioning lines live under namespace 0x0001:
Version 1 under Hyperspace would thus be: 0x0001000000000001 (decimal: 281474976710657). We could make this namespace identical to its ChainID though (decimal 3141).
Tradeoffs
Next steps
Acknowledgements
@magik6k for proposing the preferred solution in a huddle (winner!).
@Stebalien @vyzo @jennijuju @arajasek @ZenGround0 for participating in preceding discussion.
Beta Was this translation helpful? Give feedback.
All reactions