Open Stebalien opened 2 years ago
we should just load from the system actor, no?
oh nvm that gives you actor cids, not manifest CID. Why would one still want manifest CID if code cids were available ?
Ah, no. The issue isn't the actor CIDs or the manifest CIDs. The issue is mapping actor CIDs to actor versions so we can load the state with the correct "introspection" code in:
So, one solution is to just record the actor-version -> manifest mapping in the binary, which should be fine, honestly.
We can easily map the code CID to the actor type by looking at the manifest in the system actor. We should attach a (caching) GetBuiltinActors() map[string]cid.Cid method to the StateManager.
Well... "easily". To do this, we still need to be able to decode the system actor in the first place, which means we need some way to resolve a code CID to an actors version 🙄.
Currently, we load the actor manifest from the bundle (mostly for introspection). However, we should be using the state-tree:
Unfortunately, this is non-trivial:
GetBuiltinActors() map[string]cid.Cid
method to theStateManager
.For now, we'll probably continue importing the bundle.