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

Ensure order-of-operations for shuffling shard mod #805

Closed
wants to merge 2 commits into from

Conversation

paulhauner
Copy link
Contributor

What

Add some brackets to update_registry_and_shuffling_data to ensure shuffling_start_shard < SHARD_COUNT.

Why

The following code runs and prints "end"

epoch_committee_count = 2047;
SHARD_COUNT = 1024;
old_shuffling_start = 1023;

current_shuffling_start_shard = (
	old_shuffling_start +
	epoch_committee_count % SHARD_COUNT
)

assert(current_shuffling_start_shard > SHARD_COUNT)

current_shuffling_start_shard = (
	(old_shuffling_start +
	epoch_committee_count) % SHARD_COUNT
)

assert(current_shuffling_start_shard < SHARD_COUNT)

print("end")

@JustinDrake
Copy link
Collaborator

This bug fix was subsumed in #808

@djrtwo
Copy link
Contributor

djrtwo commented Mar 21, 2019

Actually going to express this to master for v0.5.1

@djrtwo djrtwo changed the base branch from dev to master March 21, 2019 14:29
@djrtwo djrtwo changed the base branch from master to dev March 21, 2019 14:29
djrtwo added a commit that referenced this pull request Mar 21, 2019
@djrtwo
Copy link
Contributor

djrtwo commented Mar 21, 2019

closing in favor of #821

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants