Skip to content
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

implement actor::is_builtin_actor(Cid) -> int32 syscall #342

Closed
raulk opened this issue Feb 24, 2022 · 0 comments
Closed

implement actor::is_builtin_actor(Cid) -> int32 syscall #342

raulk opened this issue Feb 24, 2022 · 0 comments
Assignees

Comments

@raulk
Copy link
Member

raulk commented Feb 24, 2022

Some built-in actors reference the CodeCID of other actors. Concretely:

  • the init actor holds an allowlist of actors it is allowed to construct (multisig, paych)
  • the market and miner actors validate that only "signable" actors (account, multisig) can perform certain duties
  • the market actor validate that only the miner actor can perform deal management operations
  • the power actor validates that only the miner actor can perform privileged operations

Prior to FVM, CodeCIDs were hardcoded, but with the introduction of Wasm bytecode as a portable execution format, CodeCIDs for the first time will truly content-address executable payloads. Unfortunately, this means that actors will need to learn the CodeCIDs of other actor in a more dynamic way.

We considered various solutions like:

Ultimately we settled on introducing a new infallible syscall:

actor::is_builtin_actor(Cid) -> i32

Where the input is a CodeCID, and the return value represents the matched builtin actor type:

i32 Actor type
0 Unknown
1 System
2 Init
3 Cron
4 Account
5 Power
6 Miner
7 Market
8 Payment channel
9 Multisig
10 Reward
11 Verified registry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants