Enable --limit-ledger-size on testnets (#5927)

automerge
This commit is contained in:
Michael Vines 2019-09-17 10:05:41 -07:00 committed by Grimes
parent e26f68fe62
commit de1636c792
7 changed files with 48 additions and 53 deletions

View File

@ -32,6 +32,7 @@ maybeLamports=
maybeLetsEncrypt= maybeLetsEncrypt=
maybeFullnodeAdditionalDiskSize= maybeFullnodeAdditionalDiskSize=
maybeNoSnapshot= maybeNoSnapshot=
maybeLimitLedgerSize=
usage() { usage() {
exitcode=0 exitcode=0
@ -111,7 +112,7 @@ while [[ -n $1 ]]; do
maybeLamports="$1 $2" maybeLamports="$1 $2"
shift 2 shift 2
elif [[ $1 = --no-airdrop ]]; then elif [[ $1 = --no-airdrop ]]; then
maybeDisableAirdrops="$1" maybeDisableAirdrops=$1
shift 1 shift 1
elif [[ $1 = --internal-nodes-stake-lamports ]]; then elif [[ $1 = --internal-nodes-stake-lamports ]]; then
maybeInternalNodesStakeLamports="$1 $2" maybeInternalNodesStakeLamports="$1 $2"
@ -138,7 +139,10 @@ while [[ -n $1 ]]; do
shortArgs+=("$1") shortArgs+=("$1")
shift shift
elif [[ $1 = --no-snapshot-fetch ]]; then elif [[ $1 = --no-snapshot-fetch ]]; then
maybeNoSnapshot="$1" maybeNoSnapshot=$1
shift 1
elif [[ $1 = --limit-ledger-size ]]; then
maybeLimitLedgerSize=$1
shift 1 shift 1
else else
usage "Unknown long option: $1" usage "Unknown long option: $1"
@ -379,10 +383,6 @@ if ! $skipStart; then
if [[ -n $NO_INSTALL_CHECK ]]; then if [[ -n $NO_INSTALL_CHECK ]]; then
args+=(-o noInstallCheck) args+=(-o noInstallCheck)
fi fi
if [[ -n $maybeHashesPerTick ]]; then
# shellcheck disable=SC2206 # Do not want to quote $maybeHashesPerTick
args+=($maybeHashesPerTick)
fi
if $reuseLedger; then if $reuseLedger; then
args+=(-r) args+=(-r)
fi fi
@ -398,31 +398,17 @@ if ! $skipStart; then
args+=(--deploy-update windows) args+=(--deploy-update windows)
fi fi
if [[ -n $maybeDisableAirdrops ]]; then # shellcheck disable=SC2206 # Do not want to quote
# shellcheck disable=SC2206 args+=(
args+=($maybeDisableAirdrops) $maybeHashesPerTick
fi $maybeDisableAirdrops
if [[ -n $maybeInternalNodesStakeLamports ]]; then $maybeInternalNodesStakeLamports
# shellcheck disable=SC2206 # Do not want to quote $maybeInternalNodesStakeLamports $maybeInternalNodesLamports
args+=($maybeInternalNodesStakeLamports) $maybeExternalPrimordialAccountsFile
fi $maybeLamports
if [[ -n $maybeInternalNodesLamports ]]; then $maybeNoSnapshot
# shellcheck disable=SC2206 # Do not want to quote $maybeInternalNodesLamports $maybeLimitLedgerSize
args+=($maybeInternalNodesLamports) )
fi
if [[ -n $maybeExternalPrimordialAccountsFile ]]; then
# shellcheck disable=SC2206 # Do not want to quote $maybeExternalPrimordialAccountsFile
args+=($maybeExternalPrimordialAccountsFile)
fi
if [[ -n $maybeLamports ]]; then
# shellcheck disable=SC2206 # Do not want to quote $maybeLamports
args+=($maybeLamports)
fi
if [[ -n $maybeNoSnapshot ]]; then
# shellcheck disable=SC2206
args+=($maybeNoSnapshot)
fi
time net/net.sh "${args[@]}" time net/net.sh "${args[@]}"
) || ok=false ) || ok=false

