mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
remove code of exeriments (#6187)
This commit is contained in:
parent
f9c8d556a5
commit
ded79088e9
@ -5,7 +5,6 @@ import (
|
||||
"runtime"
|
||||
|
||||
"github.com/c2h5oh/datasize"
|
||||
"github.com/ledgerwatch/erigon-lib/common/dbg"
|
||||
"github.com/ledgerwatch/erigon-lib/kv"
|
||||
kv2 "github.com/ledgerwatch/erigon-lib/kv/mdbx"
|
||||
"github.com/ledgerwatch/erigon/cmd/utils"
|
||||
@ -56,18 +55,6 @@ func openDB(opts kv2.MdbxOpts, applyMigrations bool) kv.RwDB {
|
||||
// to read all options from DB, instead of overriding them
|
||||
opts = opts.Flags(func(f uint) uint { return f | mdbx.Accede })
|
||||
|
||||
if dbg.WriteMap() {
|
||||
opts = opts.WriteMap()
|
||||
}
|
||||
if dbg.MergeTr() > 0 {
|
||||
opts = opts.WriteMergeThreshold(uint64(dbg.MergeTr() * 8192))
|
||||
}
|
||||
if dbg.MdbxReadAhead() {
|
||||
opts = opts.Flags(func(u uint) uint {
|
||||
return u &^ mdbx.NoReadahead
|
||||
})
|
||||
}
|
||||
|
||||
db := opts.MustOpen()
|
||||
if applyMigrations {
|
||||
migrator := migrations.NewMigrator(opts.GetLabel())
|
||||
|
16
node/node.go
16
node/node.go
@ -28,10 +28,8 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/c2h5oh/datasize"
|
||||
"github.com/ledgerwatch/erigon-lib/common/dbg"
|
||||
"github.com/ledgerwatch/erigon/node/nodecfg"
|
||||
"github.com/ledgerwatch/erigon/params"
|
||||
mdbx2 "github.com/torquem-ch/mdbx-go/mdbx"
|
||||
"golang.org/x/sync/semaphore"
|
||||
|
||||
"github.com/gofrs/flock"
|
||||
@ -339,20 +337,6 @@ func OpenDatabase(config *nodecfg.Config, logger log.Logger, label kv.Label) (kv
|
||||
} else {
|
||||
opts = opts.GrowthStep(16 * datasize.MB)
|
||||
}
|
||||
if dbg.WriteMap() {
|
||||
log.Info("[db] Enabling WriteMap")
|
||||
opts = opts.WriteMap()
|
||||
}
|
||||
if dbg.MergeTr() > 0 {
|
||||
log.Info("[db] Setting", "MergeThreshold", dbg.MergeTr())
|
||||
opts = opts.WriteMergeThreshold(uint64(dbg.MergeTr() * 8192))
|
||||
}
|
||||
if dbg.MdbxReadAhead() {
|
||||
log.Info("[db] Setting Enabling ReadAhead")
|
||||
opts = opts.Flags(func(u uint) uint {
|
||||
return u &^ mdbx2.NoReadahead
|
||||
})
|
||||
}
|
||||
return opts.Open()
|
||||
}
|
||||
var err error
|
||||
|
Loading…
Reference in New Issue
Block a user