diff --git a/swagger.yaml b/swagger.yaml index 1d63d4de..cf708944 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -1428,7 +1428,7 @@ components: delegatees: type: object additionalProperties: - type: float + type: number SetDelegateeResponse: type: object properties: diff --git a/tig-benchmarker/common/structs.py b/tig-benchmarker/common/structs.py index c746f3d2..c2d29f1b 100644 --- a/tig-benchmarker/common/structs.py +++ b/tig-benchmarker/common/structs.py @@ -161,8 +161,8 @@ class BlockDetails(FromDict): @dataclass class BlockData(FromDict): - confirmed_ids: Dict[str, Set[int]] - active_ids: Dict[str, Set[int]] + confirmed_ids: Dict[str, Set[str]] + active_ids: Dict[str, Set[str]] @dataclass class Block(FromDict): diff --git a/tig-benchmarker/master/master/submissions_manager.py b/tig-benchmarker/master/master/submissions_manager.py index 1833cba7..3130390f 100644 --- a/tig-benchmarker/master/master/submissions_manager.py +++ b/tig-benchmarker/master/master/submissions_manager.py @@ -1,3 +1,4 @@ +import brotli import requests import threading import logging @@ -46,7 +47,14 @@ def _post(self, submission_type: str, req: Union[SubmitPrecommitRequest, SubmitB logger.info(f"submitting {submission_type} '{req.benchmark_id}'") logger.debug(f"{req}") - resp = requests.post(f"{api_url}/submit-{submission_type}", json=req.to_dict(), headers=headers) + data = jsonify(req) + if len(data) > 10 * 1024: + headers.update({ + 'Content-Encoding': 'br', + 'Accept-Encoding': 'br', + }) + data = brotli.compress(data) + resp = requests.post(f"{api_url}/submit-{submission_type}", data=data, headers=headers) if resp.status_code == 200: logger.info(f"submitted {submission_type} successfully") elif resp.headers.get("Content-Type") == "text/plain": diff --git a/tig-benchmarker/master/requirements.txt b/tig-benchmarker/master/requirements.txt index d01ed26a..b46c68f9 100644 --- a/tig-benchmarker/master/requirements.txt +++ b/tig-benchmarker/master/requirements.txt @@ -1,4 +1,5 @@ blake3 +brotli dataclasses hypercorn numpy