WIP faster attestation packing

This commit is contained in:
Michael Sproul
2022-07-06 18:49:03 +10:00
parent 748475be1d
commit 6f7f6aed96
12 changed files with 452 additions and 124 deletions

View File

@@ -39,14 +39,18 @@ impl<'a, T: EthSpec> AttesterSlashingMaxCover<'a, T> {
impl<'a, T: EthSpec> MaxCover for AttesterSlashingMaxCover<'a, T> {
/// The result type, of which we would eventually like a collection of maximal quality.
type Object = AttesterSlashing<T>;
type Intermediate = AttesterSlashing<T>;
/// The type used to represent sets.
type Set = HashMap<u64, u64>;
/// Extract an object for inclusion in a solution.
fn object(&self) -> &AttesterSlashing<T> {
fn intermediate(&self) -> &AttesterSlashing<T> {
self.slashing
}
fn convert_to_object(slashing: &AttesterSlashing<T>) -> AttesterSlashing<T> {
slashing.clone()
}
/// Get the set of elements covered.
fn covering_set(&self) -> &HashMap<u64, u64> {
&self.effective_balances