-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Initial implementation of Poisson Sortition #2084
Conversation
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.
Try as I might, and despite several potential pitfalls, I cannot spot a single bug in this implementation. Couldn't have done it better myself 💯🙏
8df2e78
to
dea60d8
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.
refactored structure still looks correct to me 👍
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
As it turns out `big.Int#Mul` doesn't like it when you reuse input as output. ``` name old time/op new time/op delta WinCounts-8 4.56µs ± 1% 3.90µs ± 2% -14.44% (p=0.000 n=9+10) name old alloc/op new alloc/op delta WinCounts-8 3.50kB ± 0% 1.15kB ± 0% -67.23% (p=0.000 n=10+10) name old allocs/op new allocs/op delta WinCounts-8 45.0 ± 0% 24.0 ± 0% -46.67% (p=0.000 n=10+10) ``` Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
69ac1dc
to
2b597fb
Compare
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
29bfd8a
to
30135f9
Compare
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
30135f9
to
2165728
Compare
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
726755d
to
19ed695
Compare
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
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.
Couple of nitpicks. I didn't go very deep into the math, it feels like it does the correct thing, but I'm mostly putting my trust in @davidad saying it's correct
Probably want @whyrusleeping to have a look at this before merging
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.
Math seems good, though I'm guessing the big Mults and Divs will be slow...probably not the critical path, though
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
91831f4
to
4895c89
Compare
The whole sortition for |
TODO:
debug_advance
TestDealMining