Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/launchpad/backports' into v0.39
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominator008 committed Nov 24, 2020
2 parents 8062d95 + 2727c14 commit 59fab91
Show file tree
Hide file tree
Showing 43 changed files with 4,507 additions and 2,755 deletions.
12 changes: 2 additions & 10 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# CODEOWNERS: https://help.github.com/articles/about-codeowners/

# Primary repo maintainers
* @rigelrozanski @alexanderbez @jackzampolin @alessio @fedekunze
# Launchpad Stable Release Managers
* @alessio @clevinson @ethanfrey

###############################################################################
# Module Specific Ownership
# See CONTRIBUTING.md for further details
###############################################################################

# The following contributors own all files in the x/nft directory at the root
# of the repository and any of its subdirectories.
x/nft @okwme @fedekunze
8 changes: 4 additions & 4 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
- uses: technote-space/get-diff-action@v4
with:
SUFFIX_FILTER: |
.go
Expand All @@ -57,7 +57,7 @@ jobs:
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
- uses: technote-space/get-diff-action@v4
with:
SUFFIX_FILTER: |
.go
Expand All @@ -80,7 +80,7 @@ jobs:
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
- uses: technote-space/get-diff-action@v4
with:
SUFFIX_FILTER: |
.go
Expand All @@ -103,7 +103,7 @@ jobs:
needs: [build, install-runsim]
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
- uses: technote-space/get-diff-action@v4
with:
SUFFIX_FILTER: |
.go
Expand Down
154 changes: 145 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,163 @@ jobs:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

test-coverage-upload:
split-test-files:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2-beta
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
- name: Create a file with all the pkgs
run: go list ./... > pkgs.txt
- name: Split pkgs into 4 files
run: split -n l/4 --additional-suffix=.txt ./pkgs.txt
# cache multiple
- uses: actions/upload-artifact@v2
with:
name: "${{ github.sha }}-aa"
path: ./xaa.txt
- uses: actions/upload-artifact@v2
with:
name: "${{ github.sha }}-ab"
path: ./xab.txt
- uses: actions/upload-artifact@v2
with:
name: "${{ github.sha }}-ac"
path: ./xac.txt
- uses: actions/upload-artifact@v2
with:
name: "${{ github.sha }}-ad"
path: ./xad.txt

test-coverage-run-1:
runs-on: ubuntu-latest
needs: split-test-files
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v3
id: git_diff
with:
SUFFIX_FILTER: |
.go
.mod
.sum
- name: build
- uses: actions/download-artifact@v2
with:
name: "${{ github.sha }}-aa"
if: "env.GIT_DIFF != ''"
- name: test & coverage report creation
run: |
make build
cat xaa.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
if: "env.GIT_DIFF != ''"
- name: filter out DONTCOVER
run: |
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
excludelist+=" $(find ./ -type f -name '*.pb.go')"
excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')"
for filename in ${excludelist}; do
filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g')
echo "Excluding ${filename} from coverage report..."
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
done
if: "env.GIT_DIFF != ''"
- uses: codecov/[email protected]
with:
file: ./coverage.txt
if: "env.GIT_DIFF != ''"

test-coverage-run-2:
runs-on: ubuntu-latest
needs: split-test-files
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v3
id: git_diff
with:
SUFFIX_FILTER: |
.go
.mod
.sum
- uses: actions/download-artifact@v2
with:
name: "${{ github.sha }}-ab"
if: "env.GIT_DIFF != ''"
- name: test & coverage report creation
run: |
cat xab.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
if: "env.GIT_DIFF != ''"
- name: filter out DONTCOVER
run: |
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
excludelist+=" $(find ./ -type f -name '*.pb.go')"
excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')"
for filename in ${excludelist}; do
filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g')
echo "Excluding ${filename} from coverage report..."
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
done
if: "env.GIT_DIFF != ''"
- uses: codecov/[email protected]
with:
file: ./coverage.txt
if: "env.GIT_DIFF != ''"

test-coverage-run-3:
runs-on: ubuntu-latest
needs: split-test-files
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v3
id: git_diff
with:
SUFFIX_FILTER: |
.go
.mod
.sum
- uses: actions/download-artifact@v2
with:
name: "${{ github.sha }}-ac"
if: "env.GIT_DIFF != ''"
- name: test & coverage report creation
run: |
cat xac.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
if: "env.GIT_DIFF != ''"
- name: filter out DONTCOVER
run: |
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
excludelist+=" $(find ./ -type f -name '*.pb.go')"
excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')"
for filename in ${excludelist}; do
filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g')
echo "Excluding ${filename} from coverage report..."
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
done
if: "env.GIT_DIFF != ''"
- uses: codecov/[email protected]
with:
file: ./coverage.txt
if: "env.GIT_DIFF != ''"

