application-research / delta-importer

Import client for Delta
2 stars 1 forks source link

[Improvement] Improve `inPipeline` sectors determination #23

Open jcace opened 1 year ago

jcace commented 1 year ago

Right now, the code in GetDealsInPipeline() makes several queries to track everything in the pipeline. On the Boost Sealing Pipeline page, it uses the AppSealingPipelineQuery to retrieve the counts. Explore using this as it will drastically simplify the logic and potentially account for more edge cases (ex- unsealing is currently not accounted for)

https://github.com/application-research/delta-importer/blob/main/services/boost.go#L206


query AppSealingPipelineQuery {
  sealingpipeline {
    WaitDealsSectors {
      SectorID
      Used
      SectorSize
      Deals {
        ID
        Size
        IsLegacy
        __typename
      }
      __typename
    }
    SnapDealsWaitDealsSectors {
      SectorID
      Used
      SectorSize
      Deals {
        ID
        Size
        IsLegacy
        __typename
      }
      __typename
    }
    SectorStates {
      Regular {
        Key
        Value
        Order
        __typename
      }
      RegularError {
        Key
        Value
        Order
        __typename
      }
      SnapDeals {
        Key
        Value
        Order
        __typename
      }
      SnapDealsError {
        Key
        Value
        Order
        __typename
      }
      __typename
    }
    Workers {
      ID
      Start
      Stage
      Sector
      __typename
    }
    __typename
  }
}```
jcace commented 1 year ago

It might be easier to do this by querying Lotus Miner directly