Skip to content

Change User Supplied Param Change Value to json.RawMessage #4253

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

Merged
merged 5 commits into from
May 2, 2019

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented May 2, 2019

The values in changes in Parameter change proposals are now of type json.RawMessage so users no longer have to string-encode them leading to a better UX.

closes #4237


  • 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.

  • Wrote tests

  • Updated relevant documentation (docs/)

  • Added a relevant changelog entry: clog add [section] [stanza] [message]

  • rereviewed Files changed in the github PR explorer


For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@codecov
Copy link

codecov bot commented May 2, 2019

Codecov Report

Merging #4253 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #4253      +/-   ##
==========================================
- Coverage   58.91%   58.89%   -0.03%     
==========================================
  Files         215      216       +1     
  Lines       14482    14499      +17     
==========================================
+ Hits         8532     8539       +7     
- Misses       5310     5320      +10     
  Partials      640      640

@alexanderbez alexanderbez marked this pull request as ready for review May 2, 2019 12:37
@alexanderbez alexanderbez requested review from fedekunze and mossid May 2, 2019 12:37
Copy link
Contributor

@alessio alessio left a comment

Choose a reason for hiding this comment

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

tACK

It'd be nice to have test cases covering NewParamChangeJSON(),ToParamChange(), and ToParamChanges() to keep up coverage.

I think this is worth a pending entry too.

@alexanderbez
Copy link
Contributor Author

alexanderbez commented May 2, 2019

@alessio it's not worth a pending entry because this feature hasn't been released yet -- ie. the pending log entry would be redundant.

I also added unit tests for the utils.

@alexanderbez alexanderbez requested review from alessio and fedekunze and removed request for alessio May 2, 2019 16:25
Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

LGTM

@alexanderbez
Copy link
Contributor Author

Addressed your feedback @alessio

@@ -44,7 +44,7 @@ where proposal.json contains:
{
"subspace": "staking",
"key": "MaxValidators",
"value": "105"
"value": 105
Copy link
Member

Choose a reason for hiding this comment

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

Does this break amino encoding?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, in this case MaxValidators is a uint16 which isn't string-encoded -- it's just an int.

@alexanderbez alexanderbez merged commit 67f1e12 into master May 2, 2019
@alexanderbez alexanderbez deleted the 4237-param-change-prop-raw-json-values branch May 2, 2019 18:21
@vdsprakash
Copy link

I have tried of changing the the MaxValidators,SignedBlocksWindow in my own test network. The proposal was passed but the parameter is not changed.

@alexanderbez
Copy link
Contributor Author

@vdsprakash I would double check your proposal and if the proposal actually passed or not. If it did not pass, did it fail or was it rejected?

I've tested the param change proposal process on Gaia v2.0.2 which we'll use for the next major upgrade and it works just fine. Here is a screen recording where I change the two parameters you've mentioned.

Here is the parameter change proposal content:

{
  "title": "Update MaxValidators and SignedBlocksWindow params",
  "description": "Update MaxValidators and SignedBlocksWindow params",
  "changes": [
    {
      "subspace": "staking",
      "key": "MaxValidators",
      "value": 200
    },
    {
      "subspace": "slashing",
      "key": "SignedBlocksWindow",
      "value": "200"
    }
  ],
  "deposit": [
    {
      "denom": "stake",
      "amount": "10000000"
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Paramchange Proposal CLI JSON Rawmessage
5 participants