Remove BlobsSidecar used in BeaconChainDB (#4710)

This commit is contained in:
henridf 2023-03-10 13:51:36 +01:00 committed by GitHub
parent 5370a6b67b
commit f5612f2a77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 21 deletions

View File

@ -23,7 +23,7 @@ import
"."/[beacon_chain_db_light_client, filepath] "."/[beacon_chain_db_light_client, filepath]
from ./spec/datatypes/capella import BeaconState from ./spec/datatypes/capella import BeaconState
from ./spec/datatypes/deneb import TrustedSignedBeaconBlock, BlobsSidecar from ./spec/datatypes/deneb import TrustedSignedBeaconBlock
export export
phase0, altair, eth2_ssz_serialization, eth2_merkleization, kvstore, phase0, altair, eth2_ssz_serialization, eth2_merkleization, kvstore,
@ -801,11 +801,6 @@ proc putBlobSidecar*(
value: BlobSidecar) = value: BlobSidecar) =
db.blobs.putSZSSZ(blobkey(value.block_root, value.index), value) db.blobs.putSZSSZ(blobkey(value.block_root, value.index), value)
proc putBlobsSidecar*(
db: BeaconChainDB,
value: BlobsSidecar) =
db.blobs.putSZSSZ(value.beacon_block_root.data, value)
proc updateImmutableValidators*( proc updateImmutableValidators*(
db: BeaconChainDB, validators: openArray[Validator]) = db: BeaconChainDB, validators: openArray[Validator]) =
# Must be called before storing a state that references the new validators # Must be called before storing a state that references the new validators
@ -995,12 +990,6 @@ proc getBlock*[
else: else:
result.err() result.err()
proc getBlobsSidecar*(db: BeaconChainDB, key: Eth2Digest): Opt[BlobsSidecar] =
var blobs: BlobsSidecar
result.ok(blobs)
if db.blobs.getSZSSZ(key.data, result.get) != GetResult.found:
result.err()
proc getBlobSidecar*(db: BeaconChainDB, root: Eth2Digest, index: BlobIndex): proc getBlobSidecar*(db: BeaconChainDB, root: Eth2Digest, index: BlobIndex):
Opt[BlobSidecar] = Opt[BlobSidecar] =
var blobs: BlobSidecar var blobs: BlobSidecar
@ -1078,13 +1067,6 @@ proc getBlockSSZ*(
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
getBlockSSZ(db, key, data, deneb.TrustedSignedBeaconBlock) getBlockSSZ(db, key, data, deneb.TrustedSignedBeaconBlock)
proc getBlobsSidecarSZ*(db: BeaconChainDB, key: Eth2Digest, data: var seq[byte]):
bool =
let dataPtr = addr data # Short-lived
func decode(data: openArray[byte]) =
assign(dataPtr[], data)
db.blobs.get(key.data, decode).expectDb()
proc getBlobSidecarSZ*(db: BeaconChainDB, root: Eth2Digest, index: BlobIndex, proc getBlobSidecarSZ*(db: BeaconChainDB, root: Eth2Digest, index: BlobIndex,
data: var seq[byte]): data: var seq[byte]):
bool = bool =

View File

@ -26,7 +26,6 @@ from ../consensus_object_pools/block_quarantine import
from ../validators/validator_monitor import from ../validators/validator_monitor import
MsgSource, ValidatorMonitor, registerAttestationInBlock, registerBeaconBlock, MsgSource, ValidatorMonitor, registerAttestationInBlock, registerBeaconBlock,
registerSyncAggregateInBlock registerSyncAggregateInBlock
from ../spec/datatypes/deneb import BlobsSidecar
from ../spec/state_transition_block import validate_blobs_sidecar from ../spec/state_transition_block import validate_blobs_sidecar
export sszdump, signatures_batch export sszdump, signatures_batch
@ -166,7 +165,6 @@ proc dumpBlock[T](
from ../consensus_object_pools/block_clearance import from ../consensus_object_pools/block_clearance import
addBackfillBlock, addHeadBlock addBackfillBlock, addHeadBlock
from ../beacon_chain_db import putBlobsSidecar
proc storeBackfillBlock( proc storeBackfillBlock(
self: var BlockProcessor, self: var BlockProcessor,