diff --git a/beacon_chain/conf.nim b/beacon_chain/conf.nim index 27dc84c74e..37e5b69dbf 100644 --- a/beacon_chain/conf.nim +++ b/beacon_chain/conf.nim @@ -623,6 +623,11 @@ type desc: "Experimental, debug option; could disappear at any time without warning" name: "temporary-debug-trusted-setup-file" .}: Option[string] + bandwidthEstimate* {. + hidden + desc: "Bandwidth estimate for the node (bits per second)" + name: "debug-bandwidth-estimate" .}: Option[Natural] + of BNStartUpCmd.wallets: case walletsCmd* {.command.}: WalletsCmd of WalletsCmd.create: diff --git a/beacon_chain/conf_light_client.nim b/beacon_chain/conf_light_client.nim index 51b63ff73a..f5228ade02 100644 --- a/beacon_chain/conf_light_client.nim +++ b/beacon_chain/conf_light_client.nim @@ -145,6 +145,11 @@ type LightClientConf* = object desc: "A file containing the hex-encoded 256 bit secret key to be used for verifying/generating JWT tokens" name: "jwt-secret" .}: Option[InputFile] + bandwidthEstimate* {. + hidden + desc: "Bandwidth estimate for the node (bits per second)" + name: "debug-bandwidth-estimate" .}: Option[Natural] + # Testing stopAtEpoch* {. hidden diff --git a/beacon_chain/networking/eth2_network.nim b/beacon_chain/networking/eth2_network.nim index 1e3cb63592..3eff4bfc9e 100644 --- a/beacon_chain/networking/eth2_network.nim +++ b/beacon_chain/networking/eth2_network.nim @@ -2385,6 +2385,8 @@ proc createEth2Node*(rng: ref HmacDrbgContext, res.mgetOrPut(peerId, @[]).add(maddress) info "Adding priviledged direct peer", peerId, address = maddress res + , + bandwidthEstimatebps: config.bandwidthEstimate.get(100_000_000) ) pubsub = GossipSub.init( switch = switch, diff --git a/vendor/nim-libp2p b/vendor/nim-libp2p index 224f92e172..f80ce3133c 160000 --- a/vendor/nim-libp2p +++ b/vendor/nim-libp2p @@ -1 +1 @@ -Subproject commit 224f92e17251464984d6906316c54d2e1108ae43 +Subproject commit f80ce3133c1d75b3d18d1d1766a58121d8999abd