From c3c817cbce701ad88940f09df6eb78b7abdad118 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Wed, 7 Feb 2024 18:48:25 -0600 Subject: [PATCH] rework sampler & builder to support correct padding and block selection --- codex/slots/sampler/utils.nim | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/codex/slots/sampler/utils.nim b/codex/slots/sampler/utils.nim index b14659c0..fa68e408 100644 --- a/codex/slots/sampler/utils.nim +++ b/codex/slots/sampler/utils.nim @@ -84,30 +84,3 @@ func cellIndices*( let idx = cellIndex(entropy, slotRoot, numCells, indices.len + 1) indices.add(idx.Natural) indices - -func checkCellProof*[H, P]( - cellData: seq[byte], - cellProof: P, - blkRoot: H, - slotProof: P, - slotRoot: H): ?!bool = - ## Check the proof for a given cell. - ## - - let - cellLeaf = H.spongeDigest(cellData).valueOr: - return failure("Failed to digest cell data") - - slotLeaf = cellProof.reconstructRoot(cellLeaf).valueOr: - return failure("Failed to reconstruct slot leaf") - - recRoot = slotProof.reconstructRoot(slotLeaf).valueOr: - return failure("Failed to reconstruct slot root") - - if blkRoot != slotLeaf: - return failure("Block root does not match slot leaf") - - if recRoot != slotRoot: - return failure("Reconstructed slot root does not match expected slot root") - - success true