Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Runtime.CreateActor can only be used by the init actor? #1143

Closed
alanshaw opened this issue Sep 11, 2020 · 1 comment
Closed

Runtime.CreateActor can only be used by the init actor? #1143

alanshaw opened this issue Sep 11, 2020 · 1 comment

Comments

@alanshaw
Copy link
Member

alanshaw commented Sep 11, 2020

I noticed that Runtime.CreateActor should only be used by the init actor:

// Creates an actor with code `codeID` and address `address`, with empty state.
// May only be called by Init actor.
// Aborts if the provided address has previously been created.
CreateActor(codeId cid.Cid, address addr.Address)

There are no checks in lotus that this happens (see here) and it looks like go-filecoin did not check either.

Should there be an assertion within Runtime.CreateActor that the caller is the init actor?...and should there be a test in test-vectors to verify this is the case?

If yes to the above then we have a problem right now with the chaos actor because it has a CreateActor method that calls Runtime.CreateActor directly to test other behaviours and it's only able to do so because of a bug 😱.

cc @filecoin-project/oni

@anorth
Copy link
Member

anorth commented Sep 11, 2020

Yes, there should be a check in Lotus (aborting with SysErrIllegalActor).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants