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

paranoid underflow protection without error handling #14044

Merged
merged 2 commits into from
May 23, 2024

Conversation

kasey
Copy link
Contributor

@kasey kasey commented May 23, 2024

Another "not a bug, yet" change. I found this commit in a branch on my laptop. I meant to commit it in the PR where these blob request filtering methods were added but it got left out. Essentially I want to add this additional option for avoiding slot underflows, because it's good to be paranoid and prevent panics when subtracting slots, but it's also silly to have to handle errors when the underflow should be impossible based on other invariants. In this case the list of blocks has to be sorted by slot by p2p validation rules, so we should never fool the request bound calculation into picking a high slot lower than low slot, but this change makes sure that if some bug is introduced that breaks that invariant we at least won't panic.

What type of PR is this?
Bug fix

@kasey kasey requested a review from a team as a code owner May 23, 2024 14:34
@kasey kasey enabled auto-merge May 23, 2024 14:36
@kasey kasey added this pull request to the merge queue May 23, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks May 23, 2024
@prestonvanloon prestonvanloon added this pull request to the merge queue May 23, 2024
Merged via the queue into develop with commit 62b5c43 May 23, 2024
17 checks passed
@prestonvanloon prestonvanloon deleted the protect-underflow-error-free branch May 23, 2024 18:36
prestonvanloon pushed a commit that referenced this pull request May 31, 2024
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
(cherry picked from commit 62b5c43)
This pull request was closed.
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.

3 participants