create unified slashing cache (#5033)

* create unified slashing cache

* add observed slashable file

* fix broadcast validation tests

* revert block seen cache changes

* clean up slashable cache test

* check header signatures for RPC blobs

* don't throw error on RPC signature invalie
This commit is contained in:
realbigsean
2024-01-08 10:30:57 -05:00
committed by GitHub
parent f62cfc6475
commit f70c32ec70
12 changed files with 655 additions and 156 deletions

View File

@@ -155,13 +155,12 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
// Checks if a block from this proposer is already known.
let block_equivocates = || {
match self
.chain
.observed_block_producers
.read()
.proposer_has_been_observed(block.message(), block.canonical_root())
{
Ok(seen_status) => seen_status.is_slashable(),
match self.chain.observed_slashable.read().is_slashable(
block.slot(),
block.message().proposer_index(),
block.canonical_root(),
) {
Ok(is_slashable) => is_slashable,
//Both of these blocks will be rejected, so reject them now rather
// than re-queuing them.
Err(ObserveError::FinalizedBlock { .. })