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 libp2p connection Firewall #2478
Conversation
I definitely like this approach so we can control the settings we need in Teku. Have tested it out and syncing blocks works with a local network. I tried with a throttled connection and did start getting disconnections but it seems pretty reasonable given I throttled the server since it was conveniently in a docker container and it had 35 other peers on just a 256kbit connection. When the peer was disconnected through we got an error logged in the server which we should probably find a way to handle cleanly:
I'm also going to look into adjusting Teku so that it actually uses the returned future when writing requested blocks - currently it just sends them as fast as it can but should actually pay attention to when the response stream becomes unwritable and delay loading the next block to send. |
I'm not seeing any disconnections with a reasonably 1024Kbit upload limit on the serving node so I'd say these are workable starting values and we don't need to wait for the change I mentioned about waiting for blocks to finish writing. I think we should fix the error message before merging this though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reran the test and confirmed we don't log errors when disconnecting which is great.
LGTM.
PR Description
Add a Libp2p
Firewall
class as a first line handler for everyConnection
. Incorporate @ajsutton tweaks he made in this PR: libp2p/jvm-libp2p#127Documentation
documentation
label to this PR if updates are required.