From 5d10725737a45a0bce3dcb87c8120e003146eacd Mon Sep 17 00:00:00 2001 From: Agnish Ghosh Date: Thu, 28 Nov 2024 18:37:42 +0530 Subject: [PATCH] made some fixes to logic --- beacon_chain/spec/datatypes/eip7594.nim | 1 - beacon_chain/spec/eip7594_helpers.nim | 11 +++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/beacon_chain/spec/datatypes/eip7594.nim b/beacon_chain/spec/datatypes/eip7594.nim index b785df39a..c885d927e 100644 --- a/beacon_chain/spec/datatypes/eip7594.nim +++ b/beacon_chain/spec/datatypes/eip7594.nim @@ -12,7 +12,6 @@ import "."/[altair, base, deneb], kzg4844 -from std/sequtils import mapIt from std/strutils import join export base diff --git a/beacon_chain/spec/eip7594_helpers.nim b/beacon_chain/spec/eip7594_helpers.nim index e6563d6b2..c79a1d00d 100644 --- a/beacon_chain/spec/eip7594_helpers.nim +++ b/beacon_chain/spec/eip7594_helpers.nim @@ -180,14 +180,20 @@ proc reconstruction_terms*(blobIdx: int, cell_ids = newSeqOfCap[CellID](columnCount) ckzgCells = newSeqOfCap[KzgCell](columnCount) + cell_ids.setLen(0) + ckzgCells.setLen(0) + for col in data_columns: cell_ids.add col.index let cell = col.column[blobIdx] ckzgCells.add cell + + debugEcho "for blob index" + debugEcho blobIdx # Call the recovery function and handle results let recovered_cell_and_proof = recoverCellsAndKzgProofs(cell_ids, ckzgCells) - if not recovered_cell_and_proof.isOk: + if recovered_cell_and_proof.isErr: return err("Issue with computing cells and proofs!") ok(recovered_cell_and_proof.get) @@ -212,6 +218,7 @@ proc recover_cells_and_proofs_parallel*( recovered_cps = newSeq[CellsAndProofs](blobCount) # Schedule tasks on the threadpool + debugEcho "Scheduling tasks on the threadpool..." for blobIdx in 0..