storageminer: More correct listing of sealed sectors
This commit is contained in:
parent
922d8a90a5
commit
5a5c66600f
@ -114,10 +114,6 @@ func (sb *SectorBuilder) GetAllStagedSectors() ([]uint64, error) {
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sb *SectorBuilder) GetAllSealedSectors() ([]SealedSectorMetadata, error) {
|
|
||||||
return sectorbuilder.GetAllSealedSectors(sb.handle)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (sb *SectorBuilder) GeneratePoSt(sectorInfo SortedSectorInfo, challengeSeed [CommLen]byte, faults []uint64) ([]byte, error) {
|
func (sb *SectorBuilder) GeneratePoSt(sectorInfo SortedSectorInfo, challengeSeed [CommLen]byte, faults []uint64) ([]byte, error) {
|
||||||
// Wait, this is a blocking method with no way of interrupting it?
|
// Wait, this is a blocking method with no way of interrupting it?
|
||||||
// does it checkpoint itself?
|
// does it checkpoint itself?
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-sectorbuilder/sealing_state"
|
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
"github.com/ipfs/go-datastore"
|
"github.com/ipfs/go-datastore"
|
||||||
logging "github.com/ipfs/go-log"
|
logging "github.com/ipfs/go-log"
|
||||||
@ -118,15 +117,7 @@ func (m *Miner) commitUntrackedSectors(ctx context.Context) error {
|
|||||||
|
|
||||||
log.Warnf("Missing commitment for sector %d, committing sector", s.SectorID)
|
log.Warnf("Missing commitment for sector %d, committing sector", s.SectorID)
|
||||||
|
|
||||||
if err := m.commitSector(ctx, sectorbuilder.SectorSealingStatus{
|
if err := m.commitSector(ctx, s); err != nil {
|
||||||
SectorID: s.SectorID,
|
|
||||||
State: sealing_state.Sealed,
|
|
||||||
CommD: s.CommD,
|
|
||||||
CommR: s.CommR,
|
|
||||||
Proof: s.Proof,
|
|
||||||
Pieces: s.Pieces,
|
|
||||||
Ticket: s.Ticket,
|
|
||||||
}); err != nil {
|
|
||||||
log.Error("Committing uncommitted sector failed: ", err)
|
log.Error("Committing uncommitted sector failed: ", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -293,8 +293,26 @@ func (s *Store) WaitSeal(ctx context.Context, sector uint64) (sectorbuilder.Sect
|
|||||||
return s.sb.SealStatus(sector)
|
return s.sb.SealStatus(sector)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Store) Sealed() ([]sectorbuilder.SealedSectorMetadata, error) {
|
func (s *Store) Sealed() ([]sectorbuilder.SectorSealingStatus, error) {
|
||||||
return s.sb.GetAllSealedSectors()
|
l, err := s.sb.GetAllStagedSectors()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
out := make([]sectorbuilder.SectorSealingStatus, 0)
|
||||||
|
for _, sid := range l {
|
||||||
|
status, err := s.sb.SealStatus(sid)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if status.State != sealing_state.Sealed {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
out = append(out, status)
|
||||||
|
}
|
||||||
|
|
||||||
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Store) RunPoSt(ctx context.Context, sectors []*api.SectorInfo, r []byte, faults []uint64) ([]byte, error) {
|
func (s *Store) RunPoSt(ctx context.Context, sectors []*api.SectorInfo, r []byte, faults []uint64) ([]byte, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user