revert dead code

This commit is contained in:
vyzo 2023-03-30 18:11:44 +03:00 committed by Maciej Witowski
parent b908096a88
commit 371028a42a
3 changed files with 3 additions and 7 deletions

View File

@ -192,7 +192,6 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context,
cronGas = 0 cronGas = 0
partDone = metrics.Timer(ctx, metrics.VMApplyMessages) partDone = metrics.Timer(ctx, metrics.VMApplyMessages)
// TODO reorg the code to minimize the execution critical section
vmi, err := makeVm(pstate, epoch, ts.MinTimestamp()) vmi, err := makeVm(pstate, epoch, ts.MinTimestamp())
if err != nil { if err != nil {
return cid.Undef, cid.Undef, xerrors.Errorf("making vm: %w", err) return cid.Undef, cid.Undef, xerrors.Errorf("making vm: %w", err)
@ -259,7 +258,7 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context,
return cid.Cid{}, cid.Cid{}, err return cid.Cid{}, cid.Cid{}, err
} }
vmDoCron := partDone() vmCron := partDone()
partDone = metrics.Timer(ctx, metrics.VMApplyFlush) partDone = metrics.Timer(ctx, metrics.VMApplyFlush)
rectarr := blockadt.MakeEmptyArray(sm.ChainStore().ActorStore(ctx)) rectarr := blockadt.MakeEmptyArray(sm.ChainStore().ActorStore(ctx))
@ -298,7 +297,7 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context,
vmFlush := partDone() vmFlush := partDone()
partDone = func() time.Duration { return time.Duration(0) } partDone = func() time.Duration { return time.Duration(0) }
log.Infow("ApplyBlocks stats", "early", vmEarly, "earlyCronGas", earlyCronGas, "vmMsg", vmMsg, "msgGas", msgGas, "vmCron", vmDoCron, "cronGas", cronGas, "vmFlush", vmFlush, "epoch", epoch, "tsk", ts.Key()) log.Infow("ApplyBlocks stats", "early", vmEarly, "earlyCronGas", earlyCronGas, "vmMsg", vmMsg, "msgGas", msgGas, "vmCron", vmCron, "cronGas", cronGas, "vmFlush", vmFlush, "epoch", epoch, "tsk", ts.Key())
stats.Record(ctx, metrics.VMSends.M(int64(atomic.LoadUint64(&vm.StatSends))), stats.Record(ctx, metrics.VMSends.M(int64(atomic.LoadUint64(&vm.StatSends))),
metrics.VMApplied.M(int64(atomic.LoadUint64(&vm.StatApplied)))) metrics.VMApplied.M(int64(atomic.LoadUint64(&vm.StatApplied))))

View File

@ -169,7 +169,6 @@ func (sm *StateManager) callInternal(ctx context.Context, msg *types.Message, pr
if err != nil { if err != nil {
return nil, xerrors.Errorf("failed to set up vm: %w", err) return nil, xerrors.Errorf("failed to set up vm: %w", err)
} }
for i, m := range priorMsgs { for i, m := range priorMsgs {
_, err = vmi.ApplyMessage(ctx, m) _, err = vmi.ApplyMessage(ctx, m)
if err != nil { if err != nil {

View File

@ -26,9 +26,7 @@ const (
DefaultPriorityExecutionLanes = 2 DefaultPriorityExecutionLanes = 2
) )
var ErrExecutorDone = errors.New("executor has been released") // the execution environment; see below for definition, methods, and initialization
// the execution environment; see below for definition, methods, and initilization
var execution *executionEnv var execution *executionEnv
// implementation of vm executor with simple sanity check preventing use after free. // implementation of vm executor with simple sanity check preventing use after free.