diff --git a/ci/forgive-me.sh b/ci/forgive-me.sh new file mode 100755 index 00000000000000..f309f3112996a0 --- /dev/null +++ b/ci/forgive-me.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +set -x + +here="$(realpath "$(dirname "$0")")" +source_dir="${here:?}/.." + +committish="${1:?}" +tarballBaseName="${2:-solana-release}" +remote=https://github.com/solana-labs/solana.git + +cleanup_tmp_source_dir() { + rm -rf "$tmp_source_dir" +} + +set -e +tmp_source_dir="$(mktemp --directory --tmpdir="$source_dir")" + +trap 'cleanup_tmp_source_dir' EXIT + +# Clone the specified committish +git clone "$remote" "$tmp_source_dir" + +if pushd "$tmp_source_dir"; then + ( + set +e + + git fetch origin "$committish":branch_to_build + git checkout branch_to_build + + # Use our scripts + cp -ar "${source_dir}"/{fetch-perf-libs.sh,scripts,net,multinode-demo,ci} "$tmp_source_dir" + + export CHANNEL=edge + export DO_NOT_PUBLISH_TAR=true # Never publish + export TARBALL_BASENAME="$tarballBaseName" + ci/publish-tarball.sh + + cp "${tarballBaseName}"*.tar.bz2 "${source_dir}" + ) + popd +fi diff --git a/multinode-demo/bootstrap-validator.sh b/multinode-demo/bootstrap-validator.sh index 87ce93eae79d94..bb7b007c82be5a 100755 --- a/multinode-demo/bootstrap-validator.sh +++ b/multinode-demo/bootstrap-validator.sh @@ -93,7 +93,6 @@ ledger_dir="$SOLANA_CONFIG_DIR"/bootstrap-validator args+=( --enable-rpc-exit --enable-rpc-set-log-filter - --require-tower --ledger "$ledger_dir" --rpc-port 8899 --snapshot-interval-slots 200 diff --git a/multinode-demo/validator.sh b/multinode-demo/validator.sh index b95c4f1c1e0f8f..2cebf2a7f9f0b8 100755 --- a/multinode-demo/validator.sh +++ b/multinode-demo/validator.sh @@ -228,7 +228,6 @@ default_arg --ledger "$ledger_dir" default_arg --log - default_arg --enable-rpc-exit default_arg --enable-rpc-set-log-filter -default_arg --require-tower if [[ -n $SOLANA_CUDA ]]; then program=$solana_validator_cuda diff --git a/net/remote/remote-node.sh b/net/remote/remote-node.sh index e2cc5594cb805b..48da3e5c5cd86f 100755 --- a/net/remote/remote-node.sh +++ b/net/remote/remote-node.sh @@ -392,6 +392,7 @@ EOF fi cat >> ~/solana/on-reboot < validator.log.\$now 2>&1 & pid=\$! @@ -419,7 +420,7 @@ EOF args+=(--keypair config/validator-identity.json) fi - if [[ ${#extraPrimordialStakes} -eq 0 ]]; then + if [[ ${extraPrimordialStakes} -eq 0 ]]; then multinode-demo/delegate-stake.sh "${args[@]}" "$internalNodesStakeLamports" fi fi diff --git a/run.sh b/run.sh index 1745ebb5a34172..f7547f6370c254 100755 --- a/run.sh +++ b/run.sh @@ -106,7 +106,6 @@ args=( --enable-rpc-exit --enable-rpc-transaction-history --init-complete-file "$dataDir"/init-completed - --require-tower ) solana-validator "${args[@]}" & validator=$! diff --git a/scripts/cargo-install-all.sh b/scripts/cargo-install-all.sh index 8b6452fccae43a..a5d673b01e2f07 100755 --- a/scripts/cargo-install-all.sh +++ b/scripts/cargo-install-all.sh @@ -109,12 +109,14 @@ done ( set -x # shellcheck disable=SC2086 # Don't want to double quote $rust_version - $cargo $maybeRustVersion build $maybeReleaseFlag "${binArgs[@]}" + $cargo $maybeRustVersion build $maybeReleaseFlag --bins ) mkdir -p "$installDir/bin" -for bin in "${BINS[@]}"; do - cp -fv "target/$buildVariant/$bin" "$installDir"/bin +for bin in "target/$buildVariant/"*; do + if [[ "$bin" =~ /solana(-[^./]+)*$ ]]; then + cp -fv "$bin" "$installDir"/bin + fi done if [[ -d target/perf-libs ]]; then diff --git a/system-test/automation_utils.sh b/system-test/automation_utils.sh index 136399d6e7529a..b6d74b096ac303 100755 --- a/system-test/automation_utils.sh +++ b/system-test/automation_utils.sh @@ -72,7 +72,8 @@ function wait_for_bootstrap_validator_stake_drop { while true; do # shellcheck disable=SC2154 bootstrap_validator_validator_info="$(ssh "${sshOptions[@]}" "${validatorIpList[0]}" '$HOME/.cargo/bin/solana --url http://127.0.0.1:8899 validators | grep "$($HOME/.cargo/bin/solana-keygen pubkey ~/solana/config/bootstrap-validator/identity.json)"')" - bootstrap_validator_stake_percentage="$(echo "$bootstrap_validator_validator_info" | awk '{gsub(/[\(,\),\%]/,""); print $9}')" + temp="${bootstrap_validator_validator_info##[^(]*\(}" + bootstrap_validator_stake_percentage="${temp%\%)}" if [[ $(echo "$bootstrap_validator_stake_percentage < $max_stake" | bc) -ne 0 ]]; then echo "Bootstrap validator stake has fallen below $max_stake to $bootstrap_validator_stake_percentage" diff --git a/system-test/rolling-upgrade/rolling_upgrade.sh b/system-test/rolling-upgrade/rolling_upgrade.sh index 2fd7b1cdbf6252..8c3768ea0d61b8 100755 --- a/system-test/rolling-upgrade/rolling_upgrade.sh +++ b/system-test/rolling-upgrade/rolling_upgrade.sh @@ -36,6 +36,11 @@ if [[ "$UPGRADE_INITIAL_DELAY" -gt 0 ]]; then "$NET_SH" sanity fi +declare maybeExtraPrimordialStakes +if [[ -n "$EXTRA_PRIMORDIAL_STAKES" ]]; then + maybeExtraPrimordialStakes="--extra-primordial-stakes $EXTRA_PRIMORDIAL_STAKES" +fi + # Restart validators one by one # shellcheck disable=SC2154 # sourced from config above for i in "${!validatorIpList[@]}"; do @@ -47,7 +52,7 @@ for i in "${!validatorIpList[@]}"; do declare ipAddress="${validatorIpList[$i]}" "$NET_SH" stopnode -i "$ipAddress" - "$NET_SH" startnode -r -i "$ipAddress" + "$NET_SH" startnode -r -i "$ipAddress" ${maybeExtraPrimordialStakes} # This could be replaced with something based on `solana catchup` sleep_if_positive "$UPGRADE_INTERVALIDATOR_DELAY" diff --git a/system-test/testnet-automation.sh b/system-test/testnet-automation.sh index 431b9121f502ba..e456f1a114ff17 100755 --- a/system-test/testnet-automation.sh +++ b/system-test/testnet-automation.sh @@ -143,7 +143,8 @@ function launch_testnet() { # shellcheck disable=SC2086 "${REPO_ROOT}"/net/net.sh start $version_args \ -c idle=$NUMBER_OF_CLIENT_NODES $maybeStartAllowBootFailures \ - --gpu-mode $startGpuMode $maybeWarpSlot $maybeAsyncNodeInit $maybeExtraPrimordialStakes + --gpu-mode $startGpuMode $maybeWarpSlot $maybeAsyncNodeInit $maybeExtraPrimordialStakes \ + $GENESIS_OPTIONS 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" @@ -326,6 +327,7 @@ TEST_PARAMS_TO_DISPLAY=(CLOUD_PROVIDER \ PARTITION_ITERATION_COUNT \ TEST_TYPE \ CUSTOM_SCRIPT \ + GENESIS_OPTIONS \ ) TEST_CONFIGURATION=