Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add appVersion to RequestInfo #3844

Open
rootulp opened this issue Sep 5, 2024 · 0 comments
Open

Add appVersion to RequestInfo #3844

rootulp opened this issue Sep 5, 2024 · 0 comments
Labels
ABCI modifies an ABCI method refactor optional label for items that are related to implementation work and do not change functionality WS: Maintenance 🔧 includes bugs, refactors, flakes, and tech debt etc

Comments

@rootulp
Copy link
Collaborator

rootulp commented Sep 5, 2024

Problem

In celestia-app v2 there is confusing logic in Info() to determine the app version.

celestia-app/app/app.go

Lines 511 to 536 in 4b34f8b

// Info implements the ABCI interface. This method is a wrapper around baseapp's
// Info command so that it can take the app version and setup the multicommit
// store.
//
// Side-effect: calls baseapp.Init()
func (app *App) Info(req abci.RequestInfo) abci.ResponseInfo {
if height := app.LastBlockHeight(); height > 0 {
ctx, err := app.CreateQueryContext(height, false)
if err != nil {
panic(err)
}
appVersion := app.GetAppVersionFromParamStore(ctx)
if appVersion > 0 {
app.SetAppVersion(ctx, appVersion)
} else {
app.SetAppVersion(ctx, v1)
}
}
resp := app.BaseApp.Info(req)
// mount the stores for the provided app version
if resp.AppVersion > 0 && !app.IsSealed() {
app.mountKeysAndInit(resp.AppVersion)
}
return resp
}

Proposal

Consider adding AppVersion to RequestInfo

@rootulp rootulp added ABCI modifies an ABCI method refactor optional label for items that are related to implementation work and do not change functionality labels Sep 5, 2024
@rootulp rootulp added the WS: Maintenance 🔧 includes bugs, refactors, flakes, and tech debt etc label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ABCI modifies an ABCI method refactor optional label for items that are related to implementation work and do not change functionality WS: Maintenance 🔧 includes bugs, refactors, flakes, and tech debt etc
Projects
None yet
Development

No branches or pull requests

1 participant