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

fix: remove additional log line when exporting genesis #3038

Merged
merged 9 commits into from
Oct 29, 2024
2 changes: 0 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,6 @@ func New(
authAddr,
)

logger.Info("bank keeper blocklist addresses", "addresses", app.BlockedAddrs())

kingpinXD marked this conversation as resolved.
Show resolved Hide resolved
app.BankKeeper = bankkeeper.NewBaseKeeper(
appCodec,
keys[banktypes.StoreKey],
Expand Down
1 change: 0 additions & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
func (app *App) ExportAppStateAndValidators(
forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string,
) (servertypes.ExportedApp, error) {
// as if they could withdraw from the start of the next block
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved
ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()})

// We export at last height + 1, because that's the height at which
Expand Down
53 changes: 24 additions & 29 deletions cmd/zetacored/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,48 +268,43 @@ func (ac appCreator) newApp(
)
}

// appExport creates a new simapp (optionally at a given height)
// appExport is used to export the state of the application for a genesis file.
func (ac appCreator) appExport(
logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string,
appOpts servertypes.AppOptions,
modulesToExport []string,
) (servertypes.ExportedApp, error) {
var anApp *app.App
var zetaApp *app.App

homePath, ok := appOpts.Get(flags.FlagHome).(string)
if !ok || homePath == "" {
return servertypes.ExportedApp{}, errors.New("application home not set")
}

if height != -1 {
anApp = app.New(
logger,
db,
traceStore,
false,
map[int64]bool{},
homePath,
uint(1),
ac.encCfg,
appOpts,
)

if err := anApp.LoadHeight(height); err != nil {
loadLatest := false
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved
if height == -1 {
loadLatest = true
}

zetaApp = app.New(
logger,
db,
traceStore,
loadLatest,
map[int64]bool{},
homePath,
uint(1),
ac.encCfg,
appOpts,
)

// If height is -1, it means we are using the latest height.
// For all other cases, we load the specified height from the Store
if !loadLatest {
if err := zetaApp.LoadHeight(height); err != nil {
return servertypes.ExportedApp{}, err
}
} else {
anApp = app.New(
logger,
db,
traceStore,
true,
map[int64]bool{},
homePath,
uint(1),
ac.encCfg,
appOpts,
)
}

return anApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport)
return zetaApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport)
}
Loading