From 29878a9232647b5dfb06f75519baa84098110290 Mon Sep 17 00:00:00 2001 From: Agnish Ghosh Date: Tue, 15 Oct 2024 20:14:03 +0530 Subject: [PATCH] add kzg verification to sync --- beacon_chain/sync/sync_manager.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/beacon_chain/sync/sync_manager.nim b/beacon_chain/sync/sync_manager.nim index 059f6c1a1..67c3d672d 100644 --- a/beacon_chain/sync/sync_manager.nim +++ b/beacon_chain/sync/sync_manager.nim @@ -375,10 +375,14 @@ func groupDataColumns*[T](req: SyncRequest[T], else: Result[seq[DataColumnSidecars], string].ok grouped -func checkDataColumns(data_columns: seq[DataColumnSidecars]): Result[void, string] = +proc checkDataColumns(data_columns: seq[DataColumnSidecars]): Result[void, string] = for data_column_sidecars in data_columns: for data_column_sidecar in data_column_sidecars: ? data_column_sidecar[].verify_data_column_sidecar_inclusion_proof() + let sync_check_dc = + data_column_sidecar[].verify_data_column_sidecar_kzg_proofs() + if sync_check_dc.isErr: + return err("Invalid data column received while syncing") ok() proc syncStep[A, B](man: SyncManager[A, B], index: int, peer: A)