Marketplace test fails: submitted proof is invalid.

This commit is contained in:
Ben 2024-03-15 16:07:10 +01:00
parent f757e64ba4
commit 32f56e8213
No known key found for this signature in database
GPG Key ID: 541B9D8C9F1426A1
3 changed files with 5 additions and 17 deletions

View File

@ -9,8 +9,7 @@ namespace CodexPlugin
{ {
private readonly MarketplaceStarter marketplaceStarter = new MarketplaceStarter(); private readonly MarketplaceStarter marketplaceStarter = new MarketplaceStarter();
private const string DefaultDockerImage = "thatbenbierens/nim-codex:prover2"; private const string DefaultDockerImage = "codexstorage/nim-codex:sha-ba0e7d9-dist-tests";
//"codexstorage/nim-codex:latest-dist-tests";
public const string ApiPortTag = "codex_api_port"; public const string ApiPortTag = "codex_api_port";
public const string ListenPortTag = "codex_listen_port"; public const string ListenPortTag = "codex_listen_port";
public const string MetricsPortTag = "codex_metrics_port"; public const string MetricsPortTag = "codex_metrics_port";

View File

@ -181,17 +181,6 @@ namespace CodexPlugin
WaitForStorageContractState(timeout, "finished"); WaitForStorageContractState(timeout, "finished");
} }
/// <summary>
/// Wait for contract to start. Max timeout depends on contract filesize. Allows more time for larger files.
/// </summary>
public void WaitForStorageContractStarted(ByteSize contractFileSize)
{
var filesizeInMb = contractFileSize.SizeInBytes / (1024 * 1024);
var maxWaitTime = TimeSpan.FromSeconds(filesizeInMb * 10.0);
WaitForStorageContractStarted(maxWaitTime);
}
public void WaitForStorageContractStarted(TimeSpan timeout) public void WaitForStorageContractStarted(TimeSpan timeout)
{ {
WaitForStorageContractState(timeout, "started"); WaitForStorageContractState(timeout, "started");

View File

@ -66,8 +66,7 @@ namespace CodexTests.BasicTests
.WithStorageQuota(11.GB()) .WithStorageQuota(11.GB())
.EnableMarketplace(geth, contracts, initialEth: 10.Eth(), initialTokens: sellerInitialBalance, s => s .EnableMarketplace(geth, contracts, initialEth: 10.Eth(), initialTokens: sellerInitialBalance, s => s
.AsStorageNode() .AsStorageNode()
.AsValidator()) .AsValidator()));
.WithSimulateProofFailures(failEveryNProofs: 3));
AssertBalance(contracts, seller, Is.EqualTo(sellerInitialBalance)); AssertBalance(contracts, seller, Is.EqualTo(sellerInitialBalance));
seller.Marketplace.MakeStorageAvailable( seller.Marketplace.MakeStorageAvailable(
@ -91,9 +90,10 @@ namespace CodexTests.BasicTests
requiredCollateral: 10.TestTokens(), requiredCollateral: 10.TestTokens(),
minRequiredNumberOfNodes: 1, minRequiredNumberOfNodes: 1,
proofProbability: 5, proofProbability: 5,
duration: TimeSpan.FromMinutes(5)); duration: TimeSpan.FromMinutes(5),
expiry: TimeSpan.FromMinutes(4));
purchaseContract.WaitForStorageContractStarted(fileSize); purchaseContract.WaitForStorageContractStarted(TimeSpan.FromMinutes(4));
AssertBalance(contracts, seller, Is.LessThan(sellerInitialBalance), "Collateral was not placed."); AssertBalance(contracts, seller, Is.LessThan(sellerInitialBalance), "Collateral was not placed.");