Skip to content
Merged
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
3 changes: 3 additions & 0 deletions src/Nethermind/Nethermind.Config/BlocksConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ private static string GetDefaultVersionExtraData()
public ulong SecondsPerSlot { get; set; } = 12;

public bool PreWarmStateOnBlockProcessing { get; set; } = true;

public bool CachePrecompilesOnBlockProcessing { get; set; } = true;

public int PreWarmStateConcurrency { get; set; } = 0;

public int BlockProductionTimeoutMs { get; set; } = 4_000;
Expand Down
3 changes: 3 additions & 0 deletions src/Nethermind/Nethermind.Config/IBlocksConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public interface IBlocksConfig : IConfig
[ConfigItem(Description = "Whether to pre-warm the state when processing blocks. This can lead to an up to 2x speed-up in the main loop block processing.", DefaultValue = "True")]
bool PreWarmStateOnBlockProcessing { get; set; }

[ConfigItem(Description = "Whether to cache precompile results when processing blocks.", DefaultValue = "True", HiddenFromDocs = true)]
bool CachePrecompilesOnBlockProcessing { get; set; }

[ConfigItem(Description = "Specify pre-warm state concurrency. Default is logical processor - 1.", DefaultValue = "0", HiddenFromDocs = true)]
int PreWarmStateConcurrency { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public MainProcessingContext(
{
PreBlockCaches preBlockCaches = ctx.Resolve<PreBlockCaches>();
// Note: The use of FrozenDictionary means that this cannot be used for other processing env also due to risk of memory leak.
return new CachedCodeInfoRepository(precompileProvider, originalCodeInfoRepository, preBlockCaches?.PrecompileCache);
return new CachedCodeInfoRepository(precompileProvider, originalCodeInfoRepository, blocksConfig.CachePrecompilesOnBlockProcessing ? preBlockCaches?.PrecompileCache : null);
})
;
}
Expand Down