mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
Optimise import by skipping reserialisation
This commit is contained in:
@@ -22,7 +22,7 @@ use store::{
|
|||||||
errors::Error,
|
errors::Error,
|
||||||
hot_cold_store::HotColdDBError,
|
hot_cold_store::HotColdDBError,
|
||||||
metadata::{SchemaVersion, CURRENT_SCHEMA_VERSION},
|
metadata::{SchemaVersion, CURRENT_SCHEMA_VERSION},
|
||||||
DBColumn, HotColdDB, KeyValueStore, LevelDB, StoreItem,
|
DBColumn, HotColdDB, KeyValueStore, KeyValueStoreOp, LevelDB,
|
||||||
};
|
};
|
||||||
use strum::{EnumString, EnumVariantNames};
|
use strum::{EnumString, EnumVariantNames};
|
||||||
use types::{BeaconState, BlobSidecarList, EthSpec, Hash256, Slot};
|
use types::{BeaconState, BlobSidecarList, EthSpec, Hash256, Slot};
|
||||||
@@ -630,7 +630,10 @@ fn import_blobs<E: EthSpec>(
|
|||||||
num_already_known += 1;
|
num_already_known += 1;
|
||||||
} else {
|
} else {
|
||||||
let blobs = BlobSidecarList::<E>::from_ssz_bytes(&blob_bytes)?;
|
let blobs = BlobSidecarList::<E>::from_ssz_bytes(&blob_bytes)?;
|
||||||
ops.push(blobs.as_kv_store_op(block_root));
|
ops.push(KeyValueStoreOp::PutKeyValue(
|
||||||
|
block_root.to_vec(),
|
||||||
|
blob_bytes,
|
||||||
|
));
|
||||||
|
|
||||||
if let Some(blob) = blobs.first() {
|
if let Some(blob) = blobs.first() {
|
||||||
oldest_blob_slot = oldest_blob_slot.min(blob.slot());
|
oldest_blob_slot = oldest_blob_slot.min(blob.slot());
|
||||||
|
|||||||
Reference in New Issue
Block a user