Lazy hashing for SignedBeaconBlock in sync (#2916)

## Proposed Changes

Allocate less memory in sync by hashing the `SignedBeaconBlock`s in a batch directly, rather than going via SSZ bytes.

Credit to @paulhauner for finding this source of temporary allocations.
This commit is contained in:
Michael Sproul
2022-01-14 07:20:54 +00:00
parent 1c667ad3ca
commit ceeab02e3a
22 changed files with 93 additions and 39 deletions

View File

@@ -113,6 +113,14 @@ impl PartialEq for Signature {
}
}
impl Eq for Signature {}
impl std::hash::Hash for Signature {
fn hash<H: std::hash::Hasher>(&self, hasher: &mut H) {
self.0.hash(hasher);
}
}
#[derive(Clone)]
pub struct AggregateSignature([u8; SIGNATURE_BYTES_LEN]);