-
Notifications
You must be signed in to change notification settings - Fork 43
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
fix(Governor): remove CappedMath and tx order #1618
base: dev
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are limited to specific labels. Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
✅ Deploy Preview for kleros-v2-university ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for kleros-v2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for kleros-v2-neo ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Code Climate has analyzed commit 6c62e4a and detected 0 issues on this pull request. View more on Code Climate. |
Quality Gate passedIssues Measures |
CappedMath is removed because for the most part it's not needed as it was initially used to prevent underflows/overflows which isn't relevant for 0.8.0. In a couple of cases it was relevant still and I implemented a manual check there.
Requirement for tx ordering is removed since it becomes an issue where the txs in the list must be executed in a particular order (e.g. during
minStake
changes in courts). On the other hand, removing it now makes possible to submit lists with the same txs but in different order with an attempt "to steal" the list in cases where order of execution doesn't matter. In this case the list that was submitted the first should be chosen.There is no way to automate this process within the contract, since it's not possible to determine automatically whether the order of the list matters or not, thus the process of choosing the list should be done by the jurors, which might require some policy changes to address the cases of duplication.
PR-Codex overview
This PR refactors the
KlerosGovernor
contract by removing theCappedMath
library and optimizing transaction list handling.Detailed summary
CappedMath
library import and usage