From 90acd52d1d4ec7b556fb63c7e25539d4e77cf694 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Fri, 16 Feb 2024 08:59:13 -0600 Subject: [PATCH] use correct dataset geometry in erasure --- codex/erasure/erasure.nim | 2 +- tests/codex/helpers.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codex/erasure/erasure.nim b/codex/erasure/erasure.nim index 92b227aa..b03cfedd 100644 --- a/codex/erasure/erasure.nim +++ b/codex/erasure/erasure.nim @@ -241,7 +241,7 @@ proc init*( let rounded = roundUp(manifest.blocksCount, ecK) - steps = divUp(manifest.blocksCount, ecK) + steps = divUp(rounded, ecK) blocksCount = rounded + (steps * ecM) success EncodingParams( diff --git a/tests/codex/helpers.nim b/tests/codex/helpers.nim index 9ab8f52c..89e5fb1c 100644 --- a/tests/codex/helpers.nim +++ b/tests/codex/helpers.nim @@ -31,7 +31,7 @@ func `==`*(a, b: Block): bool = proc calcEcBlocksCount*(blocksCount: int, ecK, ecM: int): int = let rounded = roundUp(blocksCount, ecK) - steps = divUp(blocksCount, ecK) + steps = divUp(rounded, ecK) rounded + (steps * ecM)