Accounts for pointer downtime in waitForFailed time calculation

This commit is contained in:
Ben 2025-03-12 15:03:06 +01:00
parent c475802330
commit 604b0f2241
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
2 changed files with 7 additions and 2 deletions

View File

@ -126,7 +126,12 @@ namespace CodexClient
{
var numMissedProofsRequiredForFree = config.Collateral.MaxNumberOfSlashes;
var timePerProof = TimeSpan.FromSeconds(config.Proofs.Period);
return timePerProof * (numMissedProofsRequiredForFree + 1);
var result = timePerProof * (numMissedProofsRequiredForFree + 1);
// Times 2!
// Because of pointer-downtime it's possible that some periods even though there's a probability of 100%
// will not require any proof. To be safe we take twice the required time.
return result * 2;
}
private void WaitForStorageContractState(TimeSpan timeout, string desiredState, int sleep = 1000)

View File

@ -160,7 +160,7 @@ namespace CodexReleaseTests.MarketTests
var cid = client.UploadFile(GenerateTestFile(FilesizeMb.MB()));
return client.Marketplace.RequestStorage(new StoragePurchaseRequest(cid)
{
Duration = TimeSpan.FromMinutes(10.0),
Duration = TimeSpan.FromMinutes(20.0),
Expiry = TimeSpan.FromMinutes(5.0),
MinRequiredNumberOfNodes = NumberOfSlots,
NodeFailureTolerance = 1,