add more checking in rpc response

This commit is contained in:
Agnish Ghosh 2024-10-08 04:28:12 +05:30
parent cb3f775f75
commit 9ede8028c0
2 changed files with 5 additions and 0 deletions

View File

@ -387,6 +387,9 @@ proc verify_data_column_sidecar_kzg_proofs*(sidecar: DataColumnSidecar):
## Verify if the KZG Proofs consisting in the `DataColumnSidecar`
## is valid or not.
if not (sidecar.kzg_commitments.len == 0):
return err("Kzg commitments length cannot be 0")
# Check if the data column sidecar index < NUMBER_OF_COLUMNS
if not (sidecar.index < NUMBER_OF_COLUMNS):
return err("Data column sidecar index exceeds the NUMBER_OF_COLUMNS")

View File

@ -153,6 +153,8 @@ proc checkResponse(colIdList: seq[DataColumnIdentifier],
break
if not found:
return false
column[].verify_data_column_sidecar_kzg_proofs()isOkOr:
return false
column[].verify_data_column_sidecar_inclusion_proof().isOkOr:
return false
true