diff --git a/api/api_full.go b/api/api_full.go index ca4e1d721..97d846ca4 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -355,10 +355,10 @@ type MinerSectors struct { } type Import struct { - Key int64 + Key int64 Err string - Root *cid.Cid + Root *cid.Cid Source string FilePath string } diff --git a/node/impl/client/client.go b/node/impl/client/client.go index 6df7dcbeb..27210cbab 100644 --- a/node/impl/client/client.go +++ b/node/impl/client/client.go @@ -49,6 +49,7 @@ import ( ) var DefaultHashFunction = uint64(mh.BLAKE2B_MIN + 31) + const dealStartBuffer abi.ChainEpoch = 10000 // TODO: allow setting type API struct { @@ -306,13 +307,13 @@ func (a *API) ClientImportLocal(ctx context.Context, f io.Reader) (cid.Cid, erro prefix.MhType = DefaultHashFunction params := ihelper.DagBuilderParams{ - Maxlinks: build.UnixfsLinksPerLevel, - RawLeaves: true, + Maxlinks: build.UnixfsLinksPerLevel, + RawLeaves: true, CidBuilder: cidutil.InlineBuilder{ Builder: prefix, Limit: 126, }, - Dagserv: bufferedDS, + Dagserv: bufferedDS, } db, err := params.New(chunker.NewSizeSplitter(file, int64(build.UnixfsChunkSize))) @@ -594,13 +595,13 @@ func (a *API) clientImport(ctx context.Context, ref api.FileRef, store *importmg prefix.MhType = DefaultHashFunction params := ihelper.DagBuilderParams{ - Maxlinks: build.UnixfsLinksPerLevel, - RawLeaves: true, + Maxlinks: build.UnixfsLinksPerLevel, + RawLeaves: true, CidBuilder: cidutil.InlineBuilder{ Builder: prefix, Limit: 126, }, - Dagserv: bufDs, + Dagserv: bufDs, } db, err := params.New(chunker.NewSizeSplitter(file, int64(build.UnixfsChunkSize))) diff --git a/node/repo/fsrepo_ds.go b/node/repo/fsrepo_ds.go index c0a57d5af..a92431307 100644 --- a/node/repo/fsrepo_ds.go +++ b/node/repo/fsrepo_ds.go @@ -238,4 +238,4 @@ func (fsr *fsLockedRepo) DeleteDatastore(ns string) error { } return nil -} \ No newline at end of file +} diff --git a/node/repo/importmgr/mgr.go b/node/repo/importmgr/mgr.go index 9d658c24d..74aadad40 100644 --- a/node/repo/importmgr/mgr.go +++ b/node/repo/importmgr/mgr.go @@ -12,24 +12,25 @@ import ( ) type Mgr struct { - mds *MultiStore - ds datastore.Batching + mds *MultiStore + ds datastore.Batching Blockstore blockstore.Blockstore } type Label string + const ( - LSource = "source" // Function which created the import - LRootCid = "root" // Root CID + LSource = "source" // Function which created the import + LRootCid = "root" // Root CID LFileName = "filename" // Local file path - LMTime = "mtime" // File modification timestamp + LMTime = "mtime" // File modification timestamp ) func New(mds *MultiStore, ds datastore.Batching) *Mgr { return &Mgr{ mds: mds, - Blockstore: &multiReadBs{ + Blockstore: &multiReadBs{ mds: mds, }, @@ -99,4 +100,4 @@ func (m *Mgr) Info(id int64) (*StoreMeta, error) { } // m.Info -// m.Delete \ No newline at end of file +// m.Delete diff --git a/node/repo/importmgr/multistore.go b/node/repo/importmgr/multistore.go index 32853148e..705a3c947 100644 --- a/node/repo/importmgr/multistore.go +++ b/node/repo/importmgr/multistore.go @@ -19,7 +19,7 @@ type dsProvider interface { } type MultiStore struct { - provider dsProvider + provider dsProvider namespace string open map[int64]*Store diff --git a/node/repo/importmgr/store.go b/node/repo/importmgr/store.go index a08974262..78bb7462b 100644 --- a/node/repo/importmgr/store.go +++ b/node/repo/importmgr/store.go @@ -37,15 +37,15 @@ func openStore(ds datastore.Batching) (*Store, error) { dag := merkledag.NewDAGService(bsvc) return &Store{ - ds: ds, + ds: ds, fm: fm, Fstore: fstore, Bstore: ibs, - bsvc: bsvc, - DAG: dag, + bsvc: bsvc, + DAG: dag, }, nil } diff --git a/storage/wdpost_run.go b/storage/wdpost_run.go index 5ee74915f..f6ec64583 100644 --- a/storage/wdpost_run.go +++ b/storage/wdpost_run.go @@ -150,16 +150,16 @@ func (s *WindowPoStScheduler) checkNextRecoveries(ctx context.Context, deadline if err != nil { return xerrors.Errorf("checking unrecovered sectors: %w", err) } - + // if all sectors failed to recover, don't declare recoveries sbfCount, err := sbf.Count() if err != nil { return xerrors.Errorf("counting recovered sectors: %w", err) } - + if sbfCount == 0 { - log.Warnw("No recoveries to declare", "deadline", deadline, "faulty", uc) - return nil + log.Warnw("No recoveries to declare", "deadline", deadline, "faulty", uc) + return nil } params := &miner.DeclareFaultsRecoveredParams{