-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: split out upgrade into a separate signal module (#3290)
Closes: #3284 We've been experienceing an app hash mismatch when running `main` on mainnet. I believe this is caused because in v1 we had an upgrade module (albeit unreachable) which was still part of state (kept around for compatibility with IBC). In `main` we coped the upgrade modules state and extended it with the signalling mechanism however this module only applied from v2 to v2 meaning there wasn't the same state in v1. This attempts to fix this. It separates out the signal protocol into it's own module (which correctly should only be v2) and reimport the upgrade keeper from the sdk (as was in v1.x) --------- Co-authored-by: Rootul P <[email protected]>
- Loading branch information
Showing
26 changed files
with
240 additions
and
376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package app_test | ||
|
||
import ( | ||
"testing" | ||
|
||
v1 "github.com/celestiaorg/celestia-app/v2/pkg/appconsts/v1" | ||
v2 "github.com/celestiaorg/celestia-app/v2/pkg/appconsts/v2" | ||
"github.com/stretchr/testify/require" | ||
abci "github.com/tendermint/tendermint/abci/types" | ||
tmproto "github.com/tendermint/tendermint/proto/tendermint/types" | ||
tmversion "github.com/tendermint/tendermint/proto/tendermint/version" | ||
) | ||
|
||
func TestUpgradeAppVersion(t *testing.T) { | ||
testApp, _ := setupTestApp(t, 3) | ||
|
||
supportedVersions := []uint64{v1.Version, v2.Version} | ||
|
||
require.Equal(t, supportedVersions, testApp.SupportedVersions()) | ||
|
||
testApp.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ | ||
Height: 2, | ||
Version: tmversion.Consensus{App: 1}, | ||
}}) | ||
// app version should not have changed yet | ||
require.EqualValues(t, 1, testApp.AppVersion()) | ||
respEndBlock := testApp.EndBlock(abci.RequestEndBlock{Height: 2}) | ||
// now the app version changes | ||
require.NotNil(t, respEndBlock.ConsensusParamUpdates.Version) | ||
require.EqualValues(t, 2, respEndBlock.ConsensusParamUpdates.Version.AppVersion) | ||
require.EqualValues(t, 2, testApp.AppVersion()) | ||
} |
4 changes: 2 additions & 2 deletions
4
proto/celestia/upgrade/v1/query.proto → proto/celestia/signal/v1/query.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
proto/celestia/upgrade/v1/tx.proto → proto/celestia/signal/v1/tx.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package upgrade | ||
package signal | ||
|
||
import ( | ||
"cosmossdk.io/math" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.