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

P2p validation on main #3189

Closed
wants to merge 33 commits into from

Conversation

LeoHChen
Copy link
Contributor

No description provided.

Leo Chen added 29 commits July 2, 2020 05:18
Signed-off-by: Leo Chen <leo@harmony.one>

[libp2p] validate consensus message at p2p layer

Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
* restore the ticker to the original 3 seconds

Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
those messages are not errors, they won't be processed by consensus message handlers
but till be propagated to p2p network.

Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Being a bit conservative, as we have received many message on the network w/o
the prefix size. We need further dive deep into those messages.
So for now, better be conservative.

Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
[validation] increase the validation queue size

[validation] increase throttle

Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
@LeoHChen LeoHChen force-pushed the p2p_validation_on_main branch from 5859bbd to cb91ec5 Compare July 2, 2020 07:19
Signed-off-by: Leo Chen <leo@harmony.one>
@LeoHChen LeoHChen force-pushed the p2p_validation_on_main branch from 5ed0921 to 2543f58 Compare July 2, 2020 07:50
@LeoHChen LeoHChen requested review from rlan35 and JackyWYX July 2, 2020 07:56
Leo Chen added 3 commits July 2, 2020 07:57
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
Signed-off-by: Leo Chen <leo@harmony.one>
@LeoHChen
Copy link
Contributor Author

LeoHChen commented Jul 2, 2020

image

image

The CPU usage on a validator will be doubled as we do pubkey checking on every p2p messages even though validators may ignore them. This is the tradeoff to reduce the propagation of the invalid messages into the network. We can see clearly that the outgoing network traffic is lower than incoming traffic now as invalid ones are filtered out.

Copy link
Contributor

@JackyWYX JackyWYX left a comment

Choose a reason for hiding this comment

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

Great work! Will the update to protobuf in consensus message cause backward incompatibility?

consensus/checks.go Show resolved Hide resolved
node/node_handler.go Show resolved Hide resolved
@LeoHChen LeoHChen requested a review from chainum July 3, 2020 00:55
@LeoHChen
Copy link
Contributor Author

New PR rebased based on latest main branch. #3212

@LeoHChen LeoHChen closed this Jul 10, 2020
@LeoHChen LeoHChen deleted the p2p_validation_on_main branch July 16, 2020 07:45
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