Skip to content

Commit 9bef6f7

Browse files
committed
add blob limit, in data column sidecar gossip
1 parent dbc7781 commit 9bef6f7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

beacon_chain/gossip_processing/gossip_validation.nim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,12 @@ proc validateDataColumnSidecar*(
598598
if v.isErr:
599599
return dag.checkedReject(v.error)
600600

601+
# Check if the sidecar respects the blob limit.
602+
let epoch = block_header.slot.epoch()
603+
if lenu64(data_column_sidecar.kzg_commitments) >
604+
dag.cfg.get_blob_parameters(epoch).MAX_BLOBS_PER_BLOCK:
605+
return dag.checkedReject("DataColumnSidecar: The sidecar does not respect the blob limit")
606+
601607
# [REJECT] The sidecar is for the correct subnet
602608
# -- i.e. `compute_subnet_for_data_column_sidecar(blob_sidecar.index) == subnet_id`.
603609
if not (compute_subnet_for_data_column_sidecar(data_column_sidecar.index) == subnet_id):
@@ -723,7 +729,6 @@ proc validateDataColumnSidecar*(
723729
data_column_sidecar: gloas.DataColumnSidecar,
724730
wallTime: BeaconTime, subnet_id: uint64):
725731
Result[void, ValidationError] =
726-
727732
# [REJECT] The sidecar is valid as verified by verify_data_column_sidecar
728733
block:
729734
let v = verify_data_column_sidecar(data_column_sidecar)

0 commit comments

Comments
 (0)