diff --git a/chain/types/execresult.go b/chain/types/execresult.go index e8765f796..56f2ef143 100644 --- a/chain/types/execresult.go +++ b/chain/types/execresult.go @@ -1,9 +1,12 @@ package types +import "time" + type ExecutionResult struct { - Msg *Message - MsgRct *MessageReceipt - Error string + Msg *Message + MsgRct *MessageReceipt + Error string + Duration time.Duration Subcalls []*ExecutionResult } diff --git a/chain/vm/runtime.go b/chain/vm/runtime.go index ebaf48f59..948b0a021 100644 --- a/chain/vm/runtime.go +++ b/chain/vm/runtime.go @@ -5,6 +5,8 @@ import ( "context" "encoding/binary" "fmt" + "time" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/abi/big" @@ -366,6 +368,7 @@ func (rs *Runtime) Send(to address.Address, method abi.MethodNum, m vmr.CBORMars } func (rt *Runtime) internalSend(from, to address.Address, method abi.MethodNum, value types.BigInt, params []byte) ([]byte, aerrors.ActorError) { + start := time.Now() ctx, span := trace.StartSpan(rt.ctx, "vmc.Send") defer span.End() if span.IsRecordingEvents() { @@ -405,8 +408,9 @@ func (rt *Runtime) internalSend(from, to address.Address, method abi.MethodNum, } er := types.ExecutionResult{ - Msg: msg, - MsgRct: &mr, + Msg: msg, + MsgRct: &mr, + Duration: time.Since(start), } if errSend != nil { diff --git a/cmd/lotus-storage-miner/proving.go b/cmd/lotus-storage-miner/proving.go index 2b6d87062..7cfa010b9 100644 --- a/cmd/lotus-storage-miner/proving.go +++ b/cmd/lotus-storage-miner/proving.go @@ -3,6 +3,8 @@ package main import ( "bytes" "fmt" + "time" + "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" @@ -10,7 +12,6 @@ import ( "github.com/filecoin-project/specs-actors/actors/builtin/miner" "golang.org/x/xerrors" "gopkg.in/urfave/cli.v2" - "time" ) var provingCmd = &cli.Command{