Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nat hole punching for discv5.2 (#176)
* Plug-in hole punching * Notification message container * Plug relaying into service * Move hole punch trait to extern crate * Adjust impl of hole punch trait * fixup! Plug relaying into service * fixup! Plug-in hole punching * Update trait impl * Consolidate hole punching in Handler * fixup! Consolidate hole punching in Handler * fixup! Consolidate hole punching in Handler * Add trace info * fixup! Consolidate hole punching in Handler * Reinsert active request on hole punch attempt * Update node address conversion * RO access kbuckets from handler for hole punch target peer lookup * Replace RO access to kbuckets with channels * Add trace messages * fixup! Add trace messages * Handle each realy init separately * Receive responses in notification packets * Reset renaming of packet kind * Send responses in notification * fixup! Reset renaming of packet kind * fixup! Reinsert active request on hole punch attempt * Plug in mechanism for keeping hole punched for peer * Only give work of keeping hole punched to nodes that aren't WAN reachable * fixup! Only give work of keeping hole punched to nodes that aren't WAN reachable * Correct comment * Include nodes that discover reachable address earlier in small networks * fixup! Include nodes that discover reachable address earlier in small networks * Limit sessions with unreachable enrs * Set limit for sessions with peers with unreachable ENRs in config * Allow unlimited sessions with unreachable ENRs like in discv5.0 * Clean up fs * Update naming to match wire * Lint fixes * Doc links fix * Bug fix * Log messages fixes * Updates from nat hole punch crate * fixup! Updates from nat hole punch crate * Incorporate notification * notif sep * Incorporate notification from nat_hole_punch crate * Move hole punch trait from nat_hole_punch crate into crate * fixup! Move hole punch trait from nat_hole_punch crate into crate * Make log message more human readbable * Clean up * Stop punching holes for disconnected peers * Fix session limiter constructor bug to not write to logs on no limit and add limiter test * Fix wrong comments on message types and collect message types * Check for unused deps in CI (#1262) * Check for unused deps in CI * Bump slashing protection parking_lot version * Cherry-pick 6ee4f7f * Update github CI to latest version * Remove unused dependencies * Remove unused varaiable assignment * Restore and improve config comments * Use derive From macro * fixup! Restore and improve config comments * Restore drive-by commit to master * Return earlier from enr unreachable check * Replace parse display with dep used in lighthouse * Safeguard with const evaluation * Fix typo Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com> * Mark unreachable code * Allow assertions on constants * Fix clippy warnings * fixup! Allow assertions on constants * fixup! Return earlier from enr unreachable check * fixup! Fix session limiter constructor bug to not write to logs on no limit and add limiter test * fixup! Return earlier from enr unreachable check * Shorten debug message * Correct comment correction * Revert symbol * Nitpick Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com> * Clarify comment * Reinsert Cargo.lock in gitignore * Fix curly brace bug * remove lockfile * reduce diff * clippy * Fix typo Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com> * Check limit in config instead * Restore comment * Simplify docs * Drop notification already at service layer * Improve rust idiomacy * fixup! Drop notification already at service layer * Nitpick * Remove hole punch trait * Simplify bind Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com> * Expose unused ports range parameter in config * Fix typo Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com> * Fix ci for ipv6 tests * Name consistently with specs Co-authored-by: Age Manning <Age@AgeManning.com> * Fix typo Co-authored-by: Age Manning <Age@AgeManning.com> * Only track outgoing packets if node is behind nat * Only process relay messages if we are behind a nat * Catch malicious relay init * Clear hole punch tracker set for remaining entries * Run lint * Introduce bound on relay store * Remove redundant parameter * Keep session but drop packet that could be spoofed * Add debug info * Revert layout of hole punch code to use trait * Fix backwards compatibility of packet type Message * Remove duplicate guard * Use lru time cach for tracking sent packages * Adjust visibility, handler not alone-standing crate * Add signature for using session limiter on cache insert * Only send expired entries on channel * Remove duplicate code * Move assertion on constant outside of function * no unreachables in session enr * Avoid breaking change to lru time cache api * Change name 'session index' to name of session index type * Update docs * Update comment Co-authored-by: Kolby Moroz Liebl <31669092+KolbyML@users.noreply.github.com> * fixup! Update docs * Lint fixes * Lint fixes * fixup! Lint fixes * Fix docs * Tweak incorporation of SessionLimiter * Avoid clone * Lint fixes * Enable ipv6 tests * fixup! Fix merge conflicts with discv5.2 * fixup! Enable ipv6 tests * Fix test parallelisation * Add relay test for handler * Drive-by, fix param name * Drive-by, clean up test * Fix handler test parallelisation * Skip unnecessary interaction with service task * Add test for target * Remove unnecessary memory re-allocation for sessions cache * Reset previous commit * Improve type safety for notifications * Reset commit b32e750 and check sequence of initiator's enr against kbucket entry * Refactor initiator abbreviation * Trigger ping all peers on upgrade to reachable enr * Modify session management to inside the lrutimecache * Add reviewers comments * Simplify the code, name changes group handler API * Old mate fmt * Fix bug broken invariant active-requests and hole punch attempts * Update src/handler/mod.rs Co-authored-by: Emilia Hane <emiliaha95@gmail.com> * Update src/service.rs Co-authored-by: Emilia Hane <emiliaha95@gmail.com> * Update src/handler/mod.rs Co-authored-by: Emilia Hane <emiliaha95@gmail.com> * Complete the renaming * Fmt --------- Co-authored-by: Emilia Hane <emilia.hane@ethereum.org> Co-authored-by: Michael Sproul <michael@sigmaprime.io> Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com> Co-authored-by: Diva M <divma@protonmail.com> Co-authored-by: Age Manning <Age@AgeManning.com> Co-authored-by: Kolby Moroz Liebl <31669092+KolbyML@users.noreply.github.com>
- Loading branch information