avoid extraneous rpc call for storage start epoch
This commit is contained in:
parent
7512748b56
commit
c544f4ce44
12
extern/storage-sealing/commit_batch.go
vendored
12
extern/storage-sealing/commit_batch.go
vendored
@ -28,7 +28,6 @@ const arp = abi.RegisteredAggregationProof_SnarkPackV1
|
|||||||
type CommitBatcherApi interface {
|
type CommitBatcherApi interface {
|
||||||
SendMsg(ctx context.Context, from, to address.Address, method abi.MethodNum, value, maxFee abi.TokenAmount, params []byte) (cid.Cid, error)
|
SendMsg(ctx context.Context, from, to address.Address, method abi.MethodNum, value, maxFee abi.TokenAmount, params []byte) (cid.Cid, error)
|
||||||
StateMinerInfo(context.Context, address.Address, TipSetToken) (miner.MinerInfo, error)
|
StateMinerInfo(context.Context, address.Address, TipSetToken) (miner.MinerInfo, error)
|
||||||
StateMarketStorageDeal(context.Context, abi.DealID, TipSetToken) (*api.MarketDeal, error)
|
|
||||||
ChainHead(ctx context.Context) (TipSetToken, abi.ChainEpoch, error)
|
ChainHead(ctx context.Context) (TipSetToken, abi.ChainEpoch, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,14 +168,9 @@ func (b *CommitBatcher) getSectorDeadline(si SectorInfo) time.Time {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
proposal, err := b.api.StateMarketStorageDealProposal(b.mctx, p.DealInfo.DealID, tok)
|
startEpoch := p.DealInfo.DealSchedule.StartEpoch
|
||||||
if err != nil {
|
if startEpoch < deadlineEpoch {
|
||||||
log.Errorf("getting deal proposal for %d: %s", p.DealInfo.DealID, err)
|
deadlineEpoch = startEpoch
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if proposal.StartEpoch < deadlineEpoch {
|
|
||||||
deadlineEpoch = proposal.StartEpoch
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user