Skip to content

Commit

Permalink
update: increase max_compression_byte_size. (#75)
Browse files Browse the repository at this point in the history
* update: increase max_compression_byte_size.

* chore: cleanup.
  • Loading branch information
christopherbrumm authored Oct 4, 2023
1 parent 9d09ae4 commit f986706
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions common/protocol/src/reactors/compression/Gzip.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { gunzipSync, gzipSync } from "zlib";
import { MAX_BUNDLE_BYTE_SIZE } from "../..";
import { MAX_COMPRESSION_BYTE_SIZE } from "../..";

import { ICompression } from "../../types";

Expand All @@ -14,7 +14,7 @@ export class Gzip implements ICompression {
async decompress(data: Buffer) {
// limit maxOutputLength to protect against zip bombs
return gunzipSync(data, {
maxOutputLength: MAX_BUNDLE_BYTE_SIZE,
maxOutputLength: MAX_COMPRESSION_BYTE_SIZE,
});
}
}
5 changes: 4 additions & 1 deletion common/protocol/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ export const REFRESH_TIME = 10 * 1000;
// the time the node should halt if an error occurs
export const ERROR_IDLE_TIME = 10 * 1000;

// the max bundle size allowed to upload - currently 100MB
// the max bundle size allowed to upload - currently 200MB
export const MAX_BUNDLE_BYTE_SIZE = 200 * 1024 * 1024;

// the max compression size - currently 2GB
export const MAX_COMPRESSION_BYTE_SIZE = 2 * 10 ** 9;

// a vote map to allow human readable votes
export const VOTE = {
UNSPECIFIED: 0,
Expand Down

0 comments on commit f986706

Please sign in to comment.