def METHOD_NAME(self):
    # Pos contract enabled, stake and register in the first hard-fork phase.
    client = RpcClient(self.nodes[self.num_nodes - 1])
    client.generate_empty_blocks(300)
    sync_blocks(self.nodes)
    node_pos_identifier_list = []
    for i in range(self.num_nodes - 1):
        client = RpcClient(self.nodes[i])
        pos_identifier, _ = client.wait_for_pos_register()
        node_pos_identifier_list.append(pos_identifier)
        sync_blocks(self.nodes)
    client = RpcClient(self.nodes[self.num_nodes - 1])
    # generate blocks until we are after pos initialization and before pos start.
    best_epoch = client.epoch_number()
    client.generate_empty_blocks(600 - best_epoch)
    sync_blocks(self.nodes)
    voting_power_map = {}
    pub_keys_map = {}
    logs = client.get_logs(filter=Filter(from_epoch="earliest", to_epoch="latest_state",
                                         address=["0x0888000000000000000000000000000000000005"]))
    for log in logs:
        pos_identifier = log["topics"][1]
        if log["topics"][0] == REGISTER_TOPIC:
            bls_pub_key, vrf_pub_key = eth_abi.decode_abi(["bytes", "bytes"], decode_hex(log["data"]))
            pub_keys_map[pos_identifier] = (encode_hex_0x(bls_pub_key), encode_hex_0x(vrf_pub_key))
        elif log["topics"][0] == INCREASE_STAKE_TOPIC:
            assert pos_identifier in pub_keys_map
            voting_power_map[pos_identifier] = parse_as_int(log["data"])
    with open(os.path.join(self.options.tmpdir, "public_keys"), "w") as f:
        for pos_identifier in pub_keys_map.keys():
            f.write(",".join([pub_keys_map[pos_identifier][0][2:], pub_keys_map[pos_identifier][1][2:],
                              str(voting_power_map[pos_identifier])]) + "\n")
    initialize_tg_config(self.options.tmpdir, len(self.nodes), len(self.nodes), DEFAULT_PY_TEST_CHAIN_ID,
                         pkfile="public_keys")
    # generate blocks until pos start
    self.nodes[0].generate_empty_blocks(500)
    sync_blocks(self.nodes)
    pos_identifier, _ = client.wait_for_pos_register()
    client.generate_empty_blocks(400)
    sync_blocks(self.nodes)
    time.sleep(2)
    parent_hash = client.best_block_hash()
    for _ in range(100):
        parent_hash = client.node.test_generatecustomblock(parent_hash, [], eth_utils.encode_hex(rlp.encode([])), False, ["0x01", "0x8804"])
    sync_blocks(self.nodes)
    # Check if stopped node will be retired
    STOP_INDEX = 0
    final_serving_round = self.nodes[0].pos_stop_election()
    stopped = False
    print("final_serving_round", final_serving_round)
    latest_pos_ref = self.latest_pos_ref()
    for i in range(55):
        if not stopped and int(client.pos_status()["latestCommitted"], 0) >= final_serving_round:
            print("stop node 0")
            self.stop_node(STOP_INDEX)
            stopped = True
        print(node_pos_identifier_list[STOP_INDEX])
        assert_ne(client.pos_get_account(node_pos_identifier_list[STOP_INDEX])["status"]["availableVotes"], 0)
        assert_equal(client.pos_get_account(node_pos_identifier_list[STOP_INDEX])["status"]["forceRetired"], None)
        print(i)
        if i == 10:
            self.stop_node(5, clean=True)
            self.start_node(5, phase_to_wait=None)
            self.nodes[5].wait_for_recovery(["NormalSyncPhase"], 30)
        if i == 12:
            self.maybe_restart_node(5, 1, 0)
        if i == 15:
            assert_equal(int(client.pos_get_account(pos_identifier)["status"]["availableVotes"], 0), 2000)
            client.pos_retire_self(2000)
        if i == 30:
            self.maybe_restart_node(5, 1, 1)
        # Retire node 3 after 5 min.
        # Generate enough PoW block for PoS to progress
        client.generate_empty_blocks(60)
        # Leave some time for PoS to reach consensus
        time.sleep(3)
        client.generate_empty_blocks(1)
        new_pos_ref = self.latest_pos_ref()
        if i >= 10:
            assert_ne(latest_pos_ref, new_pos_ref)
    client.wait_for_unstake(client.node.pow_sk)
    assert_greater_than(client.get_balance(eth_utils.encode_hex(priv_to_addr(client.node.pow_sk))),
                        10000 * 10 ** 18)
    assert_equal(int(client.pos_get_account(pos_identifier)["status"]["availableVotes"], 0), 0)