Skip to content

Commit 3e7368a

Browse files
Seulgi Kimmergify[bot]
authored andcommitted
Add what to validate to the name of the verification threads
1 parent 24675f1 commit 3e7368a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

core/src/verification/queue/kind.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ pub trait Kind: 'static + Sized + Send + Sync {
6767
/// The third stage: completely verified.
6868
type Verified: Sized + Send + BlockLike + MemUsage;
6969

70+
fn name() -> &'static str;
71+
7072
/// Attempt to create the `Unverified` item from the input.
7173
fn create(input: Self::Input, engine: &CodeChainEngine) -> Result<Self::Unverified, Error>;
7274

@@ -115,6 +117,10 @@ pub mod headers {
115117
type Unverified = Header;
116118
type Verified = Header;
117119

120+
fn name() -> &'static str {
121+
"Headers"
122+
}
123+
118124
fn create(input: Self::Input, engine: &CodeChainEngine) -> Result<Self::Unverified, Error> {
119125
// FIXME: this doesn't seem to match with full block verification
120126
verify_header_basic(&input)?;
@@ -157,6 +163,10 @@ pub mod blocks {
157163
type Unverified = Unverified;
158164
type Verified = PreverifiedBlock;
159165

166+
fn name() -> &'static str {
167+
"Blocks"
168+
}
169+
160170
fn create(input: Self::Input, engine: &CodeChainEngine) -> Result<Self::Unverified, Error> {
161171
match verify_block_basic(&input.header, &input.bytes)
162172
.and_then(|_| verify_header_with_engine(&input.header, engine))

core/src/verification/queue/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl<K: Kind> VerificationQueue<K> {
162162
let deleting = Arc::clone(&deleting);
163163

164164
let handle = thread::Builder::new()
165-
.name(format!("Verifier #{}", i))
165+
.name(format!("{} Verifier #{}", K::name(), i))
166166
.spawn(move || {
167167
VerificationQueue::verify(
168168
&verification,

0 commit comments

Comments
 (0)