statesync: assert app version matches (backport #7856) (#7885)

This commit is contained in:
mergify[bot]
2022-02-23 12:17:12 +01:00
committed by GitHub
parent 5487718cff
commit db60bbad54
5 changed files with 49 additions and 26 deletions

View File

@@ -15,9 +15,12 @@ import (
"github.com/tendermint/tendermint/version"
)
const appVersion = 1
// Application is an ABCI application for use by end-to-end tests. It is a
// simple key/value store for strings, storing data in memory and persisting
// to disk as JSON, taking state sync snapshots if requested.
type Application struct {
abci.BaseApplication
logger log.Logger
@@ -99,7 +102,7 @@ func NewApplication(cfg *Config) (*Application, error) {
func (app *Application) Info(req abci.RequestInfo) abci.ResponseInfo {
return abci.ResponseInfo{
Version: version.ABCIVersion,
AppVersion: 1,
AppVersion: appVersion,
LastBlockHeight: int64(app.state.Height),
LastBlockAppHash: app.state.Hash,
}

View File

@@ -202,6 +202,8 @@ func MakeGenesis(testnet *e2e.Testnet) (types.GenesisDoc, error) {
ConsensusParams: types.DefaultConsensusParams(),
InitialHeight: testnet.InitialHeight,
}
// set the app version to 1
genesis.ConsensusParams.Version.AppVersion = 1
for validator, power := range testnet.Validators {
genesis.Validators = append(genesis.Validators, types.GenesisValidator{
Name: validator.Name,