From c544f4ce441f02c89b162c2352d5552ee650a390 Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 18 May 2021 16:59:11 +0300 Subject: [PATCH] avoid extraneous rpc call for storage start epoch --- extern/storage-sealing/commit_batch.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/extern/storage-sealing/commit_batch.go b/extern/storage-sealing/commit_batch.go index b23832fe1..ba9d988ca 100644 --- a/extern/storage-sealing/commit_batch.go +++ b/extern/storage-sealing/commit_batch.go @@ -28,7 +28,6 @@ const arp = abi.RegisteredAggregationProof_SnarkPackV1 type CommitBatcherApi interface { 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) - StateMarketStorageDeal(context.Context, abi.DealID, TipSetToken) (*api.MarketDeal, error) ChainHead(ctx context.Context) (TipSetToken, abi.ChainEpoch, error) } @@ -169,14 +168,9 @@ func (b *CommitBatcher) getSectorDeadline(si SectorInfo) time.Time { continue } - proposal, err := b.api.StateMarketStorageDealProposal(b.mctx, p.DealInfo.DealID, tok) - if err != nil { - log.Errorf("getting deal proposal for %d: %s", p.DealInfo.DealID, err) - continue - } - - if proposal.StartEpoch < deadlineEpoch { - deadlineEpoch = proposal.StartEpoch + startEpoch := p.DealInfo.DealSchedule.StartEpoch + if startEpoch < deadlineEpoch { + deadlineEpoch = startEpoch } }