View File

@ -319,6 +319,7 @@ deploy() {
ci/testnet-deploy.sh -p edge-testnet-solana-com -C gce -z us-west1-b \ ci/testnet-deploy.sh -p edge-testnet-solana-com -C gce -z us-west1-b \
-t "$CHANNEL_OR_TAG" -n 2 -c 0 -u -P \ -t "$CHANNEL_OR_TAG" -n 2 -c 0 -u -P \
-a edge-testnet-solana-com --letsencrypt edge.testnet.solana.com \ -a edge-testnet-solana-com --letsencrypt edge.testnet.solana.com \
--limit-ledger-size \
${skipCreate:+-e} \ ${skipCreate:+-e} \
${skipStart:+-s} \ ${skipStart:+-s} \
${maybeStop:+-S} \ ${maybeStop:+-S} \
@ -341,14 +342,14 @@ deploy() {
testnet-beta) testnet-beta)
( (
set -x set -x
NO_VALIDATOR_SANITY=1 \ ci/testnet-deploy.sh -p beta-testnet-solana-com -C gce -z us-west1-b \
ci/testnet-deploy.sh -p beta-testnet-solana-com -C gce -z us-west1-b \ -t "$CHANNEL_OR_TAG" -n 2 -c 0 -u -P \
-t "$CHANNEL_OR_TAG" -n 2 -c 0 -u -P \ -a beta-testnet-solana-com --letsencrypt beta.testnet.solana.com \
-a beta-testnet-solana-com --letsencrypt beta.testnet.solana.com \ --limit-ledger-size \
${skipCreate:+-e} \ ${skipCreate:+-e} \
${skipStart:+-s} \ ${skipStart:+-s} \
${maybeStop:+-S} \ ${maybeStop:+-S} \
${maybeDelete:+-D} ${maybeDelete:+-D}
) )
;; ;;
testnet-beta-perf) testnet-beta-perf)
@ -367,14 +368,14 @@ deploy() {
testnet) testnet)
( (
set -x set -x
NO_VALIDATOR_SANITY=1 \ ci/testnet-deploy.sh -p testnet-solana-com -C gce -z us-west1-b \
ci/testnet-deploy.sh -p testnet-solana-com -C gce -z us-west1-b \ -t "$CHANNEL_OR_TAG" -n 2 -c 0 -u -P \
-t "$CHANNEL_OR_TAG" -n 2 -c 0 -u -P \ -a testnet-solana-com --letsencrypt testnet.solana.com \
-a testnet-solana-com --letsencrypt testnet.solana.com \ --limit-ledger-size \
${skipCreate:+-e} \ ${skipCreate:+-e} \
${skipStart:+-s} \ ${skipStart:+-s} \
${maybeStop:+-S} \ ${maybeStop:+-S} \
${maybeDelete:+-D} ${maybeDelete:+-D}
) )
;; ;;
testnet-perf) testnet-perf)

View File

@ -26,6 +26,9 @@ while [[ -n $1 ]]; do
elif [[ $1 = --dynamic-port-range ]]; then elif [[ $1 = --dynamic-port-range ]]; then
args+=("$1" "$2") args+=("$1" "$2")
shift 2 shift 2
elif [[ $1 = --limit-ledger-size ]]; then
args+=("$1")
shift
else else
echo "Unknown argument: $1" echo "Unknown argument: $1"
$program --help $program --help

View File

@ -92,6 +92,9 @@ while [[ -n $1 ]]; do
gossip_entrypoint=$2 gossip_entrypoint=$2
args+=("$1" "$2") args+=("$1" "$2")
shift 2 shift 2
elif [[ $1 = --limit-ledger-size ]]; then
args+=("$1")
shift
elif [[ $1 = --no-snapshot-fetch ]]; then elif [[ $1 = --no-snapshot-fetch ]]; then
args+=("$1") args+=("$1")
shift shift

View File

