-
Notifications
You must be signed in to change notification settings - Fork 866
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
base: unstable
Are you sure you want to change the base?
Conversation
cda4d20
to
cc6bb00
Compare
beacon_node/http_api/src/lib.rs
Outdated
"All blobs verified successfully".to_string(), | ||
)) | ||
} else { | ||
Ok(api_types::GenericResponse::from(results.join("\n"))) |
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.
this looks like it would be a 200, but should probably be a 500?
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(); |
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.
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) { |
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.
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)? { |
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.
Could check blob consistency with the block here (when verify == true
)
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:
block_root
is consistent across eachBlobSidecarList
.block_root
exists in the database.BlobSidecarList
is already stored for thatblock_root
. If it is, ensure it matches theBlobSidecarList
we are attempting to store.