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

db/blobs: Check non-zero data is written to disk #13647

Merged
merged 1 commit into from
Feb 21, 2024
Merged

Conversation

prestonvanloon
Copy link
Member

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

Add some error returning paths when the following bad things happen:

  • The blob sidecar produced a zero length byte slice for the SSZ encoded data
  • The amount of data saved to disk does not match the length of the ssz encoded data
  • The amount of data written was zero bytes (redundant check, probably, but free to verify)

Which issues(s) does this PR fix?

We've found empty blob files on disk and this PR aims to prevent that scenario.

Other notes for review

Copy link
Member

@terencechain terencechain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a regression test?

@prestonvanloon
Copy link
Member Author

Can we add a regression test?

@terencechain Not really... These kind of errors are things that could be very unexpected. This PR aims to address some "impossible" cases with more verbose errors to assist with ruling out some potential issues.

This PR with #13648 would make blob saving more resilient

@prestonvanloon prestonvanloon added this pull request to the merge queue Feb 21, 2024
Merged via the queue into develop with commit daad29d Feb 21, 2024
17 checks passed
@prestonvanloon prestonvanloon deleted the empty-blobs branch February 21, 2024 22:18
prestonvanloon added a commit that referenced this pull request Feb 21, 2024
github-merge-queue bot pushed a commit that referenced this pull request Mar 7, 2024
* blob save: add better data checking for empty blob issues (#13647)

(cherry picked from commit daad29d)

* avoid part path collisions with mem addr entropy (#13648)

* avoid part path collisions with mem addr entropy

* Regression test

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
(cherry picked from commit 4c66e4d)

* fix error race

---------

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
Co-authored-by: kasey <489222+kasey@users.noreply.github.com>
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