diff --git a/chain/vm/fvm.go b/chain/vm/fvm.go index cdccbc11a..b3190be9d 100644 --- a/chain/vm/fvm.go +++ b/chain/vm/fvm.go @@ -8,6 +8,7 @@ import ( "github.com/ipfs/go-cid" "github.com/filecoin-project/go-address" + "github.com/filecoin-project/lotus/chain/actors/aerrors" "github.com/filecoin-project/lotus/chain/actors/policy" "github.com/filecoin-project/go-state-types/network" @@ -311,6 +312,15 @@ func (vm *FVM) ApplyMessage(ctx context.Context, cmsg types.ChainMsg) (*ApplyRet } } + var aerr aerrors.ActorError + if ret.ExitCode != 0 { + amsg := ret.FailureInfo + if amsg == "" { + amsg = "unknown error" + } + aerr = aerrors.New(exitcode.ExitCode(ret.ExitCode), amsg) + } + return &ApplyRet{ MessageReceipt: types.MessageReceipt{ Return: ret.Return, @@ -327,7 +337,7 @@ func (vm *FVM) ApplyMessage(ctx context.Context, cmsg types.ChainMsg) (*ApplyRet GasRefund: 0, GasBurned: 0, }, - ActorErr: nil, + ActorErr: aerr, ExecutionTrace: et.ToExecutionTrace(), Duration: time.Since(start), }, nil @@ -351,13 +361,22 @@ func (vm *FVM) ApplyImplicitMessage(ctx context.Context, cmsg *types.Message) (* } } + var aerr aerrors.ActorError + if ret.ExitCode != 0 { + amsg := ret.FailureInfo + if amsg == "" { + amsg = "unknown error" + } + aerr = aerrors.New(exitcode.ExitCode(ret.ExitCode), amsg) + } + return &ApplyRet{ MessageReceipt: types.MessageReceipt{ Return: ret.Return, ExitCode: exitcode.ExitCode(ret.ExitCode), GasUsed: ret.GasUsed, }, - ActorErr: nil, + ActorErr: aerr, ExecutionTrace: et.ToExecutionTrace(), Duration: time.Since(start), }, nil diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi index 4cb8411aa..791b68203 160000 --- a/extern/filecoin-ffi +++ b/extern/filecoin-ffi @@ -1 +1 @@ -Subproject commit 4cb8411aa6c15bc8f38fef9dcd9ae5d83837eb87 +Subproject commit 791b68203d33ac494b9904f04b7239674b068df4