From 63b32b4cccae5974f4fbca3f0e83751a883df2d8 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Wed, 4 Sep 2024 08:25:38 -0400 Subject: [PATCH 1/2] Strip new lines from provider addresses obtained from handpicked addresses file. Fix linter errors. --- scripts/initiate_ritual.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/initiate_ritual.py b/scripts/initiate_ritual.py index 1908c402..a5c6b9b4 100644 --- a/scripts/initiate_ritual.py +++ b/scripts/initiate_ritual.py @@ -83,7 +83,7 @@ def cli( num_nodes, random_seed, handpicked, - min_version + min_version, ): """Initiate a ritual for a TACo domain.""" @@ -108,7 +108,9 @@ def cli( # Get the contracts from the registry coordinator_contract = registry.get_contract(domain=domain, contract_name="Coordinator") - access_controller_contract = registry.get_contract(domain=domain, contract_name=access_controller) + access_controller_contract = registry.get_contract( + domain=domain, contract_name=access_controller + ) fee_model_contract = registry.get_contract(domain=domain, contract_name=fee_model) # if using a subcription, duration needs to be calculated @@ -125,23 +127,25 @@ def cli( if now > end_of_subscription: raise ValueError("Subscription has already ended.") click.echo( - "Subscription has already started. Subtracting the elapsed time from the duration." - ) + "Subscription has already started. Subtracting the elapsed time from the duration." + ) elapsed = now - start_of_subscription + 100 duration -= elapsed - # Get the staking providers in the ritual cohort if handpicked: - providers = sorted(line.lower() for line in handpicked) + providers = sorted(line.lower().strip() for line in handpicked) if not providers: raise ValueError(f"No staking providers found in the handpicked file {handpicked.name}") else: providers = sample_nodes( - domain=domain, num_nodes=num_nodes, duration=duration, random_seed=random_seed, min_version=min_version + domain=domain, + num_nodes=num_nodes, + duration=duration, + random_seed=random_seed, + min_version=min_version, ) - # Initiate the ritual transactor = Transactor(account=account) transactor.transact( From 89c27292e63032d6bbbf0d66418bea4422d0b737 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Wed, 4 Sep 2024 08:26:10 -0400 Subject: [PATCH 2/2] Add num missing text to ritual_state_check for missing transcripts/aggregations. --- scripts/ritual_state_check.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/ritual_state_check.py b/scripts/ritual_state_check.py index c6810623..8e489874 100644 --- a/scripts/ritual_state_check.py +++ b/scripts/ritual_state_check.py @@ -50,16 +50,23 @@ def print_ritual_state(ritual_id, coordinator) -> RitualState: ritual = coordinator.rituals(ritual_id) participants = coordinator.getParticipants(ritual_id) + num_missing = 0 if ritual.totalTranscripts < len(participants): print("\t(!) Missing transcripts") for participant in participants: if not participant.transcript: print(f"\t\t{participant.provider}") + num_missing += 1 + elif ritual.totalAggregations < len(participants): print("\t(!) Missing aggregated transcripts") for participant in participants: if not participant.aggregated: print(f"\t\t{participant.provider}") + num_missing += 1 + + if num_missing > 0: + print(f"\t\t> Num Missing: {num_missing}") return ritual_state