mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
client: only report block import to telemetry if new best (#3548)
* client: only report block import to telemetry if new best * grandpa: fix tests * consensus: derive Default for ImportedAux * network: fix test
This commit is contained in:
@@ -879,11 +879,15 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
|
||||
fork_choice,
|
||||
);
|
||||
|
||||
telemetry!(SUBSTRATE_INFO; "block.import";
|
||||
"height" => height,
|
||||
"best" => ?hash,
|
||||
"origin" => ?origin
|
||||
);
|
||||
if let Ok(ImportResult::Imported(ref aux)) = result {
|
||||
if aux.is_new_best {
|
||||
telemetry!(SUBSTRATE_INFO; "block.import";
|
||||
"height" => height,
|
||||
"best" => ?hash,
|
||||
"origin" => ?origin
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
result
|
||||
}
|
||||
@@ -985,7 +989,7 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
|
||||
operation.notify_imported = Some((hash, origin, import_headers.into_post(), is_new_best, storage_changes));
|
||||
}
|
||||
|
||||
Ok(ImportResult::imported())
|
||||
Ok(ImportResult::imported(is_new_best))
|
||||
}
|
||||
|
||||
fn block_execution(
|
||||
@@ -1500,7 +1504,7 @@ impl<'a, B, E, Block, RA> consensus::BlockImport<Block> for &'a Client<B, E, Blo
|
||||
BlockStatus::KnownBad => return Ok(ImportResult::KnownBad),
|
||||
}
|
||||
|
||||
Ok(ImportResult::imported())
|
||||
Ok(ImportResult::imported(false))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1528,7 +1532,7 @@ impl<B, E, Block, RA> consensus::BlockImport<Block> for Client<B, E, Block, RA>
|
||||
}
|
||||
}
|
||||
|
||||
impl<B, E, Block, RA> Finalizer<Block, Blake2Hasher, B> for Client<B, E, Block, RA> where
|
||||
impl<B, E, Block, RA> Finalizer<Block, Blake2Hasher, B> for Client<B, E, Block, RA> where
|
||||
B: backend::Backend<Block, Blake2Hasher>,
|
||||
E: CallExecutor<Block, Blake2Hasher>,
|
||||
Block: BlockT<Hash=H256>,
|
||||
@@ -1552,7 +1556,7 @@ impl<B, E, Block, RA> Finalizer<Block, Blake2Hasher, B> for Client<B, E, Block,
|
||||
}
|
||||
}
|
||||
|
||||
impl<B, E, Block, RA> Finalizer<Block, Blake2Hasher, B> for &Client<B, E, Block, RA> where
|
||||
impl<B, E, Block, RA> Finalizer<Block, Blake2Hasher, B> for &Client<B, E, Block, RA> where
|
||||
B: backend::Backend<Block, Blake2Hasher>,
|
||||
E: CallExecutor<Block, Blake2Hasher>,
|
||||
Block: BlockT<Hash=H256>,
|
||||
@@ -1833,7 +1837,7 @@ impl<B, E, Block, RA> backend::AuxStore for &Client<B, E, Block, RA>
|
||||
B: backend::Backend<Block, Blake2Hasher>,
|
||||
E: CallExecutor<Block, Blake2Hasher>,
|
||||
Block: BlockT<Hash=H256>,
|
||||
{
|
||||
{
|
||||
|
||||
fn insert_aux<
|
||||
'a,
|
||||
|
||||
Reference in New Issue
Block a user