# Validator Slashing Testing
## Setup
### Single process BN/VC
Goerli-07 running 10002 validators (including `aba2f1f` which will be targeted to get slashed).
Local VC/BN running 1 validator, a duplicate of `aba2f1f`
### Separate VC and BN
Goerli-vc-3 running 20001 validators (including `9102ee7` which will be targeted to get slashed)
Local VC/BN running 1 validator, a duplicate of `9102ee7`
## Failed attempt
Running the local VC using goerli-vc-3 BN through http resulted in the duplicate local validator publishing exactly the same attestations as the ones published by the validator running on goerli-07, which didn't trigger any slashing (same `AttestationData`).
## Successful attempt for goerli-07, single process VC/BN
Running a local VC/BN with the duplicate key `aba2f1f` and with some BN tweaking:
- Manually manipulating the `AttestationData`: setting the source epoch to `source_epoch - 1` in order to publish a different attestation from the one published by the duplicate validator running on goerli-07
- Bypassing the local slashing protection mechanism which normally would refuse to sign it:
`Refusing to sign attestation: source epoch (239855) is safe, target epoch (239857) is unsafe.`
`Refusing to sign attestation at slot 7675441 with source epoch 239855 and target epoch 239857 because it may violate a slashing condition`
This test resulted in the local validator getting slashed.
#### The local validator published an attestation and got slashed
`15:52:52.163 INFO - Validator *** Published attestation Count: 1, Slot: 7675464, Root: 28c8944b36894fea05b9d45933f8c3c6208421a4270a7e13696de37e1550a062`
[The slashed validator on goerli](https://goerli.beaconcha.in/validator/716021)
[The attester slashing on Goerli](https://goerli.beaconcha.in/slot/7675467#attester-slashings)
#### Goerli-07 detected the slashing event and shut down 9 seconds later
`{"@timestamp":"2024-02-22T14:53:01,172","level":"FATAL","thread":"ValidatorTimingChannel-0","class":"teku-status-log","message":"Validator(s) with public key(s) 0xaba2f1f21d2707f02f44c42643dd88ad9716c3ee420e455e7467bde3a82304f1666805793cf65d18b6c826495f606187 got slashed. Shutting down...","throwable":""}`
## Successful attempt for goerli-vc-03, separate VC and BN
Running a local VC/BN with the duplicate key `9102ee7` and with [the same BN tweaking](##Successful-attempt-for-goerli-07,-single-process-VC/BN)
This test resulted in the local validator getting slashed.
#### The local validator published an attestation and got slashed
`10:42:01.648 INFO - Validator *** Published attestation Count: 1, Slot: 7681110, Root: d56eab961ca97f37d42640d3faf9b5f4001a98cef91bfbadc4bf65b2606d56d6`
[The slashed validator on goerli](https://goerli.beaconcha.in/validator/716020)
[The attester slashing on Goerli](https://goerli.beaconcha.in/slot/7681114#attester-slashings)
#### Goerli-vc-03 VC detected the slashing event and shut down 11 seconds later
`{"@timestamp":"2024-02-23T09:42:13,121","level":"FATAL","thread":"ValidatorTimingChannel-1","class":"teku-status-log","message":"Validator(s) with public key(s) 0x9102ee7218ea5c1d681e965f08ae31b5a25413e89655d70cad272716d88f50ad3a84299ccf23e22e0a0590f60ed001b0 got slashed. Shutting down...","throwable":""}
Teku is shutting down`
PS: The Vc client only shut down, the BN kept running which is the expected behaviour