From 25f036f248c7441578d5a03d561dc40ae2acd03d Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 16 Mar 2020 19:02:55 -0400 Subject: [PATCH 1/4] Update params doc with restrictions --- go.mod | 2 +- go.sum | 4 ++-- x/distribution/spec/07_params.md | 16 ++++++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 15d092de1..746d86496 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d github.com/cosmos/ledger-cosmos-go v0.11.1 github.com/gogo/protobuf v1.3.1 - github.com/golang/mock v1.4.1 + github.com/golang/mock v1.4.2 github.com/golang/protobuf v1.3.5 github.com/gorilla/handlers v1.4.2 github.com/gorilla/mux v1.7.4 diff --git a/go.sum b/go.sum index 0b88b0f01..27c8f005d 100644 --- a/go.sum +++ b/go.sum @@ -133,8 +133,8 @@ github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.4.1 h1:ocYkMQY5RrXTYgXl7ICpV0IXwlEQGwKIsery4gyXa1U= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.2 h1:fXIkPzOBCwDUPvYmOPzETABgbqpYlYNigQ2o64eMr5c= +github.com/golang/mock v1.4.2/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= diff --git a/x/distribution/spec/07_params.md b/x/distribution/spec/07_params.md index 5a933e923..2bcefd0c3 100644 --- a/x/distribution/spec/07_params.md +++ b/x/distribution/spec/07_params.md @@ -6,9 +6,13 @@ order: 7 The distribution module contains the following parameters: -| Key | Type | Example | -|---------------------|--------------|------------------------| -| communitytax | string (dec) | "0.020000000000000000" | -| baseproposerreward | string (dec) | "0.010000000000000000" | -| bonusproposerreward | string (dec) | "0.040000000000000000" | -| withdrawaddrenabled | bool | true | +| Key | Type | Example | +| ------------------- | ------------ | -------------------------- | +| communitytax | string (dec) | "0.020000000000000000" [0] | +| baseproposerreward | string (dec) | "0.010000000000000000" [1] | +| bonusproposerreward | string (dec) | "0.040000000000000000" [1] | +| withdrawaddrenabled | bool | true | + +* [0] The value of `communitytax` must be positive and cannot exceed 1%. +* [1] The sum of `baseproposerreward` and `bonusproposerreward` cannot exceed 1%. +Both values must be positive. From 1c7da830c22a144fd176f18e4eaa0448bc55aa5b Mon Sep 17 00:00:00 2001 From: Jonathan Gimeno Date: Tue, 17 Mar 2020 01:36:05 +0100 Subject: [PATCH 2/4] Revert changes for keybase encoding (#5814) --- CHANGELOG.md | 4 +++- crypto/keys/keybase_base.go | 2 +- crypto/keys/types.go | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a19fb7b3..88549940f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,8 @@ balances or a single balance by denom when the `denom` query parameter is presen * [\#5785](https://github.com/cosmos/cosmos-sdk/issues/5785) JSON strings coerced to valid UTF-8 bytes at JSON marshalling time are now replaced by human-readable expressions. This change can potentially break compatibility with all those client side tools that parse log messages. +* (client) [\#5799](https://github.com/cosmos/cosmos-sdk/pull/5799) The `tx encode/decode` commands, due to change on encoding break compatibility with +older clients. ### API Breaking Changes @@ -148,7 +150,7 @@ Buffers for state serialization instead of Amino. to define their own concrete `MsgSubmitProposal` types. * The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by requiring a concrete codec to know how to serialize `Proposal` types. -* (codec) [\#5799](https://github.com/cosmos/cosmos-sdk/pull/5799) Now we favor the use of MarshalBinaryBare instead of LengthPrefixed in all cases that is not needed. +* (codec) [\#5799](https://github.com/cosmos/cosmos-sdk/pull/5799) Now we favor the use of `(Un)MarshalBinaryBare` instead of `(Un)MarshalBinaryLengthPrefixed` in all cases that are not needed. ### Improvements diff --git a/crypto/keys/keybase_base.go b/crypto/keys/keybase_base.go index 86ed00677..47c7e60d7 100644 --- a/crypto/keys/keybase_base.go +++ b/crypto/keys/keybase_base.go @@ -124,7 +124,7 @@ func (kb baseKeybase) DecodeSignature(info Info, msg []byte) (sig []byte, pub tm return nil, nil, err } - if err := CryptoCdc.UnmarshalBinaryBare([]byte(signed), sig); err != nil { + if err := CryptoCdc.UnmarshalBinaryLengthPrefixed([]byte(signed), sig); err != nil { return nil, nil, errors.Wrap(err, "failed to decode signature") } diff --git a/crypto/keys/types.go b/crypto/keys/types.go index c91f2905b..89f5cb2d5 100644 --- a/crypto/keys/types.go +++ b/crypto/keys/types.go @@ -337,12 +337,12 @@ func (i multiInfo) GetPath() (*hd.BIP44Params, error) { // encoding info func marshalInfo(i Info) []byte { - return CryptoCdc.MustMarshalBinaryBare(i) + return CryptoCdc.MustMarshalBinaryLengthPrefixed(i) } // decoding info func unmarshalInfo(bz []byte) (info Info, err error) { - err = CryptoCdc.UnmarshalBinaryBare(bz, &info) + err = CryptoCdc.UnmarshalBinaryLengthPrefixed(bz, &info) return } From b7f2f310a1c3ca3a52c78a4b1eb3cf5139671c02 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2020 09:30:05 -0300 Subject: [PATCH 3/4] Bump github.com/golang/mock from 1.4.2 to 1.4.3 (#5816) Bumps [github.com/golang/mock](https://github.com/golang/mock) from 1.4.2 to 1.4.3. - [Release notes](https://github.com/golang/mock/releases) - [Changelog](https://github.com/golang/mock/blob/master/.goreleaser.yml) - [Commits](https://github.com/golang/mock/compare/v1.4.2...v1.4.3) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 746d86496..9b7561d2d 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d github.com/cosmos/ledger-cosmos-go v0.11.1 github.com/gogo/protobuf v1.3.1 - github.com/golang/mock v1.4.2 + github.com/golang/mock v1.4.3 github.com/golang/protobuf v1.3.5 github.com/gorilla/handlers v1.4.2 github.com/gorilla/mux v1.7.4 diff --git a/go.sum b/go.sum index 6e482a1dd..7e8f83f0a 100644 --- a/go.sum +++ b/go.sum @@ -132,6 +132,8 @@ github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4er github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.4.2 h1:fXIkPzOBCwDUPvYmOPzETABgbqpYlYNigQ2o64eMr5c= github.com/golang/mock v1.4.2/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -583,7 +585,9 @@ honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/quote/v3 v3.1.0 h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= From e0280bf2d51a539500d59b66be5243b73a311b55 Mon Sep 17 00:00:00 2001 From: Gavin <13985253+gavinly@users.noreply.github.com> Date: Tue, 17 Mar 2020 11:30:24 -0400 Subject: [PATCH 4/4] Update 07_params.md --- x/distribution/spec/07_params.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/x/distribution/spec/07_params.md b/x/distribution/spec/07_params.md index 2bcefd0c3..432a4e5a9 100644 --- a/x/distribution/spec/07_params.md +++ b/x/distribution/spec/07_params.md @@ -13,6 +13,5 @@ The distribution module contains the following parameters: | bonusproposerreward | string (dec) | "0.040000000000000000" [1] | | withdrawaddrenabled | bool | true | -* [0] The value of `communitytax` must be positive and cannot exceed 1%. -* [1] The sum of `baseproposerreward` and `bonusproposerreward` cannot exceed 1%. -Both values must be positive. +* [0] The value of `communitytax` must be positive and cannot exceed 1.00. +* [1] `baseproposerreward` and `bonusproposerreward` must be positive and their sum cannot exceed 1.00.