Skip to content

fix(p2p): limit round statistic memory and record only recognized routes - #1448

Merged
oXtxNt9U merged 8 commits into
developfrom
fix/p2p/bounded-peer-statistics
Aug 14, 2026
Merged

fix(p2p): limit round statistic memory and record only recognized routes#1448
oXtxNt9U merged 8 commits into
developfrom
fix/p2p/bounded-peer-statistics

Conversation

@oXtxNt9U

Copy link
Copy Markdown
Contributor

Summary

  • The statistic plugin keyed requests by raw request.path, and unmatched paths (which skip the ban check and rate limiter entirely) were still recorded
  • RoundStatistic retained one record per request in unbounded per-ip and per-endpoint arrays
  • Measured on 500k pings per round: ~62 MiB → ~0.1 MiB retained, identical reported counts

Checklist

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.82609% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 77.94%. Comparing base (b178403) to head (8ee9e1e).

Files with missing lines Patch % Lines
packages/p2p/source/statistic/round-statistic.ts 97.72% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1448      +/-   ##
===========================================
+ Coverage    77.38%   77.94%   +0.56%     
===========================================
  Files          923      934      +11     
  Lines        15978    16456     +478     
  Branches      2185     2280      +95     
===========================================
+ Hits         12364    12827     +463     
- Misses        3609     3622      +13     
- Partials         5        7       +2     
Flag Coverage Δ
contracts 91.76% <ø> (?)
packages 77.57% <97.82%> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@oXtxNt9U
oXtxNt9U force-pushed the fix/p2p/bounded-peer-statistics branch from 1f697e8 to 8ee9e1e Compare August 14, 2026 02:39
@oXtxNt9U
oXtxNt9U merged commit 58176af into develop Aug 14, 2026
24 checks passed
@oXtxNt9U
oXtxNt9U deleted the fix/p2p/bounded-peer-statistics branch August 14, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant