From 0a31b0ddd14df4f184e166c36a1f100104ebc81f Mon Sep 17 00:00:00 2001 From: Agnish Ghosh Date: Sat, 5 Oct 2024 04:17:41 +0530 Subject: [PATCH] reorder conditions --- .../gossip_processing/gossip_validation.nim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/beacon_chain/gossip_processing/gossip_validation.nim b/beacon_chain/gossip_processing/gossip_validation.nim index f304529b0..227dd71d3 100644 --- a/beacon_chain/gossip_processing/gossip_validation.nim +++ b/beacon_chain/gossip_processing/gossip_validation.nim @@ -528,13 +528,6 @@ proc validateDataColumnSidecar*( block_header.slot, block_header.proposer_index, data_column_sidecar.index): return errIgnore("DataColumnSidecar: already have valid data column from same proposer") - # [REJECT] The sidecar's column data is valid as - # verified by `verify_data_column_kzg_proofs(sidecar)` - block: - let r = check_data_column_sidecar_kzg_proofs(data_column_sidecar) - if r.isErr: - return dag.checkedReject(r.error) - # [REJECT] The sidecar's `kzg_commitments` inclusion proof is valid as verified by # `verify_data_column_sidecar_inclusion_proof(sidecar)`. block: @@ -606,6 +599,13 @@ proc validateDataColumnSidecar*( data_column_sidecar.signed_block_header.signature): return dag.checkedReject("DataColumnSidecar: Invalid proposer signature") + # [REJECT] The sidecar's column data is valid as + # verified by `verify_data_column_kzg_proofs(sidecar)` + block: + let r = check_data_column_sidecar_kzg_proofs(data_column_sidecar) + if r.isErr: + return dag.checkedReject(r.error) + # Send notification about new data column sidecar via callback if not(isNil(dataColumnQuarantine.onDataColumnSidecarCallback)): dataColumnQuarantine.onDataColumnSidecarCallback(data_column_sidecar)