Fix lint errors
This commit is contained in:
		
							parent
							
								
									2d16af6ee6
								
							
						
					
					
						commit
						e3ee4e4718
					
				| @ -12,6 +12,7 @@ import ( | ||||
| 	"github.com/filecoin-project/go-address" | ||||
| 	"github.com/filecoin-project/go-state-types/abi" | ||||
| 	tbig "github.com/filecoin-project/go-state-types/big" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/build" | ||||
| 	"github.com/filecoin-project/lotus/chain/messagepool/gasguess" | ||||
| 	"github.com/filecoin-project/lotus/chain/types" | ||||
|  | ||||
| @ -6,7 +6,6 @@ import ( | ||||
| 	"encoding/hex" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| 	"io/ioutil" | ||||
| 	"os" | ||||
| 	"path/filepath" | ||||
| @ -31,6 +30,7 @@ import ( | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper/basicfs" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/stores" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| 	"github.com/filecoin-project/lotus/genesis" | ||||
| ) | ||||
| 
 | ||||
|  | ||||
| @ -3,7 +3,6 @@ package main | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| 	"io/ioutil" | ||||
| 	"os" | ||||
| 	"path/filepath" | ||||
| @ -20,11 +19,12 @@ import ( | ||||
| 
 | ||||
| 	"github.com/filecoin-project/go-address" | ||||
| 	"github.com/filecoin-project/go-state-types/abi" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/fsutil" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/stores" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/chain/types" | ||||
| 	lcli "github.com/filecoin-project/lotus/cli" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/fsutil" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/stores" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| ) | ||||
| 
 | ||||
| const metaFile = "sectorstore.json" | ||||
|  | ||||
							
								
								
									
										16
									
								
								extern/sector-storage/ffiwrapper/verifier_cgo.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								extern/sector-storage/ffiwrapper/verifier_cgo.go
									
									
									
									
										vendored
									
									
								
							| @ -4,17 +4,15 @@ package ffiwrapper | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/specs-actors/actors/runtime/proof" | ||||
| 
 | ||||
| 	"golang.org/x/xerrors" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/go-state-types/abi" | ||||
| 
 | ||||
| 	ffi "github.com/filecoin-project/filecoin-ffi" | ||||
| 
 | ||||
| 	"go.opencensus.io/trace" | ||||
| 	"golang.org/x/xerrors" | ||||
| 
 | ||||
| 	ffi "github.com/filecoin-project/filecoin-ffi" | ||||
| 	"github.com/filecoin-project/go-state-types/abi" | ||||
| 	"github.com/filecoin-project/specs-actors/actors/runtime/proof" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| ) | ||||
| 
 | ||||
| func (sb *Sealer) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.SectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, error) { | ||||
|  | ||||
							
								
								
									
										2
									
								
								extern/sector-storage/manager.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								extern/sector-storage/manager.go
									
									
									
									
										vendored
									
									
								
							| @ -3,7 +3,6 @@ package sectorstorage | ||||
| import ( | ||||
| 	"context" | ||||
| 	"errors" | ||||
| 	"github.com/filecoin-project/go-statestore" | ||||
| 	"io" | ||||
| 	"net/http" | ||||
| 	"sync" | ||||
| @ -15,6 +14,7 @@ import ( | ||||
| 	"golang.org/x/xerrors" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/go-state-types/abi" | ||||
| 	"github.com/filecoin-project/go-statestore" | ||||
| 	"github.com/filecoin-project/specs-storage/storage" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" | ||||
|  | ||||
							
								
								
									
										9
									
								
								extern/sector-storage/manager_calltracker.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								extern/sector-storage/manager_calltracker.go
									
									
									
									
										vendored
									
									
								
							| @ -7,9 +7,10 @@ import ( | ||||
| 	"encoding/json" | ||||
| 	"errors" | ||||
| 	"fmt" | ||||
| 	"golang.org/x/xerrors" | ||||
| 	"os" | ||||
| 
 | ||||
| 	"golang.org/x/xerrors" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| ) | ||||
| @ -71,10 +72,6 @@ func (m *Manager) setupWorkTracker() { | ||||
| 
 | ||||
| 	for _, st := range ids { | ||||
| 		wid := st.ID | ||||
| 		if err := m.work.Get(wid).Get(&st); err != nil { | ||||
| 			log.Errorf("getting work state for %s", wid) | ||||
| 			continue | ||||
| 		} | ||||
| 
 | ||||
| 		if os.Getenv("LOTUS_MINER_ABORT_UNFINISHED_WORK") == "1" { | ||||
| 			st.Status = wsDone | ||||
| @ -363,7 +360,7 @@ func (m *Manager) returnResult(callID storiface.CallID, r interface{}, serr stri | ||||
| 
 | ||||
| 	_, ok = m.results[wid] | ||||
| 	if ok { | ||||
| 		return xerrors.Errorf("result for call %v already reported") | ||||
| 		return xerrors.Errorf("result for call %v already reported", wid) | ||||
| 	} | ||||
| 
 | ||||
| 	m.results[wid] = res | ||||
|  | ||||
							
								
								
									
										2
									
								
								extern/sector-storage/manager_test.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								extern/sector-storage/manager_test.go
									
									
									
									
										vendored
									
									
								
							| @ -265,7 +265,7 @@ func TestRestartManager(t *testing.T) { | ||||
| 	cwg.Wait() | ||||
| 	require.Error(t, perr) | ||||
| 
 | ||||
| 	m, lstor, _, _ = newTestMgr(ctx, t, ds) | ||||
| 	m, _, _, _ = newTestMgr(ctx, t, ds) | ||||
| 	tw.ret = m // simulate jsonrpc auto-reconnect
 | ||||
| 	err = m.AddWorker(ctx, tw) | ||||
| 	require.NoError(t, err) | ||||
|  | ||||
							
								
								
									
										2
									
								
								extern/sector-storage/roprov.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								extern/sector-storage/roprov.go
									
									
									
									
										vendored
									
									
								
							| @ -2,13 +2,13 @@ package sectorstorage | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| 
 | ||||
| 	"golang.org/x/xerrors" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/go-state-types/abi" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/stores" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| ) | ||||
| 
 | ||||
| type readonlyProvider struct { | ||||
|  | ||||
							
								
								
									
										2
									
								
								extern/sector-storage/selector_alloc.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								extern/sector-storage/selector_alloc.go
									
									
									
									
										vendored
									
									
								
							| @ -2,7 +2,6 @@ package sectorstorage | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| 
 | ||||
| 	"golang.org/x/xerrors" | ||||
| 
 | ||||
| @ -10,6 +9,7 @@ import ( | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/stores" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| ) | ||||
| 
 | ||||
| type allocSelector struct { | ||||
|  | ||||
							
								
								
									
										2
									
								
								extern/sector-storage/selector_existing.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								extern/sector-storage/selector_existing.go
									
									
									
									
										vendored
									
									
								
							| @ -2,7 +2,6 @@ package sectorstorage | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| 
 | ||||
| 	"golang.org/x/xerrors" | ||||
| 
 | ||||
| @ -10,6 +9,7 @@ import ( | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/stores" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| ) | ||||
| 
 | ||||
| type existingSelector struct { | ||||
|  | ||||
							
								
								
									
										3
									
								
								extern/sector-storage/stats.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								extern/sector-storage/stats.go
									
									
									
									
										vendored
									
									
								
							| @ -1,8 +1,9 @@ | ||||
| package sectorstorage | ||||
| 
 | ||||
| import ( | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| ) | ||||
| 
 | ||||
| func (m *Manager) WorkerStats() map[uint64]storiface.WorkerStats { | ||||
|  | ||||
							
								
								
									
										2
									
								
								extern/sector-storage/stores/http_handler.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								extern/sector-storage/stores/http_handler.go
									
									
									
									
										vendored
									
									
								
							| @ -2,7 +2,6 @@ package stores | ||||
| 
 | ||||
| import ( | ||||
| 	"encoding/json" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| 	"io" | ||||
| 	"net/http" | ||||
| 	"os" | ||||
| @ -11,6 +10,7 @@ import ( | ||||
| 	logging "github.com/ipfs/go-log/v2" | ||||
| 	"golang.org/x/xerrors" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/tarutil" | ||||
| ) | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										6
									
								
								extern/sector-storage/stores/index.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								extern/sector-storage/stores/index.go
									
									
									
									
										vendored
									
									
								
							| @ -2,7 +2,6 @@ package stores | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| 	"net/url" | ||||
| 	gopath "path" | ||||
| 	"sort" | ||||
| @ -11,10 +10,11 @@ import ( | ||||
| 
 | ||||
| 	"golang.org/x/xerrors" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/fsutil" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/go-state-types/abi" | ||||
| 	"github.com/filecoin-project/go-state-types/big" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/fsutil" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| ) | ||||
| 
 | ||||
| var HeartbeatInterval = 10 * time.Second | ||||
|  | ||||
							
								
								
									
										3
									
								
								extern/sector-storage/stores/index_locks.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								extern/sector-storage/stores/index_locks.go
									
									
									
									
										vendored
									
									
								
							| @ -2,12 +2,13 @@ package stores | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| 	"sync" | ||||
| 
 | ||||
| 	"golang.org/x/xerrors" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/go-state-types/abi" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| ) | ||||
| 
 | ||||
| type sectorLock struct { | ||||
|  | ||||
| @ -2,13 +2,14 @@ package stores | ||||
| 
 | ||||
| import ( | ||||
| 	"context" | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| 	"testing" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/stretchr/testify/require" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/go-state-types/abi" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/extern/sector-storage/storiface" | ||||
| ) | ||||
| 
 | ||||
| var aSector = abi.SectorID{ | ||||
|  | ||||
							
								
								
									
										4
									
								
								extern/sector-storage/stores/local.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								extern/sector-storage/stores/local.go
									
									
									
									
										vendored
									
									
								
							| @ -212,12 +212,12 @@ func (st *Local) Redeclare(ctx context.Context) error { | ||||
| 	for id, p := range st.paths { | ||||
| 		mb, err := ioutil.ReadFile(filepath.Join(p.local, MetaFile)) | ||||
| 		if err != nil { | ||||
| 			return xerrors.Errorf("reading storage metadata for %s: %w", p, err) | ||||
| 			return xerrors.Errorf("reading storage metadata for %s: %w", p.local, err) | ||||
| 		} | ||||
| 
 | ||||
| 		var meta LocalStorageMeta | ||||
| 		if err := json.Unmarshal(mb, &meta); err != nil { | ||||
| 			return xerrors.Errorf("unmarshalling storage metadata for %s: %w", p, err) | ||||
| 			return xerrors.Errorf("unmarshalling storage metadata for %s: %w", p.local, err) | ||||
| 		} | ||||
| 
 | ||||
| 		fst, err := p.stat(st.localStorage) | ||||
|  | ||||
							
								
								
									
										12
									
								
								extern/storage-sealing/states_sealing.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								extern/storage-sealing/states_sealing.go
									
									
									
									
										vendored
									
									
								
							| @ -3,13 +3,8 @@ package sealing | ||||
| import ( | ||||
| 	"bytes" | ||||
| 	"context" | ||||
| 
 | ||||
| 	"github.com/ipfs/go-cid" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/build" | ||||
| 	"github.com/filecoin-project/lotus/chain/actors/builtin/miner" | ||||
| 	"github.com/filecoin-project/lotus/chain/actors/policy" | ||||
| 	miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner" | ||||
| 
 | ||||
| 	"golang.org/x/xerrors" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/go-state-types/abi" | ||||
| @ -18,7 +13,12 @@ import ( | ||||
| 	"github.com/filecoin-project/go-state-types/exitcode" | ||||
| 	"github.com/filecoin-project/go-statemachine" | ||||
| 	"github.com/filecoin-project/specs-actors/actors/builtin" | ||||
| 	miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner" | ||||
| 	"github.com/filecoin-project/specs-storage/storage" | ||||
| 
 | ||||
| 	"github.com/filecoin-project/lotus/build" | ||||
| 	"github.com/filecoin-project/lotus/chain/actors/builtin/miner" | ||||
| 	"github.com/filecoin-project/lotus/chain/actors/policy" | ||||
| ) | ||||
| 
 | ||||
| var DealSectorPriority = 1024 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user