aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2019-04-02 22:03:12 +0800
committerGitHub <noreply@github.com>2019-04-02 22:03:12 +0800
commite14f8a408c17fd6c57d769cd4635ad6cc8bde769 (patch)
treeba0d75fe1d1797be2322366e3d74cc54f77a6184 /eth
parent88d7119ebb7bcb38e16f0feb571c98f2197d7cf3 (diff)
parented34a5e08a475fdf1b3116b1f17879411bfe411d (diff)
downloadgo-tangerine-e14f8a408c17fd6c57d769cd4635ad6cc8bde769.tar
go-tangerine-e14f8a408c17fd6c57d769cd4635ad6cc8bde769.tar.gz
go-tangerine-e14f8a408c17fd6c57d769cd4635ad6cc8bde769.tar.bz2
go-tangerine-e14f8a408c17fd6c57d769cd4635ad6cc8bde769.tar.lz
go-tangerine-e14f8a408c17fd6c57d769cd4635ad6cc8bde769.tar.xz
go-tangerine-e14f8a408c17fd6c57d769cd4635ad6cc8bde769.tar.zst
go-tangerine-e14f8a408c17fd6c57d769cd4635ad6cc8bde769.zip
Merge pull request #19328 from karalabe/preload
core: prefetch next block state concurrently
Diffstat (limited to 'eth')
-rw-r--r--eth/backend.go8
-rw-r--r--eth/config.go4
2 files changed, 10 insertions, 2 deletions
diff --git a/eth/backend.go b/eth/backend.go
index ac2f903e8..af963fa49 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -165,7 +165,13 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
EWASMInterpreter: config.EWASMInterpreter,
EVMInterpreter: config.EVMInterpreter,
}
- cacheConfig = &core.CacheConfig{Disabled: config.NoPruning, TrieCleanLimit: config.TrieCleanCache, TrieDirtyLimit: config.TrieDirtyCache, TrieTimeLimit: config.TrieTimeout}
+ cacheConfig = &core.CacheConfig{
+ TrieCleanLimit: config.TrieCleanCache,
+ TrieCleanNoPrefetch: config.NoPrefetch,
+ TrieDirtyLimit: config.TrieDirtyCache,
+ TrieDirtyDisabled: config.NoPruning,
+ TrieTimeLimit: config.TrieTimeout,
+ }
)
eth.blockchain, err = core.NewBlockChain(chainDb, cacheConfig, chainConfig, eth.engine, vmConfig, eth.shouldPreserve)
if err != nil {
diff --git a/eth/config.go b/eth/config.go
index 1bbe326da..a98e69053 100644
--- a/eth/config.go
+++ b/eth/config.go
@@ -92,7 +92,9 @@ type Config struct {
// Protocol options
NetworkId uint64 // Network ID to use for selecting peers to connect to
SyncMode downloader.SyncMode
- NoPruning bool
+
+ NoPruning bool // Whether to disable pruning and flush everything to disk
+ NoPrefetch bool // Whether to disable prefetching and only load state on demand
// Whitelist of required block number -> hash values to accept
Whitelist map[uint64]common.Hash `toml:"-"`