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

[TOB] Clean up the list of connecting peers in case of handshake timeout #2729

Open
wants to merge 2 commits into
base: testnet3
Choose a base branch
from

Conversation

ljedrz
Copy link
Collaborator

@ljedrz ljedrz commented Oct 3, 2023

Supersedes https://github.com/AleoHQ/snarkOS/pull/2690 as a much simpler and tighter solution.

I verified that this works by manually reducing the handshake timeout to 1ms and checking the number of connecting peers in 2 nodes after a timed out handshake between them (which is non-zero in testnet3 and zero with this PR). While adding a regular test case for this would be possible, it would be quite verbose (as one of the nodes would need to use a custom handshake impl), so I didn't include one.

This change should obviate the current extra Disconnect check, but I'm leaving it in for now just to be sure we're no longer hitting it.

Finding: TOB-ALEO-22

@ljedrz ljedrz requested a review from howardwu October 3, 2023 10:31
@ljedrz ljedrz force-pushed the fix/handshake_timeout_cleanup branch from 5ba4d3c to 0942507 Compare October 11, 2023 08:34
@ljedrz
Copy link
Collaborator Author

ljedrz commented Oct 11, 2023

Rebased and applied the same fix for the Gateway.

@ljedrz ljedrz force-pushed the fix/handshake_timeout_cleanup branch from 0942507 to 39aa366 Compare November 7, 2023 09:40
@howardwu
Copy link
Contributor

It probably works but isn't a great design.

@ljedrz
Copy link
Collaborator Author

ljedrz commented Nov 10, 2023

Alternatives are difficult, because there is no high-level callsite where an inbound connection timeout can be handled; having that would break the modularity of the network stack, and would be significantly more complex than this proposal.

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.

None yet

2 participants