mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 05:11:09 +00:00
some initial spans for approval voting (#2525)
* some initial spans for approval voting * add stage earlier
This commit is contained in:
committed by
GitHub
parent
4e3dba91be
commit
49705026e0
@@ -45,7 +45,8 @@
|
||||
//! ```
|
||||
|
||||
use sp_core::traits::SpawnNamed;
|
||||
use polkadot_primitives::v1::{CandidateHash, Hash, PoV, ValidatorIndex};
|
||||
use polkadot_primitives::v1::{CandidateHash, Hash, PoV, ValidatorIndex, BlakeTwo256, HashT};
|
||||
use parity_scale_codec::Encode;
|
||||
use sc_network::PeerId;
|
||||
|
||||
use parking_lot::RwLock;
|
||||
@@ -176,6 +177,7 @@ pub enum Stage {
|
||||
AvailabilityDistribution = 5,
|
||||
AvailabilityRecovery = 6,
|
||||
BitfieldDistribution = 7,
|
||||
ApprovalChecking = 8,
|
||||
// Expand as needed, numbers should be ascending according to the stage
|
||||
// through the inclusion pipeline, or according to the descriptions
|
||||
// in [the path of a para chain block]
|
||||
@@ -381,6 +383,15 @@ pub fn hash_span(hash: &Hash, span_name: &'static str) -> Span {
|
||||
span
|
||||
}
|
||||
|
||||
/// Creates a `Span` referring to the given descriptor, which should be unique.
|
||||
#[inline(always)]
|
||||
pub fn descriptor_span(descriptor: impl Encode, span_name: &'static str) -> Span {
|
||||
INSTANCE.read_recursive().span(
|
||||
|| { BlakeTwo256::hash_of(&descriptor) },
|
||||
span_name,
|
||||
).into()
|
||||
}
|
||||
|
||||
/// Stateful convenience wrapper around [`mick_jaeger`].
|
||||
pub enum Jaeger {
|
||||
/// Launched and operational state.
|
||||
|
||||
Reference in New Issue
Block a user