server: remove deprecated UpgradeOldPrivValFile (#6079)

* server: remove deprecated UpgradeOldPrivValFile

OldFilePV was deprecated in Tendermint Core v0.28 and will be removed in
upcoming v0.34.5 release.

* remove imports

* Add changelog entries

Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
This commit is contained in:
Anton Kaliaev 2020-04-27 20:08:44 +04:00 committed by GitHub
parent 97e1c31d40
commit f0b72b93be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1 additions and 18 deletions

View File

@ -58,6 +58,7 @@ older clients.
### API Breaking Changes
* [\#6079](https://github.com/cosmos/cosmos-sdk/pull/6079) Remove `UpgradeOldPrivValFile` (deprecated in Tendermint Core v0.28).
* (modules) [\#5664](https://github.com/cosmos/cosmos-sdk/pull/5664) Remove amino `Codec` from simulation `StoreDecoder`, which now returns a function closure in order to unmarshal the key-value pairs.
* (x/auth) [\#6029](https://github.com/cosmos/cosmos-sdk/pull/6029) Module accounts have been moved from `x/supply` to `x/auth`.
* (x/supply) [\#6010](https://github.com/cosmos/cosmos-sdk/pull/6010) All `x/supply` types and APIs have been moved to `x/bank`.

View File

@ -165,8 +165,6 @@ func startInProcess(ctx *Context, appCreator AppCreator) (*node.Node, error) {
return nil, err
}
UpgradeOldPrivValFile(cfg)
// create & start tendermint node
tmNode, err := node.NewNode(
cfg,

View File

@ -43,7 +43,6 @@ func ShowValidatorCmd(ctx *Context) *cobra.Command {
Short: "Show this node's tendermint validator info",
RunE: func(cmd *cobra.Command, args []string) error {
cfg := ctx.Config
UpgradeOldPrivValFile(cfg)
privValidator := pvm.LoadOrGenFilePV(cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile())
valPubKey, err := privValidator.GetPubKey()
@ -77,7 +76,6 @@ func ShowAddressCmd(ctx *Context) *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
cfg := ctx.Config
UpgradeOldPrivValFile(cfg)
privValidator := pvm.LoadOrGenFilePV(
cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile())
valConsAddr := (sdk.ConsAddress)(privValidator.GetAddress())

View File

@ -19,7 +19,6 @@ import (
"github.com/tendermint/tendermint/libs/cli"
tmflags "github.com/tendermint/tendermint/libs/cli/flags"
"github.com/tendermint/tendermint/libs/log"
pvm "github.com/tendermint/tendermint/privval"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec"
@ -217,16 +216,6 @@ func TrapSignal(cleanupFunc func()) {
}()
}
// UpgradeOldPrivValFile converts old priv_validator.json file (prior to Tendermint 0.28)
// to the new priv_validator_key.json and priv_validator_state.json files.
func UpgradeOldPrivValFile(config *cfg.Config) {
if _, err := os.Stat(config.OldPrivValidatorFile()); !os.IsNotExist(err) {
if oldFilePV, err := pvm.LoadOldFilePV(config.OldPrivValidatorFile()); err == nil {
oldFilePV.Upgrade(config.PrivValidatorKeyFile(), config.PrivValidatorStateFile())
}
}
}
func skipInterface(iface net.Interface) bool {
if iface.Flags&net.FlagUp == 0 {
return true // interface down

View File

@ -11,8 +11,6 @@ import (
"github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/privval"
tmtypes "github.com/tendermint/tendermint/types"
"github.com/cosmos/cosmos-sdk/server"
)
// ExportGenesisFile creates and writes the genesis configuration to disk. An
@ -54,7 +52,6 @@ func InitializeNodeValidatorFiles(config *cfg.Config) (nodeID string, valPubKey
}
nodeID = string(nodeKey.ID())
server.UpgradeOldPrivValFile(config)
pvKeyFile := config.PrivValidatorKeyFile()
if err := tmos.EnsureDir(filepath.Dir(pvKeyFile), 0777); err != nil {