Filter non global ips from discovery (#3023)

## Issue Addressed

#3006 

## Proposed Changes

This PR changes the default behaviour of lighthouse to ignore discovered IPs that are not globally routable. It adds a CLI flag, --enable-local-discovery to permit the non-global IPs in discovery.

NOTE: We should take care in merging this as I will break current set-ups that rely on local IP discovery. I made this the non-default behaviour because we dont really want to be wasting resources attempting to connect to non-routable addresses and we dont want to propagate these to others (on the chance we can connect to one of these local nodes), improving discoveries efficiency.
This commit is contained in:
Age Manning
2022-03-02 03:14:27 +00:00
parent 668115a4b8
commit f3c1dde898
6 changed files with 40 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ exec lighthouse \
$SUBSCRIBE_ALL_SUBNETS \
--datadir $data_dir \
--testnet-dir $TESTNET_DIR \
--enable-private-discovery \
--staking \
--enr-address 127.0.0.1 \
--enr-udp-port $network_port \