diff --git a/src/Nethermind/Nethermind.AuRa.Test/AuRaBlockProducerTests.cs b/src/Nethermind/Nethermind.AuRa.Test/AuRaBlockProducerTests.cs index 9b553fc0f52..db1245bc2ce 100644 --- a/src/Nethermind/Nethermind.AuRa.Test/AuRaBlockProducerTests.cs +++ b/src/Nethermind/Nethermind.AuRa.Test/AuRaBlockProducerTests.cs @@ -229,9 +229,9 @@ private async Task StartStop(Context context, bool processingQueueEm }); context.BlockProducerRunner.Start(); - await processedEvent.WaitOneAsync(context.StepDelay * stepDelayMultiplier * 5, CancellationToken.None); + await processedEvent.WaitOneAsync(context.StepDelay * stepDelayMultiplier * 20, CancellationToken.None); context.BlockTree.ClearReceivedCalls(); - await Task.Delay(context.StepDelay); + await Task.Delay(context.StepDelay * 2); processedEvent.Reset(); try @@ -248,7 +248,7 @@ private async Task StartStop(Context context, bool processingQueueEm processedEvent.Reset(); } - await processedEvent.WaitOneAsync(context.StepDelay * stepDelayMultiplier * 5, CancellationToken.None); + await processedEvent.WaitOneAsync(context.StepDelay * stepDelayMultiplier * 20, CancellationToken.None); } finally diff --git a/src/Nethermind/Nethermind.Config.Test/SampleJson/SampleJsonConfig.json b/src/Nethermind/Nethermind.Config.Test/SampleJson/SampleJsonConfig.json index c2e3b7535a1..7ba16ed6f9c 100644 --- a/src/Nethermind/Nethermind.Config.Test/SampleJson/SampleJsonConfig.json +++ b/src/Nethermind/Nethermind.Config.Test/SampleJson/SampleJsonConfig.json @@ -4,7 +4,7 @@ "Cipher": "test" }, "JsonRpc": { - "EnabledModules": "Eth,Debug" + "EnabledModules": "Eth,Debug," }, "Discovery": { "Concurrency": "4", @@ -14,4 +14,4 @@ { "IndexLevelBucketSizes" : [16, 16, 16] } -} \ No newline at end of file +} diff --git a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/TestRpcModuleProvider.cs b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/TestRpcModuleProvider.cs index f797c9adb14..8214f6a4d41 100644 --- a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/TestRpcModuleProvider.cs +++ b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/TestRpcModuleProvider.cs @@ -53,7 +53,7 @@ private void EnableModule() where TOther : IRpcModule { if (!_jsonRpcConfig.EnabledModules.Contains(rpcModuleAttribute.ModuleType)) { - _jsonRpcConfig.EnabledModules = _jsonRpcConfig.EnabledModules.Union(new[] { rpcModuleAttribute.ModuleType }).ToArray(); + _jsonRpcConfig.EnabledModules = _jsonRpcConfig.EnabledModules.Union([rpcModuleAttribute.ModuleType]).ToArray(); } } } diff --git a/src/Nethermind/Nethermind.JsonRpc/JsonRpcConfig.cs b/src/Nethermind/Nethermind.JsonRpc/JsonRpcConfig.cs index b71dd400f67..8a1f556e69e 100644 --- a/src/Nethermind/Nethermind.JsonRpc/JsonRpcConfig.cs +++ b/src/Nethermind/Nethermind.JsonRpc/JsonRpcConfig.cs @@ -11,6 +11,7 @@ public class JsonRpcConfig : IJsonRpcConfig { public static readonly JsonRpcConfig Default = new(); private int? _webSocketsPort; + private string[] _enabledModules = ModuleType.DefaultModules.ToArray(); public bool Enabled { get; set; } public string Host { get; set; } = "127.0.0.1"; public int Timeout { get; set; } = 20000; @@ -29,7 +30,15 @@ public int WebSocketsPort public string? IpcUnixDomainSocketPath { get; set; } = null; - public string[] EnabledModules { get; set; } = ModuleType.DefaultModules.ToArray(); + public string[] EnabledModules + { + get => _enabledModules; + set + { + _enabledModules = value.Where(m => !string.IsNullOrWhiteSpace(m)).ToArray(); + } + } + public string[] AdditionalRpcUrls { get; set; } = []; public long? GasCap { get; set; } = 100000000; public int ReportIntervalSeconds { get; set; } = 300; diff --git a/src/Nethermind/Nethermind.JsonRpc/JsonRpcUrlCollection.cs b/src/Nethermind/Nethermind.JsonRpc/JsonRpcUrlCollection.cs index 81af1e31b4f..892d32fab5f 100644 --- a/src/Nethermind/Nethermind.JsonRpc/JsonRpcUrlCollection.cs +++ b/src/Nethermind/Nethermind.JsonRpc/JsonRpcUrlCollection.cs @@ -30,8 +30,9 @@ public JsonRpcUrlCollection(ILogManager logManager, IJsonRpcConfig jsonRpcConfig private void BuildUrls(bool includeWebSockets) { - bool HasEngineApi = _jsonRpcConfig.EnabledModules.Any(m => m.Equals(ModuleType.Engine, StringComparison.OrdinalIgnoreCase)); - JsonRpcUrl defaultUrl = new(Uri.UriSchemeHttp, _jsonRpcConfig.Host, _jsonRpcConfig.Port, RpcEndpoint.Http, HasEngineApi, _jsonRpcConfig.EnabledModules, HasEngineApi ? SocketClient.MAX_REQUEST_BODY_SIZE_FOR_ENGINE_API : _jsonRpcConfig.MaxRequestBodySize); + bool hasEngineApi = _jsonRpcConfig.EnabledModules.Any(m => m.Equals(ModuleType.Engine, StringComparison.OrdinalIgnoreCase)); + long? maxRequestBodySize = hasEngineApi ? SocketClient.MAX_REQUEST_BODY_SIZE_FOR_ENGINE_API : _jsonRpcConfig.MaxRequestBodySize; + JsonRpcUrl defaultUrl = new(Uri.UriSchemeHttp, _jsonRpcConfig.Host, _jsonRpcConfig.Port, RpcEndpoint.Http, hasEngineApi, _jsonRpcConfig.EnabledModules, maxRequestBodySize); Add(defaultUrl.Port, defaultUrl);