Broadcast Proposer Slashing on equivocation (#14693)

* Add equivocation detection logic; broadcast slashing immediately on equivocation

* nit: comments

* move equivocation detection to validateBeaconBlockPubSub

* include broadcasting logic within the helper function

* fix lint

* Add unit tests for equivocation detection

* remove comment that are not required

* Add changelog file

* Add descriptive comment for detectAndBroadcastEquivocation

* use head block instead of block cache for equivocation detection

* add more equivocation unit tests; update a mock to include HeadState error

* update the order of the checks

* move slashing before state fetch; update Tests

* update changelog

* use verifyProposerSlashing to verify and reject block; remove verifySlashableBlock; update tests

* Update changelog

* nit: cleaner error check

* nit: clean up

* revert code logic; update string check; add a unit test

* improve errors; merge tests

* Update a unit test

* fix lint

---------

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
kira
2025-04-24 13:27:34 -07:00
committed by GitHub
parent 1b13520270
commit 7887ebbc4a
8 changed files with 344 additions and 12 deletions

View File

@@ -2,5 +2,5 @@ package params
// Re-exports for blackbox testing.
const MainnetDenebForkEpoch = mainnetDenebForkEpoch
var MainnetBeaconConfig = mainnetBeaconConfig
var MainnetBeaconConfig = mainnetBeaconConfig