Skip to content

Commit 7fc5ed0

Browse files
committed
chore: fix comments
1 parent a84c178 commit 7fc5ed0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/beacon-node/src/network/gossip/encoding.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class DataTransformSnappy implements DataTransform {
104104
}
105105

106106
// Only after sanity length checks, we can decompress the data
107-
// using Buffer.allocUnsafe() caused huge MarkSweepCompact gc on the main thread of sas nodes
107+
// Using Buffer.alloc() instead of Buffer.allocUnsafe() to mitigate high GC pressure observed in some environments
108108
const uncompressedData = Buffer.alloc(uncompressedDataLength);
109109
decoder.decompress_into(data, uncompressedData);
110110
return uncompressedData;
@@ -121,7 +121,7 @@ export class DataTransformSnappy implements DataTransform {
121121
throw Error(`ssz_snappy encoded data length ${data.length} > ${this.maxSizePerMessage}`);
122122
}
123123

124-
// using Buffer.allocUnsafe() caused huge MarkSweepCompact gc on the main thread of sas nodes
124+
// Using Buffer.alloc() instead of Buffer.allocUnsafe() to mitigate high GC pressure observed in some environments
125125
const compressedData = Buffer.alloc(snappyWasm.max_compress_len(data.length));
126126
const compressedLen = encoder.compress_into(data, compressedData);
127127
return compressedData.subarray(0, compressedLen);

0 commit comments

Comments
 (0)