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

Add GossipSub ping #912

Merged
merged 3 commits into from
Jun 21, 2023
Merged

Add GossipSub ping #912

merged 3 commits into from
Jun 21, 2023

Conversation

Menduist
Copy link
Contributor

@Menduist Menduist commented Jun 9, 2023

The gossipsub ping will be used for various things as part of the #850

Introducing it today will enable us to test said optimizations on real networks to make sure they are viable

It is capped to make sure it doesn't introduce any security issues

@codecov
Copy link

codecov bot commented Jun 9, 2023

Codecov Report

Merging #912 (3786b00) into unstable (c76d1e1) will increase coverage by 0.10%.
The diff coverage is 83.33%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##           unstable     #912      +/-   ##
============================================
+ Coverage     84.27%   84.38%   +0.10%     
============================================
  Files            91       91              
  Lines         15012    14996      -16     
============================================
+ Hits          12651    12654       +3     
+ Misses         2361     2342      -19     
Impacted Files Coverage Δ
libp2p/protocols/pubsub/pubsubpeer.nim 91.36% <ø> (+1.43%) ⬆️
libp2p/protocols/pubsub/rpc/messages.nim 40.90% <ø> (ø)
libp2p/protocols/pubsub/gossipsub.nim 86.32% <75.00%> (-0.24%) ⬇️
libp2p/protocols/pubsub/rpc/protobuf.nim 90.81% <85.71%> (-0.31%) ⬇️
libp2p/protocols/pubsub/gossipsub/behavior.nim 88.17% <100.00%> (+0.27%) ⬆️

... and 38 files with indirect coverage changes

@@ -352,6 +353,9 @@ proc validateAndRelay(g: GossipSub,
method rpcHandler*(g: GossipSub,
peer: PubSubPeer,
rpcMsg: RPCMsg) {.async.} =
if rpcMsg.ping.len in 1..<64 and peer.pingBudget > 0:
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about making 64 a const like MaxPingLengthInBytes?

@Menduist Menduist merged commit 1c4d083 into unstable Jun 21, 2023
@Menduist Menduist deleted the gsping branch June 21, 2023 08:40
diegomrsantos pushed a commit that referenced this pull request Jun 23, 2023
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.

2 participants