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

Fix calc_delay when access_times is 1 #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gclenaghan
Copy link

When access_times is equal to 1, calc_delay fails due to getting into a state where current_block_access exceeds 1, but the check of whether the block is full uses ==. Avoid this situation by removing the shortcut logic if the boundary is outdated. Note that simply checking >= on the next round is not enough as the boundary won't be updated after the first run.

Also added a new unit test for this case.

@deknowny
Copy link
Owner

Thank you for PR! I really appreciate that you fixed it and even improved tests!

I noticed this bug too a few days ago. I'll merge it a little but later and create a tag. There is also my ralipyard library that depends on this crate where I'll bump the version too.

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

2 participants