-
Notifications
You must be signed in to change notification settings - Fork 236
feat: add a hole punching protocol try use on nat traversal #4873
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
base: develop
Are you sure you want to change the base?
Conversation
f46b1e0
to
f246fdd
Compare
c45b12b
to
d4e1331
Compare
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.
Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- util/gen-types/schemas/protocols.mol: Language not supported
fdbac35
to
fc57269
Compare
ac72347
to
e79b248
Compare
9a32af6
to
344d4b0
Compare
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.
Pull Request Overview
This PR introduces a new TCP hole punching protocol for improved NAT traversal, while removing legacy dialing behavior.
- Adds a “HolePunching” support protocol in config files and network modules.
- Implements protocol components for connection requests, delivered messages, sync messages, and NAT traversal logic.
- Adjusts peer store and network service handling to integrate the new protocol.
Reviewed Changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
util/app-config/src/configs/network.rs | Adds HolePunching enum variant and updates defaults. |
resource/ckb.toml | Appends HolePunching to supported protocols list. |
network/src/services/outbound_peer.rs | Removes legacy try_dial_observed behavior. |
network/src/protocols/support_protocols.rs | Adds protocol string and port for HolePunching. |
network/src/protocols/{identify,mod.rs,hole_punching/*} | Implements and integrates new HolePunching protocol. |
network/src/peer_store/peer_store_impl.rs | Introduces fetch_nat_addrs and updates observed address logic. |
network/src/network.rs | Integrates new HolePunching protocol into network service. |
Files not reviewed (1)
- util/gen-types/schemas/protocols.mol: Language not supported
Comments suppressed due to low confidence (2)
network/src/protocols/hole_punching/component/connection_request.rs:186
- The function name 'forword_request' appears to be a typo. Consider renaming it to 'forward_request' to improve clarity.
let content = forword_request(self.message, self_peer_id);
network/src/protocols/hole_punching/component/connection_sync.rs:71
- The function name 'forword_sync' is likely misspelled; renaming it to 'forward_sync' would better reflect its purpose.
let content = forword_sync(self.message);
344d4b0
to
cbe4c7d
Compare
2c1acf7
to
b089e28
Compare
What problem does this PR solve?
close #4824 #4766
This PR introduces a protocol to coordinate node connection behavior, attempting to perform TCP traversal through coordination:
try dial observe address
behavior.to
object is itself, it returns a Delivered message.to
object is not itself, it broadcasts the route and ttl modified.from
object is itself, it starts a TCP connection request and responds with a Sync messagefrom
object is not itself, it modifies the route and ttl and propagates the message to the next router object.to
object is itself, it starts a TCP connection request.to
object is not itself, it propagates the message to the next router object.Check List
Tests
Release note