Fix gossip verification of duplicate attester slashings (#5385)

* Fix gossip verification of duplicate attester slashings
This commit is contained in:
Michael Sproul
2024-03-21 07:47:38 +11:00
committed by GitHub
parent f33ce8cc34
commit 65a6118c53
5 changed files with 208 additions and 19 deletions

View File

@@ -231,11 +231,9 @@ pub fn process_attester_slashings<T: EthSpec>(
spec: &ChainSpec,
) -> Result<(), BlockProcessingError> {
for (i, attester_slashing) in attester_slashings.iter().enumerate() {
verify_attester_slashing(state, attester_slashing, verify_signatures, spec)
.map_err(|e| e.into_with_index(i))?;
let slashable_indices =
get_slashable_indices(state, attester_slashing).map_err(|e| e.into_with_index(i))?;
verify_attester_slashing(state, attester_slashing, verify_signatures, spec)
.map_err(|e| e.into_with_index(i))?;
for i in slashable_indices {
slash_validator(state, i as usize, None, ctxt, spec)?;