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

feat: remove unnecessary conversion from Multiaddr to IP #369

Merged
merged 5 commits into from
Nov 13, 2022

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Nov 3, 2022

Gossipsub currently polls connection manager frequently to figure what IPs each peer connection has. This is very inneficient and causes performance issues in Lodestar

Instead js-libp2p should follow a similar pattern to rust-libp2p, which injects an AddressChange event into protocols. See https://github.com/sigp/rust-libp2p/blob/a3dec471c046127e8e0d88bc89a881affb56a76c/protocols/gossipsub/src/behaviour.rs#L3282

@achingbrain is js-libp2p emitting a similar event already? Where could this be added if not?

@wemeetagain
Copy link
Member

@wemeetagain wemeetagain changed the title Remove unnecessary conversion from Multiaddr to IP feat: remove unnecessary conversion from Multiaddr to IP Nov 4, 2022
@wemeetagain wemeetagain marked this pull request as ready for review November 11, 2022 20:57
@wemeetagain wemeetagain requested a review from a team as a code owner November 11, 2022 20:57
@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2022

Codecov Report

Base: 83.58% // Head: 83.26% // Decreases project coverage by -0.31% ⚠️

Coverage data is based on head (f23795f) compared to base (129b9cd).
Patch coverage: 64.62% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #369      +/-   ##
==========================================
- Coverage   83.58%   83.26%   -0.32%     
==========================================
  Files          47       48       +1     
  Lines       11771    11779       +8     
  Branches     1266     1264       -2     
==========================================
- Hits         9839     9808      -31     
- Misses       1932     1971      +39     
Impacted Files Coverage Δ
src/index.ts 69.67% <37.50%> (-0.70%) ⬇️
src/score/peer-score.ts 85.94% <53.84%> (-1.82%) ⬇️
src/utils/multiaddr.ts 86.95% <86.95%> (ø)
test/peer-score.spec.ts 95.32% <94.73%> (-0.07%) ⬇️
src/score/compute-score.ts 90.81% <100.00%> (ø)
src/score/scoreMetrics.ts 79.53% <100.00%> (ø)
src/utils/set.ts 100.00% <100.00%> (ø)
test/scoreMetrics.spec.ts 100.00% <100.00%> (ø)

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

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

@dapplion
Copy link
Contributor Author

✔️ looks good! Can't approve since it's my PR

@wemeetagain wemeetagain merged commit e37c7c2 into master Nov 13, 2022
@wemeetagain wemeetagain deleted the dapplion/drop-is-ip branch November 13, 2022 04:02
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.

3 participants