Skip to content

Commit 8494e2e

Browse files
authored
fix(market): use MK20 DDO duration for deal schedule (#1345)
* market: preserve MK20 DDO duration with allocations * market: fix MK20 DDO duration sanity check
1 parent 4ef2e4d commit 8494e2e

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

market/mk20/mk20.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,14 +478,14 @@ func (m *MK20) sanitizeDDODeal(ctx context.Context, deal *Deal) (*ProviderDealRe
478478
if alloc.TermMin > deal.Products.DDOV1.Duration {
479479
return &ProviderDealRejectionInfo{
480480
HTTPCode: ErrBadProposal,
481-
Reason: "Allocation term min is less than deal duration",
481+
Reason: "Allocation term min is greater than deal duration",
482482
}, nil
483483
}
484484

485-
if alloc.TermMax > deal.Products.DDOV1.Duration {
485+
if alloc.TermMax < deal.Products.DDOV1.Duration {
486486
return &ProviderDealRejectionInfo{
487487
HTTPCode: ErrBadProposal,
488-
Reason: "Allocation term max is greater than deal duration",
488+
Reason: "Allocation term max is less than deal duration",
489489
}, nil
490490
}
491491

tasks/storage-market/mk20.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,14 @@ func (d *CurioStorageDealMarket) processMK20DealIngestion(ctx context.Context) {
10701070
log.Errorw("allocation expired", "deal", deal.ID, "error", err)
10711071
continue
10721072
}
1073-
end = start + alloc.TermMin
1073+
if abi.ChainEpoch(deal.Duration) < alloc.TermMin || abi.ChainEpoch(deal.Duration) > alloc.TermMax {
1074+
log.Errorw("deal duration outside allocation bounds",
1075+
"deal", deal.ID,
1076+
"duration", deal.Duration,
1077+
"term_min", alloc.TermMin,
1078+
"term_max", alloc.TermMax)
1079+
continue
1080+
}
10741081
vak = &miner.VerifiedAllocationKey{
10751082
Client: abi.ActorID(allocClientID),
10761083
ID: verifreg13.AllocationId(*mk20Deal.Products.DDOV1.AllocationId),

0 commit comments

Comments
 (0)