Merge branch 'master' into feat/testnet2

This commit is contained in:
Łukasz Magiera 2020-01-10 20:55:40 +01:00
commit 50bac00329
7 changed files with 22 additions and 16 deletions

View File

@ -100,7 +100,7 @@ jobs:
description: gotestsum format. https://github.com/gotestyourself/gotestsum#format
coverage:
type: string
default: -coverprofile=coverage.txt
default: -coverprofile=coverage.txt -coverpkg=github.com/filecoin-project/lotus/...
description: Coverage flag. Set to the empty string to disable.
codecov-upload:
type: boolean
@ -190,7 +190,7 @@ jobs:
- install-deps
- go/mod-download
- run:
command: make buildall
command: make build
no_output_timeout: 30m
- store_artifacts:
path: lotus
@ -253,7 +253,8 @@ workflows:
jobs:
- lint-changes:
args: "--new-from-rev origin/master"
- test
- test:
codecov-upload: true
- test-short:
go-test-flags: "--timeout 10m --short"
- mod-tidy-check

View File

@ -1 +1,3 @@
comment: off
ignore:
- "cbor_gen.go"

View File

@ -8,6 +8,8 @@ import (
"encoding/json"
sectorbuilder "github.com/filecoin-project/go-sectorbuilder"
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/namespace"
badger "github.com/ipfs/go-ds-badger2"
logging "github.com/ipfs/go-log/v2"
"github.com/mitchellh/go-homedir"
@ -196,7 +198,7 @@ var aggregateSectorDirsCmd = &cli.Command{
SectorSize: ssize,
Dir: destdir,
WorkerThreads: 2,
}, agmds)
}, namespace.Wrap(agmds, datastore.NewKey("/sectorbuilder")))
if err != nil {
return err
}
@ -257,7 +259,7 @@ var aggregateSectorDirsCmd = &cli.Command{
SectorSize: genm.SectorSize,
Dir: dir,
WorkerThreads: 2,
}, mds)
}, namespace.Wrap(mds, datastore.NewKey("/sectorbuilder")))
if err != nil {
return err
}

View File

@ -11,6 +11,8 @@ import (
"path/filepath"
sectorbuilder "github.com/filecoin-project/go-sectorbuilder"
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/namespace"
badger "github.com/ipfs/go-ds-badger2"
logging "github.com/ipfs/go-log/v2"
"golang.org/x/xerrors"
@ -43,7 +45,7 @@ func PreSeal(maddr address.Address, ssize uint64, offset uint64, sectors int, sb
return nil, err
}
sb, err := sectorbuilder.New(cfg, mds)
sb, err := sectorbuilder.New(cfg, namespace.Wrap(mds, datastore.NewKey("/sectorbuilder")))
if err != nil {
return nil, err
}

View File

@ -13,6 +13,7 @@ import (
paramfetch "github.com/filecoin-project/go-paramfetch"
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/namespace"
badger "github.com/ipfs/go-ds-badger2"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer"
@ -176,7 +177,7 @@ var initCmd = &cli.Command{
SectorSize: ssize,
WorkerThreads: 2,
Dir: pssb,
}, oldmds)
}, namespace.Wrap(oldmds, datastore.NewKey("/sectorbuilder")))
if err != nil {
return xerrors.Errorf("failed to open up preseal sectorbuilder: %w", err)
}
@ -185,7 +186,7 @@ var initCmd = &cli.Command{
SectorSize: ssize,
WorkerThreads: 2,
Dir: lr.Path(),
}, mds)
}, namespace.Wrap(mds, datastore.NewKey("/sectorbuilder")))
if err != nil {
return xerrors.Errorf("failed to open up sectorbuilder: %w", err)
}

View File

@ -233,7 +233,7 @@ func SetupBlockProducer(lc fx.Lifecycle, ds dtypes.MetadataDS, api api.FullNode,
}
func SectorBuilder(cfg *sectorbuilder.Config, ds dtypes.MetadataDS) (*sectorbuilder.SectorBuilder, error) {
sb, err := sectorbuilder.New(cfg, ds)
sb, err := sectorbuilder.New(cfg, namespace.Wrap(ds, datastore.NewKey("/sectorbuilder")))
if err != nil {
return nil, err
}

View File

@ -9,20 +9,18 @@ import (
"path/filepath"
"testing"
"github.com/filecoin-project/lotus/build"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/filecoin-project/go-address"
sectorbuilder "github.com/filecoin-project/go-sectorbuilder"
"github.com/filecoin-project/lotus/build"
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/namespace"
badger "github.com/ipfs/go-ds-badger2"
logging "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer"
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/client"
"github.com/filecoin-project/lotus/api/test"
@ -231,7 +229,7 @@ func builder(t *testing.T, nFull int, storage []int) ([]test.TestNode, []test.Te
WorkerThreads: 2,
Miner: genMiner,
Dir: psd,
}, mds)
}, namespace.Wrap(mds, datastore.NewKey("/sectorbuilder")))
if err != nil {
t.Fatal(err)
}