js-libp2p-gossipsub icon indicating copy to clipboard operation
js-libp2p-gossipsub copied to clipboard

feat: Add stream option to limit inbound message size

Open g11tech opened this issue 3 years ago • 1 comments

If the size is not provided decode from it-length-prefixed lib applies the ~4mb limit by default: From npm docs:

maxDataLength: If provided, will not decode messages whose data section exceeds the size specified, if omitted will use the default of 4MB.

bellatrix message sizes could be 10MB so this limit needs to be exposed via options so they can be set by lodestar

g11tech avatar Sep 29 '22 19:09 g11tech

Codecov Report

Base: 83.22% // Head: 83.58% // Increases project coverage by +0.36% :tada:

Coverage data is based on head (5d6bcc8) compared to base (19507d9). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #349      +/-   ##
==========================================
+ Coverage   83.22%   83.58%   +0.36%     
==========================================
  Files          47       47              
  Lines       11713    11771      +58     
  Branches     1258     1267       +9     
==========================================
+ Hits         9748     9839      +91     
+ Misses       1965     1932      -33     
Impacted Files Coverage Δ
src/index.ts 70.37% <100.00%> (+1.31%) :arrow_up:
src/stream.ts 97.33% <100.00%> (+0.27%) :arrow_up:
test/gossip.spec.ts 96.31% <100.00%> (+0.73%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov-commenter avatar Oct 04 '22 10:10 codecov-commenter

I think i will need to fix the tests since the pubsub reference has changed, let me update and push

g11tech avatar Oct 25 '22 16:10 g11tech

@dapplion ready for merge!

g11tech avatar Oct 26 '22 11:10 g11tech