diff --git a/.github/actions/perf-common-steps/action.yml b/.github/actions/perf-common-steps/action.yml index 1c9c3b6e14..ddb6367dba 100644 --- a/.github/actions/perf-common-steps/action.yml +++ b/.github/actions/perf-common-steps/action.yml @@ -3,19 +3,16 @@ description: Common steps for running Silkworm performance tests inputs: activation_mode: - description: 'Activation mode for performance tests (full,light)' - default: 'light' + description: 'Activation mode for performance tests (full/light)' + required: true + measure_erigon: + description: 'Flag indicating if Erigon RPCDaemon must be measured or not (true/false)' + required: true runs: using: "composite" steps: - - name: Checkout Silkworm repository - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: "0" - - name: Checkout RPC Tests Repository & Install Requirements shell: bash run: | @@ -57,6 +54,7 @@ runs: echo "SILKWORM_RPC_DAEMON_PID=$SILKWORM_RPC_DAEMON_PID" >> $GITHUB_ENV - name: Run Erigon RpcDaemon + if: ${{ inputs.measure_erigon == 'true' }} shell: bash run: | $ERIGON_DIR/rpcdaemon --datadir $ERIGON_DATA_DIR --http.api admin,debug,eth,parity,erigon,trace,web3,txpool,ots,net --verbosity 1 & @@ -79,13 +77,18 @@ runs: mkdir -p $RPC_PAST_TEST_DIR/mainnet_bin run_perf () { - servers=("silkworm" "erigon") - for i in 1 2 + servers=("silkworm") + if [[ "${{ inputs.measure_erigon }}" == "true" ]]; then + servers+=("erigon") + fi + num_servers=${#servers[@]} + for (( i=1; i<=num_servers; i++ )) do network=$1 method=$2 - pattern=$3 - sequence=$4 + repetitions=$3 + pattern=$4 + sequence=$5 # clean temporary area cd ${{runner.workspace}}/rpc-tests/perf @@ -95,7 +98,7 @@ runs: --test-type "$method" \ --pattern-file pattern/"$network"/"$pattern".tar \ --test-sequence "$sequence" \ - --repetitions 5 \ + --repetitions $repetitions \ --silk-dir ${{runner.workspace}}/silkworm \ --erigon-dir $ERIGON_DATA_DIR \ --test-mode $i \ @@ -163,25 +166,22 @@ runs: } # Launch the RPC performance test runner - failed_test= 0 - if [[ ${{ inputs.activation_mode }}" == "light" ]]; then - # Lightweight mode: narrower API coverage, shorter sequences - run_perf mainnet eth_call stress_test_eth_call_20M 100:30,1000:20,10000:20,20000:20 - run_perf mainnet eth_getLogs stress_test_eth_getLogs_15M 100:30,1000:20,10000:20 - run_perf mainnet eth_getBalance stress_test_eth_getBalance_15M 100:30,1000:20,10000:20 - run_perf mainnet eth_getBlockByHash stress_test_eth_getBlockByHash_14M 100:30,1000:20 - run_perf mainnet eth_getTransactionByHash stress_test_eth_getTransactionByHash_13M 100:30,1000:20,10000:20 - run_perf mainnet eth_getTransactionReceipt stress_test_eth_getTransactionReceipt_14M 100:30 + failed_test=0 + if [[ "${{ inputs.activation_mode }}" == "light" ]]; then + # Lightweight mode: narrower API coverage, less repetitions, shorter sequences + run_perf mainnet eth_call 3 stress_test_eth_call_20M 100:30,1000:20 + run_perf mainnet eth_getLogs 3 stress_test_eth_getLogs_15M 100:30,1000:20 + run_perf mainnet eth_getBlockByHash 3 stress_test_eth_getBlockByHash_14M 100:30,1000:20 else - # Full mode: wider API coverage, longer sequences - run_perf mainnet eth_call stress_test_eth_call_20M 1:1,100:30,1000:20,10000:20,20000:20 - run_perf mainnet eth_getLogs stress_test_eth_getLogs_15M 1:1,100:30,1000:20,10000:20,20000:20 - run_perf mainnet eth_getBalance stress_test_eth_getBalance_15M 1:1,100:30,1000:20,10000:20,20000:20 - run_perf mainnet eth_getBlockByHash stress_test_eth_getBlockByHash_14M 1:1,100:30,1000:20,10000:20 - run_perf mainnet eth_getBlockByNumber stress_test_eth_getBlockByNumber_13M 1:1,100:30,1000:20,5000:20 - run_perf mainnet eth_getTransactionByHash stress_test_eth_getTransactionByHash_13M 1:1,100:30,1000:20,10000:20 - run_perf mainnet eth_getTransactionReceipt stress_test_eth_getTransactionReceipt_14M 1:1,100:30,1000:20,5000:20,10000:20,20000:20 - run_perf mainnet eth_createAccessList stress_test_eth_createAccessList_16M 1:1,100:30,1000:20,10000:20,20000:20 + # Full mode: wider API coverage, more repetitions, longer sequences + run_perf mainnet eth_call 5 stress_test_eth_call_20M 1:1,100:30,1000:20,10000:20,20000:20 + run_perf mainnet eth_getLogs 5 stress_test_eth_getLogs_15M 1:1,100:30,1000:20,10000:20,20000:20 + run_perf mainnet eth_getBalance 5 stress_test_eth_getBalance_15M 1:1,100:30,1000:20,10000:20,20000:20 + run_perf mainnet eth_getBlockByHash 5 stress_test_eth_getBlockByHash_14M 1:1,100:30,1000:20,10000:20 + run_perf mainnet eth_getBlockByNumber 5 stress_test_eth_getBlockByNumber_13M 1:1,100:30,1000:20,5000:20 + run_perf mainnet eth_getTransactionByHash 5 stress_test_eth_getTransactionByHash_13M 1:1,100:30,1000:20,10000:20 + # run_perf mainnet eth_getTransactionReceipt 5 stress_test_eth_getTransactionReceipt_14M 1:1,100:30,1000:20,5000:20,10000:20,20000:20 + run_perf mainnet eth_createAccessList 5 stress_test_eth_createAccessList_16M 1:1,100:30,1000:20,10000:20,20000:20 fi if [ $failed_test -eq 0 ]; then diff --git a/.github/workflows/rpc-performance-tests-light.yml b/.github/workflows/rpc-performance-tests-light.yml index 357b1d7081..c76107d726 100644 --- a/.github/workflows/rpc-performance-tests-light.yml +++ b/.github/workflows/rpc-performance-tests-light.yml @@ -2,6 +2,11 @@ name: QA - RPC Performance Tests Light on: workflow_dispatch: + inputs: + measure_erigon: + description: 'Measure Erigon RPCDaemon' + type: boolean + default: false pull_request: branches: - master @@ -21,6 +26,12 @@ jobs: ERIGON_QA_PATH: /opt/erigon-qa steps: + - name: Checkout Silkworm repository + uses: actions/checkout@v3 + with: + submodules: recursive + fetch-depth: "0" - uses: ./.github/actions/perf-common-steps with: activation_mode: light + measure_erigon: ${{github.event.inputs.measure_erigon}} diff --git a/.github/workflows/rpc-performance-tests.yml b/.github/workflows/rpc-performance-tests.yml index 229653d9d4..cdbec2be83 100644 --- a/.github/workflows/rpc-performance-tests.yml +++ b/.github/workflows/rpc-performance-tests.yml @@ -18,6 +18,12 @@ jobs: ERIGON_QA_PATH: /opt/erigon-qa steps: + - name: Checkout Silkworm repository + uses: actions/checkout@v3 + with: + submodules: recursive + fetch-depth: "0" - uses: ./.github/actions/perf-common-steps with: activation_mode: full + measure_erigon: true