Skip to content

Commit

Permalink
update: increase max_compression_byte_size.
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherbrumm committed Oct 4, 2023
1 parent 9d09ae4 commit 41a90d0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion common/protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
"ts-jest": "^28.0.8",
"typedoc": "^0.22.17",
"typescript": "^4.4.3"
}
},
"gitHead": "9d09ae4ebd7695e93cc9b8184e5e557575cfd3b4"
}
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
3 changes: 2 additions & 1 deletion integrations/tendermint-bsync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"typescript": "^4.7.4"
}
},
"gitHead": "9d09ae4ebd7695e93cc9b8184e5e557575cfd3b4"
}
3 changes: 2 additions & 1 deletion integrations/tendermint-ssync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"typescript": "^4.7.4"
}
},
"gitHead": "9d09ae4ebd7695e93cc9b8184e5e557575cfd3b4"
}
3 changes: 2 additions & 1 deletion integrations/tendermint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"typescript": "^4.7.4"
}
},
"gitHead": "9d09ae4ebd7695e93cc9b8184e5e557575cfd3b4"
}

0 comments on commit 41a90d0

Please sign in to comment.