Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions execution/gethexec/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ type CachingConfig struct {
TrieDirtyCache int `koanf:"trie-dirty-cache"`
TrieCleanCache int `koanf:"trie-clean-cache"`
TrieCapLimit uint32 `koanf:"trie-cap-limit"`
TrieCapBatchSize uint32 `koanf:"trie-cap-batch-size"`
TrieCommitBatchSize uint32 `koanf:"trie-commit-batch-size"`
SnapshotCache int `koanf:"snapshot-cache"`
DatabaseCache int `koanf:"database-cache"`
SnapshotRestoreGasLimit uint64 `koanf:"snapshot-restore-gas-limit"`
Expand All @@ -60,6 +62,8 @@ func CachingConfigAddOptions(prefix string, f *flag.FlagSet) {
f.Int(prefix+".snapshot-cache", DefaultCachingConfig.SnapshotCache, "amount of memory in megabytes to cache state snapshots with")
f.Int(prefix+".database-cache", DefaultCachingConfig.DatabaseCache, "amount of memory in megabytes to cache database contents with")
f.Uint32(prefix+".trie-cap-limit", DefaultCachingConfig.TrieCapLimit, "amount of memory in megabytes to be used in the TrieDB Cap operation during maintenance")
f.Uint32(prefix+".trie-cap-batch-size", DefaultCachingConfig.TrieCapBatchSize, "batch size in bytes used in the TrieDB Cap operation (0 = use geth default)")
f.Uint32(prefix+".trie-commit-batch-size", DefaultCachingConfig.TrieCommitBatchSize, "batch size in bytes used in the TrieDB Commit operation (0 = use geth default)")
f.Uint64(prefix+".snapshot-restore-gas-limit", DefaultCachingConfig.SnapshotRestoreGasLimit, "maximum gas rolled back to recover snapshot")
f.Uint64(prefix+".head-rewind-blocks-limit", DefaultCachingConfig.HeadRewindBlocksLimit, "maximum number of blocks rolled back to recover chain head (0 = use geth default limit)")
f.Uint32(prefix+".max-number-of-blocks-to-skip-state-saving", DefaultCachingConfig.MaxNumberOfBlocksToSkipStateSaving, "maximum number of blocks to skip state saving to persistent storage (archive node only) -- warning: this option seems to cause issues")
Expand All @@ -86,6 +90,8 @@ var DefaultCachingConfig = CachingConfig{
TrieDirtyCache: 1024,
TrieCleanCache: 600,
TrieCapLimit: 100,
TrieCapBatchSize: 0, // 0 = use geth default
TrieCommitBatchSize: 0, // 0 = use geth default
SnapshotCache: 400,
DatabaseCache: 2048,
SnapshotRestoreGasLimit: 300_000_000_000,
Expand Down Expand Up @@ -113,6 +119,8 @@ func DefaultCacheConfigFor(stack *node.Node, cachingConfig *CachingConfig) *core
TrieTimeLimitRandomOffset: cachingConfig.TrieTimeLimitRandomOffset,
TriesInMemory: cachingConfig.BlockCount,
TrieRetention: cachingConfig.BlockAge,
TrieCapBatchSize: cachingConfig.TrieCapBatchSize,
TrieCommitBatchSize: cachingConfig.TrieCommitBatchSize,
SnapshotLimit: cachingConfig.SnapshotCache,
Preimages: baseConf.Preimages || cachingConfig.EnablePreimages,
SnapshotRestoreMaxGas: cachingConfig.SnapshotRestoreGasLimit,
Expand Down
Loading