Skip to content

Commit

Permalink
Merge pull request #8975 from Agoric/mhofman/8888-state-sync-logging-…
Browse files Browse the repository at this point in the history
…part-1

chore(cosmos): state-sync improvements
  • Loading branch information
mergify[bot] authored Feb 23, 2024
2 parents 771480c + c27b24e commit fd0382d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
15 changes: 11 additions & 4 deletions golang/cosmos/daemon/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import (
"github.com/cosmos/cosmos-sdk/client/debug"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/keys"
"github.com/cosmos/cosmos-sdk/client/pruning"
"github.com/cosmos/cosmos-sdk/client/rpc"
"github.com/cosmos/cosmos-sdk/client/snapshot"
"github.com/cosmos/cosmos-sdk/server"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/snapshots"
Expand Down Expand Up @@ -126,22 +128,26 @@ func initRootCmd(sender Sender, rootCmd *cobra.Command, encodingConfig params.En
cfg := sdk.GetConfig()
cfg.Seal()

ac := appCreator{
encCfg: encodingConfig,
sender: sender,
}

rootCmd.AddCommand(
genutilcli.InitCmd(gaia.ModuleBasics, gaia.DefaultNodeHome),
genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, gaia.DefaultNodeHome),
genutilcli.MigrateGenesisCmd(),
genutilcli.GenTxCmd(gaia.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, gaia.DefaultNodeHome),
genutilcli.ValidateGenesisCmd(gaia.ModuleBasics),
AddGenesisAccountCmd(encodingConfig.Marshaler, gaia.DefaultNodeHome),
tmcli.NewCompletionCmd(rootCmd, true),
testnetCmd(gaia.ModuleBasics, banktypes.GenesisBalancesIterator{}),
debug.Cmd(),
config.Cmd(),
pruning.Cmd(ac.newApp, gaia.DefaultNodeHome),
snapshot.Cmd(ac.newApp),
)

ac := appCreator{
encCfg: encodingConfig,
sender: sender,
}
server.AddCommands(rootCmd, gaia.DefaultNodeHome, ac.newApp, ac.appExport, addModuleInitFlags)

for _, command := range rootCmd.Commands() {
Expand Down Expand Up @@ -231,6 +237,7 @@ func txCommand() *cobra.Command {
authcmd.GetBroadcastCommand(),
authcmd.GetEncodeCommand(),
authcmd.GetDecodeCommand(),
authcmd.GetAuxToFeeCommand(),
flags.LineBreak,
vestingcli.GetTxCmd(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,15 @@ func (exportsHandler SwingStoreExportsHandler) RestoreExport(provider SwingStore
}
defer os.RemoveAll(exportDir)

exportsHandler.logger.Info("creating swing-store restore", "exportDir", exportDir, "height", blockHeight)

err = WriteSwingStoreExportToDirectory(provider, exportDir)
if err != nil {
return err
}

exportsHandler.logger.Info("restoring swing-store", "exportDir", exportDir, "height", blockHeight)

action := &swingStoreRestoreExportAction{
Type: swingStoreExportActionType,
BlockHeight: blockHeight,
Expand All @@ -772,7 +776,7 @@ func (exportsHandler SwingStoreExportsHandler) RestoreExport(provider SwingStore
return err
}

exportsHandler.logger.Info("restored swing-store export", "exportDir", exportDir, "height", blockHeight)
exportsHandler.logger.Info("restored swing-store", "exportDir", exportDir, "height", blockHeight)

return nil
}
Expand Down

0 comments on commit fd0382d

Please sign in to comment.