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

fix bug: connection with DirInbound may not have addresses in Peerstore. #316

Merged
merged 5 commits into from
Sep 18, 2024

Conversation

ping-ke
Copy link
Contributor

@ping-ke ping-ke commented Sep 9, 2024

Connection is filtered out when n.host.Peerstore().Addrs(remotePeerId)) == 0. which is added to fix issue https://github.com/ethstorage/go-ethstorage/issues/72. (related PR: https://github.com/ethstorage/go-ethstorage/pull/91)
However, this fix will additionally filter out some connections that should not be ignored. For example, if a connection is coming in connection (Direction == DirInbound), its address may not have been added to Peerstore yet, at this time, the incoming connection would be ignored. The following are the connections shown when stopping the es-node, but only 29 of them are added to the syncclient.
1726309045211

How to Fix
To ignore the connection without disconnecting which is caused by NAT, this can be done after we get the shard list failure.

After the change, we will get the following error for that case (temporary change its log level from debug to warning to make it more obvious)
1726309105860

Running the change on Sepolia test net before and after the change for 10 minutes, and the connected connections increase from 29 to 40.
Before change:
1726309045197
After change:
1726309045113

ethstorage/p2p/node.go Outdated Show resolved Hide resolved
@ping-ke ping-ke marked this pull request as draft September 11, 2024 11:04
@ping-ke ping-ke marked this pull request as ready for review September 14, 2024 10:31
@ping-ke ping-ke merged commit 73b8627 into main Sep 18, 2024
2 checks passed
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.

3 participants