From 9b2edbaa9b50b8dc9ff37d0ea15daac08ea9be8b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 17 Jun 2020 21:36:04 +0000 Subject: [PATCH] Plumb `--warp-slot` through net scripts (bp #10639) (#10643) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Trent Nelson Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- net/net.sh | 7 +++++++ net/remote/remote-node.sh | 6 ++++++ system-test/testnet-automation.sh | 7 ++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/net/net.sh b/net/net.sh index 1e5282d1e0..12bde2d101 100755 --- a/net/net.sh +++ b/net/net.sh @@ -98,6 +98,7 @@ Operate a configured testnet --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) + --warp-slot WARP_SLOT - Boot from a snapshot that has warped ahead to WARP_SLOT rather than a slot 0 genesis. sanity/start-specific options: -F - Discard validator nodes that didn't bootup successfully -o noInstallCheck - Skip solana-install sanity @@ -275,6 +276,7 @@ startBootstrapLeader() { \"$maybeNoSnapshot $maybeSkipLedgerVerify $maybeLimitLedgerSize $maybeWaitForSupermajority\" \ \"$gpuMode\" \ \"$GEOLOCATION_API_KEY\" \ + \"$maybeWarpSlot\" \ " ) >> "$logFile" 2>&1 || { @@ -344,6 +346,7 @@ startNode() { \"$maybeNoSnapshot $maybeSkipLedgerVerify $maybeLimitLedgerSize $maybeWaitForSupermajority\" \ \"$gpuMode\" \ \"$GEOLOCATION_API_KEY\" \ + \"$maybeWarpSlot\" \ " ) >> "$logFile" 2>&1 & declare pid=$! @@ -735,6 +738,7 @@ netemConfigFile="" netemCommand="add" clientDelayStart=0 netLogDir= +maybeWarpSlot= command=$1 [[ -n $command ]] || usage @@ -838,6 +842,9 @@ while [[ -n $1 ]]; do elif [[ $1 == --wait-for-supermajority ]]; then maybeWaitForSupermajority="$1 $2" shift 2 + elif [[ $1 == --warp-slot ]]; then + maybeWarpSlot="$1 $2" + shift 2 else usage "Unknown long option: $1" fi diff --git a/net/remote/remote-node.sh b/net/remote/remote-node.sh index 27a48e528e..b062ef867d 100755 --- a/net/remote/remote-node.sh +++ b/net/remote/remote-node.sh @@ -26,6 +26,7 @@ genesisOptions="${17}" extraNodeArgs="${18}" gpuMode="${19:-auto}" GEOLOCATION_API_KEY="${20}" +maybeWarpSlot="${21}" set +x missing() { @@ -229,6 +230,11 @@ EOF fi multinode-demo/setup.sh "${args[@]}" + if [[ -n "$maybeWarpSlot" ]]; then + # shellcheck disable=SC2086 # Do not want to quote $maybeWarSlot + solana-ledger-tool -l config/bootstrap-validator create-snapshot 0 config/bootstrap-validator $maybeWarpSlot + fi + solana-ledger-tool -l config/bootstrap-validator shred-version --max-genesis-archive-unpacked-size 1073741824 | tee config/shred-version fi args=( diff --git a/system-test/testnet-automation.sh b/system-test/testnet-automation.sh index 90bb79ef34..0a8a81b3ce 100755 --- a/system-test/testnet-automation.sh +++ b/system-test/testnet-automation.sh @@ -124,11 +124,16 @@ function launch_testnet() { declare -g version_args get_net_launch_software_version_launch_args "$CHANNEL" "solana-release" version_args + declare maybeWarpSlot + if [[ -n "$WARP_SLOT" ]]; then + maybeWarpSlot="--warp-slot $WARP_SLOT" + fi + # shellcheck disable=SC2068 # shellcheck disable=SC2086 "${REPO_ROOT}"/net/net.sh start $version_args \ -c idle=$NUMBER_OF_CLIENT_NODES $maybeStartAllowBootFailures \ - --gpu-mode $startGpuMode + --gpu-mode $startGpuMode $maybeWarpSlot execution_step "Waiting for bootstrap validator's stake to fall below ${BOOTSTRAP_VALIDATOR_MAX_STAKE_THRESHOLD}%" wait_for_bootstrap_validator_stake_drop "$BOOTSTRAP_VALIDATOR_MAX_STAKE_THRESHOLD"