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

R4R: Split Proposal Interface #3779

Merged
merged 21 commits into from
Mar 15, 2019
Merged

Conversation

mossid
Copy link
Contributor

@mossid mossid commented Mar 1, 2019

Closes: #3570

  • 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 entries in PENDING.md with issue #

  • 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 Mar 1, 2019

Codecov Report

Merging #3779 into develop will decrease coverage by 0.15%.
The diff coverage is 56.07%.

@@            Coverage Diff             @@
##           develop   #3779      +/-   ##
==========================================
- Coverage    60.95%   60.8%   -0.16%     
==========================================
  Files          192     192              
  Lines        14360   14350      -10     
==========================================
- Hits          8753    8725      -28     
- Misses        5033    5047      +14     
- Partials       574     578       +4

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Looks great @mossid -- I left a few minor bits of feedback. Mostly around constructor use and panics.

x/gov/endblocker.go Outdated Show resolved Hide resolved
x/gov/endblocker.go Outdated Show resolved Hide resolved
x/gov/genesis_test.go Outdated Show resolved Hide resolved
x/gov/genesis_test.go Outdated Show resolved Hide resolved
x/gov/handler.go Outdated Show resolved Hide resolved
x/gov/keeper.go Outdated Show resolved Hide resolved
x/gov/keeper.go Outdated Show resolved Hide resolved
x/gov/keeper_test.go Outdated Show resolved Hide resolved
x/gov/keeper_test.go Outdated Show resolved Hide resolved
x/gov/keeper_test.go Outdated Show resolved Hide resolved
alexanderbez and others added 5 commits March 1, 2019 22:08
Co-Authored-By: mossid <torecursedivine@gmail.com>
Co-Authored-By: mossid <torecursedivine@gmail.com>
…s/cosmos-sdk into joon/3570-split-proposal-interface
@mossid mossid changed the title R4R: Split Proposal Interface WIP: Split Proposal Interface Mar 2, 2019
@mossid mossid changed the title WIP: Split Proposal Interface R4R: Split Proposal Interface Mar 3, 2019
@mossid mossid changed the title R4R: Split Proposal Interface WIP: Split Proposal Interface Mar 3, 2019
alexanderbez and others added 4 commits March 4, 2019 13:21
Co-Authored-By: mossid <torecursedivine@gmail.com>
Co-Authored-By: mossid <torecursedivine@gmail.com>
…s/cosmos-sdk into joon/3570-split-proposal-interface
@alexanderbez
Copy link
Contributor

@mossid this needs a pending log entry too.

@mossid mossid added this to the v0.34.0 milestone Mar 4, 2019
Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

Mostly, this looks OK to me, but I'm not sure I'm in agreement with the broader design choices outlined in #3565 - I think we should discuss with @sunnya97 - in particular, I don't know if we want all modules to be able to define proposal types, as opposed to having the params module export a write-capable keeper to the governance module.

x/gov/proposals.go Show resolved Hide resolved
x/gov/handler.go Outdated Show resolved Hide resolved
@cwgoes
Copy link
Contributor

cwgoes commented Mar 7, 2019

Upon reflection I think I like this design choice. One note is that we will need multiple modules to be able to react to a particular proposal, and possibly in a predetermined order.

@mossid mossid mentioned this pull request Mar 7, 2019
5 tasks
Copy link
Contributor

@rigelrozanski rigelrozanski left a comment

Choose a reason for hiding this comment

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

Nice design! few comments left within, but generally looks really good

x/gov/proposals.go Show resolved Hide resolved

String() string
// ProposalContent is an interface that has title, description, and proposaltype for the Proposal
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's update this comment - AFAICT the struct which fulfills ProposalContent may also contain more detailed specifications as to how the proposal is to be executed (ex. the parameter set change amount) - we should explain this in this comment here


// checks if two proposals are equal
func ProposalEqual(proposalA Proposal, proposalB Proposal) bool {
if proposalA.ProposalID == proposalB.ProposalID &&
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of testing all the fields, we should simply marshal both proposals and test if the bytes are equal, simplified the code, makes it redundant against field additions. (also we're not so concerned about efficiency as this is used for testing)

@mossid mossid changed the title R4R: Split Proposal Interface WIP: Split Proposal Interface Mar 8, 2019
@alexanderbez
Copy link
Contributor

alexanderbez commented Mar 8, 2019

Looks like test_cover is failing because the governance tests aren't updated @mossid

@alexanderbez alexanderbez removed this from the v0.34.0 milestone Mar 11, 2019
@cwgoes
Copy link
Contributor

cwgoes commented Mar 14, 2019

Glad to re-review but needs a rebase.

@mossid mossid mentioned this pull request Mar 14, 2019
5 tasks
@mossid mossid changed the title WIP: Split Proposal Interface R4R: Split Proposal Interface Mar 14, 2019
Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

ACK, see one comment

x/gov/proposals.go Show resolved Hide resolved
}

// checks if two proposals are equal
func ProposalEqual(proposalA Proposal, proposalB Proposal) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is OK for tests, bad for production (slow), let's note that in a comment

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

ACK still stands 👍

x/gov/test_common.go Outdated Show resolved Hide resolved
@cwgoes cwgoes merged commit 465bb02 into develop Mar 15, 2019
@cwgoes cwgoes deleted the joon/3570-split-proposal-interface branch March 29, 2019 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants