-
Notifications
You must be signed in to change notification settings - Fork 714
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
[GUI] New Governance Graphical User Interface #2406
Conversation
92d40df
to
1e1e808
Compare
4302a99
to
fc81411
Compare
cc607ce
to
a3e5946
Compare
4fa167d
to
b0f17dc
Compare
d981abc
to
bf6adc6
Compare
a88662e
to
d60b8dc
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.
I like this very much.
Awesome job 🍻
Left some first impressions going through the code, will do more accurate reviewing/testing later.
One general point of discussion would be to remove the dependence of GovernanceModel
on WalletModel
(ofc for the future, as no-wallet builds are broken atm).
The proposal-creation could be its own module, depending on GovernanceModel
and WalletModel
, which would be disabled when the wallet support is not compiled (and, for example,. the "Create Proposal" button would be hidden).
Ideally a node built without wallet would not be able to create new proposals (as it couldn't send the fee tx), but should still be able to inspect the existing budgets.
@@ -19,6 +19,7 @@ class OperationResult | |||
OperationResult(bool _res) : m_res(_res) { } | |||
|
|||
std::string getError() const { return (m_error ? *m_error : ""); } | |||
bool getRes() const { return m_res; } |
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.
src/rpc/budget.cpp
Outdated
pwallet->GetKey(mnKeyID, mnKey); | ||
} | ||
if (mnKey.IsValid()) { |
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.
(b6dbb02)
Better to check the return value of GetKey
directly, rather than ignoring it and then checking if the key is valid.
Also, this loops over ALL masternodes in the list (if no filter is given) to see whther we have any of the voting keys... probably keeping the lock outside the loop (as it was) is better, performance-wise, than thousands of LOCK/UNLOCK operations for a single function call.
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.
better to improve this in another focused PR and remove the for-loop entirely. The node/wallet can know and maintain an indicator and/or a cached list of the enabled DMNs for which it can vote for.
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.
Sure, but in the meantime we can (and imo should) keep it as it was: LOCK outside of the loop, and return value of GetKey
checked.
great that you liked it zebra 😄, lot of work 🍺 . |
4dbad6a
to
deb8f3d
Compare
Same thing applies to URL length and special characters used: If user has a DAO tab opened in the wallet while wallet is syncing after being turned on, listed proposals are being updated only if user is changing tabs, for example from DAO to CONTACTS and back to DAO. Although proposals are not something that changes too often, but maybe it would be cool if the DAO tab refreshes automatically every few minutes without needing to switch tabs, for those that are addicted to following the MNO yes and no votes for each and every proposal in real time (not actually in real time, but every minute or few minutes depending on the code if it can be done). |
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.
Lots to dive into here, overall a great addition and presentation! Without duplicating @NoobieDev12 's feedback, i've restricted my comments mostly to translation issues and commenting on previous feedbacks. There is one bug that i commented on WRT to allocated/available amount being displayed in the UI.
Note: generally speaking, unless a particular UI element's name isn't self-descriptive enough, any text value set in the .ui
file that is always going to be programmatically set in the .cpp
file would be better to just use the generic <string notr="true">N/A</string>
line in the .ui
file
Plus fixed several warnings for QT duplicate widget container names.
…tion call. * Connect governanceModel stop(). * And not update next superblock height visually until the wallet passed IBD.
Plus whitespace styling corrections.
…ow::getAmountValue()`.
This fixes a conversion issue for the QString::toInt() previous usage.
And don't try to create a proposal if the wallet has not enough balance to pay for the proposal fee.
…ing to not overlap.
…ombo-boxes view initialization.
…'t been cleared from the backend yet.
…imum vote update time.
… selection dialog.
… to vote until the minimum vote time passes.
c476899
to
fccb4cc
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.
ACK fccb4cc
Lets get this merged sooner rather than later so translation source strings can be updated. any further functional or stylistic changes can be done in smaller follow-up PRs.
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.
ACK fccb4cc
Just few minor things that could also be tackled in a follow-up PR.
CBudgetProposal proposal; | ||
ss >> proposal; | ||
if (!g_budgetman.HaveProposal(proposal.GetHash()) && | ||
proposal.GetBlockStart() < clientModel->getNumBlocks()) { |
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.
(c952196)
proposal.GetBlockStart() < clientModel->getNumBlocks()) { | |
proposal.GetBlockStart() > clientModel->getNumBlocks()) { |
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.
great catch 👍
enum VoteDirection { | ||
ABSTAIN=0, | ||
YES=1, | ||
NO=2 | ||
}; |
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.
why are we duplicating this enum in the VoteInfo
struct, instead of using CBudgetVote::VoteDirection
directly?
It would be easier to maintain.
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.
the goal was to continue preparing the ground for the removal of the backend objects/functions dependencies on the GUI elements, to only have them in the cpp of the interface layer.
If I would had added CBudgetVote::VoteDirection
here, as it's a header file, then every GUI element that has the governancemodel.h
dependency, will have access to budgetvote.h
, univalue.h
and to the transaction.h
primitive for example.
will think on a different way to remove the duplication and not end up having all this unneeded dependencies.
k great. |
…ock has not passed yet c33f0e5 Bugfix GUI: proposal broadcast should be scheduled only if the block start has not passed yet (furszy) Pull request description: Small follow-up to #2406, solving zebra's comment: #2406 (comment). Fixing the not schedule of waiting proposals for broadcast at startup. Which caused that if the wallet was restarted in the middle of the broadcast process, the waiting proposals will not enter in the broadcast queue. ACKs for top commit: random-zebra: utACK c33f0e5 Fuzzbawls: utACK c33f0e5 Tree-SHA512: d0fd17276c24971571385828001a9cf95cfcf6e472b4e0dce0dcc054e2e633856833ebd39d0058fa81e5d7482483b7f04d163df1aec474c53f30ac8ff7cf564d
Adding visual interface support for the governance system.
Work in conjunction with @Neoperol ☕ who made the wireframes, layouts organization and theme styles.
Implementing the following points:
Demo videos:
1) Proposals view, budget distribution and create proposal wizard.
(Two videos due github's 10mb maximum size restriction)
create_proposals_step_1.mp4
create_proposal_step_2.mp4
2) Proposal voting flow:
proposal_voting_flow.mp4
3) Proposals grid view responsiveness.
proposal_grid_responsiveness.mp4
Important note:
This work is still in-progress, wording and visuals can change a bit moving on :), and there are some issues that i'm currently working on.
Plus, the backend tier two synchronization process requires improvements that I'm planning to do in another PR.. all of the data forced cleanups + re-synchronizations (budget proposals, votes and MNs) are notorious now that we have visual support for it.
To do: