@@ -378,22 +378,35 @@ func serializeColumnTable*[A, B](
378
378
# Iterate through the column syncer table
379
379
for k, v in man.column_syncer_table.pairs():
380
380
# Checking if the table has all the required columns
381
- if v.columns.len >= (NUMBER_OF_COLUMNS div 2) and v.columns.isSome():
382
- let
383
- recovered_cps =
384
- recover_cells_and_proofs(v.columns.get().mapIt(it[]))
385
- reconstructed_columns =
386
- get_data_column_sidecars(v.blk[], recovered_cps.get()).mapIt(newClone it)
381
+ if man.amIsupernode:
382
+ if v.columns.len >= (man.cfg.NUMBER_OF_COLUMNS div 2) and
383
+ v.columns.isSome():
384
+ let
385
+ recovered_cps =
386
+ recover_cells_and_proofs(v.columns.get().mapIt(it[]))
387
+ reconstructed_columns =
388
+ get_data_column_sidecars(v.blk[], recovered_cps.get()).mapIt(newClone it)
389
+
390
+
391
+ # Populate that particular entry with reconstructed columns
392
+ man.column_syncer_table[k] =
393
+ ColumnAndBlockResponse(
394
+ blk: v.blk,
395
+ columns: Opt.some(reconstructed_columns))
396
+
397
+ elif v.columns.len < (NUMBER_OF_COLUMNS div 2) and v.columns.isSome():
398
+ return err ("Requisite number of columns not yet reached")
387
399
400
+ elif man.amIsupernode == false:
401
+ if v.columns.len == max(man.cfg.CUSTODY_REQUIREMENT, man.cfg.SAMPLES_PER_SLOT) and
402
+ v.columns.isSome:
388
403
389
- # Populate that particular entry with reconstructed columns
390
- man.column_syncer_table[k] =
391
- ColumnAndBlockResponse(
392
- blk: v.blk,
393
- columns: Opt.some(reconstructed_columns))
404
+ # Do nothing, table entry is fine
405
+ elif v.columns.len == max(man.cfg.CUSTODY_REQUIREMENT, man.cfg.SAMPLES_PER_SLOT) and
406
+ v.columns.isSome:
394
407
395
- elif v.columns.len < (NUMBER_OF_COLUMNS div 2) and v.columns.isSome():
396
- return err ("Requisite number of columns not yet reached")
408
+ # Retry as custody has not been reached yet
409
+ return err ("Requisite number of columns not yet reached")
397
410
398
411
else:
399
412
discard
0 commit comments