Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

use staked connection for bench-tps in net scripts #34767

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case if we use staked connection, we need to specify rpc address even if ThinClient is employed. This address is used to create RpcClient to check stake of the specified address and later another RpcClient is created. So I believe that there is no harm in specifying it always

${args[*]} \
"
;;
Expand Down