Fixes to net-shaper and net.sh (#7002)

* Fixes to net-shaper and net.sh

* fixes to default filters and cleanup
This commit is contained in:
Pankaj Garg
2019-11-18 11:33:33 -08:00
committed by GitHub
parent e0a2bb9d86
commit 955aaef2e6
3 changed files with 105 additions and 33 deletions

View File

@ -61,7 +61,7 @@ Operate a configured testnet
- Override the default --hashes-per-tick for the cluster
--no-airdrop
- If set, disables airdrops. Nodes must be funded in genesis config when airdrops are disabled.
--faucet-lamports NUM_LAMPORTS_TO_MINT
--lamports NUM_LAMPORTS_TO_MINT
- Override the default 500000000000000000 lamports minted in genesis
--internal-nodes-stake-lamports NUM_LAMPORTS_PER_NODE
- Amount to stake internal nodes.
@ -88,10 +88,6 @@ Operate a configured testnet
--use-move - Build the move-loader-program and add it to the cluster
--operating-mode development|softlaunch
- Specify whether or not to launch the cluster in "development" mode with all features enabled at epoch 0,
or "softlaunch" mode with some features disabled at epoch 0 (default: development)
sanity/start-specific options:
-F - Discard validator nodes that didn't bootup successfully
-o noInstallCheck - Skip solana-install sanity
@ -172,18 +168,7 @@ while [[ -n $1 ]]; do
elif [[ $1 = --target-lamports-per-signature ]]; then
genesisOptions="$genesisOptions $1 $2"
shift 2
elif [[ $1 = --faucet-lamports ]]; then
genesisOptions="$genesisOptions $1 $2"
shift 2
elif [[ $1 = --operating-mode ]]; then
case "$2" in
development|softlaunch)
;;
*)
echo "Unexpected operating mode: \"$2\""
exit 1
;;
esac
elif [[ $1 = --lamports ]]; then
genesisOptions="$genesisOptions $1 $2"
shift 2
elif [[ $1 = --no-snapshot-fetch ]]; then
@ -860,6 +845,7 @@ deploy() {
echo "Network start logs in $netLogDir"
}
stopNode() {
local ipAddress=$1
local block=$2
@ -891,6 +877,7 @@ stopNode() {
solana/scripts/netem.sh delete < solana/netem.cfg
rm -f solana/netem.cfg
fi
solana/scripts/net-shaper.sh force_cleanup
for pattern in node solana- remote-; do
pkill -9 \$pattern
done
@ -931,6 +918,7 @@ stop() {
echo "Stopping nodes took $SECONDS seconds"
}
checkPremptibleInstances() {
# The validatorIpList nodes may be preemptible instances that can disappear at
# any time. Try to detect when a validator has been preempted to help the user
@ -1020,12 +1008,14 @@ logs)
;;
netem)
if [[ -n $netemConfigFile ]]; then
for ipAddress in "${validatorIpList[@]}"; do
"$here"/scp.sh "$netemConfigFile" solana@"$ipAddress":~/solana
done
if [[ $netemCommand = "add" ]]; then
for ipAddress in "${validatorIpList[@]}"; do
"$here"/scp.sh "$netemConfigFile" solana@"$ipAddress":~/solana
done
fi
for i in "${!validatorIpList[@]}"; do
"$here"/ssh.sh solana@"${validatorIpList[$i]}" 'solana/scripts/net-shaper.sh' \
"$netemCommand" solana/"$netemConfigFile" "${#validatorIpList[@]}" "$i"
"$netemCommand" ~solana/solana/"$netemConfigFile" "${#validatorIpList[@]}" "$i"
done
else
num_nodes=$((${#validatorIpList[@]}*netemPartition/100))