mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
mdbx: v0.12.3 (#6521)
This commit is contained in:
parent
799d6b9441
commit
7c2ed8e01f
2
Makefile
2
Makefile
@ -19,6 +19,8 @@ DOCKER_TAG ?= thorax/erigon:latest
|
||||
CGO_CFLAGS := $(shell $(GO) env CGO_CFLAGS 2>/dev/null) # don't lose default
|
||||
CGO_CFLAGS += -DMDBX_FORCE_ASSERTIONS=0 # Enable MDBX's asserts by default in 'devel' branch and disable in releases
|
||||
CGO_CFLAGS += -DMDBX_DISABLE_VALIDATION=1 # This feature is not ready yet
|
||||
CGO_CFLAGS += -DMDBX_ENABLE_PROFGC=0 # Disabled by default, but may be useful for performance debugging
|
||||
CGO_CFLAGS += -DMDBX_ENABLE_PGOP_STAT=0 # Disabled by default, but may be useful for performance debugging
|
||||
CGO_CFLAGS += -DMDBX_ENV_CHECKPID=0 # Erigon doesn't do fork() syscall
|
||||
CGO_CFLAGS += -O
|
||||
CGO_CFLAGS += -D__BLST_PORTABLE__
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
// MarshalSSZTo ssz marshals the BeaconBlockHeader object to a target array
|
||||
func (b *BeaconBlockHeader) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
dst = buf
|
||||
|
||||
|
||||
m, _ := b.MarshalSSZ()
|
||||
dst = append(dst, m...)
|
||||
|
||||
@ -33,7 +33,7 @@ func (b *BeaconBlockHeader) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
// MarshalSSZTo ssz marshals the SignedBeaconBlockHeader object to a target array
|
||||
func (s *SignedBeaconBlockHeader) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
dst = buf
|
||||
|
||||
|
||||
m, _ := s.MarshalSSZ()
|
||||
dst = append(dst, m...)
|
||||
|
||||
@ -366,6 +366,7 @@ func (s *SyncAggregate) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
dst = append(dst, m...)
|
||||
return
|
||||
}
|
||||
|
||||
// HashTreeRootWith ssz hashes the SyncAggregate object with a hasher
|
||||
func (s *SyncAggregate) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
// Field (0) 'SyncCommiteeBits'
|
||||
@ -375,7 +376,6 @@ func (s *SyncAggregate) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
}
|
||||
hh.PutBytes(root[:])
|
||||
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@ -4981,7 +4981,6 @@ func (b *BeaconStateBellatrix) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
headerRoot, err := b.LatestBlockHeader.HashTreeRoot()
|
||||
if err != nil {
|
||||
return err
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -95,7 +95,7 @@ var genesisTmpDB kv.RwDB
|
||||
var genesisDBLock *sync.Mutex
|
||||
|
||||
func init() {
|
||||
genesisTmpDB = mdbx.NewMDBX(log.New()).InMem(os.TempDir()).MapSize(2 * datasize.GB).PageSize(2 * 4096).WriteMergeThreshold(2 * 8192).MustOpen()
|
||||
genesisTmpDB = mdbx.NewMDBX(log.New()).InMem(os.TempDir()).MapSize(2 * datasize.GB).PageSize(2 * 4096).MustOpen()
|
||||
genesisDBLock = &sync.Mutex{}
|
||||
}
|
||||
|
||||
|
@ -1265,8 +1265,7 @@ func ReconstituteState(ctx context.Context, s *StageState, dirs datadir.Dirs, wo
|
||||
Flags(func(u uint) uint {
|
||||
return mdbx.UtterlyNoSync | mdbx.NoMetaSync | mdbx.NoMemInit | mdbx.LifoReclaim | mdbx.WriteMap
|
||||
}).
|
||||
WriteMergeThreshold(2 * 8192).
|
||||
PageSize(uint64(4 * datasize.KB)).
|
||||
PageSize(uint64(8 * datasize.KB)).
|
||||
WithTableCfg(func(defaultBuckets kv.TableCfg) kv.TableCfg { return kv.ReconTablesCfg }).
|
||||
Open()
|
||||
if err != nil {
|
||||
|
6
go.mod
6
go.mod
@ -3,12 +3,12 @@ module github.com/ledgerwatch/erigon
|
||||
go 1.18
|
||||
|
||||
require (
|
||||
github.com/ledgerwatch/erigon-lib v0.0.0-20230109081124-7cfe15344887
|
||||
github.com/ledgerwatch/erigon-lib v0.0.0-20230109125708-7407524d2b67
|
||||
github.com/ledgerwatch/erigon-snapshot v1.1.1-0.20230106211435-2670b273bb55
|
||||
github.com/ledgerwatch/log/v3 v3.7.0
|
||||
github.com/ledgerwatch/secp256k1 v1.0.0
|
||||
github.com/ledgerwatch/trackerslist v1.0.0 // indirect
|
||||
github.com/torquem-ch/mdbx-go v0.27.5
|
||||
github.com/torquem-ch/mdbx-go v0.28.1
|
||||
)
|
||||
|
||||
require (
|
||||
@ -65,7 +65,7 @@ require (
|
||||
github.com/prysmaticlabs/fastssz v0.0.0-20220628121656-93dfe28febab
|
||||
github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7
|
||||
github.com/prysmaticlabs/gohashtree v0.0.0-20220517220438-192ee5ae6982
|
||||
github.com/quasilyte/go-ruleguard/dsl v0.3.21
|
||||
github.com/quasilyte/go-ruleguard/dsl v0.3.22
|
||||
github.com/rs/cors v1.8.2
|
||||
github.com/spf13/cobra v1.6.1
|
||||
github.com/spf13/pflag v1.0.5
|
||||
|
12
go.sum
12
go.sum
@ -565,8 +565,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758 h1:0D5M2HQSGD3PYPwICLl+/9oulQauOuETfgFvhBDffs0=
|
||||
github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=
|
||||
github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
|
||||
github.com/ledgerwatch/erigon-lib v0.0.0-20230109081124-7cfe15344887 h1:p+Ay0Xdal6YAfEYF/WXXXKnnXrI0Z/vwBpy/8PxfGhg=
|
||||
github.com/ledgerwatch/erigon-lib v0.0.0-20230109081124-7cfe15344887/go.mod h1:eVDPfeBk2LVY7IqJjddlMTAy7BxSZ9+DgZbu+ftVNtk=
|
||||
github.com/ledgerwatch/erigon-lib v0.0.0-20230109125708-7407524d2b67 h1:URQzGfvJ/03K1ygbuPLg52CmIdLuNUdoL1C6VXgS5rA=
|
||||
github.com/ledgerwatch/erigon-lib v0.0.0-20230109125708-7407524d2b67/go.mod h1:YP0ZRMVQB9PvUMW9f/Jahj481p4gyZ/Zka+2+jEqOjI=
|
||||
github.com/ledgerwatch/erigon-snapshot v1.1.1-0.20230106211435-2670b273bb55 h1:4gY6eRXQiX0Te1oKTpsxj6MjXksQSSTHWiSh/j89sEY=
|
||||
github.com/ledgerwatch/erigon-snapshot v1.1.1-0.20230106211435-2670b273bb55/go.mod h1:3AuPxZc85jkehh/HA9h8gabv5MSi3kb/ddtzBsTVJFo=
|
||||
github.com/ledgerwatch/log/v3 v3.7.0 h1:aFPEZdwZx4jzA3+/Pf8wNDN5tCI0cIolq/kfvgcM+og=
|
||||
@ -852,8 +852,8 @@ github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7 h1:0tVE4
|
||||
github.com/prysmaticlabs/go-bitfield v0.0.0-20210809151128-385d8c5e3fb7/go.mod h1:wmuf/mdK4VMD+jA9ThwcUKjg3a2XWM9cVfFYjDyY4j4=
|
||||
github.com/prysmaticlabs/gohashtree v0.0.0-20220517220438-192ee5ae6982 h1:0izjBQiyBuyKJUe3QAnAmudVUX3AvylouGm5d+rz9bc=
|
||||
github.com/prysmaticlabs/gohashtree v0.0.0-20220517220438-192ee5ae6982/go.mod h1:4pWaT30XoEx1j8KNJf3TV+E3mQkaufn7mf+jRNb/Fuk=
|
||||
github.com/quasilyte/go-ruleguard/dsl v0.3.21 h1:vNkC6fC6qMLzCOGbnIHOd5ixUGgTbp3Z4fGnUgULlDA=
|
||||
github.com/quasilyte/go-ruleguard/dsl v0.3.21/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU=
|
||||
github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE=
|
||||
github.com/quasilyte/go-ruleguard/dsl v0.3.22/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU=
|
||||
github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk=
|
||||
github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
@ -958,8 +958,8 @@ github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDW
|
||||
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
|
||||
github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/torquem-ch/mdbx-go v0.27.5 h1:bbhXQGFCmoxbRDXKYEJwxSOOTeBKwoD4pFBUpK9+V1g=
|
||||
github.com/torquem-ch/mdbx-go v0.27.5/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E=
|
||||
github.com/torquem-ch/mdbx-go v0.28.1 h1:MxoEuK0tidGrWAdjlAjv79iAo1OyMpy1WBPnyiST6cU=
|
||||
github.com/torquem-ch/mdbx-go v0.28.1/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E=
|
||||
github.com/ugorji/go v1.1.13/go.mod h1:jxau1n+/wyTGLQoCkjok9r5zFa/FxT6eI5HiHKQszjc=
|
||||
github.com/ugorji/go/codec v1.1.13 h1:013LbFhocBoIqgHeIHKlV4JWYhqogATYWZhIcH0WHn4=
|
||||
github.com/ugorji/go/codec v1.1.13/go.mod h1:oNVt3Dq+FO91WNQ/9JnHKQP2QJxTzoN7wCBFCq1OeuU=
|
||||
|
@ -326,7 +326,6 @@ func OpenDatabase(config *nodecfg.Config, logger log.Logger, label kv.Label) (kv
|
||||
}
|
||||
roTxsLimiter := semaphore.NewWeighted(roTxLimit) // 1 less than max to allow unlocking to happen
|
||||
opts := mdbx.NewMDBX(logger).
|
||||
WriteMergeThreshold(4 * 8192).
|
||||
Path(dbPath).Label(label).
|
||||
DBVerbosity(config.DatabaseVerbosity).RoTxsLimiter(roTxsLimiter)
|
||||
if exclusive {
|
||||
|
Loading…
Reference in New Issue
Block a user