Merge branch 'dev/etan/df-forkedblobs' into feat_eip-7688

This commit is contained in:
Etan Kissling 2024-07-26 04:54:03 +02:00
commit 11f54b9587
No known key found for this signature in database
GPG Key ID: B21DA824C5A3D03D
1 changed files with 3 additions and 0 deletions

View File

@ -826,6 +826,7 @@ proc delBlobSidecar*(
root: Eth2Digest, index: BlobIndex): bool =
var res = false
for blobFork in BlobFork:
if db.blobs[blobFork] == nil: continue
if db.blobs[blobFork].del(blobkey(root, index)).expectDb():
res = true
res
@ -1080,6 +1081,7 @@ proc getBlockSSZ*(
proc getBlobSidecarSZ*[T: ForkyBlobSidecar](
db: BeaconChainDB, root: Eth2Digest, index: BlobIndex,
data: var seq[byte]): bool =
if db.blobs[T.kind] == nil: return false
let dataPtr = addr data # Short-lived
func decode(data: openArray[byte]) =
assign(dataPtr[], data)
@ -1088,6 +1090,7 @@ proc getBlobSidecarSZ*[T: ForkyBlobSidecar](
proc getBlobSidecar*[T: ForkyBlobSidecar](
db: BeaconChainDB, root: Eth2Digest, index: BlobIndex,
value: var T): bool =
if db.blobs[T.kind] == nil: return false
db.blobs[T.kind].getSZSSZ(blobkey(root, index), value) == GetResult.found
proc getBlockSZ*(