mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
eth/catalyst: allow duplicate blob hashes
This commit is contained in:
parent
4df10987d2
commit
458399a988
1 changed files with 8 additions and 6 deletions
|
|
@ -590,12 +590,12 @@ func (api *ConsensusAPI) GetBlobsV2(hashes []common.Hash) ([]*engine.BlobAndProo
|
||||||
// pull up the blob hashes
|
// pull up the blob hashes
|
||||||
var (
|
var (
|
||||||
res = make([]*engine.BlobAndProofV2, len(hashes))
|
res = make([]*engine.BlobAndProofV2, len(hashes))
|
||||||
index = make(map[common.Hash]int)
|
index = make(map[common.Hash][]int)
|
||||||
sidecars = api.eth.TxPool().GetBlobs(hashes)
|
sidecars = api.eth.TxPool().GetBlobs(hashes)
|
||||||
)
|
)
|
||||||
|
|
||||||
for i, hash := range hashes {
|
for i, hash := range hashes {
|
||||||
index[hash] = i
|
index[hash] = append(index[hash], i)
|
||||||
}
|
}
|
||||||
for i, sidecar := range sidecars {
|
for i, sidecar := range sidecars {
|
||||||
if res[i] != nil {
|
if res[i] != nil {
|
||||||
|
|
@ -611,12 +611,13 @@ func (api *ConsensusAPI) GetBlobsV2(hashes []common.Hash) ([]*engine.BlobAndProo
|
||||||
}
|
}
|
||||||
blobHashes := sidecar.BlobHashes()
|
blobHashes := sidecar.BlobHashes()
|
||||||
for bIdx, hash := range blobHashes {
|
for bIdx, hash := range blobHashes {
|
||||||
if idx, ok := index[hash]; ok {
|
if idxes, ok := index[hash]; ok {
|
||||||
proofs := sidecar.CellProofsAt(bIdx)
|
proofs := sidecar.CellProofsAt(bIdx)
|
||||||
var cellProofs []hexutil.Bytes
|
var cellProofs []hexutil.Bytes
|
||||||
for _, proof := range proofs {
|
for _, proof := range proofs {
|
||||||
cellProofs = append(cellProofs, proof[:])
|
cellProofs = append(cellProofs, proof[:])
|
||||||
}
|
}
|
||||||
|
for _, idx := range idxes {
|
||||||
res[idx] = &engine.BlobAndProofV2{
|
res[idx] = &engine.BlobAndProofV2{
|
||||||
Blob: sidecar.Blobs[bIdx][:],
|
Blob: sidecar.Blobs[bIdx][:],
|
||||||
CellProofs: cellProofs,
|
CellProofs: cellProofs,
|
||||||
|
|
@ -624,6 +625,7 @@ func (api *ConsensusAPI) GetBlobsV2(hashes []common.Hash) ([]*engine.BlobAndProo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue