Skip to content

Commit

Permalink
fix: Compute EigenDA preimage hash using preimage length - go critic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ethenotethan committed Aug 15, 2024
1 parent fc4808c commit bfd2b0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eigenda/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ type EigenDABlobInfo struct {
Unlike 4844 there's no need to inject a version byte into the 0th offset of the hash
*/
func (e *EigenDABlobInfo) PreimageHash() (*common.Hash, error) {
kzgCommit, err := e.SerializeCommitment()
bytes, err := e.SerializeCommitment()
if err != nil {
return nil, err
}

data := append(kzgCommit, uint32ToBytes(e.BlobHeader.DataLength)...)
dataHash := crypto.Keccak256Hash(data)
bytes = append(bytes, uint32ToBytes(e.BlobHeader.DataLength)...)
dataHash := crypto.Keccak256Hash(bytes)

return &dataHash, nil
}
Expand Down

0 comments on commit bfd2b0a

Please sign in to comment.