-
Notifications
You must be signed in to change notification settings - Fork 39
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
optimize Quorum #55
Comments
Splitting a uint256 into The openzeppelin library called BitMaps is most suitable for this case. Compared with the current solution ( Compared with the current solution, BitMaps saves on gas because write a non-zero storage slot (2,900 gas) is much cheaper than writing a zero storage slot (20,000 gas), excluding the access operation gas. BitMaps solution is on branch P.S. OpenZeppelin BitMaps is basically the same as our library BitMask |
📚 Context
This issue is to optimize the PR to add quorum, which addresses this issue.
mapping(address => bool) voted;
to note who has voted, we could consider splitting auint256
into bits and utilize bit position to denote whether a validator has voted.For details, please see this comment
✔️ Solution
Since the last part (split a uint256) of the optimization can be complex and we are not sure whether we will go for that route, we will open 2 PR for this issue.
The text was updated successfully, but these errors were encountered: