Dynamic FVM Calling Convention #409
Replies: 1 comment 7 replies
-
I see this as complementary to #382. That is, adopt #382 as a base convention and then adopt this proposal as a new FRC for dynamic dispatch capabilities at method number
I'm inferring from the above that your static proposal is without the hashing described in #382. I think this would be really bad for composability and the development of standards. Widespread APIs like tokens need to be called from off-chain, efficiently, and using the same method number across implementations. Needing to know the concrete type of the receiving actor is no good. We need a mechanism to coordinate non-colliding method numbers. Note that #382 doesn't prevent actors from keeping existing method numbers, especially the built-in ones which are the only actors that could really be said to exist today (but see #401: most such methods should be hidden). |
Beta Was this translation helpful? Give feedback.
-
This is an alternative proposal to #382.
Basically, we have two problems:
#382 proposes solving both problems by hashing the method name to a method number. However, this has some drawbacks:
Proposal
An alternative is to break this problem into "dynamic" and "static" dispatch:
(method_desc, params)
message to a reserved DYNAMIC_DISPATCH method number. This lets the caller tell the receiver what method the caller wants to invoke, and the receiver can then decide how it wants to handle the call (possibly delegating based on a namespace, possibly pattern matching based on some naming convention, etc.).Note: The DYNAMIC_DISPATCH method number could just be
1
. This is currently used as the "constructor" method number, but that will likely be replaced with a separate actor entrypoint.Extension: Reflection
The basic proposal only sends a method name, but we could send a more complete "method description":
This would let the receiver match on additional information, instead of just matching on the method name.
Analysis
The primary benefits of this approach are:
The primary drawbacks are:
Beta Was this translation helpful? Give feedback.
All reactions