Open anorth opened 4 years ago
The only challenge with this is that the direct manipulation needs to cover the following:
Init
actor's state and increment it in state.These are precisely the steps performed in Init.Exec
with the caveat that the mapped address is a generated address instead of the given public key address. Modifying CreateActor
to return the public key address (i.e. the first constructor parameter) when creating account actors avoids duplicating this logic and the infrastructure for state manipulation.
Modulo concerns about gas (which can be addressed) the two approaches should be compatible.
When a message is sent to a pubkey address that does not yet exist in state, an account actor is implicitly created to receive it. The account actor is allocated an ID and its address mapped through the InitActor's address table.
Should this happen through a message to the InitActor, or by direct manipulation of the InitActor's state? Similarly, should the account actor's state be initialized directly, or by calling it's constructor method? At present the spec performs direct manipulation in the VM (coupling the VM to the InitActor state), Lotus performs direct manipulation from the VM via the state tree (the state tree is coupled to InitActor state), and Go-filecoin sends a message to the InitActor (but semantics are not yet quite right).
Advantages of direct manipulation include:
Advantages of sending a message:
@icorderi @acruikshank @whyrusleeping