Skip to content

Commit

Permalink
Merge branch 'main' into bez/12667-remove-proposer-rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Aug 16, 2022
2 parents 0070c99 + fabf739 commit ff55412
Show file tree
Hide file tree
Showing 18 changed files with 167 additions and 108 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/fork-cherry-pick.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#This CI is disabled on main and meant to be enabled on forks as an easy way to cherry pick fork commits into main.
name: Cherry pick PR to Cosmos SDK
on:
#Set to trigger on every merge to main, not just a closed PR.
workflow_dispatch:
Expand Down Expand Up @@ -27,7 +29,7 @@ jobs:
git fetch --all # Get the latest code
git checkout -b pr-patch upstream/main # Create new branch based on main branch
git cherry-pick ${{github.event.pull_request.head.sha}} # Cherry pick the latest commit of PR
git push -u origin pr-patch # Push your changes to the remote branch
git push -u origin pr-patch-${{github.event.pull_request.head.sha}} # Push your changes to the remote branch
- name: Autocreate PR
shell: bash
env:
Expand All @@ -40,7 +42,7 @@ jobs:
--data '{
"title": "Automated PR for commit: ${{github.event.pull_request.head.sha}}",
"body":"Please merge these awesome changes in!",
"head":"${{github.event.pull_request.user.login}}:pr-patch",
"head":"${{github.event.pull_request.user.login}}:pr-patch-${{github.event.pull_request.head.sha}}",
"base":"main"
}' \
--fail
1 change: 1 addition & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
image: ghcr.io/notional-labs/cosmos
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [#12634](https://github.com/cosmos/cosmos-sdk/pull/12634) Move `sdk.Dec` to math package.
* [#12596](https://github.com/cosmos/cosmos-sdk/pull/12596) Remove all imports of the non-existent gogo/protobuf v1.3.3 to ease downstream use and go workspaces.
* [#12187](https://github.com/cosmos/cosmos-sdk/pull/12187) Add batch operation for x/nft module.
* [#12455](https://github.com/cosmos/cosmos-sdk/pull/12455) Show attempts count in error for signing.

### State Machine Breaking

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ parent:
<a href="https://github.com/cosmos/cosmos-sdk/blob/main/LICENSE">
<img alt="License: Apache-2.0" src="https://img.shields.io/github/license/cosmos/cosmos-sdk.svg" />
</a>
<a href="https://pkg.go.dev/github.com/cosmos/cosmos-sdk?tab=doc">
<img alt="GoDoc" src="https://pkg.go.dev/github.com/cosmos/cosmos-sdk?status.svg" />
<a href="https://pkg.go.dev/github.com/cosmos/cosmos-sdk">
<img src="https://pkg.go.dev/badge/github.com/cosmos/cosmos-sdk.svg" alt="Go Reference">
</a>
<a href="https://goreportcard.com/report/github.com/cosmos/cosmos-sdk">
<img alt="Go report card" src="https://goreportcard.com/badge/github.com/cosmos/cosmos-sdk" />
Expand Down
6 changes: 6 additions & 0 deletions cosmovisor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ Ref: https://keepachangelog.com/en/1.0.0/
## [Unreleased]
<!-- NOTE: when creating a new release, update cosmovisor/cmd/cosmovisor/cmd/version.go:Version -->

## v1.2.1 2022-08-15

* [\12918](https://github.com/cosmos/cosmos-sdk/pull/12918) Fix failure when installing cosmovisor via `go install`.
* [\12918](https://github.com/cosmos/cosmos-sdk/pull/12918) Automatically set version using module version.
* [\12918](https://github.com/cosmos/cosmos-sdk/pull/12918) Fix plan path case sensitivity issue.

## v1.2.0 2022-07-26

### Features
Expand Down
4 changes: 1 addition & 3 deletions cosmovisor/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/usr/bin/make -f

VERSION := $(shell echo $(shell git describe --always --match "cosmovisor/v*") | sed 's/^cosmovisor[/]//')

all: cosmovisor test

cosmovisor:
go build -ldflags="-X 'github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor/cmd.Version=$(VERSION)'" -mod=readonly ./cmd/cosmovisor
go build -mod=readonly ./cmd/cosmovisor

test:
go test -mod=readonly -race ./...
Expand Down
36 changes: 19 additions & 17 deletions cosmovisor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
`cosmovisor` is a small process manager for Cosmos SDK application binaries that monitors the governance module for incoming chain upgrade proposals. If it sees a proposal that gets approved, `cosmovisor` can automatically download the new binary, stop the current binary, switch from the old binary to the new one, and finally restart the node with the new binary.

<!-- TOC -->
- [Design](#design)
- [Contributing](#contributing)
- [Setup](#setup)
- [Installation](#installation)
- [Command Line Arguments And Environment Variables](#command-line-arguments-and-environment-variables)
- [Folder Layout](#folder-layout)
- [Usage](#usage)
- [Initialization](#initialization)
- [Detecting Upgrades](#detecting-upgrades)
- [Auto-Download](#auto-download)
- [Example: SimApp Upgrade](#example-simapp-upgrade)
- [Chain Setup](#chain-setup)


* [Design](#design)
* [Contributing](#contributing)
* [Setup](#setup)
* [Installation](#installation)
* [Command Line Arguments And Environment Variables](#command-line-arguments-and-environment-variables)
* [Folder Layout](#folder-layout)
* [Usage](#usage)
* [Initialization](#initialization)
* [Detecting Upgrades](#detecting-upgrades)
* [Auto-Download](#auto-download)
* [Example: SimApp Upgrade](#example-simapp-upgrade)
* [Chain Setup](#chain-setup)
* [Prepare Cosmovisor and Start the Chain](#prepare-cosmovisor-and-start-the-chain)
* [Update App](#update-app)

## Design

Expand All @@ -35,25 +35,27 @@ Cosmovisor is designed to be used as a wrapper for a `Cosmos SDK` app:

Cosmovisor is part of the Cosmos SDK monorepo, but it's a separate module with it's own release schedule.

Release branches have the following format `release/cosmovisor/vA.B.x`, where A and B are a number (e.g. `release/cosmovisor/v0.1.x`). Releases are tagged using the following format: `cosmovisor/vA.B.C`.
Release branches have the following format `release/cosmovisor/vA.B.x`, where A and B are a number (e.g. `release/cosmovisor/v1.2.x`). Releases are tagged using the following format: `cosmovisor/vA.B.C`.

## Setup

### Installation

You can download Cosmovisor from the [Github releases](https://github.com/cosmos/cosmos-sdk/releases/tag/cosmovisor%2Fv1.2.1).

To install the latest version of `cosmovisor`, run the following command:

```sh
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest
```

To install a previous version, you can specify the version. IMPORTANT: Chains that use Cosmos-SDK v0.44.3 or earlier (eg v0.44.2) and want to use auto-download feature MUST use Cosmovisor v0.1.0
To install a previous version, you can specify the version. IMPORTANT: Chains that use Cosmos-SDK v0.44.3 or earlier (eg v0.44.2) and want to use auto-download feature MUST use `cosmovisor v0.1.0`

```sh
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/[email protected]
```

You can run `cosmovisor version` to check the Cosmovisor version (works only with Cosmovisor >1.1.0).
Run `cosmovisor version` to check the cosmovisor version.

You can also install from source by pulling the cosmos-sdk repository and switching to the correct version and building as follows:

Expand Down
15 changes: 5 additions & 10 deletions cosmovisor/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# Cosmovisor v1.2.0 Release Notes

### New Features

With the `cosmovisor init` command, all the necessary folders for using cosmovisor are automatically created. You do not need to manually symlink the chain binary anymore.

We've added a new configuration option: `DAEMON_RESTART_DELAY` (as env variable). When set, Cosmovisor will wait that delay between the node halt and backup. See the [README](https://github.com/cosmos/cosmos-sdk/blob/main/cosmovisor/README.md#command-line-arguments-and-environment-variables) file for more details.
# Cosmovisor v1.2.1 Release Notes

### Bug Fixes

* Fix Cosmovisor binary usage for pre-upgrade. Cosmovisor was using the wrong binary when running a `pre-upgrade` command.

* Fix failure when installing cosmovisor via `go install`.
* Fix plan path case sensitivity issue.

### Changelog

For more details, please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/cosmovisor/v1.1.0/cosmovisor/CHANGELOG.md).
For more details, please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/cosmovisor/v1.2.1/cosmovisor/CHANGELOG.md).
7 changes: 7 additions & 0 deletions cosmovisor/args_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ func (s *argsTestSuite) TestConfigPaths() {
expectGenesis: fmt.Sprintf("/longer/prefix/%s/genesis/bin/yourd", rootName),
expectUpgrade: "/longer/prefix/cosmovisor/upgrades/some%20spaces/bin/yourd",
},
"handle casing": {
cfg: Config{Home: "/longer/prefix/", Name: "appd"},
upgradeName: "myUpgrade",
expectRoot: fmt.Sprintf("/longer/prefix/%s", rootName),
expectGenesis: fmt.Sprintf("/longer/prefix/%s/genesis/bin/appd", rootName),
expectUpgrade: "/longer/prefix/cosmovisor/upgrades/myUpgrade/bin/appd",
},
}

for _, tc := range cases {
Expand Down
22 changes: 14 additions & 8 deletions cosmovisor/cmd/cosmovisor/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"encoding/json"
"fmt"
"runtime/debug"
"strings"

"github.com/cosmos/cosmos-sdk/cosmovisor"
Expand All @@ -15,12 +16,8 @@ func init() {
rootCmd.AddCommand(versionCmd)
}

var (
// Version represents Cosmovisor version value. Overwritten during build
Version = "1.2.0"
// OutputFlag defines the output format flag
OutputFlag = "output"
)
// OutputFlag defines the output format flag
var OutputFlag = "output"

var versionCmd = &cobra.Command{
Use: "version",
Expand All @@ -37,8 +34,17 @@ var versionCmd = &cobra.Command{
},
}

func getVersion() string {
version, ok := debug.ReadBuildInfo()
if !ok {
panic("failed to get cosmovisor version")
}

return strings.TrimSpace(version.Main.Version)
}

func printVersion(logger *zerolog.Logger, args []string) error {
fmt.Println("cosmovisor version: ", Version)
fmt.Printf("cosmovisor version: %s\n", getVersion())

if err := Run(logger, append([]string{"version"}, args...)); err != nil {
return fmt.Errorf("failed to run version command: %w", err)
Expand Down Expand Up @@ -66,7 +72,7 @@ func printVersionJSON(logger *zerolog.Logger, args []string) error {
Version string `json:"cosmovisor_version"`
AppVersion json.RawMessage `json:"app_version"`
}{
Version: Version,
Version: getVersion(),
AppVersion: json.RawMessage(buf.String()),
})
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions cosmovisor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,3 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
12 changes: 9 additions & 3 deletions cosmovisor/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,11 @@ github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8=
Expand Down Expand Up @@ -642,6 +647,8 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8
github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0=
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
Expand Down Expand Up @@ -903,8 +910,6 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ=
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI=
github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5/go.mod h1:+u151txRmLpwxBmpYn9z3d1sdJdjRPQpsXuYeY9jNls=
github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96/go.mod h1:90HvCY7+oHHUKkbeMCiHt1WuFR2/hPJ9QrljDG+v6ls=
github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e/go.mod h1:80FQABjoFzZ2M5uEa6FUaJYEmqU2UOKojlFVak1UAwI=
Expand Down Expand Up @@ -1437,8 +1442,10 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
Expand Down Expand Up @@ -1624,7 +1631,6 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfG
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
Expand Down
4 changes: 0 additions & 4 deletions cosmovisor/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,5 @@ func parseUpgradeInfoFile(filename string) (upgradetypes.Plan, error) {
return upgradetypes.Plan{}, fmt.Errorf("invalid upgrade-info.json content; name and height must be not empty; got: %v", ui)
}

// Normalize name to prevent operator error in upgrade name case sensitivity
// errors.
ui.Name = strings.ToLower(ui.Name)

return ui, err
}
79 changes: 46 additions & 33 deletions cosmovisor/scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,52 @@ func TestParseUpgradeInfoFile(t *testing.T) {
filename string
expectUpgrade upgradetypes.Plan
expectErr bool
}{{
filename: "f1-good.json",
expectUpgrade: upgradetypes.Plan{Name: "upgrade1", Info: "some info", Height: 123},
expectErr: false,
}, {
filename: "f2-bad-type.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
}, {
filename: "f2-bad-type-2.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
}, {
filename: "f3-empty.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
}, {
filename: "f4-empty-obj.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
}, {
filename: "f5-partial-obj-1.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
}, {
filename: "f5-partial-obj-2.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
}, {
filename: "unknown.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
}}
}{
{
filename: "f1-good.json",
expectUpgrade: upgradetypes.Plan{Name: "upgrade1", Info: "some info", Height: 123},
expectErr: false,
},
{
filename: "f2-good.json",
expectUpgrade: upgradetypes.Plan{Name: "Upgrade2", Info: "some info", Height: 125},
expectErr: false,
},
{
filename: "f2-bad-type.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
},
{
filename: "f2-bad-type-2.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
},
{
filename: "f3-empty.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
},
{
filename: "f4-empty-obj.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
},
{
filename: "f5-partial-obj-1.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
},
{
filename: "f5-partial-obj-2.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
},
{
filename: "unknown.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
}}

for i := range cases {
tc := cases[i]
Expand Down
1 change: 1 addition & 0 deletions cosmovisor/testdata/upgrade-files/f2-good.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name": "Upgrade2", "info": "some info", "height": 125}
2 changes: 1 addition & 1 deletion crypto/keyring/keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ func newRealPrompt(dir string, buf io.Reader) func(string) (string, error) {
}

buf := bufio.NewReader(buf)
pass, err := input.GetPassword("Enter keyring passphrase:", buf)
pass, err := input.GetPassword(fmt.Sprintf("Enter keyring passphrase (attempt %d/%d):", failureCounter, maxPassphraseEntryAttempts), buf)
if err != nil {
// NOTE: LGTM.io reports a false positive alert that states we are printing the password,
// but we only log the error.
Expand Down
Loading

0 comments on commit ff55412

Please sign in to comment.