add some more tracing to chain sync

This commit is contained in:
whyrusleeping
2019-10-10 20:13:26 +09:00
parent fef544f88e
commit 3f342d7ae2
5 changed files with 31 additions and 16 deletions
+4 -4
View File
@@ -129,12 +129,12 @@ func (a *StateAPI) StateReplay(ctx context.Context, ts *types.TipSet, mc cid.Cid
}, nil
}
func (a *StateAPI) stateForTs(ts *types.TipSet) (*state.StateTree, error) {
func (a *StateAPI) stateForTs(ctx context.Context, ts *types.TipSet) (*state.StateTree, error) {
if ts == nil {
ts = a.Chain.GetHeaviestTipSet()
}
st, _, err := a.StateManager.TipSetState(ts)
st, _, err := a.StateManager.TipSetState(ctx, ts)
if err != nil {
return nil, err
}
@@ -145,7 +145,7 @@ func (a *StateAPI) stateForTs(ts *types.TipSet) (*state.StateTree, error) {
}
func (a *StateAPI) StateGetActor(ctx context.Context, actor address.Address, ts *types.TipSet) (*types.Actor, error) {
state, err := a.stateForTs(ts)
state, err := a.stateForTs(ctx, ts)
if err != nil {
return nil, err
}
@@ -154,7 +154,7 @@ func (a *StateAPI) StateGetActor(ctx context.Context, actor address.Address, ts
}
func (a *StateAPI) StateReadState(ctx context.Context, act *types.Actor, ts *types.TipSet) (*api.ActorState, error) {
state, err := a.stateForTs(ts)
state, err := a.stateForTs(ctx, ts)
if err != nil {
return nil, err
}