mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 05:14:35 +00:00
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:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user