diff --git a/beacon_node/eth2_libp2p/src/discovery/enr.rs b/beacon_node/eth2_libp2p/src/discovery/enr.rs index ffe671dcf..06e1ff5b9 100644 --- a/beacon_node/eth2_libp2p/src/discovery/enr.rs +++ b/beacon_node/eth2_libp2p/src/discovery/enr.rs @@ -120,7 +120,10 @@ pub fn build_or_load_enr( Ok(local_enr) } -pub fn create_enr_builder_from_config(config: &NetworkConfig) -> EnrBuilder { +pub fn create_enr_builder_from_config( + config: &NetworkConfig, + enable_tcp: bool, +) -> EnrBuilder { let mut builder = EnrBuilder::new("v4"); if let Some(enr_address) = config.enr_address { builder.ip(enr_address); @@ -129,8 +132,10 @@ pub fn create_enr_builder_from_config(config: &NetworkConfig) -> EnrB builder.udp(udp_port); } // we always give it our listening tcp port - let tcp_port = config.enr_tcp_port.unwrap_or_else(|| config.libp2p_port); - builder.tcp(tcp_port).tcp(config.libp2p_port); + if enable_tcp { + let tcp_port = config.enr_tcp_port.unwrap_or_else(|| config.libp2p_port); + builder.tcp(tcp_port); + } builder } @@ -140,7 +145,7 @@ pub fn build_enr( config: &NetworkConfig, enr_fork_id: EnrForkId, ) -> Result { - let mut builder = create_enr_builder_from_config(config); + let mut builder = create_enr_builder_from_config(config, true); // set the `eth2` field on our ENR builder.add_value(ETH2_ENR_KEY, &enr_fork_id.as_ssz_bytes()); diff --git a/boot_node/src/config.rs b/boot_node/src/config.rs index 6ce182048..ec89b4e14 100644 --- a/boot_node/src/config.rs +++ b/boot_node/src/config.rs @@ -79,7 +79,7 @@ impl TryFrom<&ArgMatches<'_>> for BootNodeConfig { let private_key = load_private_key(&network_config, &logger); let local_key = CombinedKey::from_libp2p(&private_key)?; - let mut local_enr = create_enr_builder_from_config(&network_config) + let mut local_enr = create_enr_builder_from_config(&network_config, false) .build(&local_key) .map_err(|e| format!("Failed to build ENR: {:?}", e))?; diff --git a/common/eth2_testnet_config/built_in_testnet_configs/mainnet/boot_enr.yaml b/common/eth2_testnet_config/built_in_testnet_configs/mainnet/boot_enr.yaml index a7774afda..9d4d090b6 100644 --- a/common/eth2_testnet_config/built_in_testnet_configs/mainnet/boot_enr.yaml +++ b/common/eth2_testnet_config/built_in_testnet_configs/mainnet/boot_enr.yaml @@ -1,6 +1,6 @@ # Lighthouse Team (Sigma Prime) -- enr:-Iu4QA1Cki3nwtymCmsx3KWt20ZdKrmljLl_5gfItvL5w6idfl7Nr5ysHQyNS7CxO5bbbB997nYDlb_47pZ3CAOvbxoBgmlkgnY0gmlwhAMaHiCJc2VjcDI1NmsxoQJIdpj_foZ02MXz4It8xKD7yUHTBx7lVFn3oeRP21KRV4N0Y3CCIyiDdWRwgiMo -- enr:-Iu4QFEg1KXis_wX0vRwBcv_vGzbcifwLE_rFqqQRMxT3c0kAMVtbbAW2U7LcPIIKmzPfpVFRG0M4C457dmkKgzYEpkBgmlkgnY0gmlwhCLzAHqJc2VjcDI1NmsxoQLQSJfEAHZApkm5edTCZ_4qps_1k_ub2CxHFxi-gr2JMIN0Y3CCIyiDdWRwgiMo +- enr:-IS4QLkKqDMy_ExrpOEWa59NiClemOnor-krjp4qoeZwIw2QduPC-q7Kz4u1IOWf3DDbdxqQIgC4fejavBOuUPy-HE4BgmlkgnY0gmlwhCLzAHqJc2VjcDI1NmsxoQLQSJfEAHZApkm5edTCZ_4qps_1k_ub2CxHFxi-gr2JMIN1ZHCCIyg +- enr:-IS4QDAyibHCzYZmIYZCjXwU9BqpotWmv2BsFlIq1V31BwDDMJPFEbox1ijT5c2Ou3kvieOKejxuaCqIcjxBjJ_3j_cBgmlkgnY0gmlwhAMaHiCJc2VjcDI1NmsxoQJIdpj_foZ02MXz4It8xKD7yUHTBx7lVFn3oeRP21KRV4N1ZHCCIyg # Teku team (Consensys) - enr:-KG4QOtcP9X1FbIMOe17QNMKqDxCpm14jcX5tiOE4_TyMrFqbmhPZHK_ZPG2Gxb1GE2xdtodOfx9-cgvNtxnRyHEmC0ghGV0aDKQ9aX9QgAAAAD__________4JpZIJ2NIJpcIQDE8KdiXNlY3AyNTZrMaEDhpehBDbZjM_L9ek699Y7vhUJ-eAdMyQW_Fil522Y0fODdGNwgiMog3VkcIIjKA # Prysm team (Prysmatic Labs)