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

[libp2p/consensus] p2p spamming defense #3212

Merged
merged 2 commits into from
Jul 15, 2020

Conversation

LeoHChen
Copy link
Contributor

This is a big PR merged many small commits together.
We add the message validation function in libp2p layer.

In the validation function, we check the following conditions

  1. the p2p message is a valid consensus message
  2. the p2p message sender has a valid public key
  3. the sender's public key is in the current committee
  4. log the number of invalid/valid messages

After the validation, the valid messages will be forward to the network,
while the invalid messages will be filtered out.

The messages intended for the validator will be handled in the consensus layer.

@LeoHChen LeoHChen mentioned this pull request Jul 10, 2020
@LeoHChen LeoHChen force-pushed the p2p_spam_defense branch 5 times, most recently from 7256c5d to f57f3d7 Compare July 10, 2020 08:50
@LeoHChen LeoHChen requested a review from chainum July 10, 2020 08:51
@rlan35 rlan35 requested review from rlan35 and JackyWYX July 10, 2020 17:43
@LeoHChen
Copy link
Contributor Author

any more comments, @JackyWYX , @sebastianj , @rlan35 ?

@LeoHChen
Copy link
Contributor Author

It's basically rebasing the old code on top of main branch, especially after the blskey wrapper changes.

node/node.go Outdated Show resolved Hide resolved
@rlan35
Copy link
Contributor

rlan35 commented Jul 14, 2020

Note: This PR contains the rebasement of the code from #3114, which already acknowledged the original author of the code.

@LeoHChen LeoHChen force-pushed the p2p_spam_defense branch 2 times, most recently from 5e2a3a0 to b19dfaf Compare July 15, 2020 09:04
This is a big PR merged many small commits together.
We add the message validation function in libp2p layer.

In the validation function, we check the following conditions
1) the p2p message is a valid consensus message
2) the p2p message sender has a valid public key
3) the sender's public key is in the current committee
4) log the number of invalid/valid messages

After the validation, the valid messages will be forward to the network,
while the invalid messages will be filtered out.

The messages intended for the validator will be handled in the consensus layer.

Signed-off-by: Leo Chen <leo@harmony.one>
restore the original grace period function

Signed-off-by: Leo Chen <leo@harmony.one>
@LeoHChen LeoHChen merged commit 0435e2d into harmony-one:main Jul 15, 2020
@LeoHChen LeoHChen deleted the p2p_spam_defense branch July 15, 2020 10:50
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