Skip to content

Commit

Permalink
Merge branch 'master' into dotnet9
Browse files Browse the repository at this point in the history
  • Loading branch information
rjnrohit authored Dec 5, 2024
2 parents f7af689 + cfb53c2 commit 6ee07b1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void Wait_times_out_at_cutoff()
[Test]
public void Does_not_wait_after_cutoff()
{
const ulong blockWaitCutoff = 1333;
ulong blockWaitCutoff = ShutterTestsCommon.Cfg.BlockUpToDateCutoff;
Random rnd = new(ShutterTestsCommon.Seed);
Timestamper timestamper = ShutterTestsCommon.InitTimestamper(ShutterTestsCommon.InitialSlotTimestamp, 2 * blockWaitCutoff);
ShutterApiSimulator api = ShutterTestsCommon.InitApi(rnd, timestamper);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class ShutterTestsCommon
public const int ChainId = BlockchainIds.Chiado;
public const ulong GenesisTimestamp = 1;
public static readonly TimeSpan SlotLength = TimeSpan.FromSeconds(5);
public static readonly TimeSpan BlockUpToDateCutoff = TimeSpan.FromSeconds(5);
public static readonly ISpecProvider SpecProvider = ChiadoSpecProvider.Instance;
public static readonly IEthereumEcdsa Ecdsa = new EthereumEcdsa(ChainId);
public static readonly ILogManager LogManager = LimboLogs.Instance;
Expand All @@ -47,6 +46,7 @@ class ShutterTestsCommon
EncryptedGasLimit = 21000 * 20,
Validator = true
};
public static readonly TimeSpan BlockUpToDateCutoff = TimeSpan.FromMilliseconds(Cfg.BlockUpToDateCutoff);

public static ShutterApiSimulator InitApi(Random rnd, ITimestamper? timestamper = null, ShutterEventSimulator? eventSimulator = null)
{
Expand Down
4 changes: 4 additions & 0 deletions src/Nethermind/Nethermind.Shutter/Config/IShutterConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ public interface IShutterConfig : IConfig
DefaultValue = "60000", HiddenFromDocs = true)]
uint DisconnectionLogInterval { get; set; }

[ConfigItem(Description = "How many milliseconds until a block is considered outdated.",
DefaultValue = "20000", HiddenFromDocs = true)]
uint BlockUpToDateCutoff { get; set; }

[ConfigItem(Description = "Whether to output libp2p logs.",
DefaultValue = "false", HiddenFromDocs = true)]
bool P2PLogsEnabled { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Nethermind.Shutter/Config/ShutterConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class ShutterConfig : IShutterConfig
public ushort MaxKeyDelay { get; set; } = 1666;
public uint DisconnectionLogTimeout { get; set; } = 1200000;
public uint DisconnectionLogInterval { get; set; } = 60000;
public uint BlockUpToDateCutoff { get; set; } = 20000;
public bool P2PLogsEnabled { get; set; } = false;
}
}
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Shutter/ShutterApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ IPAddress ip
_slotLength = slotLength;
_fileSystem = fileSystem;
_keyStoreConfig = keyStoreConfig;
_blockUpToDateCutoff = slotLength;
_blockUpToDateCutoff = TimeSpan.FromMilliseconds(cfg.BlockUpToDateCutoff);
_blockWaitCutoff = _slotLength / 3;

_txProcessingEnvFactory = new(worldStateManager, blockTree, specProvider, logManager);
Expand Down

0 comments on commit 6ee07b1

Please sign in to comment.