-
Notifications
You must be signed in to change notification settings - Fork 3
Verify caller type #2
Comments
For fine-grained access-right management that may work, the problem is that we also want to limit the access to specific methods to specific types of actors, i.e. actors with a specific |
Maybe this can be of help? ethereum/EIPs#881 |
Hey, @cryptoAtwill, I was reading through ethereum/EIPs#881 and I think we can include something similar for our actors for now (at least until there's some kind of standard for the FVM --if it ever is--). This is an idea from the top of my head. As we don't have a function
|
Sounds, good. I can draft some initial implementation, then we can discuss over that. |
Please have a look at FIP-0049 and the corresponding discussion. |
The method number 1 is reserved for the constructor, isn't it? |
We could jump right away to implement this approach (and even propose it as reference implementation to the FIP). My only concern is that is still on a draft state and I don't know to what extent it may change or when should we expect an implementation to be available. But if we think that this approach is better, let's go for it. It has been more extensively discussed.
Correct. I wanted to give an example, but the |
If my understanding is correct, that means this interface cid is generated offline and passed to the actor during construction? |
@cryptoAtwill, what do you mean by "interface CID"? |
Here is a brief update on my ideas so far. To-doIn
Standardize
|
Hey, @cryptoAtwill. Your proposal makes sense. An improved proposal, what about:
Is up to the actor to decide how to implement this I would also suggest offering the convenient methods to implement this Let me know if this design makes sense and I can extend a bit the description if it is not clear so we can start tinkering with a first prototype. |
Guys, please have a look at this. |
I agree, we should use FIP0042 for method numbers, and XORing to detect that the methods are right, but this standard doesn't consider the types of the method params, right? We are trying to go one step further and not only check that the method name (and thus the method num) is correct, but also that it has the right arguments. //cc @cryptoAtwill |
Overloading was considered in the FIP:
|
I completely missed this. @cryptoAtwill, re. our sync discussion. You may probably use FIP0042 directly without any macro-related dance. Thank you, @sergefdrv for the pointer. |
@cryptoAtwill, have a look at how @sergefdrv uses this here: https://github.com/consensus-shipyard/ipc-atomic-execution/blob/e5d70adfecfd7883382fdb84ece2308027c5617f/examples/fungible-token/src/lib.rs#L1 Consider using it for the interface identification directly. |
When the actor is invoked, it should perform a caller type checker so that when the caller is not satisfied, can throw error.
The proposed solution is to build a simple role management on
fvm
actor. We can follow existing evm role management system with some simplification. We just need two roles:caller
andadmin
. Foradmin
role, it can perform the CRUD of other roles whilecaller
can just call the actor methods.Role and address are many-to-many relationships and it can be persisted in a HAMT.
The text was updated successfully, but these errors were encountered: