Skip to content

Commit

Permalink
fix merge snafus.
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk committed Nov 15, 2020
1 parent d0b5d66 commit a2db17c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
22 changes: 20 additions & 2 deletions cmd/lotus-bench/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,25 @@ var importBenchCmd = &cli.Command{
defer c.Close() //nolint:errcheck
}

bs, err = blockstore.WrapFreecacheCache(context.Background(), bs)
bs, err = blockstore.WrapFreecacheCache(context.Background(), bs, blockstore.FreecacheConfig{Name: "single"})
if err != nil {
return err
}

cbs, err := blockstore.WrapFreecacheCache(context.Background(), bs, blockstore.FreecacheConfig{
Name: "chain",
BlockCapacity: 1 << 27, // 128MiB.
ExistsCapacity: 1 << 24, // 16MiB.
})
if err != nil {
return err
}

sbs, err := blockstore.WrapFreecacheCache(context.Background(), bs, blockstore.FreecacheConfig{
Name: "state",
BlockCapacity: 1 << 28, // 256MiB.
ExistsCapacity: 1 << 25, // 32MiB.
})
if err != nil {
return err
}
Expand All @@ -258,7 +276,7 @@ var importBenchCmd = &cli.Command{
}

metadataDs := datastore.NewMapDatastore()
cs := store.NewChainStore(bs, bs, metadataDs, vm.Syscalls(verifier), nil)
cs := store.NewChainStore(cbs, sbs, metadataDs, vm.Syscalls(verifier), nil)
stm := stmgr.NewStateManager(cs)

var carFile *os.File
Expand Down
2 changes: 1 addition & 1 deletion lib/blockstore/blockstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func WrapIDStore(bstore blockstore.Blockstore) LotusBlockstore {
}

// NewFromDatastore creates a new blockstore wrapped by the given datastore.
func NewFromDatastore(dstore ds.Batching) blockstore.Blockstore {
func NewFromDatastore(dstore ds.Batching) LotusBlockstore {
return WrapIDStore(blockstore.NewBlockstore(dstore))
}

Expand Down
1 change: 0 additions & 1 deletion node/repo/fsrepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"sync"

"github.com/BurntSushi/toml"
"github.com/filecoin-project/lotus/lib/blockstore"
"github.com/ipfs/go-datastore"
fslock "github.com/ipfs/go-fs-lock"
logging "github.com/ipfs/go-log/v2"
Expand Down
1 change: 0 additions & 1 deletion node/repo/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package repo
import (
"errors"

"github.com/filecoin-project/lotus/lib/blockstore"
"github.com/ipfs/go-datastore"
"github.com/multiformats/go-multiaddr"

Expand Down

0 comments on commit a2db17c

Please sign in to comment.