chore: simplify removeParity

This commit is contained in:
healthykim 2025-09-18 01:21:19 +09:00
parent c19ff022c4
commit da083cdf55

View file

@ -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