adopt clearer method names; fix typo.
This commit is contained in:
parent
9912212949
commit
c77f8fb382
@ -1243,7 +1243,7 @@ func (cs *ChainStore) ReadMsgMetaCids(mmc cid.Cid) ([]cid.Cid, []cid.Cid, error)
|
|||||||
return blscids, secpkcids, nil
|
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`
|
// need to be applied in order to switch the head of the chain from the `from`
|
||||||
// tipset to the `to` tipset.
|
// tipset to the `to` tipset.
|
||||||
func (cs *ChainStore) GetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*api.HeadChange, error) {
|
func (cs *ChainStore) GetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*api.HeadChange, error) {
|
||||||
|
@ -27,7 +27,7 @@ type changeHandlerAPI interface {
|
|||||||
startGeneratePoST(ctx context.Context, ts *types.TipSet, deadline *dline.Info, onComplete CompleteGeneratePoSTCb) context.CancelFunc
|
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
|
startSubmitPoST(ctx context.Context, ts *types.TipSet, deadline *dline.Info, posts []miner.SubmitWindowedPoStParams, onComplete CompleteSubmitPoSTCb) context.CancelFunc
|
||||||
onAbort(ts *types.TipSet, deadline *dline.Info)
|
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 {
|
type changeHandler struct {
|
||||||
|
@ -191,7 +191,7 @@ func (m *mockAPI) wasAbortCalled() bool {
|
|||||||
return m.abortCalled
|
return m.abortCalled
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *mockAPI) failPost(err error, ts *types.TipSet, deadline *dline.Info) {
|
func (m *mockAPI) recordPoStFailure(err error, ts *types.TipSet, deadline *dline.Info) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *mockAPI) setChangeHandler(ch *changeHandler) {
|
func (m *mockAPI) setChangeHandler(ch *changeHandler) {
|
||||||
|
@ -31,8 +31,8 @@ import (
|
|||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// failPost records a failure in the journal.
|
// recordPoStFailure records a failure in the journal.
|
||||||
func (s *WindowPoStScheduler) failPost(err error, ts *types.TipSet, deadline *dline.Info) {
|
func (s *WindowPoStScheduler) recordPoStFailure(err error, ts *types.TipSet, deadline *dline.Info) {
|
||||||
s.journal.RecordEvent(s.evtTypes[evtTypeWdPoStScheduler], func() interface{} {
|
s.journal.RecordEvent(s.evtTypes[evtTypeWdPoStScheduler], func() interface{} {
|
||||||
c := evtCommon{Error: err}
|
c := evtCommon{Error: err}
|
||||||
if ts != nil {
|
if ts != nil {
|
||||||
@ -100,9 +100,9 @@ func (s *WindowPoStScheduler) runGeneratePoST(
|
|||||||
ctx, span := trace.StartSpan(ctx, "WindowPoStScheduler.generatePoST")
|
ctx, span := trace.StartSpan(ctx, "WindowPoStScheduler.generatePoST")
|
||||||
defer span.End()
|
defer span.End()
|
||||||
|
|
||||||
posts, err := s.runPost(ctx, *deadline, ts)
|
posts, err := s.runPoStCycle(ctx, *deadline, ts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("runPost failed: %+v", err)
|
log.Errorf("runPoStCycle failed: %+v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -441,18 +441,18 @@ func (s *WindowPoStScheduler) declareFaults(ctx context.Context, dlIdx uint64, p
|
|||||||
return faults, sm, nil
|
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.
|
// 1. performs recovery declarations for the next deadline.
|
||||||
// 2. performs fault declarations for the next deadline.
|
// 2. performs fault declarations for the next deadline.
|
||||||
// 3. computes and submits proofs, batching partitions and making sure they
|
// 3. computes and submits proofs, batching partitions and making sure they
|
||||||
// don't exceed message capacity.
|
// don't exceed message capacity.
|
||||||
func (s *WindowPoStScheduler) runPost(ctx context.Context, di dline.Info, ts *types.TipSet) ([]miner.SubmitWindowedPoStParams, error) {
|
func (s *WindowPoStScheduler) runPoStCycle(ctx context.Context, di dline.Info, ts *types.TipSet) ([]miner.SubmitWindowedPoStParams, error) {
|
||||||
ctx, span := trace.StartSpan(ctx, "storage.runPost")
|
ctx, span := trace.StartSpan(ctx, "storage.runPoStCycle")
|
||||||
defer span.End()
|
defer span.End()
|
||||||
|
|
||||||
go func() {
|
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
|
// check faults / recoveries for the *next* deadline. It's already too
|
||||||
// late to declare them for this deadline
|
// late to declare them for this deadline
|
||||||
|
Loading…
Reference in New Issue
Block a user