The VM itself needs to understand actor version for 3 reasons:
Actor lookup/registration in the init actor.
Actor lookup in the state-tree.
Network upgrades.
For 1, we could:
Understand all versions of the init actor.
Invoke methods on the current init actor wasm module to perform lookups/insertions.
Understand only the current version and version the entire FVM. To do that, we'd need a layer higher up the stack to multiplex between different FVM versions.
For 2, we could:
Understand all state-tree versions.
Compile the state-tree HAMT code to WASM, but that doesn't really buy us anything over (1).
Again, understand the current version and version the entire FVM.
For 3, we could:
Add the network upgrade logic to the FVM (implies understanding all versions).
Perform upgrades outside the FVM iteself (which I'd much prefer).
Finally: do we even support old actor versions in the FVM, or only new actor versions (6+)? We don't have v0 rust actors, and versions before v6 haven't been audited (and likely won't sync the chain).
Some interesting notes:
All we need is the init actor and the HAMT, nothing else.
The shape of the init actor has never changed, except for the HAMT itself.
The VM itself needs to understand actor version for 3 reasons:
For 1, we could:
For 2, we could:
For 3, we could:
Finally: do we even support old actor versions in the FVM, or only new actor versions (6+)? We don't have v0 rust actors, and versions before v6 haven't been audited (and likely won't sync the chain).
Some interesting notes: