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 Fix Governance state import #3223

Merged
merged 6 commits into from
Jan 7, 2019
Merged

R4R Fix Governance state import #3223

merged 6 commits into from
Jan 7, 2019

Conversation

jackzampolin
Copy link
Member

@jackzampolin jackzampolin commented Jan 3, 2019

Fixes #3203

This fixes an issue with governance state import where proposal state changes are not properly tracked for imported proposals. cc @zmanian @sunnya97

  • Added entries in PENDING.md with issue #
  • rereviewed Files changed in the github PR explorer

@codecov
Copy link

codecov bot commented Jan 3, 2019

Codecov Report

Merging #3223 into develop will increase coverage by 0.48%.
The diff coverage is 58%.

@@             Coverage Diff             @@
##           develop    #3223      +/-   ##
===========================================
+ Coverage    54.86%   55.35%   +0.48%     
===========================================
  Files          133      134       +1     
  Lines         9552     9594      +42     
===========================================
+ Hits          5241     5311      +70     
+ Misses        3989     3951      -38     
- Partials       322      332      +10

@fedekunze
Copy link
Collaborator

fedekunze commented Jan 4, 2019

Needs PENDING entry. Do we also need to check for the cases when the proposal Passed or was Rejected (i.e update the proposal status on those cases)?

@alexanderbez alexanderbez requested a review from sunnya97 January 4, 2019 01:00
x/gov/genesis.go Outdated Show resolved Hide resolved
@jackzampolin
Copy link
Member Author

jackzampolin commented Jan 4, 2019

According to @sunnya97 those are the only proposal statuses that need to be stored. The other statuses are StatusRejected StatusPassed and StatusNil. No actions need to be taken on those, so they are ignored.

Can you provide more info on that @sunnya97?

@fedekunze
Copy link
Collaborator

According to @sunnya97 those are the only proposal statuses that need to be stored. The other statuses are StatusRejected StatusPassed and StatusNil. No actions need to be taken on those, so they are ignored.

@sunnya97 So when you query one of those proposals which status do we get ? Imo we should still update the status if it shows VotingPeriod...

@sunnya97
Copy link
Member

sunnya97 commented Jan 7, 2019

@fedekunze Sorry, I don't understand your question.

@jackzampolin
Yeah, so this fix has to do with making sure we recreate the ActiveProposalQueue and InactiveProposalQueue upon a state import.

The InactiveProposalQueue is where proposals currently in the DepositPeriod wait, until the Deposit period runs out (checked during EndBlocker), after which they are pruned from state if they don't meet the MinDeposit.

The ActiveProposalQueue is where proposals currently in the VotingPeriod wait, until the Voting period runs out (checked during EndBlocker), after which it is tallied.

There is no queue for proposals in the StatusRejected or StatusPassed states. And the StatusNil is just a fake Status so that the "empty value" of ProposalStatus (0x00) is "nil".

@jackzampolin jackzampolin merged commit b6ee053 into develop Jan 7, 2019
@jackzampolin jackzampolin deleted the jack/3203-gov-import branch January 7, 2019 22:24
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.

Governance proposals from previous chain have incorrect proposal_status
4 participants