Skip to content
New issue

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

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

Already on GitHub? # to your account

p2p: http catchpoints support #5924

Merged

Conversation

algorandskiy
Copy link
Contributor

Summary

P2P HTTP support for ledger service:

  1. Ledger fetcher understands p2p URL now
  2. P2pNetwork implements GetHTTPRequestConnection:
    • A new StreamChainingHost wrapper for libp2p.host.Host allows multiple stream handlers for the same protocol.ID
    • Main use is to have an extra handler for "/http/1.1" in order to track streams with HTTP protocol inside.
  3. Ledger Service worked out of the box

Test Plan

Added unit test for fetcher, service and new p2p stream wrapper.

@algorandskiy algorandskiy added Enhancement p2p Work related to the p2p project labels Jan 31, 2024
@algorandskiy algorandskiy self-assigned this Jan 31, 2024
@algorandskiy algorandskiy changed the title p2p: p2p http catchpoints support p2p: http catchpoints support Jan 31, 2024
Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: 29 lines in your changes are missing coverage. Please review.

Comparison is base (a8e2254) 55.98% compared to head (f2178ae) 56.06%.

Files Patch % Lines
network/p2p/streams.go 0.00% 13 Missing ⚠️
network/p2pNetwork.go 45.45% 4 Missing and 2 partials ⚠️
network/hybridNetwork.go 0.00% 5 Missing ⚠️
network/p2p/p2p.go 86.36% 3 Missing ⚠️
catchup/ledgerFetcher.go 88.88% 0 Missing and 1 partial ⚠️
network/wsNetwork.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           feature/p2p    #5924      +/-   ##
===============================================
+ Coverage        55.98%   56.06%   +0.07%     
===============================================
  Files              482      482              
  Lines            68057    68108      +51     
===============================================
+ Hits             38103    38186      +83     
+ Misses           27347    27318      -29     
+ Partials          2607     2604       -3     

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

Copy link
Contributor

@gmalouf gmalouf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asked a few questions, okay with approving after get a response to those.

@algorandskiy algorandskiy merged commit e8c4ae6 into algorand:feature/p2p Feb 5, 2024
16 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Enhancement p2p Work related to the p2p project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants