Skip to content

Commit 59fab91

Browse files
committed
Merge remote-tracking branch 'upstream/launchpad/backports' into v0.39
2 parents 8062d95 + 2727c14 commit 59fab91

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4507
-2755
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# CODEOWNERS: https://help.github.com/articles/about-codeowners/
22

3-
# Primary repo maintainers
4-
* @rigelrozanski @alexanderbez @jackzampolin @alessio @fedekunze
3+
# Launchpad Stable Release Managers
4+
* @alessio @clevinson @ethanfrey
55

6-
###############################################################################
7-
# Module Specific Ownership
8-
# See CONTRIBUTING.md for further details
9-
###############################################################################
10-
11-
# The following contributors own all files in the x/nft directory at the root
12-
# of the repository and any of its subdirectories.
13-
x/nft @okwme @fedekunze

.github/workflows/sims.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
needs: [build, install-runsim]
3535
steps:
3636
- uses: actions/checkout@v2
37-
- uses: technote-space/get-diff-action@v1
37+
- uses: technote-space/get-diff-action@v4
3838
with:
3939
SUFFIX_FILTER: |
4040
.go
@@ -57,7 +57,7 @@ jobs:
5757
needs: [build, install-runsim]
5858
steps:
5959
- uses: actions/checkout@v2
60-
- uses: technote-space/get-diff-action@v1
60+
- uses: technote-space/get-diff-action@v4
6161
with:
6262
SUFFIX_FILTER: |
6363
.go
@@ -80,7 +80,7 @@ jobs:
8080
needs: [build, install-runsim]
8181
steps:
8282
- uses: actions/checkout@v2
83-
- uses: technote-space/get-diff-action@v1
83+
- uses: technote-space/get-diff-action@v4
8484
with:
8585
SUFFIX_FILTER: |
8686
.go
@@ -103,7 +103,7 @@ jobs:
103103
needs: [build, install-runsim]
104104
steps:
105105
- uses: actions/checkout@v2
106-
- uses: technote-space/get-diff-action@v1
106+
- uses: technote-space/get-diff-action@v4
107107
with:
108108
SUFFIX_FILTER: |
109109
.go

.github/workflows/test.yml

Lines changed: 145 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,163 @@ jobs:
1313
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
1414
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
1515

16-
test-coverage-upload:
16+
split-test-files:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/setup-go@v2-beta
2019
- uses: actions/checkout@v2
21-
- uses: technote-space/get-diff-action@v1
20+
- name: Create a file with all the pkgs
21+
run: go list ./... > pkgs.txt
22+
- name: Split pkgs into 4 files
23+
run: split -n l/4 --additional-suffix=.txt ./pkgs.txt
24+
# cache multiple
25+
- uses: actions/upload-artifact@v2
26+
with:
27+
name: "${{ github.sha }}-aa"
28+
path: ./xaa.txt
29+
- uses: actions/upload-artifact@v2
30+
with:
31+
name: "${{ github.sha }}-ab"
32+
path: ./xab.txt
33+
- uses: actions/upload-artifact@v2
34+
with:
35+
name: "${{ github.sha }}-ac"
36+
path: ./xac.txt
37+
- uses: actions/upload-artifact@v2
38+
with:
39+
name: "${{ github.sha }}-ad"
40+
path: ./xad.txt
41+
42+
test-coverage-run-1:
43+
runs-on: ubuntu-latest
44+
needs: split-test-files
45+
timeout-minutes: 15
46+
steps:
47+
- uses: actions/checkout@v2
48+
- uses: technote-space/get-diff-action@v3
2249
id: git_diff
2350
with:
2451
SUFFIX_FILTER: |
2552
.go
2653
.mod
2754
.sum
28-
- name: build
55+
- uses: actions/download-artifact@v2
56+
with:
57+
name: "${{ github.sha }}-aa"
58+
if: "env.GIT_DIFF != ''"
59+
- name: test & coverage report creation
2960
run: |
30-
make build
61+
cat xaa.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
62+
if: "env.GIT_DIFF != ''"
63+
- name: filter out DONTCOVER
64+
run: |
65+
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
66+
excludelist+=" $(find ./ -type f -name '*.pb.go')"
67+
excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')"
68+
for filename in ${excludelist}; do
69+
filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g')
70+
echo "Excluding ${filename} from coverage report..."
71+
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
72+
done
73+
if: "env.GIT_DIFF != ''"
74+
- uses: codecov/codecov-action@v1.0.13
75+
with:
76+
file: ./coverage.txt
3177
if: "env.GIT_DIFF != ''"
3278

79+
test-coverage-run-2:
80+
runs-on: ubuntu-latest
81+
needs: split-test-files
82+
timeout-minutes: 15
83+
steps:
84+
- uses: actions/checkout@v2
85+
- uses: technote-space/get-diff-action@v3
86+
id: git_diff
87+
with:
88+
SUFFIX_FILTER: |
89+
.go
90+
.mod
91+
.sum
92+
- uses: actions/download-artifact@v2
93+
with:
94+
name: "${{ github.sha }}-ab"
95+
if: "env.GIT_DIFF != ''"
96+
- name: test & coverage report creation
97+
run: |
98+
cat xab.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
99+
if: "env.GIT_DIFF != ''"
100+
- name: filter out DONTCOVER
101+
run: |
102+
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
103+
excludelist+=" $(find ./ -type f -name '*.pb.go')"
104+
excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')"
105+
for filename in ${excludelist}; do
106+
filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g')
107+
echo "Excluding ${filename} from coverage report..."
108+
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
109+
done
110+
if: "env.GIT_DIFF != ''"
111+
- uses: codecov/codecov-action@v1.0.13
112+
with:
113+
file: ./coverage.txt
114+
if: "env.GIT_DIFF != ''"
115+
116+
test-coverage-run-3:
117+
runs-on: ubuntu-latest
118+
needs: split-test-files
119+
timeout-minutes: 15
120+
steps:
121+
- uses: actions/checkout@v2
122+
- uses: technote-space/get-diff-action@v3
123+
id: git_diff
124+
with:
125+
SUFFIX_FILTER: |
126+
.go
127+
.mod
128+
.sum
129+
- uses: actions/download-artifact@v2
130+
with:
131+
name: "${{ github.sha }}-ac"
132+
if: "env.GIT_DIFF != ''"
133+
- name: test & coverage report creation
134+
run: |
135+
cat xac.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
136+
if: "env.GIT_DIFF != ''"
137+
- name: filter out DONTCOVER
138+
run: |
139+
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
140+
excludelist+=" $(find ./ -type f -name '*.pb.go')"
141+
excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')"
142+
for filename in ${excludelist}; do
143+
filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g')
144+
echo "Excluding ${filename} from coverage report..."
145+
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
146+
done
147+
if: "env.GIT_DIFF != ''"
148+
- uses: codecov/codecov-action@v1.0.13
149+
with:
150+
file: ./coverage.txt
151+
if: "env.GIT_DIFF != ''"
152+
153+
test-coverage-run-4:
154+
runs-on: ubuntu-latest
155+
needs: split-test-files
156+
timeout-minutes: 15
157+
steps:
158+
- uses: actions/checkout@v2
159+
- uses: technote-space/get-diff-action@v3
160+
id: git_diff
161+
with:
162+
SUFFIX_FILTER: |
163+
.go
164+
.mod
165+
.sum
166+
- uses: actions/download-artifact@v2
167+
with:
168+
name: "${{ github.sha }}-ad"
169+
if: "env.GIT_DIFF != ''"
33170
- name: test & coverage report creation
34171
run: |
35-
go test ./... -mod=readonly -timeout 12m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
172+
cat xad.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
36173
if: "env.GIT_DIFF != ''"
37174
- name: filter out DONTCOVER
38175
run: |
@@ -45,8 +182,7 @@ jobs:
45182
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
46183
done
47184
if: "env.GIT_DIFF != ''"
48-
- uses: codecov/codecov-action@v1
185+
- uses: codecov/codecov-action@v1.0.13
49186
with:
50-
file: ./coverage.txt # optional
51-
fail_ci_if_error: true
187+
file: ./coverage.txt
52188
if: "env.GIT_DIFF != ''"

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,27 @@ Ref: https://keepachangelog.com/en/1.0.0/
3535

