add (salted) bloom filter liveset

This commit is contained in:
vyzo
2021-03-05 14:46:17 +02:00
parent aba6530411
commit 97abbe1eca
7 changed files with 107 additions and 18 deletions
+3 -3
View File
@@ -611,10 +611,10 @@ func Repo(r repo.Repo) Option {
Override(new(dtypes.UniversalBlockstore), modules.UniversalBlockstore),
If(cfg.EnableSplitstore,
If(cfg.Splitstore.UseLMDBHotstore,
Override(new(dtypes.HotBlockstore), modules.LMDBHotBlockstore)),
If(!cfg.Splitstore.UseLMDBHotstore,
If(cfg.Splitstore.GetHotStoreType() == "badger",
Override(new(dtypes.HotBlockstore), modules.BadgerHotBlockstore)),
If(cfg.Splitstore.GetHotStoreType() == "lmdb",
Override(new(dtypes.HotBlockstore), modules.LMDBHotBlockstore)),
Override(new(dtypes.SplitBlockstore), modules.SplitBlockstore(cfg)),
Override(new(dtypes.ChainBlockstore), modules.ChainSplitBlockstore),
Override(new(dtypes.StateBlockstore), modules.StateSplitBlockstore),
+11 -2
View File
@@ -126,13 +126,22 @@ type Blockstore struct {
}
type Splitstore struct {
UseLMDBHotstore bool
UseLMDBTracking bool
HotStoreType string
TrackingStoreType string
LiveSetType string
EnableFullCompaction bool
EnableGC bool // EXPERIMENTAL
Archival bool
}
func (s *Splitstore) GetHotStoreType() string {
// default is badger
if s.HotStoreType == "" {
return "badger"
}
return s.HotStoreType
}
// // Full Node
type Metrics struct {
+2 -1
View File
@@ -105,7 +105,8 @@ func SplitBlockstore(cfg *config.Blockstore) func(lc fx.Lifecycle, r repo.Locked
ss, err := splitstore.NewSplitStore(path, ds, cold, hot,
&splitstore.Config{
UseLMDB: cfg.Splitstore.UseLMDBTracking,
TrackingStoreType: cfg.Splitstore.TrackingStoreType,
LiveSetType: cfg.Splitstore.LiveSetType,
EnableFullCompaction: cfg.Splitstore.EnableFullCompaction,
EnableGC: cfg.Splitstore.EnableGC,
Archival: cfg.Splitstore.Archival,