Skip to content

P2P: Add DisableRelayP2PTransport param to expose ability for certain node…#6063

Closed
gmalouf wants to merge 1 commit intoalgorand:masterfrom
gmalouf:disable-p2p-relay-option
Closed

P2P: Add DisableRelayP2PTransport param to expose ability for certain node…#6063
gmalouf wants to merge 1 commit intoalgorand:masterfrom
gmalouf:disable-p2p-relay-option

Conversation

@gmalouf
Copy link
Copy Markdown
Contributor

@gmalouf gmalouf commented Jul 10, 2024

Summary

Add DisableRelayP2PTransport param to expose ability for certain node classes to not gossip messages on the P2P network (while still connecting to it).

Test Plan

Existing tests should pass.

… classes to not gossip messages on the P2P network (while still connecting to it).
@gmalouf gmalouf requested review from algorandskiy, cce and ohill July 10, 2024 19:50
@gmalouf gmalouf self-assigned this Jul 10, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 10, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 56.11%. Comparing base (5869a00) to head (2f55af5).

Files Patch % Lines
network/p2p/p2p.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6063      +/-   ##
==========================================
- Coverage   56.11%   56.11%   -0.01%     
==========================================
  Files         488      488              
  Lines       69437    69439       +2     
==========================================
- Hits        38966    38965       -1     
+ Misses      27821    27817       -4     
- Partials     2650     2657       +7     

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

Copy link
Copy Markdown
Contributor

@algorandskiy algorandskiy left a comment

Choose a reason for hiding this comment

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

Missing a unit test

Comment thread network/p2p/p2p.go
// the libp2p.NoListenAddrs builtin disables relays but this one does not
var noListenAddrs = func(cfg *libp2p.Config) error {
cfg.ListenAddrs = []multiaddr.Multiaddr{}
// the libp2p.NoListenAddrs builtin disables relays but this one only does if
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is technically right but I think two separate opts noListenAddrNoRelay := libp2p.NoListenAddrs(p2pCfg) and noListenAddrs := func... p2pCfg.ListenAddrs = []multiaddr.Multiaddr{} could be more clear?

@gmalouf
Copy link
Copy Markdown
Contributor Author

gmalouf commented Jul 11, 2024

Closing in favor of #6064

@gmalouf gmalouf closed this Jul 11, 2024
@gmalouf gmalouf deleted the disable-p2p-relay-option branch July 11, 2024 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants