From 9f2675422ac6a5f5f520023b0287ca4ae54c097e Mon Sep 17 00:00:00 2001 From: vyzo Date: Thu, 23 Mar 2023 17:34:59 +0200 Subject: [PATCH] call Executor.Done where appropriate in stmgr uses --- chain/stmgr/call.go | 3 +++ chain/stmgr/utils.go | 1 + 2 files changed, 4 insertions(+) diff --git a/chain/stmgr/call.go b/chain/stmgr/call.go index 61056528f..e94d9bccb 100644 --- a/chain/stmgr/call.go +++ b/chain/stmgr/call.go @@ -169,6 +169,8 @@ func (sm *StateManager) callInternal(ctx context.Context, msg *types.Message, pr if err != nil { return nil, xerrors.Errorf("failed to set up vm: %w", err) } + defer vmi.Done() + for i, m := range priorMsgs { _, err = vmi.ApplyMessage(ctx, m) if err != nil { @@ -201,6 +203,7 @@ func (sm *StateManager) callInternal(ctx context.Context, msg *types.Message, pr vmopt.BaseFee = big.Zero() vmopt.StateBase = stateCid + vmi.Done() vmi, err = sm.newVM(ctx, vmopt) if err != nil { return nil, xerrors.Errorf("failed to set up estimation vm: %w", err) diff --git a/chain/stmgr/utils.go b/chain/stmgr/utils.go index c93267d50..78129cb16 100644 --- a/chain/stmgr/utils.go +++ b/chain/stmgr/utils.go @@ -106,6 +106,7 @@ func ComputeState(ctx context.Context, sm *StateManager, height abi.ChainEpoch, if err != nil { return cid.Undef, nil, err } + defer vmi.Done() for i, msg := range msgs { // TODO: Use the signed message length for secp messages