diff --git a/chain/vm/invoker.go b/chain/vm/invoker.go index 941c63903..e5716740f 100644 --- a/chain/vm/invoker.go +++ b/chain/vm/invoker.go @@ -4,9 +4,11 @@ import ( "bytes" "encoding/hex" "fmt" - "github.com/filecoin-project/specs-actors/actors/builtin/account" "reflect" + "github.com/filecoin-project/specs-actors/actors/builtin/account" + "github.com/filecoin-project/specs-actors/actors/runtime/exitcode" + "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" "golang.org/x/xerrors" @@ -64,10 +66,10 @@ func (inv *invoker) Invoke(act *types.Actor, rt runtime.Runtime, method abi.Meth code, ok := inv.builtInCode[act.Code] if !ok { log.Errorf("no code for actor %s (Addr: %s)", act.Code, rt.Message().Receiver()) - return nil, aerrors.Newf(255, "no code for actor %s(%d)(%s)", act.Code, method, hex.EncodeToString(params)) + return nil, aerrors.Newf(byte(exitcode.SysErrorIllegalActor), "no code for actor %s(%d)(%s)", act.Code, method, hex.EncodeToString(params)) } if method >= abi.MethodNum(len(code)) || code[method] == nil { - return nil, aerrors.Newf(255, "no method %d on actor", method) + return nil, aerrors.Newf(byte(exitcode.SysErrInvalidMethod), "no method %d on actor", method) } return code[method](act, rt, params) diff --git a/chain/vm/runtime.go b/chain/vm/runtime.go index 76bf5db55..f29798da9 100644 --- a/chain/vm/runtime.go +++ b/chain/vm/runtime.go @@ -229,7 +229,7 @@ func (rt *Runtime) ValidateImmediateCallerIs(as ...address.Address) { return } } - rt.Abortf(exitcode.ErrForbidden, "caller %s is not one of %s", rt.Message().Caller(), as) + rt.Abortf(exitcode.SysErrForbidden, "caller %s is not one of %s", rt.Message().Caller(), as) } func (rt *Runtime) Context() context.Context { @@ -255,7 +255,7 @@ func (rt *Runtime) ValidateImmediateCallerType(ts ...cid.Cid) { return } } - rt.Abortf(exitcode.ErrForbidden, "caller cid type %q was not one of %v", callerCid, ts) + rt.Abortf(exitcode.SysErrForbidden, "caller cid type %q was not one of %v", callerCid, ts) } func (rs *Runtime) CurrEpoch() abi.ChainEpoch { diff --git a/chain/vm/validation_test.go b/chain/vm/validation_test.go index 9684bd52d..b8570706d 100644 --- a/chain/vm/validation_test.go +++ b/chain/vm/validation_test.go @@ -36,7 +36,6 @@ func init() { // initialize the test skipper with tests being skipped TestSuiteSkipper = TestSkipper{testSkips: []suites.TestCase{ /* tests to skip go here */ - //tipset.TestInternalMessageApplicationFailure, tipset.TestInvalidSenderAddress, tipset.TestBlockMessageDeduplication, tipset.TestMinerSubmitFallbackPoSt, diff --git a/chain/vm/vm.go b/chain/vm/vm.go index b40accd35..8114c6241 100644 --- a/chain/vm/vm.go +++ b/chain/vm/vm.go @@ -209,6 +209,7 @@ func (vm *VM) send(ctx context.Context, msg *types.Message, parent *Runtime, return nil, aerr, nil } } + rt := vm.makeRuntime(ctx, msg, origin, on, gasUsed, nac) if parent != nil { defer func() {