Change some Fluffy related cli defaults (#1833)

This commit is contained in:
Kim De Mey 2023-10-20 14:30:21 +02:00 committed by GitHub
parent 436ef0e40e
commit b7d0b06e79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 15 deletions

View File

@ -295,4 +295,4 @@ jobs:
- name: Run fluffy testnet - name: Run fluffy testnet
run: | run: |
./fluffy/scripts/launch_local_testnet.sh ./fluffy/scripts/launch_local_testnet.sh --run-tests

View File

@ -43,8 +43,12 @@ const
defaultStorageSize* = uint32(1000 * 1000 * 100) defaultStorageSize* = uint32(1000 * 1000 * 100)
defaultStorageSizeDesc* = $defaultStorageSize defaultStorageSizeDesc* = $defaultStorageSize
defaultTableIpLimitDesc* = $DefaultTableIpLimit defaultTableIpLimitDesc* =
defaultBucketIpLimitDesc* = $DefaultBucketIpLimit $defaultPortalProtocolConfig.tableIpLimits.tableIpLimit
defaultBucketIpLimitDesc* =
$defaultPortalProtocolConfig.tableIpLimits.bucketIpLimit
defaultBitsPerHopDesc* =
$defaultPortalProtocolConfig.bitsPerHop
type type
TrustedDigest* = MDigest[32 * 8] TrustedDigest* = MDigest[32 * 8]
@ -180,25 +184,28 @@ type
name: "proxy-uri" .}: ClientConfig name: "proxy-uri" .}: ClientConfig
tableIpLimit* {. tableIpLimit* {.
hidden
desc: "Maximum amount of nodes with the same IP in the routing table. " & desc: "Maximum amount of nodes with the same IP in the routing table. " &
"This option is currently required as many nodes are running from " & "This option is currently required as many nodes are running from " &
"the same machines. The option will be removed/adjusted in the future" "the same machines. The option will be removed/adjusted in the future"
defaultValue: DefaultTableIpLimit defaultValue: defaultPortalProtocolConfig.tableIpLimits.tableIpLimit
defaultValueDesc: $defaultTableIpLimitDesc defaultValueDesc: $defaultTableIpLimitDesc
name: "table-ip-limit" .}: uint name: "table-ip-limit" .}: uint
bucketIpLimit* {. bucketIpLimit* {.
hidden
desc: "Maximum amount of nodes with the same IP in the routing table's buckets. " & desc: "Maximum amount of nodes with the same IP in the routing table's buckets. " &
"This option is currently required as many nodes are running from " & "This option is currently required as many nodes are running from " &
"the same machines. The option will be removed/adjusted in the future" "the same machines. The option will be removed/adjusted in the future"
defaultValue: DefaultBucketIpLimit defaultValue: defaultPortalProtocolConfig.tableIpLimits.bucketIpLimit
defaultValueDesc: $defaultBucketIpLimitDesc defaultValueDesc: $defaultBucketIpLimitDesc
name: "bucket-ip-limit" .}: uint name: "bucket-ip-limit" .}: uint
bitsPerHop* {. bitsPerHop* {.
hidden hidden
desc: "Kademlia's b variable, increase for less hops per lookup" desc: "Kademlia's b variable, increase for less hops per lookup"
defaultValue: DefaultBitsPerHop defaultValue: defaultPortalProtocolConfig.bitsPerHop
defaultValueDesc: $defaultBitsPerHopDesc
name: "bits-per-hop" .}: int name: "bits-per-hop" .}: int
radiusConfig* {. radiusConfig* {.

View File

@ -38,7 +38,12 @@ const
revalidationTimeout* = chronos.seconds(30) revalidationTimeout* = chronos.seconds(30)
defaultPortalProtocolConfig* = PortalProtocolConfig( defaultPortalProtocolConfig* = PortalProtocolConfig(
tableIpLimits: DefaultTableIpLimits, # TODO / IMPORTANT NOTE:
# This must be set back to `DefaultTableIpLimits` as soon as there are
# enough nodes in the Portal network that we don't need to rely on the
# Fluffy fleet. Currently, during development, convenience is taken above
# security, this must not remain.
tableIpLimits: TableIpLimits(tableIpLimit: 32, bucketIpLimit: 16),
bitsPerHop: DefaultBitsPerHop, bitsPerHop: DefaultBitsPerHop,
radiusConfig: defaultRadiusConfig radiusConfig: defaultRadiusConfig
) )

View File

@ -34,12 +34,12 @@ if [ ${PIPESTATUS[0]} != 4 ]; then
fi fi
OPTS="h:n:d" OPTS="h:n:d"
LONGOPTS="help,nodes:,data-dir:,enable-htop,log-level:,base-port:,base-rpc-port:,trusted-block-root:,beacon-chain-bridge,base-metrics-port:,reuse-existing-data-dir,timeout:,kill-old-processes" LONGOPTS="help,nodes:,data-dir:,run-tests,log-level:,base-port:,base-rpc-port:,trusted-block-root:,beacon-chain-bridge,base-metrics-port:,reuse-existing-data-dir,timeout:,kill-old-processes"
# default values # default values
NUM_NODES="64" NUM_NODES="64"
DATA_DIR="local_testnet_data" DATA_DIR="local_testnet_data"
USE_HTOP="0" RUN_TESTS="0"
LOG_LEVEL="INFO" LOG_LEVEL="INFO"
BASE_PORT="9000" BASE_PORT="9000"
BASE_METRICS_PORT="8008" BASE_METRICS_PORT="8008"
@ -66,7 +66,7 @@ E.g.: $(basename "$0") --nodes ${NUM_NODES} --data-dir "${DATA_DIR}" # defaults
--base-metrics-port bootstrap node's metrics server port (default: ${BASE_METRICS_PORT}) --base-metrics-port bootstrap node's metrics server port (default: ${BASE_METRICS_PORT})
--beacon-chain-bridge run a beacon chain bridge attached to the bootstrap node --beacon-chain-bridge run a beacon chain bridge attached to the bootstrap node
--trusted-block-root recent trusted finalized block root to initialize the consensus light client from --trusted-block-root recent trusted finalized block root to initialize the consensus light client from
--enable-htop use "htop" to see the fluffy processes without doing any tests --run-tests when enabled run tests else use "htop" to see the fluffy processes without doing any tests
--log-level set the log level (default: ${LOG_LEVEL}) --log-level set the log level (default: ${LOG_LEVEL})
--reuse-existing-data-dir instead of deleting and recreating the data dir, keep it and reuse everything we can from it --reuse-existing-data-dir instead of deleting and recreating the data dir, keep it and reuse everything we can from it
--timeout timeout in seconds (default: ${TIMEOUT_DURATION} - no timeout) --timeout timeout in seconds (default: ${TIMEOUT_DURATION} - no timeout)
@ -96,8 +96,8 @@ while true; do
DATA_DIR="$2" DATA_DIR="$2"
shift 2 shift 2
;; ;;
--enable-htop) --run-tests)
USE_HTOP="1" RUN_TESTS="1"
shift shift
;; ;;
--log-level) --log-level)
@ -199,9 +199,12 @@ BINARIES="fluffy"
if [[ "${BEACON_CHAIN_BRIDGE}" == "1" ]]; then if [[ "${BEACON_CHAIN_BRIDGE}" == "1" ]]; then
BINARIES="${BINARIES} beacon_chain_bridge" BINARIES="${BINARIES} beacon_chain_bridge"
fi fi
TEST_BINARIES="test_portal_testnet"
$MAKE -j ${NPROC} LOG_LEVEL=TRACE ${BINARIES} $MAKE -j ${NPROC} LOG_LEVEL=TRACE ${BINARIES}
$MAKE -j ${NPROC} LOG_LEVEL=INFO ${TEST_BINARIES}
if [[ "$RUN_TESTS" == "1" ]]; then
TEST_BINARIES="test_portal_testnet"
$MAKE -j ${NPROC} LOG_LEVEL=INFO ${TEST_BINARIES}
fi
# Kill child processes on Ctrl-C/SIGTERM/exit, passing the PID of this shell # Kill child processes on Ctrl-C/SIGTERM/exit, passing the PID of this shell
# instance as the parent and the target process name as a pattern to the # instance as the parent and the target process name as a pattern to the
@ -351,7 +354,7 @@ if [[ "$BG_JOBS" != "$NUM_JOBS" ]]; then
fi fi
# launch htop and run until `TIMEOUT_DURATION` or check the nodes and quit. # launch htop and run until `TIMEOUT_DURATION` or check the nodes and quit.
if [[ "$USE_HTOP" == "1" ]]; then if [[ "$RUN_TESTS" == "0" ]]; then
htop -p "$PIDS" htop -p "$PIDS"
cleanup cleanup
else else