mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
chore: simplify removeParity
This commit is contained in:
parent
c19ff022c4
commit
da083cdf55
1 changed files with 2 additions and 10 deletions
|
|
@ -186,12 +186,6 @@ func (ptx *PooledBlobTx) RemoveParity() error {
|
||||||
return errors.New("nil sidecar")
|
return errors.New("nil sidecar")
|
||||||
}
|
}
|
||||||
|
|
||||||
for bit := range kzg4844.DataPerBlob {
|
|
||||||
if !sc.Custody.IsSet(uint(bit)) {
|
|
||||||
return errors.New("cannot remove parity for non-full payload transaction")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
blobCount := len(sc.Cells) / kzg4844.CellsPerBlob
|
blobCount := len(sc.Cells) / kzg4844.CellsPerBlob
|
||||||
if blobCount == 0 || len(sc.Cells)%kzg4844.CellsPerBlob != 0 {
|
if blobCount == 0 || len(sc.Cells)%kzg4844.CellsPerBlob != 0 {
|
||||||
return errors.New("inconsistent cell count")
|
return errors.New("inconsistent cell count")
|
||||||
|
|
@ -204,11 +198,9 @@ func (ptx *PooledBlobTx) RemoveParity() error {
|
||||||
cellsWithoutParity,
|
cellsWithoutParity,
|
||||||
sc.Cells[offset:offset+kzg4844.DataPerBlob]...,
|
sc.Cells[offset:offset+kzg4844.DataPerBlob]...,
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
for bit := 64; bit < kzg4844.CellsPerBlob; bit++ {
|
sc.Custody = types.CustodyBitmap{}.SetData()
|
||||||
sc.Custody.Clear(uint(bit))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sc.Cells = cellsWithoutParity
|
sc.Cells = cellsWithoutParity
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue