Skip to content

p2p: allocate received frames incrementally - #4810

Draft
OisinKyne wants to merge 1 commit into
mainfrom
oisin/p2p-incremental-read
Draft

OisinKyne wants to merge 1 commit into
mainfrom
oisin/p2p-incremental-read

Conversation

@OisinKyne

Copy link
Copy Markdown
Contributor

Replaces pbio.NewDelimitedReader with a reader using the same wire format and error semantics that grows its buffer as bytes arrive instead of allocating the declared length up front, so a peer declaring a large frame but sending little cannot pin a large buffer. Applies the same to dkg/sync readSizedProto. Per-protocol read limits and the 128MB maximum are unchanged.

category: bug
ticket: none

Replaces pbio.NewDelimitedReader with a reader using the same wire format
and error semantics that grows its buffer as bytes arrive instead of
allocating the declared length up front, so a peer declaring a large frame
but sending little cannot pin a large buffer. Applies the same to
dkg/sync readSizedProto. Per-protocol read limits and the 128MB maximum
are unchanged.

category: bug
ticket: none
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.36364% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.63%. Comparing base (4e4d996) to head (7f7d62d).

Files with missing lines Patch % Lines
p2p/delimited.go 86.48% 5 Missing ⚠️
dkg/sync/server.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4810      +/-   ##
==========================================
+ Coverage   67.61%   67.63%   +0.01%     
==========================================
  Files         254      255       +1     
  Lines       33609    33645      +36     
==========================================
+ Hits        22725    22756      +31     
- Misses      10883    10888       +5     
  Partials        1        1              

☔ 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.

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