Skip to content

Commit

Permalink
sealing pipeline: Output DDO pieces in SectorStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Mar 12, 2024
1 parent e5ccf19 commit 92d0077
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions storage/pipeline/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -953,20 +953,27 @@ 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 {

pdi := piece.Impl() // may be zero-val if !HasDealInfo

if !piece.HasDealInfo() || 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))
Expand Down

0 comments on commit 92d0077

Please sign in to comment.