Skip to content

Commit

Permalink
adopt clearer method names; fix typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk committed May 14, 2021
1 parent 9912212 commit 06a2828
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion chain/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ func (cs *ChainStore) ReadMsgMetaCids(mmc cid.Cid) ([]cid.Cid, []cid.Cid, error)
return blscids, secpkcids, nil
}

// GetPath returns returns the sequence of atomic head change operations that
// GetPath returns the sequence of atomic head change operations that
// need to be applied in order to switch the head of the chain from the `from`
// tipset to the `to` tipset.
func (cs *ChainStore) GetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*api.HeadChange, error) {
Expand Down
2 changes: 1 addition & 1 deletion storage/wdpost_changehandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type changeHandlerAPI interface {
startGeneratePoST(ctx context.Context, ts *types.TipSet, deadline *dline.Info, onComplete CompleteGeneratePoSTCb) context.CancelFunc
startSubmitPoST(ctx context.Context, ts *types.TipSet, deadline *dline.Info, posts []miner.SubmitWindowedPoStParams, onComplete CompleteSubmitPoSTCb) context.CancelFunc
onAbort(ts *types.TipSet, deadline *dline.Info)
failPost(err error, ts *types.TipSet, deadline *dline.Info)
recordPoStFailure(err error, ts *types.TipSet, deadline *dline.Info)
}

type changeHandler struct {
Expand Down
16 changes: 8 additions & 8 deletions storage/wdpost_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
"github.com/filecoin-project/lotus/chain/types"
)

// failPost records a failure in the journal.
func (s *WindowPoStScheduler) failPost(err error, ts *types.TipSet, deadline *dline.Info) {
// recordPoStFailure records a failure in the journal.
func (s *WindowPoStScheduler) recordPoStFailure(err error, ts *types.TipSet, deadline *dline.Info) {
s.journal.RecordEvent(s.evtTypes[evtTypeWdPoStScheduler], func() interface{} {
c := evtCommon{Error: err}
if ts != nil {
Expand Down Expand Up @@ -100,9 +100,9 @@ func (s *WindowPoStScheduler) runGeneratePoST(
ctx, span := trace.StartSpan(ctx, "WindowPoStScheduler.generatePoST")
defer span.End()

posts, err := s.runPost(ctx, *deadline, ts)
posts, err := s.runPoStCycle(ctx, *deadline, ts)
if err != nil {
log.Errorf("runPost failed: %+v", err)
log.Errorf("runPoStCycle failed: %+v", err)
return nil, err
}

Expand Down Expand Up @@ -441,18 +441,18 @@ func (s *WindowPoStScheduler) declareFaults(ctx context.Context, dlIdx uint64, p
return faults, sm, nil
}

// runPost runs a full cycle of the PoSt process:
// runPoStCycle runs a full cycle of the PoSt process:
//
// 1. performs recovery declarations for the next deadline.
// 2. performs fault declarations for the next deadline.
// 3. computes and submits proofs, batching partitions and making sure they
// don't exceed message capacity.
func (s *WindowPoStScheduler) runPost(ctx context.Context, di dline.Info, ts *types.TipSet) ([]miner.SubmitWindowedPoStParams, error) {
ctx, span := trace.StartSpan(ctx, "storage.runPost")
func (s *WindowPoStScheduler) runPoStCycle(ctx context.Context, di dline.Info, ts *types.TipSet) ([]miner.SubmitWindowedPoStParams, error) {
ctx, span := trace.StartSpan(ctx, "storage.runPoStCycle")
defer span.End()

go func() {
// TODO: extract from runPost, run on fault cutoff boundaries
// TODO: extract from runPoStCycle, run on fault cutoff boundaries

// check faults / recoveries for the *next* deadline. It's already too
// late to declare them for this deadline
Expand Down

0 comments on commit 06a2828

Please sign in to comment.