mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-23 11:48:33 +00:00
stop double-counting attestation-topic attestations (#501)
This commit is contained in:
parent
363f918f7b
commit
a9fcaf16a6
@ -34,7 +34,7 @@ declareGauge beacon_pending_exits, "Number of pending voluntary exits in local o
|
||||
declareCounter beacon_attestations_sent, "Number of beacon chain attestations sent by this peer"
|
||||
declareCounter beacon_attestations_received, "Number of beacon chain attestations received by this peer"
|
||||
declareCounter beacon_blocks_proposed, "Number of beacon chain blocks sent by this peer"
|
||||
declareCounter beacon_blocks_received, "Number of becon chain blocks received by this peer"
|
||||
declareCounter beacon_blocks_received, "Number of beacon chain blocks received by this peer"
|
||||
|
||||
logScope: topics = "beacnde"
|
||||
|
||||
@ -474,10 +474,6 @@ proc onAttestation(node: BeaconNode, attestation: Attestation) =
|
||||
signature = shortLog(attestation.signature),
|
||||
cat = "consensus" # Tag "consensus|attestation"?
|
||||
|
||||
# This is the shared codepath for both topic attestation and beacon block
|
||||
# attestations.
|
||||
beacon_attestations_received.inc()
|
||||
|
||||
if (let attestedBlock = node.blockPool.getOrResolve(
|
||||
attestation.data.beacon_block_root); attestedBlock != nil):
|
||||
let
|
||||
@ -794,6 +790,10 @@ proc run*(node: BeaconNode) =
|
||||
onBeaconBlock(node, blck)
|
||||
|
||||
waitFor node.network.subscribe(topicAttestations) do (attestation: Attestation):
|
||||
# Avoid double-counting attestation-topic attestations on shared codepath
|
||||
# when they're reflected through beacon blocks
|
||||
beacon_attestations_received.inc()
|
||||
|
||||
node.onAttestation(attestation)
|
||||
|
||||
let
|
||||
|
Loading…
x
Reference in New Issue
Block a user