Skip to content

Conversation

@tersec
Copy link
Contributor

@tersec tersec commented Jan 15, 2024

These are replicated in https://github.com/ethereum/c-kzg-4844/blob/d637761a2ece4f13dbcffcae09253408e430a6e1/bindings/nim/kzg.nim#L181-L202

proc verifyProofs*(ctx: KzgCtx,
                  blobs: openArray[KzgBlob],
                  commitments: openArray[KzgBytes48],
                  proofs: openArray[KzgBytes48]): Result[bool, string] {.gcsafe.} =
  if blobs.len != commitments.len:
    return err($KZG_BADARGS)

  if blobs.len != proofs.len:
    return err($KZG_BADARGS)

  if blobs.len == 0:
    return ok(true)

...

Which is recognized by ethereum/consensus-specs@468b5be and ethereum/consensus-specs#3368

As such, the spec removed the wrapper function. It's useful to keep the wrapper here, because it coalesces the two failure modes of failure-in-trying-to-verify with successful verification, procedurally, which rejected the proof/commitment/blob tuple. Downstream code largely doesn't care, except insofar as it would like to be able to generate more informative error messages, so keeping this wrapper avoids code duplication elsewhere.

Still, it's not in spec as of v1.4.0, so remove consensus spec reference URL.

@tersec tersec enabled auto-merge (squash) January 15, 2024 05:42
@tersec tersec disabled auto-merge January 15, 2024 05:42
@github-actions
Copy link

Unit Test Results

         9 files  ±0    1 101 suites  ±0   27m 33s ⏱️ +7s
  4 213 tests ±0    3 866 ✔️ ±0  347 💤 ±0  0 ±0 
16 834 runs  ±0  16 436 ✔️ ±0  398 💤 ±0  0 ±0 

Results for commit ef5ef3d. ± Comparison against base commit 52ed0d6.

@tersec tersec enabled auto-merge (squash) January 15, 2024 15:05
@tersec tersec merged commit 3541cfe into unstable Jan 15, 2024
@tersec tersec deleted the 1JB branch January 15, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant