From fab427d65f661d0dfea694fa6168f9fc090d61c3 Mon Sep 17 00:00:00 2001 From: Agnish Ghosh Date: Fri, 5 Jul 2024 14:34:51 +0530 Subject: [PATCH] enable dc in gossip and message router --- .../gossip_processing/gossip_validation.nim | 8 ++-- beacon_chain/spec/eip7594_helpers.nim | 2 +- beacon_chain/validators/message_router.nim | 38 +++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/beacon_chain/gossip_processing/gossip_validation.nim b/beacon_chain/gossip_processing/gossip_validation.nim index 6f1022001..861b93b88 100644 --- a/beacon_chain/gossip_processing/gossip_validation.nim +++ b/beacon_chain/gossip_processing/gossip_validation.nim @@ -530,10 +530,10 @@ proc validateDataColumnSidecar*( # [REJECT] The sidecar's `kzg_commitments` inclusion proof is valid as verified by # `verify_data_column_sidecar_inclusion_proof(sidecar)`. - # block: - # let v = check_data_column_sidecar_inclusion_proof(data_column_sidecar) - # if v.isErr: - # return dag.checkedReject(v.error) + block: + let v = check_data_column_sidecar_inclusion_proof(data_column_sidecar) + if v.isErr: + return dag.checkedReject(v.error) # [IGNORE] The sidecar's block's parent (defined by # `block_header.parent_root`) has been seen (via both gossip and diff --git a/beacon_chain/spec/eip7594_helpers.nim b/beacon_chain/spec/eip7594_helpers.nim index 1df1e0b71..ec3d0348a 100644 --- a/beacon_chain/spec/eip7594_helpers.nim +++ b/beacon_chain/spec/eip7594_helpers.nim @@ -325,7 +325,7 @@ proc verify_data_column_sidecar_kzg_proofs*(sidecar: DataColumnSidecar): Result[ ok() # https://github.com/ethereum/consensus-specs/blob/5f48840f4d768bf0e0a8156a3ed06ec333589007/specs/_features/eip7594/p2p-interface.md#verify_data_column_sidecar_inclusion_proof -proc verify_data_column_sidecar_inclusion_proof*(sidecar: DataColumnSidecar): Result[void, string] = +func verify_data_column_sidecar_inclusion_proof*(sidecar: DataColumnSidecar): Result[void, string] = # Verify if the given KZG commitments are included in the beacon block let gindex = 11.GeneralizedIndex if not is_valid_merkle_branch( diff --git a/beacon_chain/validators/message_router.nim b/beacon_chain/validators/message_router.nim index 4a05fb857..de8bdc5f9 100644 --- a/beacon_chain/validators/message_router.nim +++ b/beacon_chain/validators/message_router.nim @@ -164,25 +164,25 @@ proc routeSignedBeaconBlock*( blobRefs = Opt.some(blobs.mapIt(newClone(it))) var dataColumnRefs = Opt.none(DataColumnSidecars) - # when typeof(blck).kind >= ConsensusFork.Deneb: - # if blobsOpt.isSome(): - # let blobs = blobsOpt.get() - # let data_columns = get_data_column_sidecars(blck, blobs.mapIt(it.blob)).get() - # var das_workers = newSeq[Future[SendResult]](len(data_columns)) - # for i in 0..= ConsensusFork.Deneb: + if blobsOpt.isSome(): + let blobs = blobsOpt.get() + let data_columns = get_data_column_sidecars(blck, blobs.mapIt(it.blob)).get() + var das_workers = newSeq[Future[SendResult]](len(data_columns)) + for i in 0..