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

Store passed x/gov TextResolutions on chain #669

Closed
ethanfrey opened this issue May 27, 2019 · 4 comments · Fixed by #702
Closed

Store passed x/gov TextResolutions on chain #669

ethanfrey opened this issue May 27, 2019 · 4 comments · Fixed by #702
Assignees

Comments

@ethanfrey
Copy link
Contributor

ethanfrey commented May 27, 2019

Is your feature request related to a problem? Please describe.

When a text resolution passes governance, it is currently a no-op. I guess one can query transactions to discover this, but it would be nice to actually store the successful proposals in a bucket on chain. For easy queryability.

Resolves last point here: #633
And #613

Describe the solution you'd like

Create a new ResolutionBucket, which is only writen by TextResolutionMsg https://github.com/iov-one/weave/blob/master/cmd/bnsd/app/codec.proto#L115 (The message contents can be updated as needed).

A Resolution model can use an IDGenBucket for primary key. Stored content should be:

bytes proposal_id
orm.VersionedRef electorate
string resolution (from message https://github.com/iov-one/weave/blob/master/x/gov/codec.proto#L225-L228)

We should ensure that these numbers are all correct (pulled from "context"). Note that this Msg/Handler can only be executed in the context of a governance vote.

Secondary index on electorate (id without version) would be good (all proposals accepted by this group). The other references don't need to be indexes

There should also be a query handler in the x/gov module for this bucket for easy queries by the clients to show past resolutions

Describe alternatives you've considered
Just search by indexed tx tags. But it seems much weaker and less user-friendly. Especially if such resolutions are important and should be binding.

@husio
Copy link
Contributor

husio commented May 27, 2019

I am not sure if I understand.

When a proposal with a message of type TextResolutionMsg is created, on success TextResolutionMsg is executed. Handler of TextResolutionMsg does not change the state.

Even if the above is true, in order to execute stored TextResolutionMsg a tally must be created. In this case, the final result of the voting process is stored within the tally instance, regardless the result of processed message. Is this correct or I undestand this the wrong way?

@ethanfrey
Copy link
Contributor Author

When a proposal with a message of type TextResolutionMsg is created, on success TextResolutionMsg is executed. Handler of TextResolutionMsg does not change the state.

Yes, this is the current state (which was how it worked before in gov as well before my Executor changes).

I just want to do something there when executing this message. Store the proposal text in some bucket. The tally works the same as always, just the text of the resolution is currently not stored in any easy way. You can search all Proposals, filter by which succeeded, then parse all those vote types, extract those that were TextResolutionMsg and grab the messages.

That doesn't make it easy to build a simple UI to show past passed resolutions (which should be easy to keep memory of our decisions)

Does it make sense now?

@alpe
Copy link
Contributor

alpe commented May 28, 2019

Makes sense.

  • Electorate as orm.VersionedRef would not hurt although the version would be also available via proposal
  • ElectionRule feels redundant as it not used and also available via proposal. What use cases do you have in mind?

@ethanfrey
Copy link
Contributor Author

ElectionRule feels redundant as it not used and also available via proposal. What use cases do you have in mind?

I dunna, just trying to collect all references. The resolution was part of a Proposal, accepted by an Electorate, according to some ElectionRules.

I am happy not to store the direct ElectionRules there.
The most common case I see is "what resolutions were passed by the 'selection committe'", which is electorate. Since we have the indirect ref to ElectionRules, I am happy to remove that here

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 a pull request may close this issue.

4 participants