id: eoa-transactions-test
name: "Transaction Test"
timeout: 30m
config:
  walletPrivkey: ""
  validatorPairNames: []
  clientPairNames: []
tasks:
- name: check_clients_are_healthy
  title: "Check if at least one client is ready"
  timeout: 5m
  config:
    minClientCount: 1

# check if all client pairs propose blocks with legacy EOA transactions
- name: run_task_background
  title: "Check if all clients propose blocks with legacy EOA transactions"
  config:
    onBackgroundComplete: fail
    backgroundTask:
      name: generate_eoa_transactions
      title: "Generate 10 EOA transaction per block"
      config:
        childWallets: 100
        limitPending: 100
        limitPerBlock: 10
        randomTarget: true
        amount: 1000000
        randomAmount: true
        legacyTxType: true
      configVars:
        privateKey: "walletPrivkey"

    foregroundTask:
      name: run_task_matrix
      title: "Check transaction inclusion with all client pairs"
      timeout: 30m
      configVars:
        matrixValues: "validatorPairNames"
      config:
        runConcurrent: true
        matrixVar: "validatorPairName"
        task:
          name: check_consensus_block_proposals
          title: "Wait for block proposal with >= 5 transactions from ${validatorPairName}"
          configVars:
            validatorNamePattern: "validatorPairName"
          config:
            minTransactionCount: 5
- name: "sleep"
  title: "Wait 30sec to clear up pending transactions"
  config:
    duration: 30s

# check if legacy EOA transactions can be sent via each client pair
- name: run_task_matrix
  title: "Check if legacy EOA transactions can be sent via each client pair"
  configVars:
    matrixValues: "clientPairNames"
  config:
    runConcurrent: false
    matrixVar: "clientPairName"
    task:
      name: run_tasks
      title: "Check if legacy EOA transactions can be sent via ${clientPairName}"
      config:
        tasks:
        - name: run_task_background
          title: "Check if legacy EOA transactions can be sent via ${clientPairName}"
          config:
            onBackgroundComplete: fail
            backgroundTask:
              name: generate_eoa_transactions
              title: "Generate 10 EOA transaction per block and send via ${clientPairName}"
              config:
                childWallets: 100
                limitPending: 100
                limitPerBlock: 10
                randomTarget: true
                amount: 1000000
                randomAmount: true
                legacyTxType: true
              configVars:
                privateKey: "walletPrivkey"
                clientPattern: "clientPairName"

            foregroundTask:
              name: check_consensus_block_proposals
              title: "Wait for block proposal with >= 5 transactions"
              config:
                minTransactionCount: 5
        - name: "sleep"
          title: "Wait 30sec to clear up pending transactions"
          config:
            duration: 30s

# check if all client pairs propose blocks with dynfee EOA transactions
- name: run_task_background
  title: "Check if all clients propose blocks with dynfee EOA transactions"
  config:
    onBackgroundComplete: fail
    backgroundTask:
      name: generate_eoa_transactions
      title: "Generate 10 EOA transaction per block"
      config:
        childWallets: 100
        limitPending: 100
        limitPerBlock: 10
        randomTarget: true
        amount: 1000000
        randomAmount: true
      configVars:
        privateKey: "walletPrivkey"

    foregroundTask:
      name: run_task_matrix
      title: "Check transaction inclusion with all client pairs"
      timeout: 30m
      configVars:
        matrixValues: "validatorPairNames"
      config:
        runConcurrent: true
        matrixVar: "validatorPairName"
        task:
          name: check_consensus_block_proposals
          title: "Wait for block proposal with >= 5 transactions from ${validatorPairName}"
          configVars:
            validatorNamePattern: "validatorPairName"
          config:
            minTransactionCount: 5
- name: "sleep"
  title: "Wait 30sec to clear up pending transactions"
  config:
    duration: 30s

# check if dynfee EOA transactions can be sent via each client pair
- name: run_task_matrix
  title: "Check if dynfee EOA transactions can be sent via each client pair"
  configVars:
    matrixValues: "clientPairNames"
  config:
    runConcurrent: false
    matrixVar: "clientPairName"
    task:
      name: run_tasks
      title: "Check if dynfee EOA transactions can be sent via ${clientPairName}"
      config:
        tasks:
        - name: run_task_background
          title: "Check if dynfee EOA transactions can be sent via ${clientPairName}"
          config:
            onBackgroundComplete: fail
            backgroundTask:
              name: generate_eoa_transactions
              title: "Generate 10 EOA transaction per block and send via ${clientPairName}"
              config:
                childWallets: 100
                limitPending: 100
                limitPerBlock: 10
                randomTarget: true
                amount: 1000000
                randomAmount: true
              configVars:
                privateKey: "walletPrivkey"
                clientPattern: "clientPairName"
            foregroundTask:
              name: check_consensus_block_proposals
              title: "Wait for block proposal with >= 5 transactions"
              config:
                minTransactionCount: 5
        - name: "sleep"
          title: "Wait 30sec to clear up pending transactions"
          config:
            duration: 30s