mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-03-02 23:20:39 +00:00
enable logging of columns, conditionally subscribe to only topics that i custody for
This commit is contained in:
parent
da735abd35
commit
6a2ba50c19
@ -1149,8 +1149,13 @@ proc fetchCustodySubnetCount* (node: BeaconNode): uint64=
|
|||||||
proc addDenebMessageHandlers(
|
proc addDenebMessageHandlers(
|
||||||
node: BeaconNode, forkDigest: ForkDigest, slot: Slot) =
|
node: BeaconNode, forkDigest: ForkDigest, slot: Slot) =
|
||||||
node.addCapellaMessageHandlers(forkDigest, slot)
|
node.addCapellaMessageHandlers(forkDigest, slot)
|
||||||
let targetSubnets = node.fetchCustodySubnetCount()
|
let
|
||||||
for topic in dataColumnSidecarTopics(forkDigest, targetSubnets):
|
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)
|
node.network.subscribe(topic, basicParams)
|
||||||
|
|
||||||
if node.config.subscribeAllSubnets:
|
if node.config.subscribeAllSubnets:
|
||||||
@ -1183,9 +1188,14 @@ proc removeCapellaMessageHandlers(node: BeaconNode, forkDigest: ForkDigest) =
|
|||||||
|
|
||||||
proc removeDenebMessageHandlers(node: BeaconNode, forkDigest: ForkDigest) =
|
proc removeDenebMessageHandlers(node: BeaconNode, forkDigest: ForkDigest) =
|
||||||
node.removeCapellaMessageHandlers(forkDigest)
|
node.removeCapellaMessageHandlers(forkDigest)
|
||||||
let targetSubnets = node.fetchCustodySubnetCount()
|
let
|
||||||
for topic in dataColumnSidecarTopics(forkDigest, targetSubnets):
|
targetSubnets = node.fetchCustodySubnetCount()
|
||||||
node.network.unsubscribe(topic)
|
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) =
|
proc removeElectraMessageHandlers(node: BeaconNode, forkDigest: ForkDigest) =
|
||||||
node.removeDenebMessageHandlers(forkDigest)
|
node.removeDenebMessageHandlers(forkDigest)
|
||||||
|
@ -103,6 +103,7 @@ type
|
|||||||
func shortLog*(v: DataColumnSidecar): auto =
|
func shortLog*(v: DataColumnSidecar): auto =
|
||||||
(
|
(
|
||||||
index: v.index,
|
index: v.index,
|
||||||
|
data_column: v.column,
|
||||||
kzg_commitments: v.kzg_commitments.len,
|
kzg_commitments: v.kzg_commitments.len,
|
||||||
kzg_proofs: v.kzg_proofs.len,
|
kzg_proofs: v.kzg_proofs.len,
|
||||||
block_header: shortLog(v.signed_block_header.message),
|
block_header: shortLog(v.signed_block_header.message),
|
||||||
|
@ -371,7 +371,7 @@ proc verify_data_column_sidecar_kzg_proofs*(sidecar: DataColumnSidecar): Result[
|
|||||||
sidecarCol = sidecar.column.asSeq
|
sidecarCol = sidecar.column.asSeq
|
||||||
kzgProofs = sidecar.kzg_proofs.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():
|
if res.isErr():
|
||||||
return err("DataColumnSidecar: validation failed")
|
return err("DataColumnSidecar: validation failed")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user