Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AncientBarriers for old bodies & old receipts logging #4743

Merged
merged 5 commits into from
Oct 12, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixing SyncReport
  • Loading branch information
MarekM25 committed Oct 10, 2022
commit 873a31fa41e8789372006bea19dd1fb1cbc0677f
Original file line number Diff line number Diff line change
@@ -96,16 +96,14 @@ public void Ancient_bodies_and_receipts_are_reported_correctly(bool setBarriers)
}

SyncReport syncReport = new(pool, Substitute.For<INodeStatsManager>(), selector, syncConfig, Substitute.For<IPivot>(), logManager, timerFactory);
selector.Current.Returns((ci) => _syncModes.Count > 0 ? _syncModes.Dequeue() : SyncMode.Full);
timer.Elapsed += Raise.Event();
timer.Elapsed += Raise.Event();
selector.Current.Returns((ci) => SyncMode.FastHeaders | SyncMode.FastBodies | SyncMode.FastReceipts);
timer.Elapsed += Raise.Event();

if (setBarriers)
{
logger.Received(1).Info("Old Headers 0 / 100 | queue 0 | current 0.00bps | total 0.00bps");
logger.Received(1).Info("Old Bodies 0 / 70 | queue 0 | current 0.00bps | total 0.00bps");
logger.Received(1).Info("Old Receipts 0 / 65 | queue 0 | current 0.00bps | total 0.00bps");
logger.Received(1).Info("Old Bodies 0 / 70 | queue 0 | current 0.00bps | total 0.00bps");
logger.Received(1).Info("Old Receipts 0 / 65 | queue 0 | current 0.00bps | total 0.00bps");
}
else
{
Original file line number Diff line number Diff line change
@@ -60,8 +60,10 @@ public SyncReport(ISyncPeerPool syncPeerPool, INodeStatsManager nodeStatsManager
_fastBlocksPivotNumber = _syncConfig.PivotNumberParsed;
_blockPaddingLength = _fastBlocksPivotNumber.ToString().Length;
_paddedPivot = $"{Pad(_fastBlocksPivotNumber, _blockPaddingLength)}";
_paddedAmountOfOldBodiesToDownload = $"{Pad(_fastBlocksPivotNumber - syncConfig.AncientBodiesBarrier, _blockPaddingLength)}";
_paddedAmountOfOldReceiptsToDownload = $"{Pad(_fastBlocksPivotNumber - syncConfig.AncientReceiptsBarrier, _blockPaddingLength)}";
long amountOfBodiesToDownload = _fastBlocksPivotNumber - syncConfig.AncientBodiesBarrier;
_paddedAmountOfOldBodiesToDownload = $"{Pad(amountOfBodiesToDownload, $"{_blockPaddingLength}".Length)}";
long amountOfReceiptsToDownload = _fastBlocksPivotNumber - syncConfig.AncientReceiptsBarrier;
_paddedAmountOfOldReceiptsToDownload = $"{Pad(_fastBlocksPivotNumber - syncConfig.AncientReceiptsBarrier, $"{_blockPaddingLength}".Length)}";

StartTime = DateTime.UtcNow;