-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce a wasm-module-level actor constructor function #746
Comments
Sounds sensible.
Not sure if that's the case. The system routes actor messages to the Why the departure from the "IPLD block for parameters" interface? The constructor can still call |
Thinking out loud. The |
Ah, sorry, I mean currently. See https://github.com/filecoin-project/builtin-actors/blob/09f0ca19ac6c2b981ba183e97e622c5aaffba301/actors/miner/src/lib.rs#L132.
I was thinking that the message caller would be the init actor. But, on second thought, if we have a special method here, we can just make the message caller the actor that called the init actor. So yeah, there's no need to depart from the current system. |
Well, that could be passed into the I was actually assuming that we'd have the following flow:
This is the off-chain flow, so I assumed we'd make the on-chain flow as well. |
I'm down with trying to be agnostic about calling conventions, but we do need to call something here and so we need a convention about it. To me, it would be nice to have the priviledged I do think the separation of system-level creation from arbitrary state construction logic is valuable. It's simple, and follows a "there's only one way to do it" kind of rule w.r.t. sending messages. It'll be simpler to implement and reason through. I'm not sure that avoidance of specifying a convention or purity around IPLD-block parameters is worth breaking that for. Since no-one else is going to be calling the constructor, it's not like other callers of the actor have to adhere to this convention, they can all just ignore method numbers or whatever the callee convention is. They just wouldn't be able to repurpose method number 1 for something else. A possible, but clunky, convention for ctors could be a wrapper IPLD object that's constructed by the Init actors and passed as the parameter:
The callee would have to first decode the ConstructorParams, and then the Params (if they're CBOR). So with the options we've thought about so far, this comes down to a choice between a construction convention based on normal message calls (with some clunkiness because we want to add a parameter from the system), or adding VM special handling and a new entry point for a different type of message call used for construction. |
To make sure we're on the same page here:
The goal is to clearly distinguish between normal "sends" and actor initialization so that actors don't have to check things like "am I being constructed by the init actor, or has someone tried to re-initialize me".
Personally, I'd rather have the "create" operation be atomic so we never have a state-tree with an uninitialized actor. What was the motivation to do very little in
It turns out we don't really need to do this. @raulk pointed out that, if this is a "special" operation, we can just make the |
Yes I understand the proposal and am pushing against the additional complexity being embodied by the FVM. I'm not taking a hard stand – I can't say I love either approach, and you might decide to do it anyway.
Arguments I can see in favour of special monolithic
|
Just dropping a note here that I'm much more neutral on this proposal now (rather than initially pushing back against it). |
Currently, we "construct" actors by invoking method 1. However:
Proposal: Introduce a top-level (like
invoke
)create
function that takes the calling actor ID and the construction parameters.The text was updated successfully, but these errors were encountered: