From 0f95c1c21c42dd91567a271ee60fb0d56e20a23b Mon Sep 17 00:00:00 2001 From: Tim Olson <> Date: Tue, 9 Jan 2024 21:10:24 -0400 Subject: [PATCH] debug printouts; removed incorrect test account from secret-mock --- .secret-mock.toml | 1 - src/dexorder/base/orderlib.py | 2 +- src/dexorder/event_handler.py | 4 +--- src/dexorder/order/executionhandler.py | 1 + src/dexorder/transaction.py | 1 + 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.secret-mock.toml b/.secret-mock.toml index 38404c5..677a301 100644 --- a/.secret-mock.toml +++ b/.secret-mock.toml @@ -1,5 +1,4 @@ [accounts] -test='0x065b7ef20b68ff99e71774acae7759a873073ac3d3c502ceb90f01efb3c48079' # address 0xE1918Fc43C3a9c4854463e86Af854BE7034Fab56 [rpc_urls] local='http://localhost:8545' diff --git a/src/dexorder/base/orderlib.py b/src/dexorder/base/orderlib.py index 67fe28d..698a6ae 100644 --- a/src/dexorder/base/orderlib.py +++ b/src/dexorder/base/orderlib.py @@ -221,7 +221,7 @@ class Tranche: ) def __str__(self): - msg = f'{self.fraction/MAX_FRACTION:.1%} {self.startTime} to {self.endTime}' + msg = f'{self.fraction/MAX_FRACTION:.1%} {"start+" if self.startTimeIsRelative else ""}{self.startTime} to {"start+" if self.startTimeIsRelative else ""}{self.endTime}' if self.marketOrder: msg += ' market order' else: diff --git a/src/dexorder/event_handler.py b/src/dexorder/event_handler.py index 35c87ab..e3ae3da 100644 --- a/src/dexorder/event_handler.py +++ b/src/dexorder/event_handler.py @@ -277,7 +277,6 @@ async def process_execution_requests(): tk: TrancheKey er: ExecutionRequest pending = inflight_execution_requests.get(tk) - log.debug(f'tranche key {tk} pending height: {pending}') if pending is None or height-pending >= 30: # todo execution timeout => retry ; should we use timestamps? configure per-chain. execs[tk] = er else: @@ -286,10 +285,9 @@ async def process_execution_requests(): # execute the list # todo batch execution for tk, er in execs.items(): - log.info(f'executing tranche {tk}') job = submit_transaction_request(new_tranche_execution_request(tk, er.proof)) inflight_execution_requests[tk] = height - log.info(f'executing tranche {tk} with job {job.id}') + log.info(f'created job {job.id} to execute tranche {tk}') def handle_dexorderexecutions(event: EventData): diff --git a/src/dexorder/order/executionhandler.py b/src/dexorder/order/executionhandler.py index c150fde..d6a75ea 100644 --- a/src/dexorder/order/executionhandler.py +++ b/src/dexorder/order/executionhandler.py @@ -29,6 +29,7 @@ class TrancheExecutionHandler (TransactionHandler): async def complete_transaction(self, job: TransactionJob) -> None: req: TrancheExecutionRequest = job.request tk = TrancheKey(req.vault, req.order_index, req.tranche_index) + log.debug(f'execution request {tk} no longer in-flight') del inflight_execution_requests[tk] # no longer in-flight diff --git a/src/dexorder/transaction.py b/src/dexorder/transaction.py index cad99f6..f21ed34 100644 --- a/src/dexorder/transaction.py +++ b/src/dexorder/transaction.py @@ -59,6 +59,7 @@ async def create_transactions(): async def create_transaction(job: TransactionJob): + log.info(f'building transaction request for {job.request.__class__.__name__} {job.id}') try: handler = TransactionHandler.of(job.request.type) except KeyError: