Skip to content

Commit

Permalink
convert to milliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchhill committed Nov 6, 2024
1 parent 009fb88 commit 9413537
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/Nethermind/Nethermind.Shutter/Config/IShutterConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ public interface IShutterConfig : IConfig
DefaultValue = "true", HiddenFromDocs = true)]
bool Validator { get; set; }

[ConfigItem(Description = "How many minutes to wait for transactions before sending a disconnection warning.",
DefaultValue = "20", HiddenFromDocs = true)]
ushort DisconnectionLogTimeout { get; set; }
[ConfigItem(Description = "How many milliseconds to wait for transactions before sending a disconnection warning.",
DefaultValue = "1200000", HiddenFromDocs = true)]
uint DisconnectionLogTimeout { get; set; }

public void Validate(out Multiaddress[] bootnodeP2PAddresses)
{
Expand Down Expand Up @@ -111,9 +111,9 @@ public void Validate(out Multiaddress[] bootnodeP2PAddresses)
throw new ArgumentException("Must set Shutter keyper set manager contract address to valid address.");
}

if (DisconnectionLogTimeout == 0)
if (DisconnectionLogTimeout < 60000)
{
throw new ArgumentException("Must set Shutter disconnection log timeout greater than 0.");
throw new ArgumentException("Must set Shutter disconnection log timeout to at least a minute.");
}

if (P2PAgentVersion is null)
Expand Down
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Shutter/Config/ShutterConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public class ShutterConfig : IShutterConfig
public ulong InstanceID { get; set; } = 0;
public int EncryptedGasLimit { get; set; } = 10000000;
public ushort MaxKeyDelay { get; set; } = 1666;
public ushort DisconnectionLogTimeout { get; set; } = 20;
public uint DisconnectionLogTimeout { get; set; } = 1200000;
}
}
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Shutter/ShutterP2P.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public ShutterP2P(IShutterConfig shutterConfig, ILogManager logManager, IFileSys
{
_logger = logManager.GetClassLogger();
_cfg = shutterConfig;
DisconnectionLogTimeout = TimeSpan.FromMinutes(_cfg.DisconnectionLogTimeout);
DisconnectionLogTimeout = TimeSpan.FromMilliseconds(_cfg.DisconnectionLogTimeout);
_serviceProvider = new ServiceCollection()
.AddLibp2p(builder => builder)
.AddSingleton(new IdentifyProtocolSettings
Expand Down

0 comments on commit 9413537

Please sign in to comment.