MCPcopy Create free account
hub / github.com/ethstorage/es-node / buildSidecar

Method buildSidecar

ethstorage/archiver/api.go:199–220  ·  view source on GitHub ↗

Deprecated since Fusaka

(kvIndex uint64, kzgCommitment []byte, blobHash common.Hash)

Source from the content-addressed store, hash-verified

197
198// Deprecated since Fusaka
199func (a *API) buildSidecar(kvIndex uint64, kzgCommitment []byte, blobHash common.Hash) (*BlobSidecar, *httpError) {
200 blobData, found, err := a.storageMgr.TryRead(kvIndex, int(a.storageMgr.MaxKvSize()), blobHash)
201 if err != nil {
202 a.lg.Error("Failed to read blob", "err", err)
203 return nil, errServerError
204 }
205 if !found {
206 a.lg.Info("Blob not found by storage manager", "kvIndex", kvIndex, "blobHash", blobHash)
207 return nil, errBlobNotInES
208 }
209 blob := kzg4844.Blob(blobData)
210 kzgProof, err := kzg4844.ComputeBlobProof(&blob, kzg4844.Commitment(kzgCommitment))
211 if err != nil {
212 a.lg.Error("Failed to get kzg proof", "err", err)
213 return nil, errServerError
214 }
215 return &BlobSidecar{
216 Blob: [blobs.BlobLength]byte(blobData),
217 KZGCommitment: [48]byte(kzgCommitment),
218 KZGProof: [48]byte(kzgProof),
219 }, nil
220}

Callers 1

queryBlobSidecarsMethod · 0.95

Calls 3

TryReadMethod · 0.65
MaxKvSizeMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected