Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ol aleph 166 misc stability #719

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/aleph/vm/orchestrator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,10 @@ def main():

settings.check()

logger.debug("Initialising the DB...")
asyncio.run(run_async_db_migrations())
logger.debug("DB up to date.")
if not args.do_not_run:
logger.debug("Initialising the DB...")
asyncio.run(run_async_db_migrations())
logger.debug("DB up to date.")

if args.benchmark > 0:
asyncio.run(benchmark(runs=args.benchmark), debug=args.debug_asyncio)
Expand Down
6 changes: 5 additions & 1 deletion src/aleph/vm/orchestrator/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ async def monitor_payments(app: web.Application):

# Check if the executions continues existing or are forgotten before checking the payment
for vm_hash in list(pool.executions.keys()):
if vm_hash == settings.FAKE_INSTANCE_ID:
continue
message_status = await get_message_status(vm_hash)
if message_status != MessageStatus.PROCESSED:
logger.debug(f"Stopping {vm_hash} execution due to {message_status} message status")
Expand All @@ -160,11 +162,13 @@ async def monitor_payments(app: web.Application):
for sender, chains in pool.get_executions_by_sender(payment_type=PaymentType.hold).items():
for chain, executions in chains.items():
executions = [execution for execution in executions if execution.is_confidential]
if not executions:
continue
balance = await fetch_balance_of_address(sender)

# Stop executions until the required balance is reached
required_balance = await compute_required_balance(executions)
logger.debug(f"Required balance for Sender {sender} executions: {required_balance}")
logger.debug(f"Required balance for Sender {sender} executions: {required_balance}, {executions}")
# Stop executions until the required balance is reached
while executions and balance < (required_balance + settings.PAYMENT_BUFFER):
last_execution = executions.pop(-1)
Expand Down
Loading