Skip to content

Commit e1b59b3

Browse files
committed
minor review fixes
1 parent 4628c25 commit e1b59b3

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

apps/hip-3-pusher/src/pusher/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from hyperliquid.utils.constants import MAINNET_API_URL, TESTNET_API_URL
2-
from pydantic import BaseModel, model_validator
2+
from pydantic import BaseModel, FilePath, model_validator
33
from typing import Optional
44

55
STALE_TIMEOUT_SECONDS = 5
66

77

88
class KMSConfig(BaseModel):
99
enable_kms: bool
10-
aws_kms_key_id_path: str
10+
aws_kms_key_id_path: FilePath
1111

1212

1313
class LazerConfig(BaseModel):
@@ -33,7 +33,7 @@ class HyperliquidConfig(BaseModel):
3333
market_name: str
3434
market_symbol: str
3535
use_testnet: bool
36-
oracle_pusher_key_path: str
36+
oracle_pusher_key_path: FilePath
3737
publish_interval: float
3838
enable_publish: bool
3939

apps/hip-3-pusher/src/pusher/kms_signer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ def __init__(self, config: Config, publisher_exchanges: list[Exchange]):
3232

3333
# AWS client and public key load
3434
self.client = _init_client()
35-
self._load_public_key(config.kms.aws_kms_key_id_path)
35+
try:
36+
self._load_public_key(config.kms.aws_kms_key_id_path)
37+
except Exception as e:
38+
logger.exception("Failed to load public key from KMS; it might be incorrectly configured; error: {}", repr(e))
39+
exit()
3640

3741
def _load_public_key(self, key_path: str):
3842
# Fetch public key once so we can derive address and check recovery id
@@ -88,7 +92,7 @@ def _send_update(self, action, signature, timestamp):
8892
nonce=timestamp,
8993
)
9094
except Exception as e:
91-
logger.exception("perp_deploy_set_oracle exception for endpoint: {} error: {}", exchange.base_url, e)
95+
logger.exception("perp_deploy_set_oracle exception for endpoint: {} error: {}", exchange.base_url, repr(e))
9296

9397
return None
9498

apps/hip-3-pusher/src/pusher/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ async def main():
6262
try:
6363
asyncio.run(main())
6464
except Exception as e:
65-
logger.exception("Uncaught exception, exiting: {}", e)
65+
logger.exception("Uncaught exception, exiting; error: {}", repr(e))

apps/hip-3-pusher/src/pusher/publisher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async def run(self):
4949
try:
5050
self.publish()
5151
except Exception as e:
52-
logger.exception("Publisher.publish() exception: {}", e)
52+
logger.exception("Publisher.publish() exception: {}", repr(e))
5353

5454
def publish(self):
5555
oracle_pxs = {}
@@ -98,7 +98,7 @@ def _send_update(self, oracle_pxs, all_mark_pxs, external_perp_pxs):
9898
external_perp_pxs=external_perp_pxs,
9999
)
100100
except Exception as e:
101-
logger.exception("perp_deploy_set_oracle exception for endpoint: {} error: {}", exchange.base_url, e)
101+
logger.exception("perp_deploy_set_oracle exception for endpoint: {} error: {}", exchange.base_url, repr(e))
102102

103103
return None
104104

0 commit comments

Comments
 (0)