Skip to content

Commit 64d271c

Browse files
committed
merge finished
1 parent 3822d5e commit 64d271c

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public ChainState(ILog log, ICodexContracts contracts, IChainStateChangeHandler
4747
handler = changeHandler;
4848
this.doProofPeriodMonitoring = doProofPeriodMonitoring;
4949
TotalSpan = new TimeRange(startUtc, startUtc);
50-
PeriodMonitor = new PeriodMonitor(contracts);
50+
PeriodMonitor = new PeriodMonitor(log, contracts);
5151
}
5252

5353
public TimeRange TotalSpan { get; private set; }

ProjectPlugins/CodexContractsPlugin/Marketplace/Customizations.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ public partial class ReserveSlotFunction : IHasBlock, IHasRequestId, IHasSlotInd
9696

9797
public partial class MarketplaceConfig : IMarketplaceConfigInput
9898
{
99-
99+
public int MaxNumberOfSlashes => this.Collateral.MaxNumberOfSlashes;
100+
public TimeSpan PeriodDuration => TimeSpan.FromSeconds(this.Proofs.Period);
100101
}
101102
}
102103
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

Tests/CodexReleaseTests/Utils/MarketplaceAutoBootstrapDistTest.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@ protected TimeSpan GetPeriodDuration()
5353
protected abstract ByteSize HostAvailabilitySize { get; }
5454
protected abstract TimeSpan HostAvailabilityMaxDuration { get; }
5555
protected virtual bool MonitorChainState { get; } = true;
56+
protected TimeSpan HostBlockTTL { get; } = TimeSpan.FromMinutes(1.0);
5657

5758
public ICodexNodeGroup StartHosts()
5859
{
5960
var hosts = StartCodex(NumberOfHosts, s => s
6061
.WithName("host")
62+
.WithBlockTTL(HostBlockTTL)
63+
.WithBlockMaintenanceNumber(1000)
64+
.WithBlockMaintenanceInterval(HostBlockTTL / 2)
6165
.EnableMarketplace(GetGeth(), GetContracts(), m => m
6266
.WithInitial(StartingBalanceEth.Eth(), StartingBalanceTST.Tst())
6367
.AsStorageNode()
@@ -70,7 +74,7 @@ public ICodexNodeGroup StartHosts()
7074
AssertTstBalance(host, StartingBalanceTST.Tst(), nameof(StartHosts));
7175
AssertEthBalance(host, StartingBalanceEth.Eth(), nameof(StartHosts));
7276

73-
host.Marketplace.MakeStorageAvailable(new StorageAvailability(
77+
host.Marketplace.MakeStorageAvailable(new CreateStorageAvailability(
7478
totalSpace: HostAvailabilitySize,
7579
maxDuration: HostAvailabilityMaxDuration,
7680
minPricePerBytePerSecond: 1.TstWei(),
@@ -84,6 +88,9 @@ public ICodexNode StartOneHost()
8488
{
8589
var host = StartCodex(s => s
8690
.WithName("singlehost")
91+
.WithBlockTTL(HostBlockTTL)
92+
.WithBlockMaintenanceNumber(1000)
93+
.WithBlockMaintenanceInterval(HostBlockTTL / 2)
8794
.EnableMarketplace(GetGeth(), GetContracts(), m => m
8895
.WithInitial(StartingBalanceEth.Eth(), StartingBalanceTST.Tst())
8996
.AsStorageNode()
@@ -94,7 +101,7 @@ public ICodexNode StartOneHost()
94101
AssertTstBalance(host, StartingBalanceTST.Tst(), nameof(StartOneHost));
95102
AssertEthBalance(host, StartingBalanceEth.Eth(), nameof(StartOneHost));
96103

97-
host.Marketplace.MakeStorageAvailable(new StorageAvailability(
104+
host.Marketplace.MakeStorageAvailable(new CreateStorageAvailability(
98105
totalSpace: HostAvailabilitySize,
99106
maxDuration: HostAvailabilityMaxDuration,
100107
minPricePerBytePerSecond: 1.TstWei(),

0 commit comments

Comments
 (0)