Skip to content
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

sortition: use external sortition package #5429

Merged
merged 10 commits into from
Jun 2, 2023

Conversation

cce
Copy link
Contributor

@cce cce commented May 30, 2023

Summary

This updates the data/committee package to use the new separate github.com/algorand/sortition package, which contains the same code as in github.com/algorand/data/committee/sortition.

Test Plan

Existing tests should pass, and added a new property-based test TestCompareSortitionImpls that I ran for 10M iterations.

@cce cce requested a review from tzaffi May 30, 2023 18:44
@cce cce requested a review from bbroder-algo May 30, 2023 18:45
algorandskiy
algorandskiy previously approved these changes May 30, 2023
bbroder-algo
bbroder-algo previously approved these changes May 30, 2023
Copy link
Contributor

@bbroder-algo bbroder-algo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@codecov
Copy link

codecov bot commented May 30, 2023

Codecov Report

Merging #5429 (d73611f) into master (7d8525e) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #5429      +/-   ##
==========================================
- Coverage   55.40%   55.39%   -0.01%     
==========================================
  Files         447      447              
  Lines       63294    63294              
==========================================
- Hits        35065    35062       -3     
- Misses      25836    25844       +8     
+ Partials     2393     2388       -5     
Impacted Files Coverage Δ
data/committee/credential.go 40.25% <100.00%> (ø)
data/committee/sortition/sortition.go 84.21% <100.00%> (ø)

... and 10 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@tzaffi tzaffi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

tzaffi
tzaffi previously approved these changes May 30, 2023
@cce cce dismissed stale reviews from tzaffi, bbroder-algo, and algorandskiy via fd031b3 May 30, 2023 23:54
@algorandskiy
Copy link
Contributor

@cce please update go.sum

rapid.Just(proto.RedoCommitteeSize),
rapid.Just(proto.DownCommitteeSize),
).Draw(t, "expectedSize").(uint64)
//expectedSize := rapid.Uint64Range(1, totalMoney).Draw(t, "expectedSize").(uint64) // draw random
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//expectedSize := rapid.Uint64Range(1, totalMoney).Draw(t, "expectedSize").(uint64) // draw random

Or if you really need for local testing, it should be placed in the scope of totalMoney

Copy link
Contributor

@tzaffi tzaffi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a nit about removing a commented out line in a test

@algorandskiy algorandskiy merged commit f66a404 into algorand:master Jun 2, 2023
@algorandskiy algorandskiy changed the title build: use external sortition package sortition: use external sortition package Jun 2, 2023
@cce cce deleted the use-external-sortition-package branch June 2, 2023 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants