Skip to content

Commit 24c412a

Browse files
authored
clients/teku-bn: Add rate limit parameters (#899)
* clients/teku: Add rate limit parameters * clients/teku-bn: Use hive variable for peer scoring parameters
1 parent 7461be6 commit 24c412a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

clients/teku-bn/teku_bn.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ enr_option=$([[ "$HIVE_ETH2_BOOTNODE_ENRS" == "" ]] && echo "" || echo --p2p-dis
5151
static_option=$([[ "$HIVE_ETH2_STATIC_PEERS" == "" ]] && echo "" || echo --p2p-static-peers="$HIVE_ETH2_STATIC_PEERS")
5252
opt_sync_option=$([[ "$HIVE_ETH2_SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY" == "" ]] && echo "" || echo "--Xnetwork-safe-slots-to-import-optimistically=$HIVE_ETH2_SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY")
5353
builder_option=$([[ "$HIVE_ETH2_BUILDER_ENDPOINT" == "" ]] && echo "" || echo "--validators-builder-registration-default-enabled=true --validators-proposer-blinded-blocks-enabled=true --builder-endpoint=$HIVE_ETH2_BUILDER_ENDPOINT")
54+
peer_score_option=$([[ "$HIVE_ETH2_DISABLE_PEER_SCORING" == "" ]] && echo "" || echo "--Xp2p-gossip-scoring-enabled=false --Xpeer-rate-limit=100000 --Xpeer-request-limit=1000")
5455

5556
if [ "$HIVE_ETH2_MERGE_ENABLED" != "" ]; then
5657
echo -n "0x7365637265747365637265747365637265747365637265747365637265747365" > /jwtsecret
@@ -62,18 +63,21 @@ echo Starting Teku Beacon Node
6263
/opt/teku/bin/teku \
6364
--network=/data/testnet_setup/config.yaml \
6465
--data-path=/data/teku \
66+
--data-storage-mode=ARCHIVE \
6567
--initial-state=/data/testnet_setup/genesis.ssz \
6668
--eth1-deposit-contract-address="${HIVE_ETH2_CONFIG_DEPOSIT_CONTRACT_ADDRESS:-0x1111111111111111111111111111111111111111}" \
6769
--log-destination console \
6870
--logging="$LOG" \
69-
$metrics_option $eth1_option $merge_option $enr_option $static_option $opt_sync_option $builder_option \
71+
$metrics_option $eth1_option $merge_option $enr_option $static_option $opt_sync_option $builder_option $peer_score_option \
7072
--validators-proposer-default-fee-recipient="0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" \
7173
--p2p-port="${HIVE_ETH2_P2P_TCP_PORT:-9000}" \
7274
--p2p-udp-port="${HIVE_ETH2_P2P_UDP_PORT:-9000}" \
7375
--p2p-advertised-ip="${CONTAINER_IP}" \
7476
--p2p-peer-lower-bound="${HIVE_ETH2_P2P_TARGET_PEERS:-10}" \
75-
--rest-api-enabled=true --rest-api-interface=0.0.0.0 --rest-api-port="${HIVE_ETH2_BN_API_PORT:-4000}" --rest-api-host-allowlist="*" \
76-
--data-storage-mode=ARCHIVE \
77-
--Xstartup-target-peer-count=0 \
7877
--p2p-subscribe-all-subnets-enabled \
78+
--rest-api-enabled=true \
79+
--rest-api-interface=0.0.0.0 \
80+
--rest-api-port="${HIVE_ETH2_BN_API_PORT:-4000}" \
81+
--rest-api-host-allowlist="*" \
82+
--Xstartup-target-peer-count=0 \
7983
--Xtrusted-setup="$trusted_setup_path"

0 commit comments

Comments
 (0)