Skip to content

p2p: http catchpoints support#5924

Merged
algorandskiy merged 4 commits intoalgorand:feature/p2pfrom
algorandskiy:pavel/p2p-http-ledger-service
Feb 5, 2024
Merged

p2p: http catchpoints support#5924
algorandskiy merged 4 commits intoalgorand:feature/p2pfrom
algorandskiy:pavel/p2p-http-ledger-service

Conversation

@algorandskiy
Copy link
Copy Markdown
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
@codecov
Copy link
Copy Markdown

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
Copy Markdown
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.

Comment thread network/p2pNetwork.go
Comment thread network/hybridNetwork.go
Comment thread network/p2p/streams.go
Comment thread rpcs/ledgerService.go
Comment thread catchup/ledgerFetcher.go
@algorandskiy algorandskiy merged commit e8c4ae6 into algorand:feature/p2p Feb 5, 2024
@algorandskiy algorandskiy deleted the pavel/p2p-http-ledger-service branch March 16, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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