From f120fe99af8518bec265accb5785447da49722f1 Mon Sep 17 00:00:00 2001 From: ZenGround0 <5515260+ZenGround0@users.noreply.github.com> Date: Mon, 25 Mar 2019 15:59:14 -0700 Subject: [PATCH] sampling randomness out of range results in revert not fault (#2409) also add error code 1 to RevertErrorWrap to be consistent --- actor/builtin/miner/miner.go | 2 +- vm/errors/errors.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actor/builtin/miner/miner.go b/actor/builtin/miner/miner.go index 34c2d591a5..cadddbc712 100644 --- a/actor/builtin/miner/miner.go +++ b/actor/builtin/miner/miner.go @@ -682,7 +682,7 @@ func (ma *Actor) SubmitPoSt(ctx exec.VMContext, postProofs []proofs.PoStProof) ( seed, err := currentProvingPeriodPoStChallengeSeed(ctx, state) if err != nil { - return nil, errors.FaultErrorWrap(err, "failed to sample chain for challenge seed") + return nil, errors.RevertErrorWrap(err, "failed to sample chain for challenge seed") } var commRs []proofs.CommR diff --git a/vm/errors/errors.go b/vm/errors/errors.go index b2c35050df..589f5f5883 100644 --- a/vm/errors/errors.go +++ b/vm/errors/errors.go @@ -57,7 +57,7 @@ func NewCodedRevertErrorf(code uint8, format string, args ...interface{}) error // RevertErrorWrap wraps a given error in a RevertError. func RevertErrorWrap(err error, msg string) error { - return &RevertError{err: err, msg: msg} + return &RevertError{err: err, msg: msg, code: 1} } // RevertErrorWrapf wraps a given error in a RevertError and adds a message