From 4a4d64f5283c206b2372fb3ed260426ab810241d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 17 Jun 2022 11:20:33 +0200 Subject: [PATCH] sealing pipeline: Rename 'tok' to 'tsk' --- storage/pipeline/checks.go | 20 ++++++++++---------- storage/pipeline/commit_batch.go | 14 +++++++------- storage/pipeline/currentdealinfo.go | 22 +++++++++++----------- storage/pipeline/currentdealinfo_test.go | 4 ++-- storage/pipeline/precommit_batch.go | 4 ++-- storage/pipeline/precommit_policy.go | 2 +- storage/pipeline/precommit_policy_test.go | 2 +- storage/pipeline/sealing.go | 16 ++++++++-------- storage/pipeline/states_sealing.go | 4 ++-- storage/pipeline/terminate_batch.go | 4 ++-- storage/pipeline/upgrade_queue.go | 6 +++--- 11 files changed, 49 insertions(+), 49 deletions(-) diff --git a/storage/pipeline/checks.go b/storage/pipeline/checks.go index c03bab5d1..2e52fb505 100644 --- a/storage/pipeline/checks.go +++ b/storage/pipeline/checks.go @@ -91,12 +91,12 @@ func checkPieces(ctx context.Context, maddr address.Address, si SectorInfo, api // checkPrecommit checks that data commitment generated in the sealing process // matches pieces, and that the seal ticket isn't expired -func checkPrecommit(ctx context.Context, maddr address.Address, si SectorInfo, tok types.TipSetKey, height abi.ChainEpoch, api SealingAPI) (err error) { +func checkPrecommit(ctx context.Context, maddr address.Address, si SectorInfo, tsk types.TipSetKey, height abi.ChainEpoch, api SealingAPI) (err error) { if err := checkPieces(ctx, maddr, si, api, false); err != nil { return err } - commD, err := api.StateComputeDataCID(ctx, maddr, si.SectorType, si.dealIDs(), tok) + commD, err := api.StateComputeDataCID(ctx, maddr, si.SectorType, si.dealIDs(), tsk) if err != nil { return &ErrApi{xerrors.Errorf("calling StateComputeDataCommitment: %w", err)} } @@ -105,7 +105,7 @@ func checkPrecommit(ctx context.Context, maddr address.Address, si SectorInfo, t return &ErrBadCommD{xerrors.Errorf("on chain CommD differs from sector: %s != %s", commD, si.CommD)} } - pci, err := api.StateSectorPreCommitInfo(ctx, maddr, si.SectorNumber, tok) + pci, err := api.StateSectorPreCommitInfo(ctx, maddr, si.SectorNumber, tsk) if err != nil { return &ErrApi{xerrors.Errorf("getting precommit info: %w", err)} } @@ -118,7 +118,7 @@ func checkPrecommit(ctx context.Context, maddr address.Address, si SectorInfo, t return &ErrPrecommitOnChain{xerrors.Errorf("precommit already on chain")} } - alloc, err := api.StateMinerSectorAllocated(ctx, maddr, si.SectorNumber, tok) + alloc, err := api.StateMinerSectorAllocated(ctx, maddr, si.SectorNumber, tsk) if err != nil { return xerrors.Errorf("checking if sector is allocated: %w", err) } @@ -136,18 +136,18 @@ func checkPrecommit(ctx context.Context, maddr address.Address, si SectorInfo, t return nil } -func (m *Sealing) checkCommit(ctx context.Context, si SectorInfo, proof []byte, tok types.TipSetKey) (err error) { +func (m *Sealing) checkCommit(ctx context.Context, si SectorInfo, proof []byte, tsk types.TipSetKey) (err error) { if si.SeedEpoch == 0 { return &ErrBadSeed{xerrors.Errorf("seed epoch was not set")} } - pci, err := m.Api.StateSectorPreCommitInfo(ctx, m.maddr, si.SectorNumber, tok) + pci, err := m.Api.StateSectorPreCommitInfo(ctx, m.maddr, si.SectorNumber, tsk) if err != nil { return xerrors.Errorf("getting precommit info: %w", err) } if pci == nil { - alloc, err := m.Api.StateMinerSectorAllocated(ctx, m.maddr, si.SectorNumber, tok) + alloc, err := m.Api.StateMinerSectorAllocated(ctx, m.maddr, si.SectorNumber, tsk) if err != nil { return xerrors.Errorf("checking if sector is allocated: %w", err) } @@ -174,7 +174,7 @@ func (m *Sealing) checkCommit(ctx context.Context, si SectorInfo, proof []byte, return err } - seed, err := m.Api.StateGetRandomnessFromBeacon(ctx, crypto.DomainSeparationTag_InteractiveSealChallengeSeed, si.SeedEpoch, buf.Bytes(), tok) + seed, err := m.Api.StateGetRandomnessFromBeacon(ctx, crypto.DomainSeparationTag_InteractiveSealChallengeSeed, si.SeedEpoch, buf.Bytes(), tsk) if err != nil { return &ErrApi{xerrors.Errorf("failed to get randomness for computing seal proof: %w", err)} } @@ -211,7 +211,7 @@ func (m *Sealing) checkCommit(ctx context.Context, si SectorInfo, proof []byte, } // check that sector info is good after running a replica update -func checkReplicaUpdate(ctx context.Context, maddr address.Address, si SectorInfo, tok types.TipSetKey, api SealingAPI) error { +func checkReplicaUpdate(ctx context.Context, maddr address.Address, si SectorInfo, tsk types.TipSetKey, api SealingAPI) error { if err := checkPieces(ctx, maddr, si, api, true); err != nil { return err @@ -220,7 +220,7 @@ func checkReplicaUpdate(ctx context.Context, maddr address.Address, si SectorInf return xerrors.Errorf("replica update on sector not marked for update") } - commD, err := api.StateComputeDataCID(ctx, maddr, si.SectorType, si.dealIDs(), tok) + commD, err := api.StateComputeDataCID(ctx, maddr, si.SectorType, si.dealIDs(), tsk) if err != nil { return &ErrApi{xerrors.Errorf("calling StateComputeDataCommitment: %w", err)} } diff --git a/storage/pipeline/commit_batch.go b/storage/pipeline/commit_batch.go index 51eae6e83..128a03eab 100644 --- a/storage/pipeline/commit_batch.go +++ b/storage/pipeline/commit_batch.go @@ -39,9 +39,9 @@ type CommitBatcherApi interface { StateMinerInfo(context.Context, address.Address, types.TipSetKey) (api.MinerInfo, error) ChainHead(ctx context.Context) (*types.TipSet, error) - StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorPreCommitOnChainInfo, error) + StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorPreCommitOnChainInfo, error) StateMinerInitialPledgeCollateral(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (big.Int, error) - StateNetworkVersion(ctx context.Context, tok types.TipSetKey) (network.Version, error) + StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error) StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (big.Int, error) } @@ -427,7 +427,7 @@ func (b *CommitBatcher) processIndividually(cfg sealiface.Config) ([]sealiface.C return res, nil } -func (b *CommitBatcher) processSingle(cfg sealiface.Config, mi api.MinerInfo, avail *abi.TokenAmount, sn abi.SectorNumber, info AggregateInput, tok types.TipSetKey) (cid.Cid, error) { +func (b *CommitBatcher) processSingle(cfg sealiface.Config, mi api.MinerInfo, avail *abi.TokenAmount, sn abi.SectorNumber, info AggregateInput, tsk types.TipSetKey) (cid.Cid, error) { enc := new(bytes.Buffer) params := &miner.ProveCommitSectorParams{ SectorNumber: sn, @@ -438,7 +438,7 @@ func (b *CommitBatcher) processSingle(cfg sealiface.Config, mi api.MinerInfo, av return cid.Undef, xerrors.Errorf("marshaling commit params: %w", err) } - collateral, err := b.getSectorCollateral(sn, tok) + collateral, err := b.getSectorCollateral(sn, tsk) if err != nil { return cid.Undef, err } @@ -604,8 +604,8 @@ func (b *CommitBatcher) getCommitCutoff(si SectorInfo) (time.Time, error) { return time.Now().Add(time.Duration(cutoffEpoch-ts.Height()) * time.Duration(build.BlockDelaySecs) * time.Second), nil } -func (b *CommitBatcher) getSectorCollateral(sn abi.SectorNumber, tok types.TipSetKey) (abi.TokenAmount, error) { - pci, err := b.api.StateSectorPreCommitInfo(b.mctx, b.maddr, sn, tok) +func (b *CommitBatcher) getSectorCollateral(sn abi.SectorNumber, tsk types.TipSetKey) (abi.TokenAmount, error) { + pci, err := b.api.StateSectorPreCommitInfo(b.mctx, b.maddr, sn, tsk) if err != nil { return big.Zero(), xerrors.Errorf("getting precommit info: %w", err) } @@ -613,7 +613,7 @@ func (b *CommitBatcher) getSectorCollateral(sn abi.SectorNumber, tok types.TipSe return big.Zero(), xerrors.Errorf("precommit info not found on chain") } - collateral, err := b.api.StateMinerInitialPledgeCollateral(b.mctx, b.maddr, pci.Info, tok) + collateral, err := b.api.StateMinerInitialPledgeCollateral(b.mctx, b.maddr, pci.Info, tsk) if err != nil { return big.Zero(), xerrors.Errorf("getting initial pledge collateral: %w", err) } diff --git a/storage/pipeline/currentdealinfo.go b/storage/pipeline/currentdealinfo.go index d39ef9a5d..bfc948610 100644 --- a/storage/pipeline/currentdealinfo.go +++ b/storage/pipeline/currentdealinfo.go @@ -24,7 +24,7 @@ type CurrentDealInfoAPI interface { StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error) StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*api.MarketDeal, error) StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) - StateNetworkVersion(ctx context.Context, tok types.TipSetKey) (network.Version, error) + StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error) } type CurrentDealInfo struct { @@ -40,19 +40,19 @@ type CurrentDealInfoManager struct { // GetCurrentDealInfo gets the current deal state and deal ID. // Note that the deal ID is assigned when the deal is published, so it may // have changed if there was a reorg after the deal was published. -func (mgr *CurrentDealInfoManager) GetCurrentDealInfo(ctx context.Context, tok types.TipSetKey, proposal *market.DealProposal, publishCid cid.Cid) (CurrentDealInfo, error) { +func (mgr *CurrentDealInfoManager) GetCurrentDealInfo(ctx context.Context, tsk types.TipSetKey, proposal *market.DealProposal, publishCid cid.Cid) (CurrentDealInfo, error) { // Lookup the deal ID by comparing the deal proposal to the proposals in // the publish deals message, and indexing into the message return value - dealID, pubMsgTok, err := mgr.dealIDFromPublishDealsMsg(ctx, tok, proposal, publishCid) + dealID, pubMsgTok, err := mgr.dealIDFromPublishDealsMsg(ctx, tsk, proposal, publishCid) if err != nil { return CurrentDealInfo{}, err } // Lookup the deal state by deal ID - marketDeal, err := mgr.CDAPI.StateMarketStorageDeal(ctx, dealID, tok) + marketDeal, err := mgr.CDAPI.StateMarketStorageDeal(ctx, dealID, tsk) if err == nil && proposal != nil { // Make sure the retrieved deal proposal matches the target proposal - equal, err := mgr.CheckDealEquality(ctx, tok, *proposal, marketDeal.Proposal) + equal, err := mgr.CheckDealEquality(ctx, tsk, *proposal, marketDeal.Proposal) if err != nil { return CurrentDealInfo{}, err } @@ -65,11 +65,11 @@ func (mgr *CurrentDealInfoManager) GetCurrentDealInfo(ctx context.Context, tok t // dealIDFromPublishDealsMsg looks up the publish deals message by cid, and finds the deal ID // by looking at the message return value -func (mgr *CurrentDealInfoManager) dealIDFromPublishDealsMsg(ctx context.Context, tok types.TipSetKey, proposal *market.DealProposal, publishCid cid.Cid) (abi.DealID, types.TipSetKey, error) { +func (mgr *CurrentDealInfoManager) dealIDFromPublishDealsMsg(ctx context.Context, tsk types.TipSetKey, proposal *market.DealProposal, publishCid cid.Cid) (abi.DealID, types.TipSetKey, error) { dealID := abi.DealID(0) // Get the return value of the publish deals message - lookup, err := mgr.CDAPI.StateSearchMsg(ctx, tok, publishCid, api.LookbackNoLimit, true) + lookup, err := mgr.CDAPI.StateSearchMsg(ctx, tsk, publishCid, api.LookbackNoLimit, true) if err != nil { return dealID, types.EmptyTSK, xerrors.Errorf("looking for publish deal message %s: search msg failed: %w", publishCid, err) } @@ -131,7 +131,7 @@ func (mgr *CurrentDealInfoManager) dealIDFromPublishDealsMsg(ctx context.Context // index of the target deal proposal dealIdx := -1 for i, paramDeal := range pubDealsParams.Deals { - eq, err := mgr.CheckDealEquality(ctx, tok, *proposal, paramDeal.Proposal) + eq, err := mgr.CheckDealEquality(ctx, tsk, *proposal, paramDeal.Proposal) if err != nil { return dealID, types.EmptyTSK, xerrors.Errorf("comparing publish deal message %s proposal to deal proposal: %w", publishCid, err) } @@ -169,12 +169,12 @@ func (mgr *CurrentDealInfoManager) dealIDFromPublishDealsMsg(ctx context.Context return dealIDs[outIdx], lookup.TipSet, nil } -func (mgr *CurrentDealInfoManager) CheckDealEquality(ctx context.Context, tok types.TipSetKey, p1, p2 market.DealProposal) (bool, error) { - p1ClientID, err := mgr.CDAPI.StateLookupID(ctx, p1.Client, tok) +func (mgr *CurrentDealInfoManager) CheckDealEquality(ctx context.Context, tsk types.TipSetKey, p1, p2 market.DealProposal) (bool, error) { + p1ClientID, err := mgr.CDAPI.StateLookupID(ctx, p1.Client, tsk) if err != nil { return false, err } - p2ClientID, err := mgr.CDAPI.StateLookupID(ctx, p2.Client, tok) + p2ClientID, err := mgr.CDAPI.StateLookupID(ctx, p2.Client, tsk) if err != nil { return false, err } diff --git a/storage/pipeline/currentdealinfo_test.go b/storage/pipeline/currentdealinfo_test.go index c5653959d..3087577d6 100644 --- a/storage/pipeline/currentdealinfo_test.go +++ b/storage/pipeline/currentdealinfo_test.go @@ -359,7 +359,7 @@ func (mapi *CurrentDealInfoMockAPI) ChainGetMessage(ctx context.Context, c cid.C }, nil } -func (mapi *CurrentDealInfoMockAPI) StateLookupID(ctx context.Context, addr address.Address, token types.TipSetKey) (address.Address, error) { +func (mapi *CurrentDealInfoMockAPI) StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) { return addr, nil } @@ -379,7 +379,7 @@ func (mapi *CurrentDealInfoMockAPI) StateSearchMsg(ctx context.Context, from typ return mapi.SearchMessageLookup, mapi.SearchMessageErr } -func (mapi *CurrentDealInfoMockAPI) StateNetworkVersion(ctx context.Context, tok types.TipSetKey) (network.Version, error) { +func (mapi *CurrentDealInfoMockAPI) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error) { return mapi.Version, nil } diff --git a/storage/pipeline/precommit_batch.go b/storage/pipeline/precommit_batch.go index ca3b84f6b..0a27725df 100644 --- a/storage/pipeline/precommit_batch.go +++ b/storage/pipeline/precommit_batch.go @@ -32,7 +32,7 @@ type PreCommitBatcherApi interface { StateMinerInfo(context.Context, address.Address, types.TipSetKey) (api.MinerInfo, error) StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (big.Int, error) ChainHead(ctx context.Context) (*types.TipSet, error) - StateNetworkVersion(ctx context.Context, tok types.TipSetKey) (network.Version, error) + StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error) } type preCommitEntry struct { @@ -309,7 +309,7 @@ func (b *PreCommitBatcher) processSingle(cfg sealiface.Config, mi api.MinerInfo, return mcid, nil } -func (b *PreCommitBatcher) processBatch(cfg sealiface.Config, tok types.TipSetKey, bf abi.TokenAmount, nv network.Version) ([]sealiface.PreCommitBatchRes, error) { +func (b *PreCommitBatcher) processBatch(cfg sealiface.Config, tsk types.TipSetKey, bf abi.TokenAmount, nv network.Version) ([]sealiface.PreCommitBatchRes, error) { params := miner.PreCommitSectorBatchParams{} deposit := big.Zero() var res sealiface.PreCommitBatchRes diff --git a/storage/pipeline/precommit_policy.go b/storage/pipeline/precommit_policy.go index 8aa5ff4b5..8a753ccf9 100644 --- a/storage/pipeline/precommit_policy.go +++ b/storage/pipeline/precommit_policy.go @@ -20,7 +20,7 @@ type PreCommitPolicy interface { type Chain interface { ChainHead(context.Context) (*types.TipSet, error) - StateNetworkVersion(ctx context.Context, tok types.TipSetKey) (network.Version, error) + StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error) } // BasicPreCommitPolicy satisfies PreCommitPolicy. It has two modes: diff --git a/storage/pipeline/precommit_policy_test.go b/storage/pipeline/precommit_policy_test.go index dd5764fff..d673126b9 100644 --- a/storage/pipeline/precommit_policy_test.go +++ b/storage/pipeline/precommit_policy_test.go @@ -42,7 +42,7 @@ func fakeConfigGetter(stub *fakeConfigStub) pipeline.GetSealingConfigFunc { } } -func (f *fakeChain) StateNetworkVersion(ctx context.Context, tok types.TipSetKey) (network.Version, error) { +func (f *fakeChain) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error) { return build.NewestNetworkVersion, nil } diff --git a/storage/pipeline/sealing.go b/storage/pipeline/sealing.go index f4cfce155..402e46250 100644 --- a/storage/pipeline/sealing.go +++ b/storage/pipeline/sealing.go @@ -43,10 +43,10 @@ type SealingAPI interface { StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) - StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorPreCommitOnChainInfo, error) - StateComputeDataCID(ctx context.Context, maddr address.Address, sectorType abi.RegisteredSealProof, deals []abi.DealID, tok types.TipSetKey) (cid.Cid, error) - StateSectorGetInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorOnChainInfo, error) - StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*lminer.SectorLocation, error) + StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorPreCommitOnChainInfo, error) + StateComputeDataCID(ctx context.Context, maddr address.Address, sectorType abi.RegisteredSealProof, deals []abi.DealID, tsk types.TipSetKey) (cid.Cid, error) + StateSectorGetInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) + StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*lminer.SectorLocation, error) StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error) StateMinerPreCommitDepositForPower(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (big.Int, error) StateMinerInitialPledgeCollateral(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (big.Int, error) @@ -54,15 +54,15 @@ type SealingAPI interface { StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (big.Int, error) StateMinerSectorAllocated(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (bool, error) StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*api.MarketDeal, error) - StateNetworkVersion(ctx context.Context, tok types.TipSetKey) (network.Version, error) + StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error) StateMinerProvingDeadline(context.Context, address.Address, types.TipSetKey) (*dline.Info, error) StateMinerDeadlines(context.Context, address.Address, types.TipSetKey) ([]api.Deadline, error) - StateMinerPartitions(ctx context.Context, m address.Address, dlIdx uint64, tok types.TipSetKey) ([]api.Partition, error) + StateMinerPartitions(ctx context.Context, m address.Address, dlIdx uint64, tsk types.TipSetKey) ([]api.Partition, error) MpoolPushMessage(context.Context, *types.Message, *api.MessageSendSpec) (*types.SignedMessage, error) ChainHead(ctx context.Context) (*types.TipSet, error) ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error) - StateGetRandomnessFromBeacon(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tok types.TipSetKey) (abi.Randomness, error) - StateGetRandomnessFromTickets(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tok types.TipSetKey) (abi.Randomness, error) + StateGetRandomnessFromBeacon(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) + StateGetRandomnessFromTickets(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) ChainReadObj(context.Context, cid.Cid) ([]byte, error) } diff --git a/storage/pipeline/states_sealing.go b/storage/pipeline/states_sealing.go index e5a35ee3d..ae0d31017 100644 --- a/storage/pipeline/states_sealing.go +++ b/storage/pipeline/states_sealing.go @@ -381,7 +381,7 @@ func (m *Sealing) handlePreCommitting(ctx statemachine.Context, sector SectorInf } } - params, pcd, tok, err := m.preCommitParams(ctx, sector) + params, pcd, tsk, err := m.preCommitParams(ctx, sector) if err != nil { return ctx.Send(SectorChainPreCommitFailed{xerrors.Errorf("preCommitParams: %w", err)}) } @@ -399,7 +399,7 @@ func (m *Sealing) handlePreCommitting(ctx statemachine.Context, sector SectorInf return ctx.Send(SectorChainPreCommitFailed{xerrors.Errorf("could not serialize pre-commit sector parameters: %w", err)}) } - mi, err := m.Api.StateMinerInfo(ctx.Context(), m.maddr, tok) + mi, err := m.Api.StateMinerInfo(ctx.Context(), m.maddr, tsk) if err != nil { log.Errorf("handlePreCommitting: api error, not proceeding: %+v", err) return nil diff --git a/storage/pipeline/terminate_batch.go b/storage/pipeline/terminate_batch.go index 3fda1940d..0f65ca31a 100644 --- a/storage/pipeline/terminate_batch.go +++ b/storage/pipeline/terminate_batch.go @@ -25,11 +25,11 @@ import ( ) type TerminateBatcherApi interface { - StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*lminer.SectorLocation, error) + StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*lminer.SectorLocation, error) MpoolPushMessage(context.Context, *types.Message, *api.MessageSendSpec) (*types.SignedMessage, error) StateMinerInfo(context.Context, address.Address, types.TipSetKey) (api.MinerInfo, error) StateMinerProvingDeadline(context.Context, address.Address, types.TipSetKey) (*dline.Info, error) - StateMinerPartitions(ctx context.Context, m address.Address, dlIdx uint64, tok types.TipSetKey) ([]api.Partition, error) + StateMinerPartitions(ctx context.Context, m address.Address, dlIdx uint64, tsk types.TipSetKey) ([]api.Partition, error) } type TerminateBatcher struct { diff --git a/storage/pipeline/upgrade_queue.go b/storage/pipeline/upgrade_queue.go index d3c2d4184..97dbf4ced 100644 --- a/storage/pipeline/upgrade_queue.go +++ b/storage/pipeline/upgrade_queue.go @@ -50,14 +50,14 @@ func (m *Sealing) MarkForSnapUpgrade(ctx context.Context, id abi.SectorNumber) e return m.sectors.Send(uint64(id), SectorMarkForUpdate{}) } -func (m *Sealing) sectorActive(ctx context.Context, tok types.TipSetKey, sector abi.SectorNumber) (bool, error) { - dls, err := m.Api.StateMinerDeadlines(ctx, m.maddr, tok) +func (m *Sealing) sectorActive(ctx context.Context, tsk types.TipSetKey, sector abi.SectorNumber) (bool, error) { + dls, err := m.Api.StateMinerDeadlines(ctx, m.maddr, tsk) if err != nil { return false, xerrors.Errorf("getting proving deadlines: %w", err) } for dl := range dls { - parts, err := m.Api.StateMinerPartitions(ctx, m.maddr, uint64(dl), tok) + parts, err := m.Api.StateMinerPartitions(ctx, m.maddr, uint64(dl), tsk) if err != nil { return false, xerrors.Errorf("getting partitions for deadline %d: %w", dl, err) }