Skip to content

Allow importing of historical blobs via HTTP API #6656

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

Open
wants to merge 9 commits into
base: unstable
Choose a base branch
from

Conversation

macladson
Copy link
Member

@macladson macladson commented Dec 4, 2024

Issue Addressed

#5391

Proposed Changes

Allows importing historical blobs into the blobs-db via the /lighthouse/database/import_blobs endpoint.
Supports SSZ through /lighthouse/database/import_blobs_ssz.

In both cases, the required format must deserialize to Vec<BlobSidecarList<E>>

Performs the following checks:

  • Checks that block_root is consistent across each BlobSidecarList.
  • Checks that block_root exists in the database.
  • Checks if a BlobSidecarList is already stored for that block_root. If it is, ensure it matches the BlobSidecarList we are attempting to store.

@macladson macladson added work-in-progress PR is a work-in-progress database labels Dec 4, 2024
"All blobs verified successfully".to_string(),
))
} else {
Ok(api_types::GenericResponse::from(results.join("\n")))
Copy link
Member

Choose a reason for hiding this comment

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

this looks like it would be a 200, but should probably be a 500?

Copy link

mergify bot commented Mar 17, 2025

This pull request has merge conflicts. Could you please resolve them @macladson? 🙏

for blob_sidecar_list in historical_blob_sidecars {
// Ensure all block_roots in the blob list are the same.
let block_root = {
let first_block_root = blob_sidecar_list[0].block_root();
Copy link
Member

Choose a reason for hiding this comment

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

Need to handle empty blob_sidecar_list safely here

}

// Check if a `blob_sidecar_list` is already stored for this block root.
match self.get_blobs(&block_root) {
Copy link
Member

Choose a reason for hiding this comment

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

Lets try adding a log with the time that this step takes

};

// Check block is stored for this block_root.
if !self.block_exists(&block_root)? {
Copy link
Member

Choose a reason for hiding this comment

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

Could check blob consistency with the block here (when verify == true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database work-in-progress PR is a work-in-progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants