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

Add tests for piece index conversions #3308

Merged
merged 2 commits into from
Dec 11, 2024
Merged

Add tests for piece index conversions #3308

merged 2 commits into from
Dec 11, 2024

Conversation

teor2345
Copy link
Member

This PR makes sure the piece index conversions calculate the right values.

During testing I discovered that the practical limit for these conversions is about u64::MAX/4, before some calculations start to cause an overflow. But I tested the RPC server and it correctly rejects both large piece indexes (not found error) and large offsets (too large error). So I don't think this is much of an issue in production.

Code contributor checklist:

@teor2345 teor2345 self-assigned this Dec 11, 2024
@teor2345 teor2345 enabled auto-merge December 11, 2024 05:21
@teor2345 teor2345 added this pull request to the merge queue Dec 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 11, 2024
@nazar-pc nazar-pc added this pull request to the merge queue Dec 11, 2024
Merged via the queue into main with commit e35cd7b Dec 11, 2024
8 checks passed
@nazar-pc nazar-pc deleted the piece-index-tests branch December 11, 2024 07:48
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.

2 participants