We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c17dc8c commit 17676f6Copy full SHA for 17676f6
1 file changed
src/beacon/beacon_entries.rs
@@ -33,6 +33,14 @@ pub struct BeaconEntry {
33
34
impl BeaconEntry {
35
pub fn new(round: u64, signature: Vec<u8>) -> Self {
36
+ // Drop any excess capacity to make heap usage deterministic across allocators.
37
+ // Avoid shrink_to_fit: it's a non-binding hint.
38
+ let signature = signature.into_boxed_slice().into_vec();
39
+ debug_assert_eq!(
40
+ signature.len(),
41
+ signature.capacity(),
42
+ "BeaconEntry::signature should be right-sized"
43
+ );
44
Self { round, signature }
45
}
46
0 commit comments