sealing: Wire up context to batchers

This commit is contained in:
Łukasz Magiera 2021-06-16 11:43:06 +02:00
parent c1529714e6
commit 1f914053b4
2 changed files with 5 additions and 5 deletions

View File

@ -131,7 +131,7 @@ type pendingPiece struct {
accepted func(abi.SectorNumber, abi.UnpaddedPieceSize, error) accepted func(abi.SectorNumber, abi.UnpaddedPieceSize, error)
} }
func New(api SealingAPI, fc config.MinerFeeConfig, events Events, maddr address.Address, ds datastore.Batching, sealer sectorstorage.SectorManager, sc SectorIDCounter, verif ffiwrapper.Verifier, prov ffiwrapper.Prover, pcp PreCommitPolicy, gc GetSealingConfigFunc, notifee SectorStateNotifee, as AddrSel) *Sealing { func New(mctx context.Context, api SealingAPI, fc config.MinerFeeConfig, events Events, maddr address.Address, ds datastore.Batching, sealer sectorstorage.SectorManager, sc SectorIDCounter, verif ffiwrapper.Verifier, prov ffiwrapper.Prover, pcp PreCommitPolicy, gc GetSealingConfigFunc, notifee SectorStateNotifee, as AddrSel) *Sealing {
s := &Sealing{ s := &Sealing{
api: api, api: api,
feeCfg: fc, feeCfg: fc,
@ -152,9 +152,9 @@ func New(api SealingAPI, fc config.MinerFeeConfig, events Events, maddr address.
notifee: notifee, notifee: notifee,
addrSel: as, addrSel: as,
terminator: NewTerminationBatcher(context.TODO(), maddr, api, as, fc, gc), terminator: NewTerminationBatcher(mctx, maddr, api, as, fc, gc),
precommiter: NewPreCommitBatcher(context.TODO(), maddr, api, as, fc, gc), precommiter: NewPreCommitBatcher(mctx, maddr, api, as, fc, gc),
commiter: NewCommitBatcher(context.TODO(), maddr, api, as, fc, gc, prov), commiter: NewCommitBatcher(mctx, maddr, api, as, fc, gc, prov),
getConfig: gc, getConfig: gc,
dealInfo: &CurrentDealInfoManager{api}, dealInfo: &CurrentDealInfoManager{api},

View File

@ -157,7 +157,7 @@ func (m *Miner) Run(ctx context.Context) error {
return m.addrSel.AddressFor(ctx, m.api, mi, use, goodFunds, minFunds) return m.addrSel.AddressFor(ctx, m.api, mi, use, goodFunds, minFunds)
} }
m.sealing = sealing.New(adaptedAPI, m.feeCfg, NewEventsAdapter(evts), m.maddr, m.ds, m.sealer, m.sc, m.verif, m.prover, &pcp, sealing.GetSealingConfigFunc(m.getSealConfig), m.handleSealingNotifications, as) m.sealing = sealing.New(ctx, adaptedAPI, m.feeCfg, NewEventsAdapter(evts), m.maddr, m.ds, m.sealer, m.sc, m.verif, m.prover, &pcp, sealing.GetSealingConfigFunc(m.getSealConfig), m.handleSealingNotifications, as)
go m.sealing.Run(ctx) //nolint:errcheck // logged intside the function go m.sealing.Run(ctx) //nolint:errcheck // logged intside the function