small fixes
This commit is contained in:
parent
4436148fa1
commit
b2fcca87ff
@ -100,6 +100,8 @@ func (m *Miner) Run(ctx context.Context) error {
|
|||||||
evts := events.NewEvents(ctx, m.api)
|
evts := events.NewEvents(ctx, m.api)
|
||||||
m.sealing = sealing.New(m.api, evts, m.maddr, m.worker, m.ds, m.sb, m.tktFn)
|
m.sealing = sealing.New(m.api, evts, m.maddr, m.worker, m.ds, m.sb, m.tktFn)
|
||||||
|
|
||||||
|
go m.sealing.Run(ctx)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,10 @@ var fsmPlanners = []func(events []statemachine.Event, state *SectorInfo) error{
|
|||||||
on(SectorPreCommitFailed{}, api.PreCommitFailed),
|
on(SectorPreCommitFailed{}, api.PreCommitFailed),
|
||||||
),
|
),
|
||||||
api.Committing: planCommitting,
|
api.Committing: planCommitting,
|
||||||
api.CommitWait: planOne(on(SectorProving{}, api.Proving)),
|
api.CommitWait: planOne(
|
||||||
|
on(SectorProving{}, api.Proving),
|
||||||
|
on(SectorCommitFailed{}, api.CommitFailed),
|
||||||
|
),
|
||||||
|
|
||||||
api.Proving: planOne(
|
api.Proving: planOne(
|
||||||
on(SectorFaultReported{}, api.FaultReported),
|
on(SectorFaultReported{}, api.FaultReported),
|
||||||
@ -238,6 +241,6 @@ func planOne(ts ...func() (mut mutator, next api.SectorState)) func(events []sta
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return xerrors.Errorf("planner for state %s received unexpected event %+v", events[0])
|
return xerrors.Errorf("planner for state %s received unexpected event %+v", api.SectorStates[state.State], events[0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,11 @@ func (evt SectorSeedReady) apply(state *SectorInfo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SectorSealCommitFailed struct{ error }
|
type SectorSealCommitFailed struct{ error }
|
||||||
|
|
||||||
type SectorCommitFailed struct{ error }
|
type SectorCommitFailed struct{ error }
|
||||||
|
|
||||||
|
func (evt SectorCommitFailed) apply(*SectorInfo) {}
|
||||||
|
|
||||||
type SectorCommitted struct {
|
type SectorCommitted struct {
|
||||||
message cid.Cid
|
message cid.Cid
|
||||||
proof []byte
|
proof []byte
|
||||||
|
@ -80,8 +80,6 @@ func New(api sealingApi, events *events.Events, maddr address.Address, worker ad
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Sealing) Run(ctx context.Context) error {
|
func (m *Sealing) Run(ctx context.Context) error {
|
||||||
m.events = events.NewEvents(ctx, m.api)
|
|
||||||
|
|
||||||
if err := m.restartSectors(ctx); err != nil {
|
if err := m.restartSectors(ctx); err != nil {
|
||||||
log.Errorf("%+v", err)
|
log.Errorf("%+v", err)
|
||||||
return xerrors.Errorf("failed load sector states: %w", err)
|
return xerrors.Errorf("failed load sector states: %w", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user