Nat hole punching for discv5.2#176
Conversation
@jxs nice that you want to get involved. perhaps this is smthg you could dig into? |
Co-authored-by: Emilia Hane <emiliaha95@gmail.com>
Co-authored-by: Emilia Hane <emiliaha95@gmail.com>
Co-authored-by: Emilia Hane <emiliaha95@gmail.com>
Further Review - Simplification of some code
AgeManning
left a comment
There was a problem hiding this comment.
I think we've got this to a state that is clean and workable.
I think there is more machinery around ENR support for NATs, self-identification and backwards compatibility to work on. But these can be separated as future PRs.
This work should be used as a base for the 5.2 upgrade, imo.
Closes #133. This implements a new protocol with the same goal as the rendezvous protocol outlined as draft in the issue, that is to hole punch NATs, but with a different method. The protocol is tailored with more precision after discv5's design to remove identified attack vector's that the rendezvous protocol introduced like the 2-for-1 message triggering and adding mechanisms to make NAT hole punching produce almost only necessary overhead for the network at whole by taking parameters like connectivity between relays and targets into account, for example that as the time an initiator stores a relay to a target increases, the connectivity guarantee between that relay and the target decreases. The new discv5.2 spec contains the new hole punching protocol and the rationale is still in review.
Testing with my discv5-cli fork.