-
Notifications
You must be signed in to change notification settings - Fork 3
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
DAC voting, base fee proposal #269
Conversation
fee8858
to
c61241b
Compare
3e6cf54
to
a4998e4
Compare
f9a89d2
to
4c1b2c3
Compare
80a330d
to
8a44b5d
Compare
a555726
to
581065d
Compare
6a3f379
to
18ea0ec
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.
Nice work!
There are some minor things (comments), and some general things which should be at least discussed:
1.) If possible (not sure if it makes sense) the final PR should have at least 2 commits, the base implementation and another commit the basefee specialization. This would help to see what is required to implement a more complex one (thinking about a multi option proposal where the exit is not necessarily a simple 50% one.
2.) It should be evaluated (with @Noctunus because the idea was initially from him) to operate with a fee multiplier instead setting the basefee. This could then be applied to all spialized Fees.
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.
Some more comments for additional comments :-)
@c4t-ag |
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 work, go!
Why this should be merged
This PR adds feature of DAC proposals and voting which is executed with transactions.
Also, this PR renames all DAO entries to DAC.
How this works
There are 3 new transactions:
Vote and proposal fields in txs represented by bytes, not some structure or interface. This is done in order to be able to add new proposal types without needing to update codec.
Block builder will try to build block with FinishProposalsTx when there are early finished proposals or expired proposals.
Proposals execution and semantic verification logic resides in its own proposalExecutor type methods in txs/executor package. Proposals are calling this methods via visitor pattern.
Proposals and votes logic are encapsulated behind interfaces, which could be implemented by different types. This PR adds BaseFeeProposal and SimpleVote types.
SimpleVote is vote that simply points to specific proposal option index, e.g. baseFee proposal with options [ {newFee: 100}, {newFee: 200} ], and simpleVote {0}, where vote is for newFee 100 option.
BaseFeeProposal is proposal to change base fee, its options are new base fees. This proposal can only be proposed by caminoProposer address state role, which is introduced in this PR as well.
All proposals can be voted only by addresses that were active validators at the moment of addProposalTx block execution. While its not required for voters to still be active valaditors when they vote, it is required for them to still be consortium members.
Commits
PR consists of 3 commits:
How this was tested
Unit-tests, integration tests