File tree 1 file changed +13
-5
lines changed
1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -413,11 +413,19 @@ func groupAndFillColumnTable*[A, B](
413
413
return err (" DataColumnSidecar: unexpected signed_block_header" )
414
414
inc column_cursor
415
415
# Make a table entry for the grouped columns
416
- man.column_syncer_table[forkyBlck.message.slot] =
417
- ColumnAndBlockResponse (
418
- blk: forkyBlck,
419
- columns: Opt .some (grouped[block_idx]))
420
- ok ()
416
+ if grouped[block_idx].len > 0 :
417
+ man.column_syncer_table[forkyBlck.message.slot] =
418
+ ColumnAndBlockResponse (
419
+ blk: forkyBlck,
420
+ columns: Opt .some (grouped[block_idx]))
421
+
422
+ if column_cursor != columns.len:
423
+ # we reached the end of blocks without consuming all columns,
424
+ # so either we got too few blocks in the paired request, or the
425
+ # columns sent to us by the peer is malicious
426
+ ok ()
427
+ else :
428
+ return err (" DataColumnSidecar: invalid block/column is received" )
421
429
422
430
proc serializeColumnTable * [A, B](
423
431
man: ColumnManager [A, B]
You can’t perform that action at this time.
0 commit comments