From 8d734d81d924433be69dfde50dfea46df6f4e792 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 10 Jun 2021 07:50:51 -0700 Subject: [PATCH] fix(lotus-sim): log failed pre-commits and continue --- cmd/lotus-sim/simulation/precommit.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/cmd/lotus-sim/simulation/precommit.go b/cmd/lotus-sim/simulation/precommit.go index 51fdaedc6..854722f6a 100644 --- a/cmd/lotus-sim/simulation/precommit.go +++ b/cmd/lotus-sim/simulation/precommit.go @@ -17,6 +17,7 @@ import ( tutils "github.com/filecoin-project/specs-actors/v5/support/testing" "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/aerrors" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/actors/policy" "github.com/filecoin-project/lotus/chain/types" @@ -170,7 +171,7 @@ func (ss *simulationState) packPreCommitsMiner(ctx context.Context, cb packFunc, } enc, err := actors.SerializeParams(¶ms) if err != nil { - return 0, false, err + return added, false, err } // NOTE: just in-case, sendAndFund will "fund" and re-try for any message // that fails due to "insufficient funds". @@ -184,13 +185,22 @@ func (ss *simulationState) packPreCommitsMiner(ctx context.Context, cb packFunc, // try again with a smaller batch. targetBatchSize /= 2 continue + } else if aerr, ok := err.(aerrors.ActorError); ok && !aerr.IsFatal() { + // Log the error and move on. No reason to stop. + log.Errorw("failed to pre-commit for unknown reasons", + "error", aerr, + "miner", minerAddr, + "sectors", batch, + "epoch", ss.nextEpoch(), + ) + return added, false, nil } else if err != nil { - return 0, false, err + return added, false, err } for _, info := range batch { if err := ss.commitQueue.enqueueProveCommit(minerAddr, epoch, info); err != nil { - return 0, false, err + return added, false, err } added++ } @@ -215,7 +225,7 @@ func (ss *simulationState) packPreCommitsMiner(ctx context.Context, cb packFunc, } if err := ss.commitQueue.enqueueProveCommit(minerAddr, epoch, info); err != nil { - return 0, false, err + return added, false, err } added++ }