Merge pull request #8545 from swift-mx/mx_dev

fix: update StatApplied when fvm apply message
This commit is contained in:
Łukasz Magiera
2022-05-06 14:23:30 -04:00
committed by GitHub
+3
View File
@@ -3,6 +3,7 @@ package vm
import (
"bytes"
"context"
"sync/atomic"
"time"
"github.com/ipfs/go-cid"
@@ -295,6 +296,7 @@ func NewFVM(ctx context.Context, opts *VMOpts) (*FVM, error) {
func (vm *FVM) ApplyMessage(ctx context.Context, cmsg types.ChainMsg) (*ApplyRet, error) {
start := build.Clock.Now()
defer atomic.AddUint64(&StatApplied, 1)
msgBytes, err := cmsg.VMMessage().Serialize()
if err != nil {
return nil, xerrors.Errorf("serializing msg: %w", err)
@@ -345,6 +347,7 @@ func (vm *FVM) ApplyMessage(ctx context.Context, cmsg types.ChainMsg) (*ApplyRet
func (vm *FVM) ApplyImplicitMessage(ctx context.Context, cmsg *types.Message) (*ApplyRet, error) {
start := build.Clock.Now()
defer atomic.AddUint64(&StatApplied, 1)
msgBytes, err := cmsg.VMMessage().Serialize()
if err != nil {
return nil, xerrors.Errorf("serializing msg: %w", err)