3636
# Changelog
3737

38+
## [v0.39.2]
39+
40+
### Features
41+
42+
* (types/coin.go) [\#6755](https://github.com/cosmos/cosmos-sdk/pull/6755) [\#8001](https://github.com/cosmos/cosmos-sdk/pull/8001) Allow custom regex validation for `Coin` denom through `SetCoinDenomRegex()`.
43+
* (version) [\#7835](https://github.com/cosmos/cosmos-sdk/issues/7835) [\#7940](https://github.com/cosmos/cosmos-sdk/issues/7940) The version --long command now shows the list of build dependencies and their versioning information.
44+
45+
### Improvements
46+
47+
* (deps) Bump Tendermint version to [v0.33.9](https://github.com/tendermint/tendermint/releases/tag/v0.33.9)
48+
49+
### Bug Fixes
50+
51+
* (crypto) [\#7966](https://github.com/cosmos/cosmos-sdk/issues/7966) `BIP44Params` `String()` method now correctly returns the absolute HD path by adding the `m/` prefix.
52+
* (client) [\#7588](https://github.com/cosmos/cosmos-sdk/issues/7588) Fix gov votes querier to use proper query params.
53+
* (types) [\#7038](https://github.com/cosmos/cosmos-sdk/issues/7038) Fix infinite looping of `ApproxRoot` by including a hard-coded maximum iterations limit of 100.
54+
* (types) [\#7084](https://github.com/cosmos/cosmos-sdk/pull/7084) Fix panic when calling `BigInt()` on an uninitialized `Int`.
55+
* (client) [\#7048](https://github.com/cosmos/cosmos-sdk/issues/7048) Fix client `keys add` failure when generating mnemonic in interactive mode.
56+
* (keys) [\#7397](https://github.com/cosmos/cosmos-sdk/pull/7397) Update 99designs/keyring to v1.1.6 for go 1.15 compatibility.
57+
* (kvstore) [\#7385](https://github.com/cosmos/cosmos-sdk/issues/7385) Allow new stores to be registered during on-chain upgrades.
58+
3859
## [v0.39.1]
3960

4061
* (x/auth) [\#6861](https://github.com/cosmos/cosmos-sdk/pull/6861) Remove public key Bech32 encoding for all account types for JSON serialization, instead relying on direct Amino encoding. In addition, JSON serialization utilizes Amino instead of the Go stdlib, so integers are treated as strings.

RELEASE_NOTES.md

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,47 @@
1-
# Cosmos SDK v0.39.1 Release Notes
1+
# Cosmos SDK v0.39.2 Release Notes
22

3-
This release fixes the [issue affecting the accounts migration](https://github.com/cosmos/cosmos-sdk/issues/6828) from v0.38 to v0.39.
3+
This release fixes various bugs and brings coin's denom validation to the *Cosmos SDK 0.39* release series.
44

5-
See the [Cosmos SDK 0.39.1 milestone](https://github.com/cosmos/cosmos-sdk/milestone/29?closed=1) on our issue tracker for details.
5+
See the [Cosmos SDK 0.39.2 milestone](https://github.com/cosmos/cosmos-sdk/milestone/30?closed=1) on our issue tracker for details.
66

7-
## Remove custom JSON serialization for account types
7+
## Allow ValidateDenom() to be customised per application
88

9-
Account types JSON serialization has now changed to Amino. Changes are significant (e.g. integers are treated
10-
as strings) thus it is required to migrate the exported state of an application before restarting the node
11-
with a more recent version of the Cosmos SDK.
9+
Applications can now customise `types.Coin` denomination validation by passing
10+
their application-specific validation function to `types.SetCoinDenomRegex()`.
1211

13-
## REST server's --unsafe-cors mode
12+
## Upgrade queries don't work after upgrade
1413

15-
This a UX improvement [back ported from master](https://github.com/cosmos/cosmos-sdk/pull/6853) that allows developers to disable CORS
16-
restrictions during app development and testing by passing the `--unsafe-cors` option to the client's `rest-server` command.
14+
New stores can now be registered during an on-chain upgrade. This is to
15+
prevent blockchain state queries from stopping working after a successful upgrade.
1716

18-
## Tendermint 0.33.7
17+
## ApproxRoot() infinite looping
1918

20-
Tendermint 0.33.7 brings an important regression fix. Please refer to [this bug report](https://github.com/tendermint/tendermint/issues/5112) for more information.
19+
The `types.Dec.ApproxRoot()` function has now a maximum number 100 iterations as backup boundary
20+
condition to prevent the client's code from entering an endless loop.
21+
22+
## Go 1.15
23+
24+
This is the first release of the Launchpad series that has been tested and built with **go 1.15**.
25+
26+
## Tendermint's updates
27+
28+
Tendermint has received a few updates in the last development cycle.
29+
30+
The pings frequency for remote private validators and the number of GetPubKey requests
31+
have been reduced to prevent validators from [failing to sync when using remote signers](https://github.com/tendermint/tendermint/issues/5550).
32+
33+
A security vulnerability that affected the Go's `encoding/binary` package was reported.
34+
Tendermint's `v0.33.8` release was published with the objective to aid users in using the correct version of Go.
35+
Please refer to [this bug report](https://github.com/golang/go/issues/40618) for more information.
36+
37+
## Known issues
38+
39+
Keyrings using the `test` backend that were created with applications built with `Cosmos SDK v0.39.1`
40+
and `go 1.15` may break with the following error after re-compiling with `Cosmos SDK v0.39.2`:
41+
42+
```
43+
ERROR: aes.KeyUnwrap(): integrity check failed.
44+
```
45+
46+
This is due to [the update](https://github.com/99designs/keyring/pull/75) that the `jose2go` dependency
47+
has received that made it [fully compatible with go 1.15](https://github.com/dvsekhvalnov/jose2go/issues/26).

baseapp/baseapp_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ func TestLoadVersionPruning(t *testing.T) {
364364

365365
for _, v := range []int64{1, 2, 4} {
366366
_, err = app.cms.CacheMultiStoreWithVersion(v)
367-
require.Error(t, err)
367+
require.NoError(t, err)
368368
}
369369

370370
for _, v := range []int64{3, 5, 6, 7} {

client/keys/add.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,21 +216,25 @@ func RunAddCmd(cmd *cobra.Command, args []string, kb keys.Keybase, inBuf *bufio.
216216
}
217217

218218
// Get bip39 mnemonic
219-
var mnemonic string
220-
var bip39Passphrase string
219+
var mnemonic, bip39Passphrase string
221220

222-
if interactive || viper.GetBool(flagRecover) {
223-
bip39Message := "Enter your bip39 mnemonic"
224-
if !viper.GetBool(flagRecover) {
225-
bip39Message = "Enter your bip39 mnemonic, or hit enter to generate one."
221+
recover, _ := cmd.Flags().GetBool(flagRecover)
222+
if recover {
223+
mnemonic, err = input.GetString("Enter your bip39 mnemonic", inBuf)
224+
if err != nil {
225+
return err
226226
}
227227

228-
mnemonic, err = input.GetString(bip39Message, inBuf)
228+
if !bip39.IsMnemonicValid(mnemonic) {
229+
return errors.New("invalid mnemonic")
230+
}
231+
} else if interactive {
232+
mnemonic, err = input.GetString("Enter your bip39 mnemonic, or hit enter to generate one.", inBuf)
229233
if err != nil {
230234
return err
231235
}
232236

233-
if !bip39.IsMnemonicValid(mnemonic) {
237+
if !bip39.IsMnemonicValid(mnemonic) && mnemonic != "" {
234238
return errors.New("invalid mnemonic")
235239
}
236240
}

0 commit comments

Comments
 (0)