sector import: Plumbing for DownloadSectorData in the sealing system

This commit is contained in:
Łukasz Magiera
2022-09-19 12:13:05 +02:00
parent 39e4845f42
commit fbb487ae2b
17 changed files with 235 additions and 27 deletions
+4 -21
View File
@@ -3,7 +3,6 @@ package api
import (
"bytes"
"context"
"net/http"
"time"
"github.com/google/uuid"
@@ -170,6 +169,7 @@ type StorageMiner interface {
ReturnMoveStorage(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
ReturnUnsealPiece(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
ReturnReadPiece(ctx context.Context, callID storiface.CallID, ok bool, err *storiface.CallError) error //perm:admin retry:true
ReturnDownloadSector(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
ReturnFetch(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
// SealingSchedDiag dumps internal sealing scheduler state
@@ -563,11 +563,11 @@ type RemoteSectorMeta struct {
// Sector urls - lotus will use those for fetching files into local storage
// Required in all states
DataUnsealed *SectorData
DataUnsealed *storiface.SectorData
// Required in PreCommitting and later
DataSealed *SectorData
DataCache *SectorData
DataSealed *storiface.SectorData
DataCache *storiface.SectorData
////////
// SEALING SERVICE HOOKS
@@ -575,20 +575,3 @@ type RemoteSectorMeta struct {
// todo Commit1Provider
// todo OnDone / OnStateChange
}
type SectorData struct {
// Local when set to true indicates to lotus that sector data is already
// available locally; When set lotus will skip fetching sector data, and
// only check that sector data exists in sector storage
Local bool
// URL to the sector data
// For sealed/unsealed sector, lotus expects octet-stream
// For cache, lotus expects a tar archive with cache files (todo maybe use not-tar; specify what files with what paths must be present)
// Valid schemas:
// - http:// / https://
URL string
// optional http headers to use when requesting sector data
Headers http.Header
}