|
|
|
@ -65,6 +65,7 @@ const ( |
|
|
|
|
badBlockLimit = 10 |
|
|
|
|
triesInMemory = 128 |
|
|
|
|
shardCacheLimit = 2 |
|
|
|
|
commitsCacheLimit = 10 |
|
|
|
|
epochCacheLimit = 10 |
|
|
|
|
|
|
|
|
|
// BlocksPerEpoch is the number of blocks in one epoch
|
|
|
|
@ -168,6 +169,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par |
|
|
|
|
futureBlocks, _ := lru.New(maxFutureBlocks) |
|
|
|
|
badBlocks, _ := lru.New(badBlockLimit) |
|
|
|
|
shardCache, _ := lru.New(shardCacheLimit) |
|
|
|
|
commitsCache, _ := lru.New(commitsCacheLimit) |
|
|
|
|
epochCache, _ := lru.New(epochCacheLimit) |
|
|
|
|
|
|
|
|
|
bc := &BlockChain{ |
|
|
|
@ -184,6 +186,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par |
|
|
|
|
blockCache: blockCache, |
|
|
|
|
futureBlocks: futureBlocks, |
|
|
|
|
shardStateCache: shardCache, |
|
|
|
|
lastCommitsCache: commitsCache, |
|
|
|
|
epochCache: epochCache, |
|
|
|
|
engine: engine, |
|
|
|
|
vmConfig: vmConfig, |
|
|
|
|