Skip to content

Commit

Permalink
Fix commitment length check
Browse files Browse the repository at this point in the history
Signed-off-by: litt3 <[email protected]>
  • Loading branch information
litt3 committed Jan 14, 2025
1 parent 2d392ff commit db51291
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions api/clients/v2/eigenda_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,15 @@ func (c *EigenDAClient) verifyBlobFromRelay(
return false
}

// checking that the length returned by the relay matches the claimed length is sufficient here: it isn't necessary
// to verify the length proof itself, since this will have been done by DA nodes prior to signing for availability.
if uint(len(blob)) != blobCommitments.Length {
// Checking that the length returned by the relay is <= the length claimed in the BlobCommitments is sufficient
// here: it isn't necessary to verify the length proof itself, since this will have been done by DA nodes prior to
// signing for availability.
//
// Note that the length in the commitment is the length of the blob, padded to a power of 2. For this reason, we
// assert <=, as opposed to asserting equality
if uint(len(blob)) > blobCommitments.Length {
c.log.Warn(
"blob length doesn't match length claimed in blob commitments",
"blob length is greater than length claimed in blob commitments",
"blobKey", blobKey, "relayKey", relayKey, "blobLength", len(blob),
"blobCommitments.Length", blobCommitments.Length)
return false
Expand Down

0 comments on commit db51291

Please sign in to comment.