diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index c749ee5bd..a0ef80bda 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -1149,9 +1149,14 @@ proc fetchCustodySubnetCount* (node: BeaconNode): uint64= proc addDenebMessageHandlers( node: BeaconNode, forkDigest: ForkDigest, slot: Slot) = node.addCapellaMessageHandlers(forkDigest, slot) - let targetSubnets = node.fetchCustodySubnetCount() - for topic in dataColumnSidecarTopics(forkDigest, targetSubnets): - node.network.subscribe(topic, basicParams) + let + targetSubnets = node.fetchCustodySubnetCount() + custody_subnets = node.network.nodeId.get_custody_column_subnet(targetSubnets) + + for i in 0'u64 ..< targetSubnets: + if i in custody_subnets.get: + let topic = getDataColumnSidecarTopic(forkDigest, i) + node.network.subscribe(topic, basicParams) if node.config.subscribeAllSubnets: node.network.loadCscnetsMetadata(DATA_COLUMN_SIDECAR_SUBNET_COUNT.uint8) @@ -1183,9 +1188,14 @@ proc removeCapellaMessageHandlers(node: BeaconNode, forkDigest: ForkDigest) = proc removeDenebMessageHandlers(node: BeaconNode, forkDigest: ForkDigest) = node.removeCapellaMessageHandlers(forkDigest) - let targetSubnets = node.fetchCustodySubnetCount() - for topic in dataColumnSidecarTopics(forkDigest, targetSubnets): - node.network.unsubscribe(topic) + let + targetSubnets = node.fetchCustodySubnetCount() + custody_subnets = node.network.nodeId.get_custody_column_subnet(targetSubnets) + + for i in 0'u64 ..< targetSubnets: + if i in custody_subnets.get: + let topic = getDataColumnSidecarTopic(forkDigest, i) + node.network.unsubscribe(topic, basicParams) proc removeElectraMessageHandlers(node: BeaconNode, forkDigest: ForkDigest) = node.removeDenebMessageHandlers(forkDigest) diff --git a/beacon_chain/spec/datatypes/eip7594.nim b/beacon_chain/spec/datatypes/eip7594.nim index 69769a082..829be6b24 100644 --- a/beacon_chain/spec/datatypes/eip7594.nim +++ b/beacon_chain/spec/datatypes/eip7594.nim @@ -103,6 +103,7 @@ type func shortLog*(v: DataColumnSidecar): auto = ( index: v.index, + data_column: v.column, kzg_commitments: v.kzg_commitments.len, kzg_proofs: v.kzg_proofs.len, block_header: shortLog(v.signed_block_header.message), diff --git a/beacon_chain/spec/eip7594_helpers.nim b/beacon_chain/spec/eip7594_helpers.nim index 9238c3345..a80837c3a 100644 --- a/beacon_chain/spec/eip7594_helpers.nim +++ b/beacon_chain/spec/eip7594_helpers.nim @@ -371,7 +371,7 @@ proc verify_data_column_sidecar_kzg_proofs*(sidecar: DataColumnSidecar): Result[ sidecarCol = sidecar.column.asSeq kzgProofs = sidecar.kzg_proofs.asSeq - let res = validate_data_column_sidecar(kzgCommits, cellIndices, sidecarCol, kzgProofs) + let res = verifyCellKzgProofBatch(kzgCommits, cellIndices, sidecarCol, kzgProofs) if res.isErr(): return err("DataColumnSidecar: validation failed")