-
Notifications
You must be signed in to change notification settings - Fork 20k
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
core/txpool/blobpool: avoid possible zero index panic #30430
core/txpool/blobpool: avoid possible zero index panic #30430
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor nit, otherwise this looks like a correct fix to me!
Co-authored-by: Martin HS <martin@swende.se>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
In my opinion, it's impossible to cause the panic. The panic only happens when all transactions in |
I would suspect you are correct, but I didn't spend a lot of time investigating. The thing is, with the change in this PR, it is trivial to ascertain that code is correct and will not So, code is clearer and more robust with this PR (more robust since any changes in events leading up to the vulnerable line can no longer cause the bug to trigger). |
This situation(
len(txs) == 0
) rarely occurs, but if it does, it will panic.