2
0
mirror of synced 2025-01-24 07:19:45 +00:00

Adds log topics for block exchange

This commit is contained in:
benbierens 2024-01-18 09:55:07 +01:00
parent 2f10b30283
commit 29fa554146
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
3 changed files with 26 additions and 0 deletions

View File

@ -27,6 +27,13 @@ namespace CodexPlugin
public class CodexLogCustomTopics
{
public CodexLogCustomTopics(CodexLogLevel discV5, CodexLogLevel libp2p, CodexLogLevel blockExchange)
{
DiscV5 = discV5;
Libp2p = libp2p;
BlockExchange = blockExchange;
}
public CodexLogCustomTopics(CodexLogLevel discV5, CodexLogLevel libp2p)
{
DiscV5 = discV5;
@ -35,6 +42,7 @@ namespace CodexPlugin
public CodexLogLevel DiscV5 { get; set; }
public CodexLogLevel Libp2p { get; set; }
public CodexLogLevel? BlockExchange { get; }
}
public class CodexSetup : CodexStartupConfig, ICodexSetup

View File

@ -54,10 +54,23 @@ namespace CodexPlugin
"websock",
"ws-session"
};
var blockExchangeTopics = new[]
{
"codex",
"pendingblocks",
"peerctxstore",
"discoveryengine",
"repostore"
};
level = $"{level};" +
$"{CustomTopics.DiscV5.ToString()!.ToLowerInvariant()}:{string.Join(",", discV5Topics)};" +
$"{CustomTopics.Libp2p.ToString()!.ToLowerInvariant()}:{string.Join(",", libp2pTopics)}";
if (CustomTopics.BlockExchange != null)
{
level += $";{CustomTopics.BlockExchange.ToString()!.ToLowerInvariant()}:{string.Join(",", blockExchangeTopics)}";
}
}
return level;
}

View File

@ -112,6 +112,11 @@ namespace CodexTests.BasicTests
AssertBalance(contracts, seller, Is.GreaterThan(sellerInitialBalance), "Seller was not paid for storage.");
AssertBalance(contracts, buyer, Is.LessThan(buyerInitialBalance), "Buyer was not charged for storage.");
var log = Ci.DownloadLog(seller);
log.AssertLogContains("Received a request to store a slot!");
log.AssertLogContains("Received proof challenge");
log.AssertLogContains("Collecting input for proof");
//CheckLogForErrors(seller, buyer);
}