test-coverage-run-4:
runs-on: ubuntu-latest
needs: split-test-files
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v3
id: git_diff
with:
SUFFIX_FILTER: |
.go
.mod
.sum
- uses: actions/download-artifact@v2
with:
name: "${{ github.sha }}-ad"
if: "env.GIT_DIFF != ''"
- name: test & coverage report creation
run: |
go test ./... -mod=readonly -timeout 12m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
cat xad.txt | xargs go test -mod=readonly -timeout 15m -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock'
if: "env.GIT_DIFF != ''"
- name: filter out DONTCOVER
run: |
Expand All @@ -45,8 +182,7 @@ jobs:
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
done
if: "env.GIT_DIFF != ''"
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v1.0.13
with:
file: ./coverage.txt # optional
fail_ci_if_error: true
file: ./coverage.txt
if: "env.GIT_DIFF != ''"
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,27 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Changelog

## [v0.39.2]

### Features

* (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()`.
* (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.

### Improvements

* (deps) Bump Tendermint version to [v0.33.9](https://github.com/tendermint/tendermint/releases/tag/v0.33.9)

### Bug Fixes

* (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.
* (client) [\#7588](https://github.com/cosmos/cosmos-sdk/issues/7588) Fix gov votes querier to use proper query params.
* (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.
* (types) [\#7084](https://github.com/cosmos/cosmos-sdk/pull/7084) Fix panic when calling `BigInt()` on an uninitialized `Int`.
* (client) [\#7048](https://github.com/cosmos/cosmos-sdk/issues/7048) Fix client `keys add` failure when generating mnemonic in interactive mode.
* (keys) [\#7397](https://github.com/cosmos/cosmos-sdk/pull/7397) Update 99designs/keyring to v1.1.6 for go 1.15 compatibility.
* (kvstore) [\#7385](https://github.com/cosmos/cosmos-sdk/issues/7385) Allow new stores to be registered during on-chain upgrades.

## [v0.39.1]

* (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.
Expand Down
51 changes: 39 additions & 12 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,47 @@
# Cosmos SDK v0.39.1 Release Notes
# Cosmos SDK v0.39.2 Release Notes

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

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

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

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

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

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

## Tendermint 0.33.7
## ApproxRoot() infinite looping

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.
The `types.Dec.ApproxRoot()` function has now a maximum number 100 iterations as backup boundary
condition to prevent the client's code from entering an endless loop.

## Go 1.15

This is the first release of the Launchpad series that has been tested and built with **go 1.15**.

## Tendermint's updates

Tendermint has received a few updates in the last development cycle.

The pings frequency for remote private validators and the number of GetPubKey requests
have been reduced to prevent validators from [failing to sync when using remote signers](https://github.com/tendermint/tendermint/issues/5550).

A security vulnerability that affected the Go's `encoding/binary` package was reported.
Tendermint's `v0.33.8` release was published with the objective to aid users in using the correct version of Go.
Please refer to [this bug report](https://github.com/golang/go/issues/40618) for more information.

## Known issues

Keyrings using the `test` backend that were created with applications built with `Cosmos SDK v0.39.1`
and `go 1.15` may break with the following error after re-compiling with `Cosmos SDK v0.39.2`:

```
ERROR: aes.KeyUnwrap(): integrity check failed.
```

This is due to [the update](https://github.com/99designs/keyring/pull/75) that the `jose2go` dependency
has received that made it [fully compatible with go 1.15](https://github.com/dvsekhvalnov/jose2go/issues/26).
2 changes: 1 addition & 1 deletion baseapp/baseapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ func TestLoadVersionPruning(t *testing.T) {

for _, v := range []int64{1, 2, 4} {
_, err = app.cms.CacheMultiStoreWithVersion(v)
require.Error(t, err)
require.NoError(t, err)
}

for _, v := range []int64{3, 5, 6, 7} {
Expand Down
20 changes: 12 additions & 8 deletions client/keys/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,21 +216,25 @@ func RunAddCmd(cmd *cobra.Command, args []string, kb keys.Keybase, inBuf *bufio.
}

// Get bip39 mnemonic
var mnemonic string
var bip39Passphrase string
var mnemonic, bip39Passphrase string

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

mnemonic, err = input.GetString(bip39Message, inBuf)
if !bip39.IsMnemonicValid(mnemonic) {
return errors.New("invalid mnemonic")
}
} else if interactive {
mnemonic, err = input.GetString("Enter your bip39 mnemonic, or hit enter to generate one.", inBuf)
if err != nil {
return err
}

if !bip39.IsMnemonicValid(mnemonic) {
if !bip39.IsMnemonicValid(mnemonic) && mnemonic != "" {
return errors.New("invalid mnemonic")
}
}
Expand Down
Loading

0 comments on commit 59fab91

Please sign in to comment.