From 77dd1f512e3282df97521b3b1e4d4ad476359699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 12 Mar 2024 17:02:38 +0100 Subject: [PATCH] sealing pipeline: Output DDO pieces in SectorStatus (#11709) --- storage/pipeline/input.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/storage/pipeline/input.go b/storage/pipeline/input.go index 53c96fc55..335e080ae 100644 --- a/storage/pipeline/input.go +++ b/storage/pipeline/input.go @@ -952,20 +952,30 @@ func (m *Sealing) SectorsStatus(ctx context.Context, sid abi.SectorNumber, showO return api.SectorInfo{}, err } + nv, err := m.Api.StateNetworkVersion(ctx, types.EmptyTSK) + if err != nil { + return api.SectorInfo{}, xerrors.Errorf("getting network version: %w", err) + } + deals := make([]abi.DealID, len(info.Pieces)) pieces := make([]api.SectorPiece, len(info.Pieces)) for i, piece := range info.Pieces { - // todo make this work with DDO deals in some reasonable way - pieces[i].Piece = piece.Piece() - if !piece.HasDealInfo() || piece.Impl().PublishCid == nil { + + if !piece.HasDealInfo() { + continue + } + + pdi := piece.Impl() + if pdi.Valid(nv) != nil { continue } - pdi := piece.DealInfo().Impl() // copy pieces[i].DealInfo = &pdi - deals[i] = piece.DealInfo().Impl().DealID + if pdi.PublishCid != nil { + deals[i] = pdi.DealID + } } log := make([]api.SectorLog, len(info.Log))