Sector Index #

import abi ""
import sector ""
import piece ""
import smarkact ""

// TODO import this from StorageMarket
type SectorIndex struct {
    BySectorID     {abi.SectorID: sector.SectorInfo}
    ByUnsealedCID  {abi.UnsealedSectorCID: sector.SectorInfo}
    BySealedCID    {abi.SealedSectorCID: sector.SectorInfo}
    ByPieceID      {piece.PieceID: sector.SectorInfo}
    ByDealID       {abi.DealID: sector.SectorInfo}

type SectorIndexerSubsystem struct {
    Index    SectorIndex
    Store    SectorStore
    Builder  SectorBuilder

    // AddNewDeal is called by StorageMiningSubsystem after the StorageMarket
    // has made a deal. AddNewDeal returns an error when:
    // - there is no capacity to store more deals and their pieces
    AddNewDeal(deal smarkact.StorageDeal) StageDealResponse

    // bring back if needed.
    // OnNewTipset(chain Chain, epoch abi.Epoch) struct {}

    // SectorsExpiredAtEpoch returns the set of sectors that expire
    // at a particular epoch.
    SectorsExpiredAtEpoch(epoch abi.ChainEpoch) [abi.SectorID]

    // removeSectors removes the given sectorIDs from storage.
    removeSectors(sectorIDs [abi.SectorID])