forked from jl777/SuperNET
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored seednode loop to tokio and async. (#631)
* Exclude mm2-seednodes-optimisation from CI triggers. * Count the number of sent messages and their total size in seednode loop. * Add max_msg_size to seednode_loop metrics. * Log send buffer size when electrum client is connected. * Log send buffer size for seednode listener and every connected client TcpStream. * Log nodelay value of TcpListener and every TcpStream. * Try to set nodelay = true. * Try to set_send_buffer_size to 200000. * Try to refactor seednode_loop to async_std. * Recv messages only and log them. * Drop connection if EOF reached. * Enable rebroadcast back. * Log message send attempts. * Try to increase channel capacity. * Use vec of mpsc senders instead of async_std mpmc. * Remove excessive logging. * Log the invalid JSON message and it's sender. * Skip lines that are not valid JSON. * Log JSON deserialize error only when buffer.len() > 1. * Try tokio TCP implementation instead of async_std. * Log the case when buffer can be probably lost. * Split incoming connections TcpStreams and process them in separate async loops. * Do not send message back to peer from which it was received. * Remove excessive logging. * Enable CI build for this branch back. * Try to spawn read and write processing loops on tokio 0.2 runtime. * Use String as P2PMessage content to avoid non-deterministic serialization issues. The deserialized and then serialized message might produce non-equal string so same message can be serialized to JSON differently causing double processing on client nodes connected to several seeds. * Explicitly disable debug_assertions for release profile. * Update tokio to 0.2.22. * Fix after merge.
- Loading branch information
1 parent
e51a128
commit 8c2bf3f
Showing
11 changed files
with
211 additions
and
161 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.