@ -60,9 +60,9 @@ additionalFullNodeCount=2
clientNodeCount=1 clientNodeCount=1
replicatorNodeCount=0 replicatorNodeCount=0
blockstreamer=false blockstreamer=false
fullNodeBootDiskSizeInGb=1000 fullNodeBootDiskSizeInGb=500
clientBootDiskSizeInGb=75 clientBootDiskSizeInGb=75
replicatorBootDiskSizeInGb=1000 replicatorBootDiskSizeInGb=500
fullNodeAdditionalDiskSizeInGb= fullNodeAdditionalDiskSizeInGb=
externalNodes=false externalNodes=false
failOnValidatorBootupFailure=true failOnValidatorBootupFailure=true

View File

@ -123,6 +123,7 @@ remoteExternalPrimordialAccountsFile=
internalNodesStakeLamports= internalNodesStakeLamports=
internalNodesLamports= internalNodesLamports=
maybeNoSnapshot="" maybeNoSnapshot=""
maybeLimitLedgerSize=""
maybeSkipLedgerVerify="" maybeSkipLedgerVerify=""
maybeDisableAirdrops="" maybeDisableAirdrops=""
debugBuild=false debugBuild=false
@ -153,6 +154,9 @@ while [[ -n $1 ]]; do
elif [[ $1 = --no-build ]]; then elif [[ $1 = --no-build ]]; then
doBuild=false doBuild=false
shift 1 shift 1
elif [[ $1 = --limit-ledger-size ]]; then
maybeLimitLedgerSize="$1"
shift 1
elif [[ $1 = --skip-ledger-verify ]]; then elif [[ $1 = --skip-ledger-verify ]]; then
maybeSkipLedgerVerify="$1" maybeSkipLedgerVerify="$1"
shift 1 shift 1
@ -400,7 +404,6 @@ startBootstrapLeader() {
;; ;;
esac esac
# shellcheck disable=SC2086 # Don't want to double quote "$maybeNoSnapshot $maybeSkipLedgerVerify"
ssh "${sshOptions[@]}" -n "$ipAddress" \ ssh "${sshOptions[@]}" -n "$ipAddress" \
"./solana/net/remote/remote-node.sh \ "./solana/net/remote/remote-node.sh \
$deployMethod \ $deployMethod \
@ -418,7 +421,7 @@ startBootstrapLeader() {
$numBenchTpsClients \"$benchTpsExtraArgs\" \ $numBenchTpsClients \"$benchTpsExtraArgs\" \
$numBenchExchangeClients \"$benchExchangeExtraArgs\" \ $numBenchExchangeClients \"$benchExchangeExtraArgs\" \
\"$genesisOptions\" \ \"$genesisOptions\" \
"$maybeNoSnapshot $maybeSkipLedgerVerify" \ \"$maybeNoSnapshot $maybeSkipLedgerVerify $maybeLimitLedgerSize\" \
" "
) >> "$logFile" 2>&1 || { ) >> "$logFile" 2>&1 || {
cat "$logFile" cat "$logFile"
@ -482,7 +485,7 @@ startNode() {
$numBenchTpsClients \"$benchTpsExtraArgs\" \ $numBenchTpsClients \"$benchTpsExtraArgs\" \
$numBenchExchangeClients \"$benchExchangeExtraArgs\" \ $numBenchExchangeClients \"$benchExchangeExtraArgs\" \
\"$genesisOptions\" \ \"$genesisOptions\" \
\"$maybeNoSnapshot $maybeSkipLedgerVerify\" \ \"$maybeNoSnapshot $maybeSkipLedgerVerify $maybeLimitLedgerSize\" \
" "
) >> "$logFile" 2>&1 & ) >> "$logFile" 2>&1 &
declare pid=$! declare pid=$!

View File

@ -384,7 +384,6 @@ fn main() {
clap::Arg::with_name("limit_ledger_size") clap::Arg::with_name("limit_ledger_size")
.long("limit-ledger-size") .long("limit-ledger-size")
.takes_value(false) .takes_value(false)
.requires("snapshot_path")
.help("drop older slots in the ledger"), .help("drop older slots in the ledger"),
) )
.arg( .arg(