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

gs1.1: feat: add invalid message spam protection #113

Merged
merged 1 commit into from
Jul 22, 2020

Conversation

wemeetagain
Copy link
Member

Implements https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.1.md#spam-protection-measures final bullet point

Following the resolution to #105 , we now have a "reason" to reject messages.
This is a slight refactor of PeerScore#rejectMessage and IWantTracer#rejectMessage to align with go-libp2p-pubsub behavior.

  • rejectMessage now accepts reason parameter
  • PeerScore#ignoreMessage removed in favor of reusing rejectMessage

@codecov-commenter
Copy link

codecov-commenter commented Jul 21, 2020

Codecov Report

Merging #113 into gsv1.1 will increase coverage by 0.44%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           gsv1.1     #113      +/-   ##
==========================================
+ Coverage   75.93%   76.37%   +0.44%     
==========================================
  Files          22       22              
  Lines        1342     1346       +4     
==========================================
+ Hits         1019     1028       +9     
+ Misses        323      318       -5     
Impacted Files Coverage Δ
src/tracer.js 100.00% <0.00%> (ø)
src/constants.js 100.00% <0.00%> (ø)
src/index.js 68.57% <0.00%> (+0.31%) ⬆️
src/score/peerScore.js 81.89% <0.00%> (+1.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89bf606...27fe567. Read the comment docs.

@wemeetagain wemeetagain merged commit c51f157 into gsv1.1 Jul 22, 2020
@wemeetagain wemeetagain deleted the cayman/gs1.1-spam-protection branch July 22, 2020 15:37
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