Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment client breaking #5811

Closed

Conversation

jgimeno
Copy link
Contributor

@jgimeno jgimeno commented Mar 16, 2020

Closes: #5748

Description


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@alessio
Copy link
Contributor

alessio commented Mar 16, 2020

Input file file.json (provided by @jgimeno):

alessio@bangalter:~/work/gaia$ cat file.json 
{"type":"cosmos-sdk/StdTx","value":{"msg":[{"type":"cosmos-sdk/MsgCreateValidator","value":{"description":{"moniker":"testing"},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"cosmos139ge8zja3cdeqyj9ln4w7864ns2qd32m85cn6r","validator_address":"cosmosvaloper139ge8zja3cdeqyj9ln4w7864ns2qd32mzqvxks","pubkey":"cosmosvalconspub1zcjduepqphuekucs22f5sc48f2truzu5ckvghtj9y4uq2g7gw0funw8gcw8svgzdmt","value":{"denom":"stake","amount":"100000000"}}}],"fee":{"amount":[],"gas":"200000"},"signatures":[{"pub_key":{"type":"tendermint/PubKeySecp256k1","value":"AyD7bZGcZUCvrK3W3kkKouJgBVJlzLaqyK4B8wbjfnRd"},"signature":"RcqEAbVWkzQjU3vVwkIZPzWpCkR8w9h0tMyTa4TivYMXagiC2TpVnY7b4+acLKT9JKLK5SOaU/BIu3vH3cSsOg=="}],"memo":"777460061688fddbaa04fd1b40f850179b45de76@192.168.1.17:26656"}}

Compile gaia from master branch:

alessio@bangalter:~/work/gaia$ make install
go install -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=gaia -X github.com/cosmos/cosmos-sdk/version.ServerName=gaiad -X github.com/cosmos/cosmos-sdk/version.ClientName=gaiacli -X github.com/cosmos/cosmos-sdk/version.Version=0.0.0-159-g680bb19 -X github.com/cosmos/cosmos-sdk/version.Commit=680bb196d6c5ece0c78875dff0175fdd780711ac -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"' -trimpath ./cmd/gaiad
go install -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=gaia -X github.com/cosmos/cosmos-sdk/version.ServerName=gaiad -X github.com/cosmos/cosmos-sdk/version.ClientName=gaiacli -X github.com/cosmos/cosmos-sdk/version.Version=0.0.0-159-g680bb19 -X github.com/cosmos/cosmos-sdk/version.Commit=680bb196d6c5ece0c78875dff0175fdd780711ac -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"' -trimpath ./cmd/gaiacli

Verifying gaiacli version output:

alessio@bangalter:~/work/gaia$ gaiacli version --long --output=text
name: gaia
server_name: gaiad
client_name: gaiacli
version: 0.0.0-159-g680bb19
commit: 680bb196d6c5ece0c78875dff0175fdd780711ac
build_tags: netgo,ledger
go: go version go1.14 linux/amd64

Encoding file.json and saving output to output.master

alessio@bangalter:~/work/gaia$ gaiacli tx encode file.json > output.master

Compiling gaia from master HEAD-1 commit:

alessio@bangalter:~/work/gaia$ git checkout 89e8df1882f6af6b939bc6f8a5f244b0cb04619d
Note: switching to '89e8df1882f6af6b939bc6f8a5f244b0cb04619d'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
  git switch -c <new-branch-name>
Or undo this operation with:
  git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 89e8df1 Merge PR #312: proto: remove proto mentions
alessio@bangalter:~/work/gaia$ make install
go install -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=gaia -X github.com/cosmos/cosmos-sdk/version.ServerName=gaiad -X github.com/cosmos/cosmos-sdk/version.ClientName=gaiacli -X github.com/cosmos/cosmos-sdk/version.Version=0.0.0-158-g89e8df1 -X github.com/cosmos/cosmos-sdk/version.Commit=89e8df1882f6af6b939bc6f8a5f244b0cb04619d -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"' -trimpath ./cmd/gaiad
go install -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=gaia -X github.com/cosmos/cosmos-sdk/version.ServerName=gaiad -X github.com/cosmos/cosmos-sdk/version.ClientName=gaiacli -X github.com/cosmos/cosmos-sdk/version.Version=0.0.0-158-g89e8df1 -X github.com/cosmos/cosmos-sdk/version.Commit=89e8df1882f6af6b939bc6f8a5f244b0cb04619d -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"' -trimpath ./cmd/gaiacli

Verifying gaia version output:

alessio@bangalter:~/work/gaia$ gaiacli version --long --output=text
name: gaia
server_name: gaiad
client_name: gaiacli
version: 0.0.0-158-g89e8df1
commit: 89e8df1882f6af6b939bc6f8a5f244b0cb04619d
build_tags: netgo,ledger
go: go version go1.14 linux/amd64

Encoding file.json and saving output to output.89e8df1882f6af6b939bc6f8a5f244b0cb04619d:

alessio@bangalter:~/work/gaia$ gaiacli tx encode file.json > output.89e8df1882f6af6b939bc6f8a5f244b0cb04619d

Compare outputs:

alessio@bangalter:~/work/gaia$ diff -u output.master output.89e8df1882f6af6b939bc6f8a5f244b0cb04619d 
--- output.master	2020-03-17 00:34:34.518007264 +0100
+++ output.89e8df1882f6af6b939bc6f8a5f244b0cb04619d	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ei7e8fdxKw6Ijs3Nzc0NjAwNjE2ODhmZGRiYWEwNGZkMWI0MGY4NTAxNzliNDVkZTc2QDE5Mi4xNjguMS4xNzoyNjY1Ng=="

@alexanderbez alexanderbez reopened this Mar 16, 2020
@@ -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.
* (codec) [\#5799](https://github.com/cosmos/cosmos-sdk/pull/5799) Now we favor the use of MarshalBinaryBare instead of LengthPrefixed in all cases that are not needed,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgimeno can we instead state which commands break here. AFAIK, it's only tx encode/decode.

Copy link
Contributor

@alessio alessio Mar 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit concerning: cosmos/gaia@680bb19#diff-ef04ec516e080b802253864b259addb3L621

Because of the changes in coins serialization, I'd advise to warn the users about the impact of the change instead of mentioning every single affected command (which could potentially be many)

EDIT: nevermind, that's a different thing (#5790)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plus, @jgimeno I'd advise to revert the changes in keys serialization. That risks to be a very painful issue for the users

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Errr what you linked @alessio has nothing to do with serialization. That's a completely orthogonal change and has been stated in the CHANGELOG already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgimeno
Copy link
Contributor Author

jgimeno commented Mar 17, 2020

#5814 we add the comment here.

@jgimeno jgimeno closed this Mar 17, 2020
@tac0turtle tac0turtle deleted the jonathan/5748-update-breaking-changes-changelog branch March 4, 2021 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Favor Marshal/Unmarshal BinaryBare over Length-Prefixing
3 participants