fix slashing handling

This commit is contained in:
realbigsean
2024-05-17 09:51:32 -04:00
parent a8088f1bfa
commit bafb5f0cc0
4 changed files with 96 additions and 51 deletions

View File

@@ -247,6 +247,7 @@ impl<E: EthSpec> Slasher<E> {
batch,
current_epoch,
&self.config,
&self.log,
) {
Ok(slashings) => {
if !slashings.is_empty() {
@@ -294,14 +295,25 @@ impl<E: EthSpec> Slasher<E> {
indexed_attestation_id,
)?;
if let Some(slashing) = slashing_status.into_slashing(attestation) {
debug!(
self.log,
"Found double-vote slashing";
"validator_index" => validator_index,
"epoch" => slashing.attestation_1().data().target.epoch,
);
slashings.insert(slashing);
match slashing_status.into_slashing(attestation) {
Ok(Some(slashing)) => {
debug!(
self.log,
"Found double-vote slashing";
"validator_index" => validator_index,
"epoch" => slashing.attestation_1().data().target.epoch,
);
slashings.insert(slashing);
}
Err(e) => {
error!(
self.log,
"Invalid slashing conversion";
"validator_index" => validator_index,
"error" => e
);
}
Ok(None) => {}
}
}