Add grandpa telemetry (+ other minor improvements) (#1997)

* Support skipping the interactive purge prompt

Skip it via `cargo run -- purge-chain -y`.

* Fix typos

* Add Grandpa telemetry

* Address comments

* Revert unnecessary version bump

* Version bump to make CI run

* Remove unnecessary cast

* Do not bump version
This commit is contained in:
Michael Müller
2019-03-15 15:04:01 +01:00
committed by Bastian Köcher
parent 35a67b31e5
commit c52c528ee8
31 changed files with 139 additions and 45 deletions
@@ -37,6 +37,7 @@ use runtime_primitives::generic::BlockId;
use runtime_primitives::ApplyError;
use transaction_pool::txpool::{self, Pool as TransactionPool};
use inherents::InherentData;
use substrate_telemetry::{telemetry, CONSENSUS_INFO};
/// Build new blocks.
pub trait BlockBuilder<Block: BlockT> {
@@ -252,6 +253,10 @@ impl<Block, C, A> Proposer<Block, C, A> where
.collect::<Vec<_>>()
.join(", ")
);
telemetry!(CONSENSUS_INFO; "prepared_block_for_proposing";
"number" => ?block.header().number(),
"hash" => ?<<C as AuthoringApi>::Block as BlockT>::Hash::from(block.header().hash()),
);
let substrate_block = Decode::decode(&mut block.encode().as_slice())
.expect("blocks are defined to serialize to substrate blocks correctly; qed");