Increase stores cache (#1485)

Co-authored-by: stasatdaglabs <39559713+stasatdaglabs@users.noreply.github.com>
This commit is contained in:
Ori Newman 2021-02-04 10:06:02 +02:00 committed by GitHub
parent 44280b9006
commit 6f53da18b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,6 +70,10 @@ func (f *factory) NewConsensus(dagParams *dagconfig.Params, db infrastructuredat
pruningWindowSizeForCaches := int(dagParams.PruningDepth()) pruningWindowSizeForCaches := int(dagParams.PruningDepth())
// This is used for caches that are used as part of deletePastBlocks that need to traverse until
// the previous pruning point.
pruningWindowSizePlusFinalityDepthForCache := int(dagParams.PruningDepth() + dagParams.FinalityDepth())
// Data Structures // Data Structures
acceptanceDataStore := acceptancedatastore.New(200) acceptanceDataStore := acceptancedatastore.New(200)
blockStore, err := blockstore.New(dbManager, 200) blockStore, err := blockstore.New(dbManager, 200)
@ -80,11 +84,12 @@ func (f *factory) NewConsensus(dagParams *dagconfig.Params, db infrastructuredat
if err != nil { if err != nil {
return nil, err return nil, err
} }
blockRelationStore := blockrelationstore.New(pruningWindowSizeForCaches) blockRelationStore := blockrelationstore.New(pruningWindowSizePlusFinalityDepthForCache)
blockStatusStore := blockstatusstore.New(200)
blockStatusStore := blockstatusstore.New(pruningWindowSizePlusFinalityDepthForCache)
multisetStore := multisetstore.New(200) multisetStore := multisetstore.New(200)
pruningStore := pruningstore.New() pruningStore := pruningstore.New()
reachabilityDataStore := reachabilitydatastore.New(pruningWindowSizeForCaches) reachabilityDataStore := reachabilitydatastore.New(pruningWindowSizePlusFinalityDepthForCache)
utxoDiffStore := utxodiffstore.New(200) utxoDiffStore := utxodiffstore.New(200)
consensusStateStore := consensusstatestore.New(10_000) consensusStateStore := consensusstatestore.New(10_000)
ghostdagDataStore := ghostdagdatastore.New(pruningWindowSizeForCaches) ghostdagDataStore := ghostdagdatastore.New(pruningWindowSizeForCaches)