From 71cbd792908f08df189d3d876c6c2a8a6a9e43fa Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Thu, 12 Dec 2019 19:25:15 +0100 Subject: [PATCH] add a bit more tracing in publish storage deal --- chain/actors/actor_storagemarket.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/chain/actors/actor_storagemarket.go b/chain/actors/actor_storagemarket.go index dd3e78bec..7a9549ba6 100644 --- a/chain/actors/actor_storagemarket.go +++ b/chain/actors/actor_storagemarket.go @@ -5,6 +5,7 @@ import ( "context" "sort" + "go.opencensus.io/trace" "golang.org/x/xerrors" "github.com/filecoin-project/go-amt-ipld" @@ -254,6 +255,9 @@ func setMarketBalances(vmctx types.VMContext, nd *hamt.Node, set map[address.Add } func GetMarketBalances(ctx context.Context, store *hamt.CborIpldStore, rcid cid.Cid, addrs ...address.Address) ([]StorageParticipantBalance, *hamt.Node, ActorError) { + ctx, span := trace.StartSpan(ctx, "GetMarketBalances") + defer span.End() + nd, err := hamt.LoadNode(ctx, store, rcid) if err != nil { return nil, nil, aerrors.HandleExternalError(err, "failed to load miner set") @@ -381,6 +385,9 @@ func (sma StorageMarketActor) PublishStorageDeals(act *types.Actor, vmctx types. } func (st *StorageMarketState) validateDeal(vmctx types.VMContext, deal StorageDealProposal, providerWorker address.Address) aerrors.ActorError { + ctx, span := trace.StartSpan(vmctx.Context(), "validateDeal") + defer span.End() + if vmctx.BlockHeight() > deal.ProposalExpiration { return aerrors.New(1, "deal proposal already expired") } @@ -394,7 +401,7 @@ func (st *StorageMarketState) validateDeal(vmctx types.VMContext, deal StorageDe } // TODO: do some caching (changes gas so needs to be in spec too) - b, bnd, aerr := GetMarketBalances(vmctx.Context(), vmctx.Ipld(), st.Balances, deal.Client, providerWorker) + b, bnd, aerr := GetMarketBalances(ctx, vmctx.Ipld(), st.Balances, deal.Client, providerWorker) if aerr != nil { return aerrors.Wrap(aerr, "getting client, and provider balances") }