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