diff --git a/tools/stress_delegator_multi_collators_evm.py b/tools/stress_delegator_multi_collators_evm.py index ae92749..3660d80 100644 --- a/tools/stress_delegator_multi_collators_evm.py +++ b/tools/stress_delegator_multi_collators_evm.py @@ -188,15 +188,17 @@ def main(): # noqa: C901 # Leave the delegators try: evm_receipt = delegator_leave_delegators(w3, eth_chain_id, kps[0]['kp']) + print('Leave delegators successfully') if evm_receipt['status'] != 1: print('Leave delegators failed') raise IOError('Leave delegators failed') - except ValueError: + except ValueError as e: + print(f'Leave delegators failed {e}') pass for i in range(10000): print('Setup delegators start {}'.format(i)) - setup_delegators(substrate, w3, contract, eth_chain_id, kps, validators, collator_nums, args.number) + setup_delegators(substrate, w3, eth_chain_id, kps, validators, collator_nums, args.number) if not check_delegator_number(substrate, kps[0]['substrate'], args.number): print('Delegator number not found') diff --git a/tools/stress_delegator_multi_collators_substrate.py b/tools/stress_delegator_multi_collators_substrate.py index fd92fb9..739fe3e 100644 --- a/tools/stress_delegator_multi_collators_substrate.py +++ b/tools/stress_delegator_multi_collators_substrate.py @@ -105,6 +105,18 @@ def setup_delegators(substrate, kps, validators, number): if number == 1: return print('Wait for one session') + # [TODO] Let us skip this, only need to enable in Krest/Peaq docker env + # batch = ExtrinsicBatch(substrate, KP_GLOBAL_SUDO) + # batch.compose_sudo_call( + # 'ParachainStaking', + # 'force_new_round', + # {} + # ) + # receipt = batch.execute() + # if not receipt.is_success: + # print('Force new round failed') + # raise IOError('Force new round failed') + wait_next_session(substrate, receipt.block_hash) # Delegate @@ -117,6 +129,11 @@ def setup_delegators(substrate, kps, validators, number): validator, get_collator_stake(substrate, validator)) print(f'Setup delegators for {validator} successfully, {idx} / {len(validators)}') + # [TODO] Let us skip this, only need to enable in Krest/Peaq docker env + # receipt = batch.execute() + # if not receipt.is_success: + # print('Force new round failed') + # raise IOError('Force new round failed') wait_next_session(substrate, receipt.block_hash) @@ -158,6 +175,17 @@ def main(): return print(f'Number of validators are {len(validators)}') + # [TODO] Let us skip this, only need to enable in Krest/Peaq docker env + # batch = ExtrinsicBatch(substrate, KP_GLOBAL_SUDO) + # batch.compose_sudo_call( + # 'ParachainStaking', + # 'force_new_round', + # {} + # ) + # receipt = batch.execute() + # if not receipt.is_success: + # print('Force new round failed') + # raise IOError('Force new round failed') kps = [Keypair.create_from_mnemonic('trumpet depth hidden success nominee twenty erode mixture pond bread easily cycle')] for i in range(10000):