-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: historical proposals #112
Conversation
✅ Deploy Preview for regen-groups-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Following up on your question this morning, as far as I can tell, no need to add a provider when using graphql-request client. Let me know how you're ready for a review, currently receiving the following error with my local setup:
Cannot query field "allProposals" on type "Query".: {"response":{"errors":[{"message":"Cannot query field \"allProposals\" on type \"Query\".","locations":[{"line":2,"column":3}]},{"message":"Unknown type \"Proposal\".","locations":[{"line":9,"column":26}]}],"status":400,"headers":{"map":{"content-length":"195","content-type":"application/json; charset=utf-8"}}},"request":{"query":"query ProposalsByGroupPolicyAddress($groupPolicyAddress: String!) {\n allProposals(condition: {groupPolicyAddress: $groupPolicyAddress}) {\n nodes {\n ...ProposalItem\n }\n }\n}\n\nfragment ProposalItem on Proposal {\n type\n blockHeight\n txIdx\n msgIdx\n chainNum\n timestamp\n txHash\n id: proposalId\n status\n groupPolicyAddress\n groupPolicyVersion\n metadata\n proposers\n submitTime\n groupVersion\n groupPolicyAddress\n finalTallyResult\n votingPeriodEnd\n executorResult\n messages\n}","variables":{"groupPolicyAddress":"regen1afk9zr2hn2jsac63h4hm60vl9z3e5u69gndzf7c99cqge3vzwjzs475lmr"}}}
40e0d14
to
57a5108
Compare
I ended up adding this, i just saw this comment but I think the why a Provider is needed or recommended, is so that the child components all use the same instance of the client. It turned out to not be too much work to add this in.
I'd guess that's it probably because you aren't connected to an up-to-date version of the indexer database, but it's little hard to tell without a bit more info on your local setup |
aba4d17
to
5512fdd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As part of this, we should also probably display the final tally result for proposals that have been pruned instead of the ProposalVotesTable
as we had discussed
03764d4
to
77b8189
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As part of the groups-ui audit and while testing this, I've realized that there was an existing bug but somewhat related to historical proposals/votes. That happens as soon as votes have been pruned but not the proposal (could happen since votes gets pruned at the end of the voting period while proposal at the latest gets pruned at voting period + max exec period). In this case, on the proposal page, you see "No votes" but the VotesGraph
at the top shows votes, which is puzzling:
This is because the VotesGraph
uses either the proposal finalTallyResult
or the votes while the VotesTable
is based on votes only.
Now that we have a ProposalFinalTallyTable
, maybe we could use in place of the empty votes table in this case?
Also fine to tackle this as a separate issue but I believe this should be fixed for the MVP.
@blushi I don't mind handle this now or in a separate issue. No strong preference, it doesn't seem too complicated. |
yeah I think that should work @wgwz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-approving from a code standpoint, but getting some CORS issue on the deploy preview
b0609de
to
f00bec5
Compare
@blushi i think this should be fixed now, although it was a little weird for me at first. but to fix the CORS issue i just needed to update VITE_PROXY_URL_REGEN_MAINNET and VITE_PROXY_URL_REGEN_TESTNET in netlify. |
just writing up the issue i mentioned in our check-in today. the prod groups-ui offers the toggle between networks, i.e. redwood and mainnet. an interesting question comes up here. @ryanchristo @blushi curious to hear your thoughts! |
Yes, a user should be able to switch networks in both staging and production with historical votes available in the groups ui in both staging and production as well. Same way the proxy URLs for both are available in both deployments currently. |
To properly use the staging environment for testing, an issue might come up that is specific to mainnet and therefore we would be able to resolve the issue before pushed to production. We may want to use the testnet to test a scenario on redwood and a user should be able to interact with the production deployment using redwood and the same features as mainnet. |
I think we can worry about storage separately from including support for both endpoints within the groups-ui. |
I opened #131 as a followup. We can continue the discussion there. Not something we need to address in this pr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK. Nice work!
Closes: #63
This approach adds support for historical proposals.
Historical proposals are proposals that have been pruned from state.
This approach utilizes graphql queries to our indexer graphql API.
The indexer database is the source of data for historical proposals.