mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 05:11:09 +00:00
Don't err on deactivated leaf during valiation. (#3708)
* Don't err on deactivated leaf during valiation. * Fix error level + formatting of unrelated code.
This commit is contained in:
@@ -92,7 +92,7 @@ pub enum Error {
|
||||
#[error(transparent)]
|
||||
ValidationFailed(#[from] ValidationFailed),
|
||||
#[error(transparent)]
|
||||
Mpsc(#[from] mpsc::SendError),
|
||||
BackgroundValidationMpsc(#[from] mpsc::SendError),
|
||||
#[error(transparent)]
|
||||
UtilError(#[from] util::Error),
|
||||
}
|
||||
@@ -444,7 +444,7 @@ async fn validate_and_make_available(
|
||||
tx_command
|
||||
.send(ValidatedCandidateCommand::AttestNoPoV(candidate.hash()))
|
||||
.await
|
||||
.map_err(Error::Mpsc)?;
|
||||
.map_err(Error::BackgroundValidationMpsc)?;
|
||||
return Ok(())
|
||||
},
|
||||
Err(err) => return Err(err),
|
||||
@@ -650,11 +650,19 @@ impl CandidateBackingJob {
|
||||
// spawn background task.
|
||||
let bg = async move {
|
||||
if let Err(e) = validate_and_make_available(params).await {
|
||||
tracing::error!(
|
||||
target: LOG_TARGET,
|
||||
"Failed to validate and make available: {:?}",
|
||||
e
|
||||
);
|
||||
if let Error::BackgroundValidationMpsc(error) = e {
|
||||
tracing::debug!(
|
||||
target: LOG_TARGET,
|
||||
?error,
|
||||
"Mpsc background validation mpsc died during validation- leaf no longer active?"
|
||||
);
|
||||
} else {
|
||||
tracing::error!(
|
||||
target: LOG_TARGET,
|
||||
"Failed to validate and make available: {:?}",
|
||||
e
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
sender
|
||||
|
||||
Reference in New Issue
Block a user