enable logging of columns, conditionally subscribe to only topics that i custody for

This commit is contained in:
Agnish Ghosh 2024-08-24 19:56:52 +05:30
parent da735abd35
commit 6a2ba50c19
No known key found for this signature in database
GPG Key ID: 7BDDA05D1B25E9F8
3 changed files with 18 additions and 7 deletions

View File

@ -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)

View File

@ -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),

View File

@ -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")