From 7519bb71be3aee3bef757bbfb4786eca0ccf8948 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Wed, 9 Sep 2020 17:59:25 +0100 Subject: [PATCH] fix: error when actor panics directly --- chain/vm/runtime.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chain/vm/runtime.go b/chain/vm/runtime.go index 043ea3a45f4..467ca185d99 100644 --- a/chain/vm/runtime.go +++ b/chain/vm/runtime.go @@ -123,7 +123,11 @@ func (rt *Runtime) shimCall(f func() interface{}) (rval []byte, aerr aerrors.Act //log.Desugar().WithOptions(zap.AddStacktrace(zapcore.ErrorLevel)). //Sugar().Errorf("spec actors failure: %s", r) log.Errorf("spec actors failure: %s", r) - aerr = aerrors.Newf(1, "spec actors failure: %s", r) + // If an actor implementation panics directly (rather than calling Abortf) then the evaluation is undefined. + // There is no exit code corresponding to this. The result should not go on chain. A panic (which could also + // come from some actor dependency) may indicate a transient state or error that cannot be replicated by + // other nodes and thus cannot form part of consensus. E.g. an out-of-memory. + aerr = aerrors.Fatalf("spec actors failure: %s", r) } }()