-
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
feat(dk): log(n) draw #89
Conversation
✅ Deploy Preview for kleros-v2 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
It would be useful to have a benchmark to ensure that it does save gas because it saves 1 SLOAD+MSTORE operation at the expense of several CALL to KlerosCore at each iteration. |
Updating with some gas benchmarks reported from hardhat with the updated test file. The efficient implementation is more gas efficient with ~ 16 > jurors staked in the sortition tree under the test scenario. n = number of staked jurors n=16 |
be303b3
to
e6e5216
Compare
Code Climate has analyzed commit e6e5216 and detected 0 issues on this pull request. View more on Code Climate. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Original implementation sload's the entire sortition tree node array and mstores this array.
This implementation only accesses the necessary sortition tree indexes; hence log(n) complexity per draw.
There are a few more low hanging fruit sortition tree related optimizations, will address these in the future.