From 7ea661bf87874cc9b6e050ad7d864cfe40837fe1 Mon Sep 17 00:00:00 2001 From: Aayush Date: Thu, 26 May 2022 18:33:04 -0400 Subject: [PATCH] fvm: fail if implicit message fails --- chain/vm/fvm.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/chain/vm/fvm.go b/chain/vm/fvm.go index c01f60a25..db086d99e 100644 --- a/chain/vm/fvm.go +++ b/chain/vm/fvm.go @@ -3,6 +3,7 @@ package vm import ( "bytes" "context" + "fmt" "os" "time" @@ -413,12 +414,18 @@ func (vm *FVM) ApplyImplicitMessage(ctx context.Context, cmsg *types.Message) (* } } - return &ApplyRet{ + applyRet := &ApplyRet{ MessageReceipt: receipt, ActorErr: aerr, ExecutionTrace: et, Duration: duration, - }, nil + } + + if ret.ExitCode != 0 { + return applyRet, fmt.Errorf("implicit message failed with exit code: %d and error: %w", ret.ExitCode, applyRet.ActorErr) + } + + return applyRet, nil } func (vm *FVM) Flush(ctx context.Context) (cid.Cid, error) {