Skip to content

Commit

Permalink
Add execution_transaction_timeout setting (#272)
Browse files Browse the repository at this point in the history
Signed-off-by: cyc60 <[email protected]>
  • Loading branch information
cyc60 authored Jan 19, 2024
1 parent 1fb31b0 commit 3fe893c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Settings(metaclass=Singleton):
consensus_retry_timeout: int
execution_endpoints: list[str]
execution_timeout: int
execution_transaction_timeout: int
execution_retry_timeout: int

harvest_vault: bool
Expand Down Expand Up @@ -162,6 +163,9 @@ def set(
'POOL_SIZE', default=None, cast=lambda x: int(x) if x else None
)
self.execution_timeout = decouple_config('EXECUTION_TIMEOUT', default=30, cast=int)
self.execution_transaction_timeout = decouple_config(
'EXECUTION_TRANSACTION_TIMEOUT', default=300, cast=int
)
self.execution_retry_timeout = decouple_config(
'EXECUTION_RETRY_TIMEOUT', default=60, cast=int
)
Expand Down
4 changes: 3 additions & 1 deletion src/exits/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@ async def submit_exit_signatures(
return None

logger.info('Waiting for transaction %s confirmation', Web3.to_hex(tx))
await execution_client.eth.wait_for_transaction_receipt(tx, timeout=300)
await execution_client.eth.wait_for_transaction_receipt(
tx, timeout=settings.execution_transaction_timeout
)
return Web3.to_hex(tx)
4 changes: 3 additions & 1 deletion src/harvest/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ async def submit_harvest_transaction(harvest_params: HarvestParams) -> HexStr |

tx_hash = Web3.to_hex(tx)
logger.info('Waiting for transaction %s confirmation', tx_hash)
await execution_client.eth.wait_for_transaction_receipt(tx, timeout=300)
await execution_client.eth.wait_for_transaction_receipt(
tx, timeout=settings.execution_transaction_timeout
)
return tx_hash
8 changes: 6 additions & 2 deletions src/validators/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ async def register_single_validator(

tx_hash = Web3.to_hex(tx)
logger.info('Waiting for transaction %s confirmation', tx_hash)
await execution_client.eth.wait_for_transaction_receipt(tx, timeout=300)
await execution_client.eth.wait_for_transaction_receipt(
tx, timeout=settings.execution_transaction_timeout
)
return tx_hash


Expand Down Expand Up @@ -339,5 +341,7 @@ async def register_multiple_validator(

tx_hash = Web3.to_hex(tx)
logger.info('Waiting for transaction %s confirmation', tx_hash)
await execution_client.eth.wait_for_transaction_receipt(tx, timeout=300)
await execution_client.eth.wait_for_transaction_receipt(
tx, timeout=settings.execution_transaction_timeout
)
return tx_hash

0 comments on commit 3fe893c

Please sign in to comment.