Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions core/txpool/blobpool/blobpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -1334,17 +1334,20 @@ func (p *BlobPool) GetBlobs(vhashes []common.Hash, version byte) ([]*kzg4844.Blo
}
data, err := p.store.Get(txID)
if err != nil {
return nil, nil, nil, err
log.Error("Tracked blob transaction missing from store", "id", txID, "err", err)
continue
}

// Decode the blob transaction
tx := new(types.Transaction)
if err := rlp.DecodeBytes(data, tx); err != nil {
return nil, nil, nil, err
log.Error("Blobs corrupted for traced transaction", "id", txID, "err", err)
continue
}
sidecar := tx.BlobTxSidecar()
if sidecar == nil {
return nil, nil, nil, fmt.Errorf("blob tx without sidecar %x", tx.Hash())
log.Error("Blob tx without sidecar", "hash", tx.Hash(), "id", txID)
continue
}
// Traverse the blobs in the transaction
for i, hash := range tx.BlobHashes() {
Expand Down
17 changes: 10 additions & 7 deletions eth/catalyst/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,20 +541,23 @@ func (api *ConsensusAPI) GetBlobsV2(hashes []common.Hash) ([]*engine.BlobAndProo
getBlobsV2RequestMiss.Inc(1)
return nil, nil
}
getBlobsV2RequestHit.Inc(1)

blobs, _, proofs, err := api.eth.BlobTxPool().GetBlobs(hashes, types.BlobSidecarVersion1)
if err != nil {
return nil, engine.InvalidParams.With(err)
}
res := make([]*engine.BlobAndProofV2, len(hashes))
for i := 0; i < len(blobs); i++ {
// the blob is missing, return null as response. It should
// be caught by `AvailableBlobs` though, perhaps data race
// occurs between two calls.
if blobs[i] == nil {

// To comply with API spec, check again that we really got all data needed
for _, blob := range blobs {
if blob == nil {
getBlobsV2RequestMiss.Inc(1)
return nil, nil
}
}
getBlobsV2RequestHit.Inc(1)

res := make([]*engine.BlobAndProofV2, len(hashes))
for i := 0; i < len(blobs); i++ {
var cellProofs []hexutil.Bytes
for _, proof := range proofs[i] {
cellProofs = append(cellProofs, proof[:])
Expand Down
Loading