diff --git a/beacon_chain/conf.nim b/beacon_chain/conf.nim index 27dc84c74..37e5b69db 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 51b63ff73..f5228ade0 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 ae79b38fa..5787ad9a0 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 224f92e17..f80ce3133 160000 --- a/vendor/nim-libp2p +++ b/vendor/nim-libp2p @@ -1 +1 @@ -Subproject commit 224f92e17251464984d6906316c54d2e1108ae43 +Subproject commit f80ce3133c1d75b3d18d1d1766a58121d8999abd