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

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
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
52 changes: 24 additions & 28 deletions cmd/zetacored/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,48 +268,44 @@ 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")
}

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 height != -1 {
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved
anApp = app.New(
logger,
db,
traceStore,
false,
map[int64]bool{},
homePath,
uint(1),
ac.encCfg,
appOpts,
)

if err := anApp.LoadHeight(height); err != nil {
err := zetaApp.LoadHeight(height)
if err != nil {
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved
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