From 98bd626b1e65bfd7c312e198e12f13cb9d350042 Mon Sep 17 00:00:00 2001
From: Michael Mueller <mich@elmueller.net>
Date: Thu, 19 Sep 2019 17:24:02 +0200
Subject: [PATCH] Do not send unfinalized authority sets to telemetry

`update_authority_set()` is called from, among others,
import side. These updates only track a pending change
and may or may not happen, hence it's wrong to send
this set to telemetry (which would assume that this is
the current, finalized authority set).
---
 core/finality-grandpa/src/aux_schema.rs | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/core/finality-grandpa/src/aux_schema.rs b/core/finality-grandpa/src/aux_schema.rs
index 599604c1d32..a2b05a0cd60 100644
--- a/core/finality-grandpa/src/aux_schema.rs
+++ b/core/finality-grandpa/src/aux_schema.rs
@@ -25,7 +25,6 @@ use fork_tree::ForkTree;
 use grandpa::round::State as RoundState;
 use sr_primitives::traits::{Block as BlockT, NumberFor};
 use log::{info, warn};
-use substrate_telemetry::{telemetry, CONSENSUS_INFO};
 use fg_primitives::{AuthorityId, AuthorityWeight, SetId, RoundNumber};
 
 use crate::authorities::{AuthoritySet, SharedAuthoritySet, PendingChange, DelayKind};
@@ -376,17 +375,6 @@ pub(crate) fn update_authority_set<Block: BlockT, F, R>(
 	let encoded_set = set.encode();
 
 	if let Some(new_set) = new_set {
-		telemetry!(CONSENSUS_INFO; "afg.authority_set";
-			"hash" => ?new_set.canon_hash,
-			"number" => ?new_set.canon_number,
-			"authority_set_id" => ?new_set.set_id,
-			"authorities" => {
-				let authorities: Vec<String> =
-					new_set.authorities.iter().map(|(id, _)| format!("{}", id)).collect();
-				format!("{:?}", authorities)
-			}
-		);
-
 		// we also overwrite the "last completed round" entry with a blank slate
 		// because from the perspective of the finality gadget, the chain has
 		// reset.
-- 
GitLab