Skip to content

Commit

Permalink
use staked connection for bench-tps in net scripts (solana-labs#34767)
Browse files Browse the repository at this point in the history
* add client-node-id to use staked connection

* Add flag to use unstaked connection for bench-tps

* Add bind-address for multinode

* always specify url for bench-tps
  • Loading branch information
kirill lykov authored Jan 13, 2024
1 parent 257ba2f commit 5a1a697
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
3 changes: 3 additions & 0 deletions multinode-demo/bench-tps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ usage() {
}

args=("$@")
default_arg --url "http://127.0.0.1:8899"
default_arg --entrypoint "127.0.0.1:8001"
default_arg --faucet "127.0.0.1:9900"
default_arg --duration 90
default_arg --tx-count 50000
default_arg --thread-batch-sleep-ms 0
default_arg --bind-address "127.0.0.1"
default_arg --client-node-id "${SOLANA_CONFIG_DIR}/bootstrap-validator/identity.json"

$solana_bench_tps "${args[@]}"
9 changes: 8 additions & 1 deletion net/net.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ usage() {
-c bench-tps=2="--tx_count 25000"
This will start 2 bench-tps clients, and supply "--tx_count 25000"
to the bench-tps client.
--use-unstaked-connection - Use unstaked connection. By default, staked connection with
bootstrap node credendials is used.
EOM
)
cat <<EOF
Expand Down Expand Up @@ -444,7 +446,8 @@ startClient() {
startCommon "$ipAddress"
ssh "${sshOptions[@]}" -f "$ipAddress" \
"./solana/net/remote/remote-client.sh $deployMethod $entrypointIp \
$clientToRun \"$RUST_LOG\" \"$benchTpsExtraArgs\" $clientIndex $clientType"
$clientToRun \"$RUST_LOG\" \"$benchTpsExtraArgs\" $clientIndex $clientType \
$maybeUseUnstakedConnection"
) >> "$logFile" 2>&1 || {
cat "$logFile"
echo "^^^ +++"
Expand Down Expand Up @@ -832,6 +835,7 @@ extraPrimordialStakes=0
disableQuic=false
enableUdp=false
clientType=thin-client
maybeUseUnstakedConnection=""

command=$1
[[ -n $command ]] || usage
Expand Down Expand Up @@ -976,6 +980,9 @@ while [[ -n $1 ]]; do
;;
esac
shift 2
elif [[ $1 = --use-unstaked-connection ]]; then
maybeUseUnstakedConnection="$1"
shift 1
else
usage "Unknown long option: $1"
fi
Expand Down
12 changes: 10 additions & 2 deletions net/remote/remote-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ fi
benchTpsExtraArgs="$5"
clientIndex="$6"
clientType="${7:-thin-client}"
maybeUseUnstakedConnection="$8"

missing() {
echo "Error: $1 not specified"
Expand Down Expand Up @@ -68,25 +69,32 @@ solana-bench-tps)
net/scripts/rsync-retry.sh -vPrc \
"$entrypointIp":~/solana/config/bench-tps"$clientIndex".yml ./client-accounts.yml

net/scripts/rsync-retry.sh -vPrc \
"$entrypointIp":~/solana/config/validator-identity-1.json ./validator-identity.json

args=()

if ${TPU_CLIENT}; then
args+=(--use-tpu-client)
args+=(--url "http://$entrypointIp:8899")
elif ${RPC_CLIENT}; then
args+=(--use-rpc-client)
args+=(--url "http://$entrypointIp:8899")
else
args+=(--entrypoint "$entrypointIp:8001")
fi

if [[ -z "$maybeUseUnstakedConnection" ]]; then
args+=(--bind-address "$entrypointIp")
args+=(--client-node-id ./validator-identity.json)
fi

clientCommand="\
solana-bench-tps \
--duration 7500 \
--sustained \
--threads $threadCount \
$benchTpsExtraArgs \
--read-client-keys ./client-accounts.yml \
--url "http://$entrypointIp:8899" \
${args[*]} \
"
;;
Expand Down

0 comments on commit 5a1a697

Please sign in to comment.