Skip to content
Open
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
14 changes: 1 addition & 13 deletions cmd/celestia-appd/cmd/modify_root_command_multiplexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ import (
"github.com/spf13/cobra"
)

// v2UpgradeHeight is the block height at which the v2 upgrade occurred.
// this can be overridden at build time using ldflags:
// -ldflags="-X 'github.com/celestiaorg/celestia-app/v6/cmd/celestia-appd/cmd.v2UpgradeHeight=1751707'" for arabica
// -ldflags="-X 'github.com/celestiaorg/celestia-app/v6/cmd/celestia-appd/cmd.v2UpgradeHeight=2585031'" for mocha
// -ldflags="-X 'github.com/celestiaorg/celestia-app/v6/cmd/celestia-appd/cmd.v2UpgradeHeight=2371495'" for mainnet
var v2UpgradeHeight = ""

var defaultArgs = []string{
"--with-tendermint=false",
"--transport=grpc",
Expand Down Expand Up @@ -56,17 +49,12 @@ func modifyRootCommand(rootCommand *cobra.Command) {
panic(err)
}

v3Args := defaultArgs
if v2UpgradeHeight != "" {
v3Args = append(v3Args, "--v2-upgrade-height="+v2UpgradeHeight)
}

versions, err := abci.NewVersions(
abci.Version{
Appd: appdV3,
ABCIVersion: abci.ABCIClientVersion1,
AppVersion: 3,
StartArgs: v3Args,
StartArgs: defaultArgs,
}, abci.Version{
Appd: appdV4,
ABCIVersion: abci.ABCIClientVersion2,
Expand Down
3 changes: 0 additions & 3 deletions cmd/celestia-appd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ func initRootCommand(rootCommand *cobra.Command, capp *app.App) {
// addStartFlags adds flags to the start command.
func addStartFlags(startCmd *cobra.Command) {
startCmd.Flags().Int64(UpgradeHeightFlag, 0, "Upgrade height to switch from v1 to v2. Must be coordinated amongst all validators")
if err := startCmd.Flags().MarkDeprecated(UpgradeHeightFlag, "This flag is deprecated and was only useful prior to v4."); err != nil {
panic(err)
}

startCmd.Flags().Duration(TimeoutCommitFlag, 0, "Override the application configured timeout_commit. Note: only for testing purposes.")
if err := startCmd.Flags().MarkDeprecated(TimeoutCommitFlag, "Use --delayed-precommit-timeout instead."); err != nil {
Expand Down
33 changes: 22 additions & 11 deletions scripts/single-node-all-upgrades.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

# This script starts a local single node testnet on app version 1 and then
# upgrades to app version 2, 3, 4, 5, and 6.
#
# Prerequisites:
# - Modify the `Makefile` and set V2_UPGRADE_HEIGHT = 2
# - Run `make install`

set -o errexit # Stop script execution if an error is encountered
set -o nounset # Stop script execution if an undefined variable is used
Expand Down Expand Up @@ -87,11 +83,22 @@ createGenesis() {

echo "Overriding the genesis.json app version to 1..."
sed -i'.bak' 's/"app_version": *"[^"]*"/"app_version": "1"/' "${APP_HOME}"/config/genesis.json

# Set minimum gas price to avoid parsing errors
sed -i'.bak' 's/^minimum-gas-prices = ".*"/minimum-gas-prices = "0utia"/' "${APP_HOME}"/config/app.toml
}

deleteCelestiaAppHome() {
echo "Killing any running celestia-appd processes..."
pkill -f "celestia-appd.*start" 2>/dev/null || true
sleep 2

echo "Deleting $APP_HOME..."
rm -r "$APP_HOME"
if [ -d "$APP_HOME" ]; then
rm -rf "$APP_HOME"
fi
# Wait a moment to ensure deletion is complete
sleep 1
}

startCelestiaApp() {
Expand All @@ -101,7 +108,9 @@ startCelestiaApp() {
--api.enable \
--grpc.enable \
--grpc-web.enable \
--delayed-precommit-timeout 1s
--force-no-bbr \
--v2-upgrade-height=3 \
--timeout-commit=1s
}

# Function to perform upgrade to a specific version
Expand All @@ -118,9 +127,10 @@ performUpgrade() {
--broadcast-mode ${BROADCAST_MODE} \
--yes

sleep 1
sleep 2
echo "Querying the tally for v${target_version}..."
celestia-appd query signal tally ${target_version}
celestia-appd query signal tally ${target_version} --home ${APP_HOME}
sleep 2

echo "Submitting msg try upgrade..."
celestia-appd tx signal try-upgrade \
Expand All @@ -131,10 +141,11 @@ performUpgrade() {
--chain-id ${CHAIN_ID} \
--broadcast-mode ${BROADCAST_MODE} \
--yes
sleep 2

echo "Waiting for upgrade to complete..."
while true; do
current_version=$(celestia-appd status | jq -r '.node_info.protocol_version.app')
current_version=$(celestia-appd status --home ${APP_HOME} | jq -r '.node_info.protocol_version.app')
if [ "$current_version" = "${target_version}" ]; then
echo "Upgrade to version ${target_version} complete!"
break
Expand All @@ -148,13 +159,13 @@ startUpgrades() {
sleep 30
echo "Waiting for app version 2 before proceeding..."
while true; do
current_version=$(celestia-appd status | jq -r '.node_info.protocol_version.app')
current_version=$(celestia-appd status --home ${APP_HOME} | jq -r '.node_info.protocol_version.app')
if [ "$current_version" = "2" ]; then
echo "App version 2 detected, proceeding with v3 upgrade..."
break
fi
echo "Current version: $current_version, waiting for version 2..."
sleep 1
sleep 2
done

# Perform upgrades to versions 3, 4, 5, and 6
Expand Down