From b9e10433cec5fc1b6ef2c19f3c63e1ef2597343c Mon Sep 17 00:00:00 2001 From: Rootul Patel Date: Wed, 27 Nov 2024 15:40:05 -0500 Subject: [PATCH] refactor!: remove OverrideUpgradeHeightDelayStr --- Makefile | 5 +---- app/test/upgrade_test.go | 4 +--- pkg/appconsts/overrides.go | 1 - pkg/appconsts/versioned_consts.go | 7 ------- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 8d106d4173..c734b1e596 100644 --- a/Makefile +++ b/Makefile @@ -28,16 +28,13 @@ PACKAGE_NAME := github.com/celestiaorg/celestia-app/v3 GOLANG_CROSS_VERSION ?= v1.23.1 # Set this to override the max square size of the binary OVERRIDE_MAX_SQUARE_SIZE ?= -# Set this to override the upgrade height delay of the binary -OVERRIDE_UPGRADE_HEIGHT_DELAY ?= # process linker flags ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=celestia-app \ -X github.com/cosmos/cosmos-sdk/version.AppName=celestia-appd \ -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ - -X github.com/celestiaorg/celestia-app/v3/pkg/appconsts.OverrideSquareSizeUpperBoundStr=$(OVERRIDE_MAX_SQUARE_SIZE) \ - -X github.com/celestiaorg/celestia-app/v3/pkg/appconsts.OverrideUpgradeHeightDelayStr=$(OVERRIDE_UPGRADE_HEIGHT_DELAY) + -X github.com/celestiaorg/celestia-app/v3/pkg/appconsts.OverrideSquareSizeUpperBoundStr=$(OVERRIDE_MAX_SQUARE_SIZE) BUILD_FLAGS := -tags "ledger" -ldflags '$(ldflags)' diff --git a/app/test/upgrade_test.go b/app/test/upgrade_test.go index d59d05ce8b..899d2268c9 100644 --- a/app/test/upgrade_test.go +++ b/app/test/upgrade_test.go @@ -38,9 +38,6 @@ func TestAppUpgradeV3(t *testing.T) { t.Skip("skipping TestAppUpgradeV3 in short mode") } - appconsts.OverrideUpgradeHeightDelayStr = "1" - defer func() { appconsts.OverrideUpgradeHeightDelayStr = "" }() - testApp, genesis := SetupTestAppWithUpgradeHeight(t, 3) upgradeFromV1ToV2(t, testApp) @@ -258,6 +255,7 @@ func SetupTestAppWithUpgradeHeight(t *testing.T, upgradeHeight int64) (*app.App, encCfg := encoding.MakeConfig(app.ModuleEncodingRegisters...) testApp := app.New(log.NewNopLogger(), db, nil, 0, encCfg, upgradeHeight, util.EmptyAppOptions{}) genesis := genesis.NewDefaultGenesis(). + WithChainID("test"). WithValidators(genesis.NewDefaultValidator(testnode.DefaultValidatorAccountName)). WithConsensusParams(app.DefaultInitialConsensusParams()) genDoc, err := genesis.Export() diff --git a/pkg/appconsts/overrides.go b/pkg/appconsts/overrides.go index 39c5f4c6d0..2404b3203f 100644 --- a/pkg/appconsts/overrides.go +++ b/pkg/appconsts/overrides.go @@ -6,5 +6,4 @@ package appconsts // Look at the Makefile to see how these are set. var ( OverrideSquareSizeUpperBoundStr string - OverrideUpgradeHeightDelayStr string ) diff --git a/pkg/appconsts/versioned_consts.go b/pkg/appconsts/versioned_consts.go index 73d635d010..57ff919bee 100644 --- a/pkg/appconsts/versioned_consts.go +++ b/pkg/appconsts/versioned_consts.go @@ -80,13 +80,6 @@ func GetTimeoutCommit(v uint64) time.Duration { // UpgradeHeightDelay returns the delay in blocks after a quorum has been reached that the chain should upgrade to the new version. func UpgradeHeightDelay(chainID string, v uint64) int64 { - if OverrideUpgradeHeightDelayStr != "" { - parsedValue, err := strconv.ParseInt(OverrideUpgradeHeightDelayStr, 10, 64) - if err != nil { - panic("Invalid OverrideUpgradeHeightDelayStr value") - } - return parsedValue - } if chainID == "test" { return 3 }