Closed Stebalien closed 2 years ago
cc @ZenGround0 @vyzo @raulk @anorth
NOTE: this needs to get PRed to the FIP, but I wanted to get the exact design nailed down before doing that.
Thanks for starting this, @Stebalien.
To me it sounds like the right place to place the built-in actor registry is the system actor.
The Filecoin spec defines this actor as the "general system actor". That's rather unspecific, but I would imagine this is the appropriate place to hold consensus-critical static system configuration values that the network needs to agree on. The list of built-in actors falls under that category.
In fact, this creates precedent to store more consensus-critical, general, static configuration values in-band in the state tree, e.g. the gas pricing schedule, like we have discussed in the past 👍
And eventually, we could move the network_name
from the init actor to the system actor, as it really doesn't belong in the former. (I suppose it was placed in the init actor for convenience, but not correctness.)
Option<Cid>
.
None
, we'll load the registry from the system actor.Some
, we'll load it from the supplied block.It would be extremely convenient to make the data structure inside the state tree and the bundle identical.
I do still think that a Map<Cid, SomeMetadataStruct>
is the right type:
Map<Cid, ActorMetadata>
.NOTE: this needs to get PRed to the FIP, but I wanted to get the exact design nailed down before doing that.
Since I'm editing FIP-0031 to prepare it for Last Call, I can own the FIP update. But let's make a decision today ;-)
Outcome from sync discussion:
Map<String, Cid>
, where the string keys are the type tokens from the current synthetic CIDs (fil/<version>/<type>
). This also facilitates translations for users in the context of https://github.com/filecoin-project/FIPs/discussions/310.This mostly sounds ok to me. A few minor concerns:
What's the CID in the manifest value the CID of? The WASM code, or a metadata struct, or ...?
Currently the wasm code. I've filed https://github.com/filecoin-project/ref-fvm/issues/744 for discussion.
I think it would be helpful to have a design for how the init actor is going to store code for user actors so that we can ensure this manifest doesn't lead to two different paths when instantiating builtin vs user actors later. The OP noted both that change is hard, but also we must change this anyway, so there's not much point trying to avoid it now.
I agree. We didn't address that here because we don't need to address it till M2. But having at least a design sketch would be helpful.
Consider a simple list of tuples as the representation for a small mapping. Introducing IPLD Map here would be the first usage in all of Filecoin, AFAIK, so it's not guaranteed to be friction-free.
That is a good point. I think we'll need to "get over it" eventually, but this may not be the best place to do so.
Introducing IPLD Map here would be the first usage in all of Filecoin
Pedantically, I feel that I need to remind you about the genesis block.
@raulk to confirm if this is all good!
Confirmed; this is implemented.
Currently:
As of nv16, this code will live on-chain as state and will be referenced by real CIDs. We could continue passing in a CAR file with these actors when we construct the machine, however:
Proposal: Include a builtin-actor "manifest" in either the init actor, or the system actor.
Specifically (ish):