Tidy slasher logs for known slashings (#2108)
## Proposed Changes This quiets the slasher logs when ingesting slashings that are already known. Previously we would log an `ERRO` when a slashing was rediscovered locally but had already been submitted on-chain. This is to be expected from time to time, as different users' slashers will run at different times, and it's likely that slashings will make it on-chain before all users have detected them locally.
This commit is contained in:
parent
2931b05582
commit
c5f03f7d56
@ -223,8 +223,6 @@ pub enum AttesterSlashingInvalid {
|
|||||||
IndexedAttestation2Invalid(BlockOperationError<IndexedAttestationInvalid>),
|
IndexedAttestation2Invalid(BlockOperationError<IndexedAttestationInvalid>),
|
||||||
/// The validator index is unknown. One cannot slash one who does not exist.
|
/// The validator index is unknown. One cannot slash one who does not exist.
|
||||||
UnknownValidator(u64),
|
UnknownValidator(u64),
|
||||||
/// The specified validator has already been withdrawn.
|
|
||||||
ValidatorAlreadyWithdrawn(u64),
|
|
||||||
/// There were no indices able to be slashed.
|
/// There were no indices able to be slashed.
|
||||||
NoSlashableIndices,
|
NoSlashableIndices,
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,12 @@ use slasher::{
|
|||||||
};
|
};
|
||||||
use slog::{debug, error, info, trace, warn, Logger};
|
use slog::{debug, error, info, trace, warn, Logger};
|
||||||
use slot_clock::SlotClock;
|
use slot_clock::SlotClock;
|
||||||
use state_processing::VerifyOperation;
|
use state_processing::{
|
||||||
|
per_block_processing::errors::{
|
||||||
|
AttesterSlashingInvalid, BlockOperationError, ProposerSlashingInvalid,
|
||||||
|
},
|
||||||
|
VerifyOperation,
|
||||||
|
};
|
||||||
use std::sync::mpsc::{sync_channel, Receiver, SyncSender, TrySendError};
|
use std::sync::mpsc::{sync_channel, Receiver, SyncSender, TrySendError};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use task_executor::TaskExecutor;
|
use task_executor::TaskExecutor;
|
||||||
@ -175,12 +180,22 @@ impl<T: BeaconChainTypes> SlasherService<T> {
|
|||||||
)
|
)
|
||||||
}) {
|
}) {
|
||||||
Ok(verified) => verified,
|
Ok(verified) => verified,
|
||||||
|
Err(BeaconChainError::AttesterSlashingValidationError(
|
||||||
|
BlockOperationError::Invalid(AttesterSlashingInvalid::NoSlashableIndices),
|
||||||
|
)) => {
|
||||||
|
debug!(
|
||||||
|
log,
|
||||||
|
"Skipping attester slashing for slashed validators";
|
||||||
|
"slashing" => ?slashing,
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
warn!(
|
warn!(
|
||||||
log,
|
log,
|
||||||
"Attester slashing produced is invalid";
|
"Attester slashing produced is invalid";
|
||||||
"error" => format!("{:?}", e),
|
"error" => ?e,
|
||||||
"slashing" => format!("{:?}", slashing),
|
"slashing" => ?slashing,
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -191,8 +206,8 @@ impl<T: BeaconChainTypes> SlasherService<T> {
|
|||||||
error!(
|
error!(
|
||||||
log,
|
log,
|
||||||
"Beacon chain refused attester slashing";
|
"Beacon chain refused attester slashing";
|
||||||
"error" => format!("{:?}", e),
|
"error" => ?e,
|
||||||
"slashing" => format!("{:?}", slashing),
|
"slashing" => ?slashing,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +219,7 @@ impl<T: BeaconChainTypes> SlasherService<T> {
|
|||||||
debug!(
|
debug!(
|
||||||
log,
|
log,
|
||||||
"Unable to publish attester slashing";
|
"Unable to publish attester slashing";
|
||||||
"error" => format!("{:?}", e),
|
"error" => e,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -221,19 +236,29 @@ impl<T: BeaconChainTypes> SlasherService<T> {
|
|||||||
|
|
||||||
for slashing in proposer_slashings {
|
for slashing in proposer_slashings {
|
||||||
let verified_slashing = match beacon_chain.with_head(|head| {
|
let verified_slashing = match beacon_chain.with_head(|head| {
|
||||||
Ok::<_, BeaconChainError>(
|
Ok(slashing
|
||||||
slashing
|
|
||||||
.clone()
|
.clone()
|
||||||
.validate(&head.beacon_state, &beacon_chain.spec)?,
|
.validate(&head.beacon_state, &beacon_chain.spec)?)
|
||||||
)
|
|
||||||
}) {
|
}) {
|
||||||
Ok(verified) => verified,
|
Ok(verified) => verified,
|
||||||
|
Err(BeaconChainError::ProposerSlashingValidationError(
|
||||||
|
BlockOperationError::Invalid(ProposerSlashingInvalid::ProposerNotSlashable(
|
||||||
|
index,
|
||||||
|
)),
|
||||||
|
)) => {
|
||||||
|
debug!(
|
||||||
|
log,
|
||||||
|
"Skipping proposer slashing for slashed validator";
|
||||||
|
"validator_index" => index,
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!(
|
error!(
|
||||||
log,
|
log,
|
||||||
"Proposer slashing produced is invalid";
|
"Proposer slashing produced is invalid";
|
||||||
"error" => format!("{:?}", e),
|
"error" => ?e,
|
||||||
"slashing" => format!("{:?}", slashing),
|
"slashing" => ?slashing,
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -247,7 +272,7 @@ impl<T: BeaconChainTypes> SlasherService<T> {
|
|||||||
debug!(
|
debug!(
|
||||||
log,
|
log,
|
||||||
"Unable to publish proposer slashing";
|
"Unable to publish proposer slashing";
|
||||||
"error" => format!("{:?}", e),
|
"error" => e,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user