mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
eth/catalyst: enforce all blobs or nil on getBlobsV2
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
497b96f5b7
commit
ac2a6b2218
1 changed files with 10 additions and 1 deletions
|
|
@ -541,12 +541,21 @@ 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)
|
||||
}
|
||||
|
||||
// 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++ {
|
||||
// the blob is missing, return null as response. It should
|
||||
|
|
|
|||
Loading…
Reference in a new issue