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

Autonat and Kademlia settings updates. #2242

Merged
merged 4 commits into from
Nov 17, 2023
Merged

Autonat and Kademlia settings updates. #2242

merged 4 commits into from
Nov 17, 2023

Conversation

shamil-gadelshin
Copy link
Contributor

This PR fixes several problems with autonat and Kademlia:

  • disable Kademlia address removal from Identify::Received event because we had two problems with it: 1)deletion was after the addition of the address and thus it could remove all the addresses, 2) removing all the addresses could remove peer from buckets and thus lose it's long-lasting position
  • introduce autonat-wrapper behaviour that catches new listen addresses and new external address candidates from swarm. We add only listen addresses comply with our enable-private-ips settings and we use only external address candidates that has similar ports as our listening ports.
  • make autonat mandatory protocol - we enable early network autonat services by bootstrap-node

Code contributor checklist:

@shamil-gadelshin shamil-gadelshin added the networking Subspace networking (DSN) label Nov 17, 2023
@shamil-gadelshin shamil-gadelshin self-assigned this Nov 17, 2023
@shamil-gadelshin shamil-gadelshin changed the title Autonat updates. Autonat and Kademlia settings updates. Nov 17, 2023
@@ -100,6 +100,8 @@ const YAMUX_BUFFER_SIZE: usize = Piece::SIZE + 1024 * 1024;

/// Max confidence for autonat protocol. Could affect Kademlia mode change.
pub(crate) const AUTONAT_MAX_CONFIDENCE: usize = 3;
/// We set a very long pause before autonat initialization.
const AUTONAT_SERVER_PROBE_DELAY: Duration = Duration::from_secs(3600 * 24 * 365);
Copy link
Member

Choose a reason for hiding this comment

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

Why not Duration::MAX?

Copy link
Member

Choose a reason for hiding this comment

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

crates/subspace-networking/src/constructor.rs Outdated Show resolved Hide resolved
@nazar-pc nazar-pc enabled auto-merge November 17, 2023 16:40
@nazar-pc nazar-pc added this pull request to the merge queue Nov 17, 2023
Merged via the queue into main with commit e9af82f Nov 17, 2023
10 checks passed
@nazar-pc nazar-pc deleted the autonat-wrapper branch November 17, 2023 20:09
@nazar-pc nazar-pc mentioned this pull request Nov 18, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
networking Subspace networking (DSN)
Projects
Development

Successfully merging this pull request may close these issues.

2 participants