Optimize attester slashing (#1745)

## Issue Addressed

Closes #1548 

## Proposed Changes

Optimizes attester slashing choice by choosing the ones that cover the most amount of validators slashed, with the highest effective balances 

## Additional Info

Initial pass, need to write a test for it
This commit is contained in:
Daniel Schonfeld
2020-10-22 01:43:54 +00:00
parent 668513b67e
commit 8f86baa48d
4 changed files with 300 additions and 39 deletions

View File

@@ -1725,7 +1725,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
state.latest_block_header.canonical_root()
};
let (proposer_slashings, attester_slashings) = self.op_pool.get_slashings(&state);
let (proposer_slashings, attester_slashings) =
self.op_pool.get_slashings(&state, &self.spec);
let eth1_data = eth1_chain.eth1_data_for_block_production(&state, &self.spec)?;
let deposits = eth1_chain