From 363e65385a8dce0c56c23698294c9b92c02f28ff Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Wed, 21 Jun 2023 13:58:32 +0100 Subject: [PATCH 001/202] Use better processing timer for logging (#5843) * Use different processing timer * Use single queue * Revert to simpler --- .../Nethermind.Consensus/Processing/ProcessingStats.cs | 2 +- src/Nethermind/Nethermind.Runner/NLog.config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs b/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs index 5d36900eb83..8885971466c 100644 --- a/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs +++ b/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs @@ -181,7 +181,7 @@ public void UpdateStats(Block? block, IBlockTree blockTreeCtx, int recoveryQueue // Only output the total throughput in debug mode if (_logger.IsDebug) { - _logger.Debug($"- Total throughput {totalMgasPerSecond,7:F2} MGas/s | {totalTxPerSecond,9:F2} t/s | {totalBlocksPerSecond,7:F2} Blk/s | Gas gwei: {Evm.Metrics.MinGasPrice:N2} .. {Math.Max(Evm.Metrics.MinGasPrice, Evm.Metrics.EstMedianGasPrice):N2} ({Evm.Metrics.AveGasPrice:N2}) .. {Evm.Metrics.MaxGasPrice:N2}"); + _logger.Debug($"- Total throughput {totalMgasPerSecond,7:F2} MGas/s | {totalTxPerSecond,9:F2} t/s | {totalBlocksPerSecond,7:F2} b/s | Gas gwei: {Evm.Metrics.MinGasPrice:N2} .. {Math.Max(Evm.Metrics.MinGasPrice, Evm.Metrics.EstMedianGasPrice):N2} ({Evm.Metrics.AveGasPrice:N2}) .. {Evm.Metrics.MaxGasPrice:N2}"); } if (_logger.IsTrace) diff --git a/src/Nethermind/Nethermind.Runner/NLog.config b/src/Nethermind/Nethermind.Runner/NLog.config index 5a51f937e3d..48c58e3230d 100644 --- a/src/Nethermind/Nethermind.Runner/NLog.config +++ b/src/Nethermind/Nethermind.Runner/NLog.config @@ -35,7 +35,7 @@ + foregroundColor="DarkGray" wholeWords="true" /> From 10be6f6091f415a07c5b126fc80457b24e28c6a4 Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Wed, 21 Jun 2023 20:19:41 +0100 Subject: [PATCH 002/202] Don't use DarkGray (#5849) --- .../Nethermind.Consensus/Processing/ProcessingStats.cs | 4 ++-- src/Nethermind/Nethermind.Runner/NLog.config | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs b/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs index 8885971466c..b9fda9e1435 100644 --- a/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs +++ b/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs @@ -176,8 +176,8 @@ public void UpdateStats(Block? block, IBlockTree blockTreeCtx, int recoveryQueue > 75 => whiteText, _ => "" }; - _logger.Info($"- Block{(chunkBlocks > 1 ? $"s {chunkBlocks,-9:N0}" : " ")}{(chunkBlocks == 1 ? mgasColor : "")} {chunkMGas,7:F2}{resetColor} MGas | {chunkTx,6:N0} txs | calls {callsColor}{chunkCalls,6:N0}{resetColor} {darkGreyText}({chunkEmptyCalls,3:N0}){resetColor} | sload {chunkSload,7:N0} | sstore {sstoreColor}{chunkSstore,6:N0}{resetColor} | create {createsColor}{chunkCreates,3:N0}{resetColor}{(currentSelfDestructs - _lastSelfDestructs > 0 ? $"{darkGreyText}({-(currentSelfDestructs - _lastSelfDestructs),3:N0}){resetColor}" : "")}"); - _logger.Info($"- Block throughput {mgasPerSecond,7:F2} MGas/s | {txps,9:F2} t/s | {bps,7:F2} Blk/s | recv {recoveryQueueSize,7:N0} | proc {blockQueueSize,6:N0}"); + _logger.Info($"- Block{(chunkBlocks > 1 ? "s" : " ")}{(chunkBlocks == 1 ? mgasColor : "")} {chunkMGas,7:F2}{resetColor} MGas | {chunkTx,6:N0} txs | calls {callsColor}{chunkCalls,6:N0}{resetColor} {darkGreyText}({chunkEmptyCalls,3:N0}){resetColor} | sload {chunkSload,7:N0} | sstore {sstoreColor}{chunkSstore,6:N0}{resetColor} | create {createsColor}{chunkCreates,3:N0}{resetColor}{(currentSelfDestructs - _lastSelfDestructs > 0 ? $"{darkGreyText}({-(currentSelfDestructs - _lastSelfDestructs),3:N0}){resetColor}" : "")}"); + _logger.Info($"- Block throughput {mgasPerSecond,7:F2} MGas/s | {txps,9:F2} t/s | {bps,7:F2} b/s | recv {recoveryQueueSize,7:N0} | proc {blockQueueSize,6:N0}"); // Only output the total throughput in debug mode if (_logger.IsDebug) { diff --git a/src/Nethermind/Nethermind.Runner/NLog.config b/src/Nethermind/Nethermind.Runner/NLog.config index 48c58e3230d..5a51f937e3d 100644 --- a/src/Nethermind/Nethermind.Runner/NLog.config +++ b/src/Nethermind/Nethermind.Runner/NLog.config @@ -35,7 +35,7 @@ + foregroundColor="Gray" wholeWords="true" /> From 0e4300a1f232dd4412ec82d755c7bd66b7cb8f4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Thu, 22 Jun 2023 19:48:41 +0200 Subject: [PATCH 003/202] Bump to 1.20.0-rc --- src/Nethermind/Directory.Build.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Nethermind/Directory.Build.props b/src/Nethermind/Directory.Build.props index e9129de653f..b09a50eba00 100644 --- a/src/Nethermind/Directory.Build.props +++ b/src/Nethermind/Directory.Build.props @@ -9,8 +9,8 @@ Demerzel Solutions Limited Nethermind $(Commit.Substring(0, 8)) - 1.23.0 - unstable + 1.20.0-rc + From d16ab35fc340c35dec7dd5dd3a0d9ac63b1d28cf Mon Sep 17 00:00:00 2001 From: Ruben Buniatyan Date: Thu, 29 Jun 2023 14:31:38 +0200 Subject: [PATCH 004/202] Update DotNetty feed (cherry picked from commit 3e330adcae80c3e5f4a907791cd0a0741355e455) --- src/Nethermind/Directory.Packages.props | 6 +++--- src/Nethermind/nuget.config | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Nethermind/Directory.Packages.props b/src/Nethermind/Directory.Packages.props index 32559d8eb16..44ad5a19a6c 100644 --- a/src/Nethermind/Directory.Packages.props +++ b/src/Nethermind/Directory.Packages.props @@ -42,9 +42,9 @@ - - - + + + diff --git a/src/Nethermind/nuget.config b/src/Nethermind/nuget.config index 84c8ccf735e..a4c5094636a 100644 --- a/src/Nethermind/nuget.config +++ b/src/Nethermind/nuget.config @@ -3,14 +3,14 @@ - + - + From a9e742c62574fe9dd94090ae38f2de484193fd85 Mon Sep 17 00:00:00 2001 From: Ruben Buniatyan Date: Tue, 4 Jul 2023 14:05:17 +0200 Subject: [PATCH 005/202] Update DotNetty package (cherry picked from commit 47a92ee5df310d55dbafa1fa97528ca6f59c9371) --- src/Nethermind/Directory.Packages.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Nethermind/Directory.Packages.props b/src/Nethermind/Directory.Packages.props index 44ad5a19a6c..9a2378d4c79 100644 --- a/src/Nethermind/Directory.Packages.props +++ b/src/Nethermind/Directory.Packages.props @@ -42,9 +42,9 @@ - - - + + + From 78e5ec6f7831a61e8b51d74e8be19e271287de9d Mon Sep 17 00:00:00 2001 From: Marcin Sobczak Date: Tue, 20 Jun 2023 11:51:47 +0200 Subject: [PATCH 006/202] minor fixes --- src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs | 4 ++-- .../Nethermind.TxPool/TransactionExtensions.cs | 11 ----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index 6ad0f609cc9..c59b04aaa38 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -598,13 +598,13 @@ public void should_add_tx_if_cost_of_executing_all_txs_in_bucket_exceeds_balance } } - _txPool.GetPendingTransactionsCount().Should().Be(8); // nonces 0-6 and 8 + _txPool.GetPendingTransactions().Length.Should().Be(8); // nonces 0-6 and 8 _txPool.GetPendingTransactions().Last().Nonce.Should().Be(8); _txPool.SubmitTx(transactions[8], TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.AlreadyKnown); _txPool.SubmitTx(transactions[7], TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); - _txPool.GetPendingTransactionsCount().Should().Be(8); // nonces 0-7 - 8 was removed because of not enough balance + _txPool.GetPendingTransactions().Length.Should().Be(8); // nonces 0-7 - 8 was removed because of not enough balance _txPool.GetPendingTransactions().Last().Nonce.Should().Be(7); _txPool.GetPendingTransactions().Should().BeEquivalentTo(transactions.SkipLast(2)); } diff --git a/src/Nethermind/Nethermind.TxPool/TransactionExtensions.cs b/src/Nethermind/Nethermind.TxPool/TransactionExtensions.cs index 65102975786..6d734de72a9 100644 --- a/src/Nethermind/Nethermind.TxPool/TransactionExtensions.cs +++ b/src/Nethermind/Nethermind.TxPool/TransactionExtensions.cs @@ -78,18 +78,7 @@ internal static bool IsOverflowWhenAddingTxCostToCumulative(this Transaction tx, overflow |= UInt256.AddOverflow(currentCost, maxTxCost, out cumulativeCost); overflow |= UInt256.AddOverflow(cumulativeCost, tx.Value, out cumulativeCost); - if (tx.SupportsBlobs) - { - // if tx.SupportsBlobs and has BlobVersionedHashes = null, it will throw on earlier step of validation, in TxValidator - overflow |= UInt256.MultiplyOverflow(Eip4844Constants.GasPerBlob, (UInt256)tx.BlobVersionedHashes!.Length, out UInt256 blobGas); - overflow |= UInt256.MultiplyOverflow(blobGas, tx.MaxFeePerBlobGas ?? UInt256.MaxValue, out UInt256 blobGasCost); - overflow |= UInt256.AddOverflow(cumulativeCost, blobGasCost, out cumulativeCost); - } - return overflow; } - - internal static bool IsOverflowInTxCostAndValue(this Transaction tx, out UInt256 txCost) - => IsOverflowWhenAddingTxCostToCumulative(tx, UInt256.Zero, out txCost); } } From a293ae9ff2826fa5bac9a9aaafc2e99b02c1444c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Fri, 14 Jul 2023 12:28:12 +0200 Subject: [PATCH 007/202] Update version to 1.20.0 --- src/Nethermind/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nethermind/Directory.Build.props b/src/Nethermind/Directory.Build.props index b09a50eba00..66f05f5aceb 100644 --- a/src/Nethermind/Directory.Build.props +++ b/src/Nethermind/Directory.Build.props @@ -9,7 +9,7 @@ Demerzel Solutions Limited Nethermind $(Commit.Substring(0, 8)) - 1.20.0-rc + 1.20.0 From 0e3b7cba60e12edf78282dc308c1a3a6f8fa7e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 17 Jul 2023 17:54:48 +0200 Subject: [PATCH 008/202] Bump to 1.20.1 --- src/Nethermind/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nethermind/Directory.Build.props b/src/Nethermind/Directory.Build.props index 66f05f5aceb..f7dd5f65268 100644 --- a/src/Nethermind/Directory.Build.props +++ b/src/Nethermind/Directory.Build.props @@ -9,7 +9,7 @@ Demerzel Solutions Limited Nethermind $(Commit.Substring(0, 8)) - 1.20.0 + 1.20.1 From 4ea37b2b3ea0659949fad1ae8248b6fcfa78eb28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Thu, 20 Jul 2023 10:44:27 +0200 Subject: [PATCH 009/202] Add workflow to compare rpcs Fix path Run on push temporarily Fix file path Fix inputs and missing vars All fields not required Inherit secrets when calling run-a-single-node-from-branch Add default for cl_client Use base_tag generated by run-a-single-node Download artifacts from other post-merge-smoke-tests Remove the old download-artifact Change the name of token secret Remove usage of external action Allow to specify smoke tests branch to use Remove additional option to fit dispatch limit fix: wrong inputs string format Export run id Fix rpc url Fix debug Add runner's ip to `allowed_ips` Maximum 10 inputs is allowed in workflow_dispatch Add allowed_ips to workflow_dispatch inputs Try to join two ips Print `,` conditionally Update public-ip Debug Use VPN Add wireguard.conf Fix location Checkout the repository before installing wireguard Update wireguard.conf to match nethermind repo secrets Update environment variables to match secrets Install flood before wireguard Use include in matrix to specify both name and address Revert "Use include in matrix to specify both name and address" This reverts commit 71caa0cadb041f12c5e191bc82afe699ab70a303. --- .github/workflows/rpc-comparison.yaml | 78 ++++++++ .../run-a-single-node-from-branch.yml | 178 +++++++++++++----- .gitignore | 1 + scripts/wait-for-workflow-completed.sh | 2 + scripts/wireguard.conf.template | 10 + 5 files changed, 218 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/rpc-comparison.yaml create mode 100644 scripts/wireguard.conf.template diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml new file mode 100644 index 00000000000..234c0c4fe21 --- /dev/null +++ b/.github/workflows/rpc-comparison.yaml @@ -0,0 +1,78 @@ +name: '[JSON-RPC] Compare Nethermind between clients and versions' + +on: + push: + branches: + - 'rpc-comparison-testing' + workflow_dispatch: + inputs: + allowed_ips: + type: string + description: "A comma-separated list of ips allowed to connect to the node" + default: '' + required: false + +jobs: + + create_node: + name: Create node from current branch + uses: ./.github/workflows/run-a-single-node-from-branch.yml + secrets: inherit + with: + allowed_ips: ${{ inputs.allowed_ips }} + + extract_rpc_url: + name: Extract RPC url from artifacts generated by create_node + runs-on: ubuntu-latest + needs: create_node + outputs: + rpc_url: ${{ steps.extract_rpc_url.outputs.rpc_url }} + steps: + - name: Download artifact + id: download-artifact + uses: dawidd6/action-download-artifact@v2 + with: + github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} + run_id: ${{ needs.create_node.outputs.run_id }} + name: "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" + repo: NethermindEth/post-merge-smoke-tests + + - run: echo "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" + - run: echo "${{ github.actor }}-${{ needs.create_node.outputs.rpc_url }}-smoketests" + + - name: Get RPC url to the newly created node + id: extract_rpc_url + run: echo "rpc_url=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT + + compare: + name: Compare JSON-RPC responses between clients and versions + runs-on: ubuntu-latest + needs: extract_rpc_url + strategy: + matrix: + rpc_to_compare: [INFURA_ENDPOINT, NETHERMIND_ARCHIVE_ENDPOINT] + steps: + - uses: actions/checkout@v3 + - name: Install flood + run: pip install git+https://github.com/piwonskp/flood.git + + - name: Install WireGuard + run: | + sudo apt update + sudo apt install -y wireguard resolvconf + sudo mkdir -p /etc/wireguard + envsubst < scripts/wireguard.conf.template > wg0.conf + sudo wg-quick up ./wg0.conf + env: + WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Test equality of responses + run: flood all nethermind_current=${{ needs.extract_rpc_url.outputs.rpc_url }} ${{ matrix.rpc_to_compare }}=${{ secrets[matrix.rpc_to_compare] }} --equality + diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 79d37bd69c5..97d2f60d817 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -53,9 +53,82 @@ on: description: "Provide any additional flags to the CL client in space-separated format. Example: \"clflag1=1 clflag2=2\"." default: "" required: false - additional_options: - description: "A Json property which allows to customize node even more" - default: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":""}' + ssh_keys: + description: "SSH Keys to be installed in the smoke test nodes (separated by commas without space in-between commas) for example: key1,key2,key3" + default: "" + required: false + smoke_tests_ref: + description: "Ref of the smoke tests repository to be used for smoke tests" + default: "main" + workflow_call: + inputs: + smoke_tests_ref: + description: "Ref of the smoke tests repository to be used for smoke tests" + default: "main" + required: false + type: string + network: + description: "Select a network on which You want to run a node" + default: "mainnet" + required: false + type: string + cl_client: + description: "Select Consensus Layer Client to run node against" + default: "lighthouse" + required: false + type: string + cl_custom_image: + description: "In case of need to run non-default cl image (different than actually supported by Sedge) put it in there" + default: "" + required: false + type: string + config: + description: "Select a config file which will be selected for tests." + default: "default.json" + required: false + type: string + non_validator_mode: + description: "If checked, node will be started in NonValidator mode (OldBodies and oldReceipts will not be synced)" + default: true + type: boolean + timeout: + description: "Timeout in hours before triggering the deletion of smoke test instances. Maximum time of node lifetime can be 72 hours." + default: "24" + required: false + type: string + volume: + description: "In case custom volume size needs to be applied, put value in GB here)" + required: false + default: "" + type: string + additional_nethermind_flags: + type: string + description: "Provide any additional flags to the Nethermind in space-separated format. Example: \"JsonRpc.Enabled=false Sync.SnapSync=false\"." + default: "" + required: false + additional_cl_flags: + type: string + description: "Provide any additional flags to the CL client in space-separated format. Example: \"clflag1=1 clflag2=2\"." + default: "" + required: false + ssh_keys: + type: string + description: "SSH Keys to be installed in the smoke test nodes (separated by commas without space in-between commas) for example: key1,key2,key3" + default: "" + required: false + allowed_ips: + type: string + description: "A comma-separated list of ips allowed to connect to the node" + default: "" + required: false + outputs: + base_tag: + description: "" + value: ${{ jobs.create_docker_image.outputs.base_tag }} + run_id: + description: "" + value: ${{ jobs.trigger_node_and_vm_creation.outputs.run_id }} + jobs: create_docker_image: @@ -64,7 +137,7 @@ jobs: base_tag: ${{ steps.set-base-tag.outputs.base_tag }} steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Prepare docker tag id: prepare_ref @@ -88,41 +161,28 @@ jobs: - name: Extract dockerfile from additional_options id: extract_dockerfile run: | - echo "dockerfile=$(echo '${{ inputs.additional_options }}' | jq -r .default_dockerfile)" >> $GITHUB_OUTPUT - echo "build-config=$(echo '${{ inputs.additional_options }}' | jq -r .default_dockerfile_build_type | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + echo "REPO=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + + - name: Trigger Docker Build Action with Cleaned Ref + run: | + echo $INPUTS | gh workflow run $WORKFLOW_ID --ref $WORKFLOW_REF --json + env: + WORKFLOW_ID: 'build-nethermind-docker-images.yml' + WORKFLOW_REF: ${{ github.ref }} + GITHUB_USER: ${{ secrets.REPOSITORY_DISPATCH_USER }} + GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} + INPUTS: > + { + "repo": "${{ env.REPO }}", + "tag": "${{ env.CLEAN_REF }}", + "dockerfile": "Dockerfile" + } - name: Set Repo and Org Variables run: | - echo "ORG_NAME=${{ github.repository_owner }}" >> $GITHUB_ENV - echo "REPO_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV - - - name: Check if master branch and default additional_options - id: check_conditions - run: | - if - [[ "${{ github.ref }}" == "refs/heads/master" ]] && - [[ "${{ steps.extract_dockerfile.outputs.dockerfile }}" == "Dockerfile" ]] && - [[ "${{ steps.extract_dockerfile.outputs.build-config }}" == "release" ]]; then - echo "skip_docker_build=true" >> $GITHUB_OUTPUT - else - echo "skip_docker_build=false" >> $GITHUB_OUTPUT - fi + echo "ORG_NAME=$(echo $GITHUB_REPOSITORY | cut -d / -f 1)" >> $GITHUB_ENV + echo "REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d / -f 2)" >> $GITHUB_ENV - - name: Trigger Docker Build Action with Cleaned Ref - if: steps.check_conditions.outputs.skip_docker_build != 'true' - uses: benc-uk/workflow-dispatch@v1 - env: - ADDITIONAL_OPTIONS: ${{ inputs.additional_options }} - with: - workflow: publish-docker.yml - ref: "${{ github.ref }}" - token: "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" - inputs: '{ - "tag": "${{ env.CLEAN_REF }}", - "dockerfile": "${{ steps.extract_dockerfile.outputs.dockerfile }}", - "build-config": "${{ steps.extract_dockerfile.outputs.build-config }}" - }' - - name: Wait for Docker Build Action to complete if: steps.check_conditions.outputs.skip_docker_build != 'true' env: @@ -142,9 +202,11 @@ jobs: trigger_node_and_vm_creation: needs: create_docker_image runs-on: ubuntu-latest + outputs: + run_id: ${{ steps.wait-for-node-creation.outputs.run_id }} steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Prepare docker tag id: prepare_ref @@ -163,23 +225,37 @@ jobs: echo "allowed_ips=$(echo '${{ inputs.additional_options }}' | jq -r .allowed_ips)" >> $GITHUB_OUTPUT - name: Trigger Node creation Repo Action - uses: benc-uk/workflow-dispatch@v1 - with: - workflow: run-single-node.yml - repo: NethermindEth/post-merge-smoke-tests - ref: "main" - token: "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" - inputs: '{ - "github_username": "${{ github.actor }}", - "base_tag": "${{ env.BASE_TAG }}", - "config_file": "${{ inputs.config }}", - "nethermind_branch": "${{ env.CLEAN_REF }}", - "network": "${{ inputs.network }}", - "cl_client": "${{ inputs.cl_client }}", - "additional_options": "{\"cl_custom_image\":\"${{ inputs.cl_custom_image }}\", \"timeout\":\"${{ steps.extract_variables.outputs.timeout }}\", \"non_validator_mode\":${{ inputs.non_validator_mode }}, \"additional_nethermind_flags\":\"${{ inputs.additional_nethermind_flags }}\", \"additional_cl_flags\":\"${{ inputs.additional_cl_flags }}\", \"ssh_keys\":\"${{ steps.extract_variables.outputs.ssh_keys }}\", \"allowed_ips\":\"${{ steps.extract_variables.outputs.allowed_ips }}\"}" - }' + run: | + echo $INPUTS | gh -R $WORKFLOW_REPO workflow run $WORKFLOW_ID --ref $WORKFLOW_REF --json + env: + WORKFLOW_ID: 'run-single-node.yml' + WORKFLOW_REF: main + WORKFLOW_REPO: NethermindEth/post-merge-smoke-tests + GITHUB_USER: ${{ secrets.REPOSITORY_DISPATCH_USER }} + GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} + INPUTS: > + { + "github_username": "${{ github.actor }}", + "base_tag": "${{ env.BASE_TAG }}", + "config_file": "${{ inputs.config }}", + "nethermind_branch": "${{ env.CLEAN_REF }}", + "network": "${{ inputs.network }}", + "cl_client": "${{ inputs.cl_client }}", + "additional_options": + "{ + \"cl_custom_image\":\"${{ inputs.cl_custom_image }}\", + \"timeout\":\"${{ inputs.timeout }}\", + \"non_validator_mode\":\"${{ inputs.non_validator_mode }}\", + \"volume_size\":\"${{ inputs.volume }}\", + \"additional_nethermind_flags\":\"${{ inputs.additional_nethermind_flags }}\", + \"additional_cl_flags\":\"${{ inputs.additional_cl_flags }}\", + \"ssh_keys\":\"${{ inputs.ssh_keys }}\", + \"allowed_ips\":\"${{ inputs.allowed_ips }}\" + }" + } - name: Wait for creation of node + id: wait-for-node-creation env: GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} WORKFLOW_ID: 'run-single-node.yml' diff --git a/.gitignore b/.gitignore index 786949cd2cf..7c30a7bf11e 100644 --- a/.gitignore +++ b/.gitignore @@ -409,3 +409,4 @@ src/Nethermind/Nethermind.BeaconNode.Host/release src/Nethermind/Nethermind.Runner/git-hash keystore/ /.githooks +.vscode diff --git a/scripts/wait-for-workflow-completed.sh b/scripts/wait-for-workflow-completed.sh index 37bcc0d0870..dad6f3677ce 100644 --- a/scripts/wait-for-workflow-completed.sh +++ b/scripts/wait-for-workflow-completed.sh @@ -75,6 +75,8 @@ while true; do exit 1 else echo "✅ The workflow completed successfully! Exiting." + echo "👀 Check workflow details at: https://github.com/${ORG_NAME}/${REPO_NAME}/actions/runs/$run_id" + echo "run_id=$run_id" >> $GITHUB_OUTPUT break fi fi diff --git a/scripts/wireguard.conf.template b/scripts/wireguard.conf.template new file mode 100644 index 00000000000..4d8bce58fca --- /dev/null +++ b/scripts/wireguard.conf.template @@ -0,0 +1,10 @@ +[Interface] +PrivateKey = ${WIREGUARD_PRIVKEY} +Address = ${WIREGUARD_ADDRESS} +DNS = ${WIREGUARD_DNS} + +[Peer] +PublicKey = ${WIREGUARD_PUBKEY} +PresharedKey = ${WIREGUARD_PRESHAREDKEY} +AllowedIPs = ${WIREGUARD_ALLOWED_IPS} +Endpoint = ${WIREGUARD_SERVER_IP}:${WIREGUARD_SERVER_PORT} From 0a0649308eca8ae5db98f4aac2c8698f6911361f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Tue, 8 Aug 2023 18:01:54 +0200 Subject: [PATCH 010/202] Trigger workflow? --- .github/workflows/rpc-comparison.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 234c0c4fe21..4d2a50191af 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -13,7 +13,6 @@ on: required: false jobs: - create_node: name: Create node from current branch uses: ./.github/workflows/run-a-single-node-from-branch.yml From c80d9f3a2898589af4e5996948c7155f2d8a98c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Tue, 8 Aug 2023 18:11:32 +0200 Subject: [PATCH 011/202] Fix run-a-single-node-from-branch.yml --- .github/workflows/run-a-single-node-from-branch.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 97d2f60d817..57174a3912a 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -57,9 +57,6 @@ on: description: "SSH Keys to be installed in the smoke test nodes (separated by commas without space in-between commas) for example: key1,key2,key3" default: "" required: false - smoke_tests_ref: - description: "Ref of the smoke tests repository to be used for smoke tests" - default: "main" workflow_call: inputs: smoke_tests_ref: From 9c127cced0e755f1ce4779f951a216231aaffafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Wed, 9 Aug 2023 11:39:27 +0200 Subject: [PATCH 012/202] Update branch name --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 4d2a50191af..bd4ba309ad2 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -3,7 +3,7 @@ name: '[JSON-RPC] Compare Nethermind between clients and versions' on: push: branches: - - 'rpc-comparison-testing' + - 'rpc-comparison-testing-v1.20.1' workflow_dispatch: inputs: allowed_ips: From b8d275c32162be70849f4c3e59086542410143e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Wed, 9 Aug 2023 17:48:20 +0200 Subject: [PATCH 013/202] Wait for the node to sync --- .github/workflows/rpc-comparison.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index bd4ba309ad2..1b93d7ca163 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -71,7 +71,11 @@ jobs: WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Wait for the node to sync + run: | + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' ${{ needs.extract_rpc_url.outputs.rpc_url }} | jq -e '.result' + do sleep 300; done - name: Test equality of responses run: flood all nethermind_current=${{ needs.extract_rpc_url.outputs.rpc_url }} ${{ matrix.rpc_to_compare }}=${{ secrets[matrix.rpc_to_compare] }} --equality - From 06937bd740fa3652fdf4486f5a06ec51e7b71c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Tue, 15 Aug 2023 12:27:29 +0200 Subject: [PATCH 014/202] Add a separate job to wait for node sync --- .github/workflows/rpc-comparison.yaml | 36 +++++++++++++++++++++------ 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 1b93d7ca163..2ab16447f36 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -42,11 +42,38 @@ jobs: - name: Get RPC url to the newly created node id: extract_rpc_url run: echo "rpc_url=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT + + wait_for_node_to_sync: + name: Wait for the node to sync + runs-on: ubuntu-latest + needs: extract_rpc_url + steps: + - name: Install WireGuard + run: | + sudo apt update + sudo apt install -y wireguard resolvconf + sudo mkdir -p /etc/wireguard + envsubst < scripts/wireguard.conf.template > wg0.conf + sudo wg-quick up ./wg0.conf + env: + WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Wait for the node to sync + run: | + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' ${{ needs.extract_rpc_url.outputs.rpc_url }} | jq -e '.result' + do sleep 300; done compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - needs: extract_rpc_url + needs: [extract_rpc_url, wait_for_node_to_sync] strategy: matrix: rpc_to_compare: [INFURA_ENDPOINT, NETHERMIND_ARCHIVE_ENDPOINT] @@ -71,11 +98,6 @@ jobs: WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - - - name: Wait for the node to sync - run: | - while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' ${{ needs.extract_rpc_url.outputs.rpc_url }} | jq -e '.result' - do sleep 300; done - + - name: Test equality of responses run: flood all nethermind_current=${{ needs.extract_rpc_url.outputs.rpc_url }} ${{ matrix.rpc_to_compare }}=${{ secrets[matrix.rpc_to_compare] }} --equality From 0877822714347a44da8751e47fbcfabe67a662ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Tue, 15 Aug 2023 13:15:32 +0200 Subject: [PATCH 015/202] Fix missing checkout --- .github/workflows/rpc-comparison.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 2ab16447f36..d216077b062 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -47,7 +47,8 @@ jobs: name: Wait for the node to sync runs-on: ubuntu-latest needs: extract_rpc_url - steps: + steps: + - uses: actions/checkout@v3 - name: Install WireGuard run: | sudo apt update From 352bf642b804da4ac15b71844856c4833afaa0c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Thu, 17 Aug 2023 12:09:35 +0200 Subject: [PATCH 016/202] Use validator mode and set Pruning to None --- .github/workflows/rpc-comparison.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index d216077b062..059156db59b 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -19,6 +19,8 @@ jobs: secrets: inherit with: allowed_ips: ${{ inputs.allowed_ips }} + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None extract_rpc_url: name: Extract RPC url from artifacts generated by create_node From 4a833a71161b9a7216b25767a2a07133565d29f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Fri, 18 Aug 2023 11:19:08 +0200 Subject: [PATCH 017/202] Increase timeout of wait to sync to 10 hours --- .github/workflows/rpc-comparison.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 059156db59b..f25b1fafeec 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -49,6 +49,7 @@ jobs: name: Wait for the node to sync runs-on: ubuntu-latest needs: extract_rpc_url + timeout-minutes: 600 steps: - uses: actions/checkout@v3 - name: Install WireGuard From 6c85ab9633b0b783c71c6dd28d70991ec0a68c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Fri, 18 Aug 2023 18:12:42 +0200 Subject: [PATCH 018/202] Change step timeout as well --- .github/workflows/rpc-comparison.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index f25b1fafeec..6d1c9d1df7e 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -70,6 +70,7 @@ jobs: WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - name: Wait for the node to sync + timeout-minutes: 600 run: | while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' ${{ needs.extract_rpc_url.outputs.rpc_url }} | jq -e '.result' do sleep 300; done From 8377d3411d35ee0da8ce4a8730e710a4da064f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Mon, 21 Aug 2023 13:17:15 +0200 Subject: [PATCH 019/202] Wait 5.5h before running `wait_for_node_to_sync` For github hosted runners time limit for a job is 6 hours. It is less than a node needs to sync. Thus we wait 5.5 hours before checking the sync status of node. --- .github/workflows/rpc-comparison.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 6d1c9d1df7e..e36ebb0fa0e 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -44,11 +44,18 @@ jobs: - name: Get RPC url to the newly created node id: extract_rpc_url run: echo "rpc_url=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT - + + sleep: + name: Sleep since syncing lasts longer than 6 hours (time limit for a job) + runs-on: ubuntu-latest + needs: extract_rpc_url + steps: + - run: sleep 5h 30m + wait_for_node_to_sync: name: Wait for the node to sync runs-on: ubuntu-latest - needs: extract_rpc_url + needs: sleep timeout-minutes: 600 steps: - uses: actions/checkout@v3 From c8a360bf8024a4b047e8b7e7b579238428647d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Tue, 22 Aug 2023 11:00:27 +0200 Subject: [PATCH 020/202] Fix needs --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index e36ebb0fa0e..84f8051ef3a 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -55,7 +55,7 @@ jobs: wait_for_node_to_sync: name: Wait for the node to sync runs-on: ubuntu-latest - needs: sleep + needs: [sleep, extract_rpc_url] timeout-minutes: 600 steps: - uses: actions/checkout@v3 From 13d9a282ead78eaf91b4a5f96c2ce6e9ed98ab50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Wed, 23 Aug 2023 11:41:44 +0200 Subject: [PATCH 021/202] Wait another 5.5h --- .github/workflows/rpc-comparison.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 84f8051ef3a..1d0512c3760 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -51,11 +51,17 @@ jobs: needs: extract_rpc_url steps: - run: sleep 5h 30m + sleep2: + name: Sleep since syncing lasts longer than 6 hours (time limit for a job) + runs-on: ubuntu-latest + needs: sleep + steps: + - run: sleep 5h 30m wait_for_node_to_sync: name: Wait for the node to sync runs-on: ubuntu-latest - needs: [sleep, extract_rpc_url] + needs: [sleep2, extract_rpc_url] timeout-minutes: 600 steps: - uses: actions/checkout@v3 From 476a16d5e50ee916ad3f5b2de3fb0d7e016bfa37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Thu, 24 Aug 2023 10:10:15 +0200 Subject: [PATCH 022/202] Fix indentation --- .github/workflows/rpc-comparison.yaml | 96 +++++++++++++-------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 1d0512c3760..98ae16c5756 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -50,13 +50,13 @@ jobs: runs-on: ubuntu-latest needs: extract_rpc_url steps: - - run: sleep 5h 30m + - run: sleep 5h 30m sleep2: name: Sleep since syncing lasts longer than 6 hours (time limit for a job) runs-on: ubuntu-latest needs: sleep steps: - - run: sleep 5h 30m + - run: sleep 5h 30m wait_for_node_to_sync: name: Wait for the node to sync @@ -64,29 +64,29 @@ jobs: needs: [sleep2, extract_rpc_url] timeout-minutes: 600 steps: - - uses: actions/checkout@v3 - - name: Install WireGuard - run: | - sudo apt update - sudo apt install -y wireguard resolvconf - sudo mkdir -p /etc/wireguard - envsubst < scripts/wireguard.conf.template > wg0.conf - sudo wg-quick up ./wg0.conf - env: - WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' - WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' - WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' - WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' - WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' - WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' - WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' - WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - - - name: Wait for the node to sync - timeout-minutes: 600 - run: | - while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' ${{ needs.extract_rpc_url.outputs.rpc_url }} | jq -e '.result' - do sleep 300; done + - uses: actions/checkout@v3 + - name: Install WireGuard + run: | + sudo apt update + sudo apt install -y wireguard resolvconf + sudo mkdir -p /etc/wireguard + envsubst < scripts/wireguard.conf.template > wg0.conf + sudo wg-quick up ./wg0.conf + env: + WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Wait for the node to sync + timeout-minutes: 600 + run: | + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' ${{ needs.extract_rpc_url.outputs.rpc_url }} | jq -e '.result' + do sleep 300; done compare: name: Compare JSON-RPC responses between clients and versions @@ -96,26 +96,26 @@ jobs: matrix: rpc_to_compare: [INFURA_ENDPOINT, NETHERMIND_ARCHIVE_ENDPOINT] steps: - - uses: actions/checkout@v3 - - name: Install flood - run: pip install git+https://github.com/piwonskp/flood.git - - - name: Install WireGuard - run: | - sudo apt update - sudo apt install -y wireguard resolvconf - sudo mkdir -p /etc/wireguard - envsubst < scripts/wireguard.conf.template > wg0.conf - sudo wg-quick up ./wg0.conf - env: - WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' - WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' - WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' - WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' - WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' - WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' - WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' - WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - - - name: Test equality of responses - run: flood all nethermind_current=${{ needs.extract_rpc_url.outputs.rpc_url }} ${{ matrix.rpc_to_compare }}=${{ secrets[matrix.rpc_to_compare] }} --equality + - uses: actions/checkout@v3 + - name: Install flood + run: pip install git+https://github.com/piwonskp/flood.git + + - name: Install WireGuard + run: | + sudo apt update + sudo apt install -y wireguard resolvconf + sudo mkdir -p /etc/wireguard + envsubst < scripts/wireguard.conf.template > wg0.conf + sudo wg-quick up ./wg0.conf + env: + WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Test equality of responses + run: flood all nethermind_current=${{ needs.extract_rpc_url.outputs.rpc_url }} ${{ matrix.rpc_to_compare }}=${{ secrets[matrix.rpc_to_compare] }} --equality From 21bab0c471bbed46ea5f135d43f5d462eb91a4af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Fri, 25 Aug 2023 11:37:39 +0200 Subject: [PATCH 023/202] Remove sleep2 --- .github/workflows/rpc-comparison.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 98ae16c5756..c33007382d7 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -51,17 +51,11 @@ jobs: needs: extract_rpc_url steps: - run: sleep 5h 30m - sleep2: - name: Sleep since syncing lasts longer than 6 hours (time limit for a job) - runs-on: ubuntu-latest - needs: sleep - steps: - - run: sleep 5h 30m wait_for_node_to_sync: name: Wait for the node to sync runs-on: ubuntu-latest - needs: [sleep2, extract_rpc_url] + needs: [sleep, extract_rpc_url] timeout-minutes: 600 steps: - uses: actions/checkout@v3 From 327864177495491ed08cfbca986f794398e07374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Fri, 25 Aug 2023 11:38:49 +0200 Subject: [PATCH 024/202] Remove debug info --- .github/workflows/rpc-comparison.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index c33007382d7..1ce515db4b4 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -38,9 +38,6 @@ jobs: name: "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" repo: NethermindEth/post-merge-smoke-tests - - run: echo "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" - - run: echo "${{ github.actor }}-${{ needs.create_node.outputs.rpc_url }}-smoketests" - - name: Get RPC url to the newly created node id: extract_rpc_url run: echo "rpc_url=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT From 53f3717fb48c1363fde9e4cd4789e1fe8954cfa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 21:40:05 +0100 Subject: [PATCH 025/202] Change approach to multi nodes --- .github/workflows/rpc-comparison.yaml | 106 ++++++++++++++++++++------ 1 file changed, 82 insertions(+), 24 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 1ce515db4b4..52c58f8ff1c 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -3,7 +3,7 @@ name: '[JSON-RPC] Compare Nethermind between clients and versions' on: push: branches: - - 'rpc-comparison-testing-v1.20.1' + - 'rpc-comparison-1.23.0' workflow_dispatch: inputs: allowed_ips: @@ -11,36 +11,76 @@ on: description: "A comma-separated list of ips allowed to connect to the node" default: '' required: false + what_to_compare: + type: string + description: "A space-separated list of clients/branches. If "infura" then current branch to infura will be compared. If two nethermind branches, then two version will be compared." + default: "infura" + required: true jobs: - create_node: - name: Create node from current branch - uses: ./.github/workflows/run-a-single-node-from-branch.yml - secrets: inherit - with: - allowed_ips: ${{ inputs.allowed_ips }} - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None + parse_input: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Set matrix for branches + id: set-matrix + run: | + what_to_compare="${{ github.event.inputs.what_to_compare }}" + if [[ "$what_to_compare" == "infura" ]]; then + # Extract the current branch name from GITHUB_REF + current_branch=${GITHUB_REF#refs/heads/} + branches=("$current_branch") + else + # Split the input into an array + IFS=' ' read -r -a branches <<< "$what_to_compare" + fi + echo "matrix=${branches}" >> $GITHUB_OUTPUT + + create_node: + needs: parse_input + runs-on: ubuntu-latest + strategy: + matrix: + branch: ${{fromJson(needs.parse_input.outputs.matrix)}} + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: ${{ matrix.branch }} + - name: Run create_node job + uses: ./.github/workflows/run-a-single-node-from-branch.yml + with: + allowed_ips: ${{ github.event.inputs.allowed_ips }} + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None extract_rpc_url: name: Extract RPC url from artifacts generated by create_node runs-on: ubuntu-latest needs: create_node outputs: - rpc_url: ${{ steps.extract_rpc_url.outputs.rpc_url }} + rpc_urls: ${{ steps.aggregate_rpc_urls.outputs.rpc_urls }} steps: - - name: Download artifact - id: download-artifact - uses: dawidd6/action-download-artifact@v2 - with: - github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - run_id: ${{ needs.create_node.outputs.run_id }} - name: "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" - repo: NethermindEth/post-merge-smoke-tests + - name: Checkout code + uses: actions/checkout@v2 - - name: Get RPC url to the newly created node - id: extract_rpc_url - run: echo "rpc_url=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT + - name: Extract RPC URLs + id: aggregate_rpc_urls + run: | + rpc_urls="" + for matrix_val in ${{ fromJson(needs.create_node.result) }} + do + artifact_name="${{ github.actor }}-${matrix_val}-${{ needs.create_node.outputs.base_tag }}-smoketests" + echo "Downloading artifact: $artifact_name" + wget -O artifact.zip --header='Authorization: token ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}' \ + "https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/artifacts/$artifact_name/zip" + unzip artifact.zip + rpc_url=$(cat ./terraform.tfstate | jq -r '.outputs.nodes_data.value[0].rpc_url') + rpc_urls="$rpc_urls$rpc_url," + rm -rf artifact.zip terraform.tfstate + done + echo "rpc_urls=${rpc_urls%?}" >> $GITHUB_OUTPUT sleep: name: Sleep since syncing lasts longer than 6 hours (time limit for a job) @@ -73,11 +113,29 @@ jobs: WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - - name: Wait for the node to sync + - name: Wait for the nodes to sync timeout-minutes: 600 run: | - while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' ${{ needs.extract_rpc_url.outputs.rpc_url }} | jq -e '.result' - do sleep 300; done + rpc_urls=(${{ needs.extract_rpc_url.outputs.rpc_urls }}) + sync_complete_flag=0 + + check_sync() { + rpc_url=$1 + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' $rpc_url | jq -e '.result'; do + sleep 300 + done + echo "Node at $rpc_url synced." + sync_complete_flag=$((sync_complete_flag+1)) + } + + for url in "${rpc_urls[@]}"; do + check_sync "$url" & + done + + # Wait for all nodes to sync + while [ $sync_complete_flag -ne ${#rpc_urls[@]} ]; do + sleep 60 + done compare: name: Compare JSON-RPC responses between clients and versions From 863d9e82bd5630a7babb5c010a3cdc7fd279a52a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= <43241881+kamilchodola@users.noreply.github.com> Date: Tue, 28 Nov 2023 21:42:41 +0100 Subject: [PATCH 026/202] Fix desc --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 52c58f8ff1c..74ef631f249 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -13,7 +13,7 @@ on: required: false what_to_compare: type: string - description: "A space-separated list of clients/branches. If "infura" then current branch to infura will be compared. If two nethermind branches, then two version will be compared." + description: "A space-separated list of clients/branches. If 'infura' then current branch to infura will be compared. If two nethermind branches, then two version will be compared." default: "infura" required: true From 15c83ae9c8e1aeecb77bf18226899b3e7936c39e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 21:43:20 +0100 Subject: [PATCH 027/202] Fix branch name for trigger --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 52c58f8ff1c..629715395b1 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -3,7 +3,7 @@ name: '[JSON-RPC] Compare Nethermind between clients and versions' on: push: branches: - - 'rpc-comparison-1.23.0' + - 'rpc-comparision-1.23.0' workflow_dispatch: inputs: allowed_ips: From ba1f35a130ffb598e47738bcffa7d59bab6950a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 21:44:29 +0100 Subject: [PATCH 028/202] Add logs --- .github/workflows/rpc-comparison.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index b50e0019993..b81643ac5c6 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -35,6 +35,7 @@ jobs: # Split the input into an array IFS=' ' read -r -a branches <<< "$what_to_compare" fi + echo ${branches} echo "matrix=${branches}" >> $GITHUB_OUTPUT create_node: From 9025c588103668babf7ace2dad68aa5d7239d928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 21:46:20 +0100 Subject: [PATCH 029/202] Add hardcoded value --- .github/workflows/rpc-comparison.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index b81643ac5c6..b4532f6ce99 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -26,7 +26,8 @@ jobs: - name: Set matrix for branches id: set-matrix run: | - what_to_compare="${{ github.event.inputs.what_to_compare }}" + # what_to_compare="${{ github.event.inputs.what_to_compare }}" + what_to_compare="infura" if [[ "$what_to_compare" == "infura" ]]; then # Extract the current branch name from GITHUB_REF current_branch=${GITHUB_REF#refs/heads/} From 889de1f87bd15285a7aa48cff6883b476cdbda07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:01:45 +0100 Subject: [PATCH 030/202] Fix matrix --- .github/workflows/rpc-comparison.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index b4532f6ce99..f269529c2c5 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -36,15 +36,15 @@ jobs: # Split the input into an array IFS=' ' read -r -a branches <<< "$what_to_compare" fi - echo ${branches} - echo "matrix=${branches}" >> $GITHUB_OUTPUT + printf -v joined ',"%s"' "${branches[@]}" + json_array="[${joined:1}]" + echo "matrix=$json_array" >> $GITHUB_OUTPUT create_node: needs: parse_input runs-on: ubuntu-latest strategy: - matrix: - branch: ${{fromJson(needs.parse_input.outputs.matrix)}} + matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} steps: - name: Checkout code uses: actions/checkout@v2 From 5b5c76eaf3bfab8ef08df772f013372cdca2ab34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:13:02 +0100 Subject: [PATCH 031/202] Change matrix approach --- .github/workflows/rpc-comparison.yaml | 49 +++++++++++++++++++++------ 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index f269529c2c5..47eb269dea2 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -13,9 +13,14 @@ on: required: false what_to_compare: type: string - description: "A space-separated list of clients/branches. If 'infura' then current branch to infura will be compared. If two nethermind branches, then two version will be compared." - default: "infura" - required: true + description: "A space-separated list of branches. If empty, then selected branch will be used. If multiple specified, those will be compared to themselves." + default: "" + required: false + compare_with: + type: string + description: "A space-separated list of additional comparers. If empty, then nothing else will be added to comparision. Possible options: 'infura', 'archive', 'feature/branch'" + default: "" + required: false jobs: parse_input: @@ -23,22 +28,44 @@ jobs: outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: + - name: Install jq + run: sudo apt-get install jq + - name: Set matrix for branches id: set-matrix run: | - # what_to_compare="${{ github.event.inputs.what_to_compare }}" - what_to_compare="infura" - if [[ "$what_to_compare" == "infura" ]]; then - # Extract the current branch name from GITHUB_REF + #what_to_compare="${{ github.event.inputs.what_to_compare }}" + #compare_with="${{ github.event.inputs.compare_with }}" + + what_to_compare="" + compare_with="infura" + + # Determine the primary branches to compare + if [[ "$what_to_compare" == "" ]]; then current_branch=${GITHUB_REF#refs/heads/} branches=("$current_branch") else - # Split the input into an array - IFS=' ' read -r -a branches <<< "$what_to_compare" + readarray -t branches <<< "$what_to_compare" fi + + # Add additional comparers if specified + if [[ "$compare_with" != "" ]]; then + IFS=' ' read -r -a additional_branches <<< "$compare_with" + for branch in "${additional_branches[@]}"; do + if [[ "$branch" != "infura" && "$branch" != "archive" ]]; then + # Treat as additional branch + branches+=("$branch") + fi + done + fi + + # Convert array to JSON array string printf -v joined ',"%s"' "${branches[@]}" - json_array="[${joined:1}]" - echo "matrix=$json_array" >> $GITHUB_OUTPUT + MATRIX="[${joined:1}]" + + echo $MATRIX > matrix.json + cat matrix.json + echo "matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT create_node: needs: parse_input From 102b4c5b41f927e7eff47de240cda6c78673aab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:17:02 +0100 Subject: [PATCH 032/202] Fix json creation --- .github/workflows/rpc-comparison.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 47eb269dea2..0e463378e0c 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -59,9 +59,9 @@ jobs: done fi - # Convert array to JSON array string - printf -v joined ',"%s"' "${branches[@]}" - MATRIX="[${joined:1}]" + # Convert array to JSON object with named array + printf -v joined ', "%s"' "${branches[@]}" + MATRIX="{\"branch\": [${joined:2}]}" # Ensure the key name 'branch' is used echo $MATRIX > matrix.json cat matrix.json From 803ff36accbcef1ff53eeac82c439e2f2d55f80e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:18:51 +0100 Subject: [PATCH 033/202] Fix path --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 0e463378e0c..a2e010f2286 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -78,7 +78,7 @@ jobs: with: ref: ${{ matrix.branch }} - name: Run create_node job - uses: ./.github/workflows/run-a-single-node-from-branch.yml + uses: .github/workflows/run-a-single-node-from-branch.yml with: allowed_ips: ${{ github.event.inputs.allowed_ips }} non_validator_mode: false From 75d4eaef2df883e63147714e9afc1f1ded80f247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:23:27 +0100 Subject: [PATCH 034/202] Select branch --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index a2e010f2286..756d0be1360 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -78,7 +78,7 @@ jobs: with: ref: ${{ matrix.branch }} - name: Run create_node job - uses: .github/workflows/run-a-single-node-from-branch.yml + uses: ./.github/workflows/run-a-single-node-from-branch.yml@${{ matrix.branch }} with: allowed_ips: ${{ github.event.inputs.allowed_ips }} non_validator_mode: false From 31030370da388a100f4e68fe5844b8fbe323eebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:24:36 +0100 Subject: [PATCH 035/202] Absolut path --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 756d0be1360..f9610fe46fc 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -78,7 +78,7 @@ jobs: with: ref: ${{ matrix.branch }} - name: Run create_node job - uses: ./.github/workflows/run-a-single-node-from-branch.yml@${{ matrix.branch }} + uses: NethermindEth/nethermind/.github/workflows/run-a-single-node-from-branch.yml with: allowed_ips: ${{ github.event.inputs.allowed_ips }} non_validator_mode: false From cc6a6f60202e7064aeaa323160259373d483d019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:28:55 +0100 Subject: [PATCH 036/202] revert path --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index f9610fe46fc..0e463378e0c 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -78,7 +78,7 @@ jobs: with: ref: ${{ matrix.branch }} - name: Run create_node job - uses: NethermindEth/nethermind/.github/workflows/run-a-single-node-from-branch.yml + uses: ./.github/workflows/run-a-single-node-from-branch.yml with: allowed_ips: ${{ github.event.inputs.allowed_ips }} non_validator_mode: false From b3a51fd96a93b1490f15f058ead05e866f4353aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:32:57 +0100 Subject: [PATCH 037/202] static path --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 0e463378e0c..a55b9827ab3 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -78,7 +78,7 @@ jobs: with: ref: ${{ matrix.branch }} - name: Run create_node job - uses: ./.github/workflows/run-a-single-node-from-branch.yml + uses: /home/runner/work/nethermind/.github/workflows/run-a-single-node-from-branch.yml with: allowed_ips: ${{ github.event.inputs.allowed_ips }} non_validator_mode: false From 33a1c7d79842819bc32cd47ef58c37562e33b84f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:35:09 +0100 Subject: [PATCH 038/202] Remove ref --- .github/workflows/rpc-comparison.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index a55b9827ab3..caf0f6ee82a 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -75,10 +75,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 - with: - ref: ${{ matrix.branch }} - name: Run create_node job - uses: /home/runner/work/nethermind/.github/workflows/run-a-single-node-from-branch.yml + uses: ./.github/workflows/run-a-single-node-from-branch.yml with: allowed_ips: ${{ github.event.inputs.allowed_ips }} non_validator_mode: false From bd71f871f573c04d991c8860578276fb1b21d17d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:37:42 +0100 Subject: [PATCH 039/202] bump checkout --- .github/workflows/rpc-comparison.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index caf0f6ee82a..65d2eb470ec 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -74,7 +74,9 @@ jobs: matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 + with: + ref: ${{ matrix.branch }} - name: Run create_node job uses: ./.github/workflows/run-a-single-node-from-branch.yml with: From 074a6e9a5d9385b3478c1326cc30e9b86b30aaf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:40:36 +0100 Subject: [PATCH 040/202] add logs --- .github/workflows/rpc-comparison.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 65d2eb470ec..746cc42cb2d 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -77,6 +77,9 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ matrix.branch }} + - name: Debug tree + run: | + tree - name: Run create_node job uses: ./.github/workflows/run-a-single-node-from-branch.yml with: From c1a7fe7664d8be9dc4714d12d04ebc38bcec6bc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:43:27 +0100 Subject: [PATCH 041/202] Add fethc depth --- .github/workflows/rpc-comparison.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 746cc42cb2d..e20ceb7a42f 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -77,6 +77,7 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ matrix.branch }} + fetch-depth: 0 - name: Debug tree run: | tree From 024770c62cd9566064c6d3731c9cdd5edee33814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:46:50 +0100 Subject: [PATCH 042/202] change debug log --- .github/workflows/rpc-comparison.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index e20ceb7a42f..09f938be9ea 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -77,10 +77,9 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ matrix.branch }} - fetch-depth: 0 - name: Debug tree run: | - tree + ls -la - name: Run create_node job uses: ./.github/workflows/run-a-single-node-from-branch.yml with: From eaf6f606947281dea35c077d54d8369d6cfb1e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:48:17 +0100 Subject: [PATCH 043/202] More logs --- .github/workflows/rpc-comparison.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 09f938be9ea..d2bedf7ada2 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -79,6 +79,8 @@ jobs: ref: ${{ matrix.branch }} - name: Debug tree run: | + ls -la /home/runner/work/nethermind + ls -la /home/runner/work/nethermind/nethermind ls -la - name: Run create_node job uses: ./.github/workflows/run-a-single-node-from-branch.yml From 8c2cf2fdcd73781bd1a9a1e197b2dfe13ee3dac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:49:47 +0100 Subject: [PATCH 044/202] Change logs --- .github/workflows/rpc-comparison.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index d2bedf7ada2..6ec1de3bc24 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -79,9 +79,8 @@ jobs: ref: ${{ matrix.branch }} - name: Debug tree run: | - ls -la /home/runner/work/nethermind - ls -la /home/runner/work/nethermind/nethermind - ls -la + ls -la /home/runner/work/nethermind/nethermind/.github + ls -la /home/runner/work/nethermind/nethermind/.github/workflows - name: Run create_node job uses: ./.github/workflows/run-a-single-node-from-branch.yml with: From d4986fe63e430dbc924ae3934514c44dc39db0d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:01:06 +0100 Subject: [PATCH 045/202] Change back to old version of run0single-node --- .github/workflows/rpc-comparison.yaml | 6 +-- .../run-a-single-node-from-branch.yml | 41 +++++++------------ 2 files changed, 15 insertions(+), 32 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 6ec1de3bc24..98b4f900949 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -74,13 +74,9 @@ jobs: matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ matrix.branch }} - - name: Debug tree - run: | - ls -la /home/runner/work/nethermind/nethermind/.github - ls -la /home/runner/work/nethermind/nethermind/.github/workflows - name: Run create_node job uses: ./.github/workflows/run-a-single-node-from-branch.yml with: diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 57174a3912a..d2b0d9d5ede 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -14,7 +14,6 @@ on: - sepolia - goerli - chiado - - holesky cl_client: description: "Select Consensus Layer Client to run node against" default: "" @@ -45,6 +44,14 @@ on: description: "If checked, node will be started in NonValidator mode (OldBodies and oldReceipts will not be synced)" default: true type: boolean + timeout: + description: "Timeout in hours before triggering the deletion of smoke test instances. Maximum time of node lifetime can be 72 hours." + default: "24" + required: true + volume: + description: "In case custom volume size needs to be applied, put value in GB here)" + required: false + default: "" additional_nethermind_flags: description: "Provide any additional flags to the Nethermind in space-separated format. Example: \"JsonRpc.Enabled=false Sync.SnapSync=false\"." default: "" @@ -150,13 +157,12 @@ jobs: run: | BASE_TAG="${GITHUB_USERNAME:0:1}$(shuf -i 1000-9999 -n 1)" echo "BASE_TAG=$BASE_TAG" >> $GITHUB_ENV - echo "base_tag=$BASE_TAG" >> $GITHUB_OUTPUT + echo "::set-output name=base_tag::$BASE_TAG" - name: Creating a node with NodeName="DevNode-${{ github.actor }}-${{ env.BASE_TAG }}-${{ env.CLEAN_REF }}-${{ inputs.network }}-${{ inputs.cl_client }}" run: echo "NodeName='DevNode-${{ github.actor }}-${{ env.BASE_TAG }}-${{ env.CLEAN_REF }}-${{ inputs.network }}-${{ inputs.cl_client }}'" - - - name: Extract dockerfile from additional_options - id: extract_dockerfile + + - name: Set Repo Variable run: | echo "REPO=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV @@ -181,10 +187,9 @@ jobs: echo "REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d / -f 2)" >> $GITHUB_ENV - name: Wait for Docker Build Action to complete - if: steps.check_conditions.outputs.skip_docker_build != 'true' env: GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - WORKFLOW_ID: 'publish-docker.yml' + WORKFLOW_ID: 'build-nethermind-docker-images.yml' MAX_WAIT_MINUTES: '5' INTERVAL: '5' TIMEOUT: '10' @@ -213,13 +218,9 @@ jobs: echo "CLEAN_REF=$CLEAN_REF" >> $GITHUB_ENV - - name: Extract Variables - id: extract_variables + - name: Use BASE_TAG run: | echo "BASE_TAG=${{ needs.create_docker_image.outputs.base_tag }}" >> $GITHUB_ENV - echo "timeout=$(echo '${{ inputs.additional_options }}' | jq -r .timeout)" >> $GITHUB_OUTPUT - echo "ssh_keys=$(echo '${{ inputs.additional_options }}' | jq -r .ssh_keys)" >> $GITHUB_OUTPUT - echo "allowed_ips=$(echo '${{ inputs.additional_options }}' | jq -r .allowed_ips)" >> $GITHUB_OUTPUT - name: Trigger Node creation Repo Action run: | @@ -264,19 +265,5 @@ jobs: REF: 'main' run: | chmod +x scripts/wait-for-workflow-completed.sh - ./scripts/wait-for-workflow-completed.sh | tee script-output.txt - run_id=$(grep -oP 'Run ID: \K\d+' script-output.txt) - echo "Run ID extracted is: $run_id" - echo "RUN_ID=$run_id" >> $GITHUB_ENV + ./scripts/wait-for-workflow-completed.sh working-directory: ${{ github.workspace }} - - - name: Download machine specs artifact - run: | - ARTIFACT_ID=$(curl -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/runs/${{ env.RUN_ID }}/artifacts | jq '.artifacts[0].id') - curl -L -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" -o artifact.zip https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/artifacts/$ARTIFACT_ID/zip - unzip artifact.zip -d ./downloaded-artifacts/ - - - name: Display machine specs content - run: | - FILE=$(ls downloaded-artifacts/machine-details | head -n 1) - cat "downloaded-artifacts/machine-details/$FILE" From dfce4060ac342423be0b80bbf14c084bb4799764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:01:54 +0100 Subject: [PATCH 046/202] revert changes --- .../run-a-single-node-from-branch.yml | 41 ++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index d2b0d9d5ede..57174a3912a 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -14,6 +14,7 @@ on: - sepolia - goerli - chiado + - holesky cl_client: description: "Select Consensus Layer Client to run node against" default: "" @@ -44,14 +45,6 @@ on: description: "If checked, node will be started in NonValidator mode (OldBodies and oldReceipts will not be synced)" default: true type: boolean - timeout: - description: "Timeout in hours before triggering the deletion of smoke test instances. Maximum time of node lifetime can be 72 hours." - default: "24" - required: true - volume: - description: "In case custom volume size needs to be applied, put value in GB here)" - required: false - default: "" additional_nethermind_flags: description: "Provide any additional flags to the Nethermind in space-separated format. Example: \"JsonRpc.Enabled=false Sync.SnapSync=false\"." default: "" @@ -157,12 +150,13 @@ jobs: run: | BASE_TAG="${GITHUB_USERNAME:0:1}$(shuf -i 1000-9999 -n 1)" echo "BASE_TAG=$BASE_TAG" >> $GITHUB_ENV - echo "::set-output name=base_tag::$BASE_TAG" + echo "base_tag=$BASE_TAG" >> $GITHUB_OUTPUT - name: Creating a node with NodeName="DevNode-${{ github.actor }}-${{ env.BASE_TAG }}-${{ env.CLEAN_REF }}-${{ inputs.network }}-${{ inputs.cl_client }}" run: echo "NodeName='DevNode-${{ github.actor }}-${{ env.BASE_TAG }}-${{ env.CLEAN_REF }}-${{ inputs.network }}-${{ inputs.cl_client }}'" - - - name: Set Repo Variable + + - name: Extract dockerfile from additional_options + id: extract_dockerfile run: | echo "REPO=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV @@ -187,9 +181,10 @@ jobs: echo "REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d / -f 2)" >> $GITHUB_ENV - name: Wait for Docker Build Action to complete + if: steps.check_conditions.outputs.skip_docker_build != 'true' env: GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - WORKFLOW_ID: 'build-nethermind-docker-images.yml' + WORKFLOW_ID: 'publish-docker.yml' MAX_WAIT_MINUTES: '5' INTERVAL: '5' TIMEOUT: '10' @@ -218,9 +213,13 @@ jobs: echo "CLEAN_REF=$CLEAN_REF" >> $GITHUB_ENV - - name: Use BASE_TAG + - name: Extract Variables + id: extract_variables run: | echo "BASE_TAG=${{ needs.create_docker_image.outputs.base_tag }}" >> $GITHUB_ENV + echo "timeout=$(echo '${{ inputs.additional_options }}' | jq -r .timeout)" >> $GITHUB_OUTPUT + echo "ssh_keys=$(echo '${{ inputs.additional_options }}' | jq -r .ssh_keys)" >> $GITHUB_OUTPUT + echo "allowed_ips=$(echo '${{ inputs.additional_options }}' | jq -r .allowed_ips)" >> $GITHUB_OUTPUT - name: Trigger Node creation Repo Action run: | @@ -265,5 +264,19 @@ jobs: REF: 'main' run: | chmod +x scripts/wait-for-workflow-completed.sh - ./scripts/wait-for-workflow-completed.sh + ./scripts/wait-for-workflow-completed.sh | tee script-output.txt + run_id=$(grep -oP 'Run ID: \K\d+' script-output.txt) + echo "Run ID extracted is: $run_id" + echo "RUN_ID=$run_id" >> $GITHUB_ENV working-directory: ${{ github.workspace }} + + - name: Download machine specs artifact + run: | + ARTIFACT_ID=$(curl -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/runs/${{ env.RUN_ID }}/artifacts | jq '.artifacts[0].id') + curl -L -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" -o artifact.zip https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/artifacts/$ARTIFACT_ID/zip + unzip artifact.zip -d ./downloaded-artifacts/ + + - name: Display machine specs content + run: | + FILE=$(ls downloaded-artifacts/machine-details | head -n 1) + cat "downloaded-artifacts/machine-details/$FILE" From 0797b0824653c886fd5a78ff69881952b1a751c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:05:50 +0100 Subject: [PATCH 047/202] Change job --- .github/workflows/rpc-comparison.yaml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 98b4f900949..4687210e0de 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -67,22 +67,17 @@ jobs: cat matrix.json echo "matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT - create_node: - needs: parse_input - runs-on: ubuntu-latest + create_node: + name: Create node from current branch + uses: ./.github/workflows/run-a-single-node-from-branch.yml@${{ matrix.branch }} strategy: matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch }} - - name: Run create_node job - uses: ./.github/workflows/run-a-single-node-from-branch.yml - with: - allowed_ips: ${{ github.event.inputs.allowed_ips }} - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None + secrets: inherit + with: + allowed_ips: ${{ inputs.allowed_ips }} + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + extract_rpc_url: name: Extract RPC url from artifacts generated by create_node From 8eca9d131fa411a3a6b2c33a0fe7a86efba9fb64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:08:42 +0100 Subject: [PATCH 048/202] Add matrix to path --- .github/workflows/rpc-comparison.yaml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 4687210e0de..9cb9255941d 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -67,17 +67,22 @@ jobs: cat matrix.json echo "matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT - create_node: - name: Create node from current branch - uses: ./.github/workflows/run-a-single-node-from-branch.yml@${{ matrix.branch }} + create_node: + needs: parse_input + runs-on: ubuntu-latest strategy: matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} - secrets: inherit - with: - allowed_ips: ${{ inputs.allowed_ips }} - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None - + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + - name: Run create_node job + uses: ./.github/workflows/run-a-single-node-from-branch.yml@${{ matrix.branch }} + with: + allowed_ips: ${{ github.event.inputs.allowed_ips }} + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None extract_rpc_url: name: Extract RPC url from artifacts generated by create_node From 723bf801219fbc9ae9c9efbb8ae4ad75501cb31c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:25:11 +0100 Subject: [PATCH 049/202] Adjust ref --- .github/workflows/rpc-comparison.yaml | 23 +++++------- .../run-a-single-node-from-branch.yml | 37 ++++++++----------- 2 files changed, 24 insertions(+), 36 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 9cb9255941d..18b420a1b3e 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -67,22 +67,17 @@ jobs: cat matrix.json echo "matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT - create_node: - needs: parse_input - runs-on: ubuntu-latest + create_node: + name: Create node from current branch + uses: ./.github/workflows/run-a-single-node-from-branch.yml + secrets: inherit strategy: matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch }} - - name: Run create_node job - uses: ./.github/workflows/run-a-single-node-from-branch.yml@${{ matrix.branch }} - with: - allowed_ips: ${{ github.event.inputs.allowed_ips }} - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None + with: + allowed_ips: ${{ inputs.allowed_ips }} + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: ${{ matrix.branch }} extract_rpc_url: name: Extract RPC url from artifacts generated by create_node diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 57174a3912a..5f21a86a51e 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -53,10 +53,9 @@ on: description: "Provide any additional flags to the CL client in space-separated format. Example: \"clflag1=1 clflag2=2\"." default: "" required: false - ssh_keys: - description: "SSH Keys to be installed in the smoke test nodes (separated by commas without space in-between commas) for example: key1,key2,key3" - default: "" - required: false + additional_options: + description: "A Json property which allows to customize node even more" + default: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":""}' workflow_call: inputs: smoke_tests_ref: @@ -64,6 +63,11 @@ on: default: "main" required: false type: string + nethermind_repo_ref: + description: "Ref of the nethermind repo in case it is needed to be changed" + default: "" + required: false + type: string network: description: "Select a network on which You want to run a node" default: "mainnet" @@ -88,16 +92,6 @@ on: description: "If checked, node will be started in NonValidator mode (OldBodies and oldReceipts will not be synced)" default: true type: boolean - timeout: - description: "Timeout in hours before triggering the deletion of smoke test instances. Maximum time of node lifetime can be 72 hours." - default: "24" - required: false - type: string - volume: - description: "In case custom volume size needs to be applied, put value in GB here)" - required: false - default: "" - type: string additional_nethermind_flags: type: string description: "Provide any additional flags to the Nethermind in space-separated format. Example: \"JsonRpc.Enabled=false Sync.SnapSync=false\"." @@ -108,15 +102,10 @@ on: description: "Provide any additional flags to the CL client in space-separated format. Example: \"clflag1=1 clflag2=2\"." default: "" required: false - ssh_keys: + additional_options: type: string - description: "SSH Keys to be installed in the smoke test nodes (separated by commas without space in-between commas) for example: key1,key2,key3" - default: "" - required: false - allowed_ips: - type: string - description: "A comma-separated list of ips allowed to connect to the node" - default: "" + description: "A Json property which allows to customize node even more" + default: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":""}' required: false outputs: base_tag: @@ -135,6 +124,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 + with: + ref: ${{ inputs.nethermind_repo_ref }} - name: Prepare docker tag id: prepare_ref @@ -204,6 +195,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 + with: + ref: ${{ inputs.nethermind_repo_ref }} - name: Prepare docker tag id: prepare_ref From bf37e3d5bdb5f91ef30c1611f4778d4d40278e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:26:27 +0100 Subject: [PATCH 050/202] fix allowed_ips --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 18b420a1b3e..64e571e42d8 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -74,7 +74,7 @@ jobs: strategy: matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} with: - allowed_ips: ${{ inputs.allowed_ips }} + additional_options: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' non_validator_mode: false additional_nethermind_flags: Pruning.Mode=None nethermind_repo_ref: ${{ matrix.branch }} From 7c99e16ef082f90644d000fd69336f53d534491f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:27:03 +0100 Subject: [PATCH 051/202] missing needs --- .github/workflows/rpc-comparison.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 64e571e42d8..ca1bb8d8723 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -67,7 +67,8 @@ jobs: cat matrix.json echo "matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT - create_node: + create_node: + needs: parse_input name: Create node from current branch uses: ./.github/workflows/run-a-single-node-from-branch.yml secrets: inherit From c20781b688eda668dc314293b201fcef5d7b5334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:29:27 +0100 Subject: [PATCH 052/202] Fix trigger job --- .../run-a-single-node-from-branch.yml | 99 +++++++++---------- 1 file changed, 48 insertions(+), 51 deletions(-) diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 5f21a86a51e..21590983121 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -123,7 +123,7 @@ jobs: base_tag: ${{ steps.set-base-tag.outputs.base_tag }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ inputs.nethermind_repo_ref }} @@ -149,28 +149,41 @@ jobs: - name: Extract dockerfile from additional_options id: extract_dockerfile run: | - echo "REPO=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - - - name: Trigger Docker Build Action with Cleaned Ref - run: | - echo $INPUTS | gh workflow run $WORKFLOW_ID --ref $WORKFLOW_REF --json - env: - WORKFLOW_ID: 'build-nethermind-docker-images.yml' - WORKFLOW_REF: ${{ github.ref }} - GITHUB_USER: ${{ secrets.REPOSITORY_DISPATCH_USER }} - GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - INPUTS: > - { - "repo": "${{ env.REPO }}", - "tag": "${{ env.CLEAN_REF }}", - "dockerfile": "Dockerfile" - } + echo "dockerfile=$(echo '${{ inputs.additional_options }}' | jq -r .default_dockerfile)" >> $GITHUB_OUTPUT + echo "build-config=$(echo '${{ inputs.additional_options }}' | jq -r .default_dockerfile_build_type | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT - name: Set Repo and Org Variables run: | - echo "ORG_NAME=$(echo $GITHUB_REPOSITORY | cut -d / -f 1)" >> $GITHUB_ENV - echo "REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d / -f 2)" >> $GITHUB_ENV + echo "ORG_NAME=${{ github.repository_owner }}" >> $GITHUB_ENV + echo "REPO_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV + + - name: Check if master branch and default additional_options + id: check_conditions + run: | + if + [[ "${{ github.ref }}" == "refs/heads/master" ]] && + [[ "${{ steps.extract_dockerfile.outputs.dockerfile }}" == "Dockerfile" ]] && + [[ "${{ steps.extract_dockerfile.outputs.build-config }}" == "release" ]]; then + echo "skip_docker_build=true" >> $GITHUB_OUTPUT + else + echo "skip_docker_build=false" >> $GITHUB_OUTPUT + fi + - name: Trigger Docker Build Action with Cleaned Ref + if: steps.check_conditions.outputs.skip_docker_build != 'true' + uses: benc-uk/workflow-dispatch@v1 + env: + ADDITIONAL_OPTIONS: ${{ inputs.additional_options }} + with: + workflow: publish-docker.yml + ref: "${{ github.ref }}" + token: "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" + inputs: '{ + "tag": "${{ env.CLEAN_REF }}", + "dockerfile": "${{ steps.extract_dockerfile.outputs.dockerfile }}", + "build-config": "${{ steps.extract_dockerfile.outputs.build-config }}" + }' + - name: Wait for Docker Build Action to complete if: steps.check_conditions.outputs.skip_docker_build != 'true' env: @@ -190,11 +203,9 @@ jobs: trigger_node_and_vm_creation: needs: create_docker_image runs-on: ubuntu-latest - outputs: - run_id: ${{ steps.wait-for-node-creation.outputs.run_id }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ inputs.nethermind_repo_ref }} @@ -215,37 +226,23 @@ jobs: echo "allowed_ips=$(echo '${{ inputs.additional_options }}' | jq -r .allowed_ips)" >> $GITHUB_OUTPUT - name: Trigger Node creation Repo Action - run: | - echo $INPUTS | gh -R $WORKFLOW_REPO workflow run $WORKFLOW_ID --ref $WORKFLOW_REF --json - env: - WORKFLOW_ID: 'run-single-node.yml' - WORKFLOW_REF: main - WORKFLOW_REPO: NethermindEth/post-merge-smoke-tests - GITHUB_USER: ${{ secrets.REPOSITORY_DISPATCH_USER }} - GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - INPUTS: > - { - "github_username": "${{ github.actor }}", - "base_tag": "${{ env.BASE_TAG }}", - "config_file": "${{ inputs.config }}", - "nethermind_branch": "${{ env.CLEAN_REF }}", - "network": "${{ inputs.network }}", - "cl_client": "${{ inputs.cl_client }}", - "additional_options": - "{ - \"cl_custom_image\":\"${{ inputs.cl_custom_image }}\", - \"timeout\":\"${{ inputs.timeout }}\", - \"non_validator_mode\":\"${{ inputs.non_validator_mode }}\", - \"volume_size\":\"${{ inputs.volume }}\", - \"additional_nethermind_flags\":\"${{ inputs.additional_nethermind_flags }}\", - \"additional_cl_flags\":\"${{ inputs.additional_cl_flags }}\", - \"ssh_keys\":\"${{ inputs.ssh_keys }}\", - \"allowed_ips\":\"${{ inputs.allowed_ips }}\" - }" - } + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: run-single-node.yml + repo: NethermindEth/post-merge-smoke-tests + ref: "main" + token: "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" + inputs: '{ + "github_username": "${{ github.actor }}", + "base_tag": "${{ env.BASE_TAG }}", + "config_file": "${{ inputs.config }}", + "nethermind_branch": "${{ env.CLEAN_REF }}", + "network": "${{ inputs.network }}", + "cl_client": "${{ inputs.cl_client }}", + "additional_options": "{\"cl_custom_image\":\"${{ inputs.cl_custom_image }}\", \"timeout\":\"${{ steps.extract_variables.outputs.timeout }}\", \"non_validator_mode\":${{ inputs.non_validator_mode }}, \"additional_nethermind_flags\":\"${{ inputs.additional_nethermind_flags }}\", \"additional_cl_flags\":\"${{ inputs.additional_cl_flags }}\", \"ssh_keys\":\"${{ steps.extract_variables.outputs.ssh_keys }}\", \"allowed_ips\":\"${{ steps.extract_variables.outputs.allowed_ips }}\"}" + }' - name: Wait for creation of node - id: wait-for-node-creation env: GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} WORKFLOW_ID: 'run-single-node.yml' From 49119837638a172190e17f75edf0981afc86887f Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Wed, 21 Jun 2023 13:58:32 +0100 Subject: [PATCH 053/202] Use better processing timer for logging (#5843) * Use different processing timer * Use single queue * Revert to simpler --- .../Nethermind.Consensus/Processing/ProcessingStats.cs | 2 +- src/Nethermind/Nethermind.Runner/NLog.config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs b/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs index 5d36900eb83..8885971466c 100644 --- a/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs +++ b/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs @@ -181,7 +181,7 @@ public void UpdateStats(Block? block, IBlockTree blockTreeCtx, int recoveryQueue // Only output the total throughput in debug mode if (_logger.IsDebug) { - _logger.Debug($"- Total throughput {totalMgasPerSecond,7:F2} MGas/s | {totalTxPerSecond,9:F2} t/s | {totalBlocksPerSecond,7:F2} Blk/s | Gas gwei: {Evm.Metrics.MinGasPrice:N2} .. {Math.Max(Evm.Metrics.MinGasPrice, Evm.Metrics.EstMedianGasPrice):N2} ({Evm.Metrics.AveGasPrice:N2}) .. {Evm.Metrics.MaxGasPrice:N2}"); + _logger.Debug($"- Total throughput {totalMgasPerSecond,7:F2} MGas/s | {totalTxPerSecond,9:F2} t/s | {totalBlocksPerSecond,7:F2} b/s | Gas gwei: {Evm.Metrics.MinGasPrice:N2} .. {Math.Max(Evm.Metrics.MinGasPrice, Evm.Metrics.EstMedianGasPrice):N2} ({Evm.Metrics.AveGasPrice:N2}) .. {Evm.Metrics.MaxGasPrice:N2}"); } if (_logger.IsTrace) diff --git a/src/Nethermind/Nethermind.Runner/NLog.config b/src/Nethermind/Nethermind.Runner/NLog.config index 5a51f937e3d..48c58e3230d 100644 --- a/src/Nethermind/Nethermind.Runner/NLog.config +++ b/src/Nethermind/Nethermind.Runner/NLog.config @@ -35,7 +35,7 @@ + foregroundColor="DarkGray" wholeWords="true" /> From 54c8ccb85046d7f5e697d70e65124039b3985bb1 Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Wed, 21 Jun 2023 20:19:41 +0100 Subject: [PATCH 054/202] Don't use DarkGray (#5849) --- .../Nethermind.Consensus/Processing/ProcessingStats.cs | 4 ++-- src/Nethermind/Nethermind.Runner/NLog.config | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs b/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs index 8885971466c..b9fda9e1435 100644 --- a/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs +++ b/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs @@ -176,8 +176,8 @@ public void UpdateStats(Block? block, IBlockTree blockTreeCtx, int recoveryQueue > 75 => whiteText, _ => "" }; - _logger.Info($"- Block{(chunkBlocks > 1 ? $"s {chunkBlocks,-9:N0}" : " ")}{(chunkBlocks == 1 ? mgasColor : "")} {chunkMGas,7:F2}{resetColor} MGas | {chunkTx,6:N0} txs | calls {callsColor}{chunkCalls,6:N0}{resetColor} {darkGreyText}({chunkEmptyCalls,3:N0}){resetColor} | sload {chunkSload,7:N0} | sstore {sstoreColor}{chunkSstore,6:N0}{resetColor} | create {createsColor}{chunkCreates,3:N0}{resetColor}{(currentSelfDestructs - _lastSelfDestructs > 0 ? $"{darkGreyText}({-(currentSelfDestructs - _lastSelfDestructs),3:N0}){resetColor}" : "")}"); - _logger.Info($"- Block throughput {mgasPerSecond,7:F2} MGas/s | {txps,9:F2} t/s | {bps,7:F2} Blk/s | recv {recoveryQueueSize,7:N0} | proc {blockQueueSize,6:N0}"); + _logger.Info($"- Block{(chunkBlocks > 1 ? "s" : " ")}{(chunkBlocks == 1 ? mgasColor : "")} {chunkMGas,7:F2}{resetColor} MGas | {chunkTx,6:N0} txs | calls {callsColor}{chunkCalls,6:N0}{resetColor} {darkGreyText}({chunkEmptyCalls,3:N0}){resetColor} | sload {chunkSload,7:N0} | sstore {sstoreColor}{chunkSstore,6:N0}{resetColor} | create {createsColor}{chunkCreates,3:N0}{resetColor}{(currentSelfDestructs - _lastSelfDestructs > 0 ? $"{darkGreyText}({-(currentSelfDestructs - _lastSelfDestructs),3:N0}){resetColor}" : "")}"); + _logger.Info($"- Block throughput {mgasPerSecond,7:F2} MGas/s | {txps,9:F2} t/s | {bps,7:F2} b/s | recv {recoveryQueueSize,7:N0} | proc {blockQueueSize,6:N0}"); // Only output the total throughput in debug mode if (_logger.IsDebug) { diff --git a/src/Nethermind/Nethermind.Runner/NLog.config b/src/Nethermind/Nethermind.Runner/NLog.config index 48c58e3230d..5a51f937e3d 100644 --- a/src/Nethermind/Nethermind.Runner/NLog.config +++ b/src/Nethermind/Nethermind.Runner/NLog.config @@ -35,7 +35,7 @@ + foregroundColor="Gray" wholeWords="true" /> From f69ff70f22a30a783ab52441883b26a4cb1a64aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Thu, 22 Jun 2023 19:48:41 +0200 Subject: [PATCH 055/202] Bump to 1.20.0-rc --- src/Nethermind/Directory.Build.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Nethermind/Directory.Build.props b/src/Nethermind/Directory.Build.props index e9129de653f..b09a50eba00 100644 --- a/src/Nethermind/Directory.Build.props +++ b/src/Nethermind/Directory.Build.props @@ -9,8 +9,8 @@ Demerzel Solutions Limited Nethermind $(Commit.Substring(0, 8)) - 1.23.0 - unstable + 1.20.0-rc + From 71f964f5acf29a54f1d246b7045eb8c199cfe8e7 Mon Sep 17 00:00:00 2001 From: Ruben Buniatyan Date: Thu, 29 Jun 2023 14:31:38 +0200 Subject: [PATCH 056/202] Update DotNetty feed (cherry picked from commit 3e330adcae80c3e5f4a907791cd0a0741355e455) --- src/Nethermind/Directory.Packages.props | 6 +++--- src/Nethermind/nuget.config | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Nethermind/Directory.Packages.props b/src/Nethermind/Directory.Packages.props index 32559d8eb16..44ad5a19a6c 100644 --- a/src/Nethermind/Directory.Packages.props +++ b/src/Nethermind/Directory.Packages.props @@ -42,9 +42,9 @@ - - - + + + diff --git a/src/Nethermind/nuget.config b/src/Nethermind/nuget.config index 84c8ccf735e..a4c5094636a 100644 --- a/src/Nethermind/nuget.config +++ b/src/Nethermind/nuget.config @@ -3,14 +3,14 @@ - + - + From 32287928f8ec2a64718bbab07bce25b118f60d4a Mon Sep 17 00:00:00 2001 From: Ruben Buniatyan Date: Tue, 4 Jul 2023 14:05:17 +0200 Subject: [PATCH 057/202] Update DotNetty package (cherry picked from commit 47a92ee5df310d55dbafa1fa97528ca6f59c9371) --- src/Nethermind/Directory.Packages.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Nethermind/Directory.Packages.props b/src/Nethermind/Directory.Packages.props index 44ad5a19a6c..9a2378d4c79 100644 --- a/src/Nethermind/Directory.Packages.props +++ b/src/Nethermind/Directory.Packages.props @@ -42,9 +42,9 @@ - - - + + + From c409761c1a79f4e32ea3af46b3f8dcf2a8582092 Mon Sep 17 00:00:00 2001 From: Marcin Sobczak Date: Tue, 20 Jun 2023 11:51:47 +0200 Subject: [PATCH 058/202] minor fixes --- src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs | 4 ++-- .../Nethermind.TxPool/TransactionExtensions.cs | 11 ----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index 6ad0f609cc9..c59b04aaa38 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -598,13 +598,13 @@ public void should_add_tx_if_cost_of_executing_all_txs_in_bucket_exceeds_balance } } - _txPool.GetPendingTransactionsCount().Should().Be(8); // nonces 0-6 and 8 + _txPool.GetPendingTransactions().Length.Should().Be(8); // nonces 0-6 and 8 _txPool.GetPendingTransactions().Last().Nonce.Should().Be(8); _txPool.SubmitTx(transactions[8], TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.AlreadyKnown); _txPool.SubmitTx(transactions[7], TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); - _txPool.GetPendingTransactionsCount().Should().Be(8); // nonces 0-7 - 8 was removed because of not enough balance + _txPool.GetPendingTransactions().Length.Should().Be(8); // nonces 0-7 - 8 was removed because of not enough balance _txPool.GetPendingTransactions().Last().Nonce.Should().Be(7); _txPool.GetPendingTransactions().Should().BeEquivalentTo(transactions.SkipLast(2)); } diff --git a/src/Nethermind/Nethermind.TxPool/TransactionExtensions.cs b/src/Nethermind/Nethermind.TxPool/TransactionExtensions.cs index 65102975786..6d734de72a9 100644 --- a/src/Nethermind/Nethermind.TxPool/TransactionExtensions.cs +++ b/src/Nethermind/Nethermind.TxPool/TransactionExtensions.cs @@ -78,18 +78,7 @@ internal static bool IsOverflowWhenAddingTxCostToCumulative(this Transaction tx, overflow |= UInt256.AddOverflow(currentCost, maxTxCost, out cumulativeCost); overflow |= UInt256.AddOverflow(cumulativeCost, tx.Value, out cumulativeCost); - if (tx.SupportsBlobs) - { - // if tx.SupportsBlobs and has BlobVersionedHashes = null, it will throw on earlier step of validation, in TxValidator - overflow |= UInt256.MultiplyOverflow(Eip4844Constants.GasPerBlob, (UInt256)tx.BlobVersionedHashes!.Length, out UInt256 blobGas); - overflow |= UInt256.MultiplyOverflow(blobGas, tx.MaxFeePerBlobGas ?? UInt256.MaxValue, out UInt256 blobGasCost); - overflow |= UInt256.AddOverflow(cumulativeCost, blobGasCost, out cumulativeCost); - } - return overflow; } - - internal static bool IsOverflowInTxCostAndValue(this Transaction tx, out UInt256 txCost) - => IsOverflowWhenAddingTxCostToCumulative(tx, UInt256.Zero, out txCost); } } From e96d1c8aef3ac372918f64a56f94977e25c770de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Fri, 14 Jul 2023 12:28:12 +0200 Subject: [PATCH 059/202] Update version to 1.20.0 --- src/Nethermind/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nethermind/Directory.Build.props b/src/Nethermind/Directory.Build.props index b09a50eba00..66f05f5aceb 100644 --- a/src/Nethermind/Directory.Build.props +++ b/src/Nethermind/Directory.Build.props @@ -9,7 +9,7 @@ Demerzel Solutions Limited Nethermind $(Commit.Substring(0, 8)) - 1.20.0-rc + 1.20.0 From b7d39a4d42d8696cba62156481c04acee4c35161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 17 Jul 2023 17:54:48 +0200 Subject: [PATCH 060/202] Bump to 1.20.1 --- src/Nethermind/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nethermind/Directory.Build.props b/src/Nethermind/Directory.Build.props index 66f05f5aceb..f7dd5f65268 100644 --- a/src/Nethermind/Directory.Build.props +++ b/src/Nethermind/Directory.Build.props @@ -9,7 +9,7 @@ Demerzel Solutions Limited Nethermind $(Commit.Substring(0, 8)) - 1.20.0 + 1.20.1 From c137daf79bf264df7ad2a043577374dddfa96368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Thu, 20 Jul 2023 10:44:27 +0200 Subject: [PATCH 061/202] Add workflow to compare rpcs Fix path Run on push temporarily Fix file path Fix inputs and missing vars All fields not required Inherit secrets when calling run-a-single-node-from-branch Add default for cl_client Use base_tag generated by run-a-single-node Download artifacts from other post-merge-smoke-tests Remove the old download-artifact Change the name of token secret Remove usage of external action Allow to specify smoke tests branch to use Remove additional option to fit dispatch limit fix: wrong inputs string format Export run id Fix rpc url Fix debug Add runner's ip to `allowed_ips` Maximum 10 inputs is allowed in workflow_dispatch Add allowed_ips to workflow_dispatch inputs Try to join two ips Print `,` conditionally Update public-ip Debug Use VPN Add wireguard.conf Fix location Checkout the repository before installing wireguard Update wireguard.conf to match nethermind repo secrets Update environment variables to match secrets Install flood before wireguard Use include in matrix to specify both name and address Revert "Use include in matrix to specify both name and address" This reverts commit 71caa0cadb041f12c5e191bc82afe699ab70a303. --- .github/workflows/rpc-comparison.yaml | 78 ++++++++ .../run-a-single-node-from-branch.yml | 178 +++++++++++++----- .gitignore | 1 + scripts/wait-for-workflow-completed.sh | 2 + scripts/wireguard.conf.template | 10 + 5 files changed, 218 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/rpc-comparison.yaml create mode 100644 scripts/wireguard.conf.template diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml new file mode 100644 index 00000000000..234c0c4fe21 --- /dev/null +++ b/.github/workflows/rpc-comparison.yaml @@ -0,0 +1,78 @@ +name: '[JSON-RPC] Compare Nethermind between clients and versions' + +on: + push: + branches: + - 'rpc-comparison-testing' + workflow_dispatch: + inputs: + allowed_ips: + type: string + description: "A comma-separated list of ips allowed to connect to the node" + default: '' + required: false + +jobs: + + create_node: + name: Create node from current branch + uses: ./.github/workflows/run-a-single-node-from-branch.yml + secrets: inherit + with: + allowed_ips: ${{ inputs.allowed_ips }} + + extract_rpc_url: + name: Extract RPC url from artifacts generated by create_node + runs-on: ubuntu-latest + needs: create_node + outputs: + rpc_url: ${{ steps.extract_rpc_url.outputs.rpc_url }} + steps: + - name: Download artifact + id: download-artifact + uses: dawidd6/action-download-artifact@v2 + with: + github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} + run_id: ${{ needs.create_node.outputs.run_id }} + name: "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" + repo: NethermindEth/post-merge-smoke-tests + + - run: echo "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" + - run: echo "${{ github.actor }}-${{ needs.create_node.outputs.rpc_url }}-smoketests" + + - name: Get RPC url to the newly created node + id: extract_rpc_url + run: echo "rpc_url=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT + + compare: + name: Compare JSON-RPC responses between clients and versions + runs-on: ubuntu-latest + needs: extract_rpc_url + strategy: + matrix: + rpc_to_compare: [INFURA_ENDPOINT, NETHERMIND_ARCHIVE_ENDPOINT] + steps: + - uses: actions/checkout@v3 + - name: Install flood + run: pip install git+https://github.com/piwonskp/flood.git + + - name: Install WireGuard + run: | + sudo apt update + sudo apt install -y wireguard resolvconf + sudo mkdir -p /etc/wireguard + envsubst < scripts/wireguard.conf.template > wg0.conf + sudo wg-quick up ./wg0.conf + env: + WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Test equality of responses + run: flood all nethermind_current=${{ needs.extract_rpc_url.outputs.rpc_url }} ${{ matrix.rpc_to_compare }}=${{ secrets[matrix.rpc_to_compare] }} --equality + diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 79d37bd69c5..97d2f60d817 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -53,9 +53,82 @@ on: description: "Provide any additional flags to the CL client in space-separated format. Example: \"clflag1=1 clflag2=2\"." default: "" required: false - additional_options: - description: "A Json property which allows to customize node even more" - default: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":""}' + ssh_keys: + description: "SSH Keys to be installed in the smoke test nodes (separated by commas without space in-between commas) for example: key1,key2,key3" + default: "" + required: false + smoke_tests_ref: + description: "Ref of the smoke tests repository to be used for smoke tests" + default: "main" + workflow_call: + inputs: + smoke_tests_ref: + description: "Ref of the smoke tests repository to be used for smoke tests" + default: "main" + required: false + type: string + network: + description: "Select a network on which You want to run a node" + default: "mainnet" + required: false + type: string + cl_client: + description: "Select Consensus Layer Client to run node against" + default: "lighthouse" + required: false + type: string + cl_custom_image: + description: "In case of need to run non-default cl image (different than actually supported by Sedge) put it in there" + default: "" + required: false + type: string + config: + description: "Select a config file which will be selected for tests." + default: "default.json" + required: false + type: string + non_validator_mode: + description: "If checked, node will be started in NonValidator mode (OldBodies and oldReceipts will not be synced)" + default: true + type: boolean + timeout: + description: "Timeout in hours before triggering the deletion of smoke test instances. Maximum time of node lifetime can be 72 hours." + default: "24" + required: false + type: string + volume: + description: "In case custom volume size needs to be applied, put value in GB here)" + required: false + default: "" + type: string + additional_nethermind_flags: + type: string + description: "Provide any additional flags to the Nethermind in space-separated format. Example: \"JsonRpc.Enabled=false Sync.SnapSync=false\"." + default: "" + required: false + additional_cl_flags: + type: string + description: "Provide any additional flags to the CL client in space-separated format. Example: \"clflag1=1 clflag2=2\"." + default: "" + required: false + ssh_keys: + type: string + description: "SSH Keys to be installed in the smoke test nodes (separated by commas without space in-between commas) for example: key1,key2,key3" + default: "" + required: false + allowed_ips: + type: string + description: "A comma-separated list of ips allowed to connect to the node" + default: "" + required: false + outputs: + base_tag: + description: "" + value: ${{ jobs.create_docker_image.outputs.base_tag }} + run_id: + description: "" + value: ${{ jobs.trigger_node_and_vm_creation.outputs.run_id }} + jobs: create_docker_image: @@ -64,7 +137,7 @@ jobs: base_tag: ${{ steps.set-base-tag.outputs.base_tag }} steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Prepare docker tag id: prepare_ref @@ -88,41 +161,28 @@ jobs: - name: Extract dockerfile from additional_options id: extract_dockerfile run: | - echo "dockerfile=$(echo '${{ inputs.additional_options }}' | jq -r .default_dockerfile)" >> $GITHUB_OUTPUT - echo "build-config=$(echo '${{ inputs.additional_options }}' | jq -r .default_dockerfile_build_type | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + echo "REPO=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + + - name: Trigger Docker Build Action with Cleaned Ref + run: | + echo $INPUTS | gh workflow run $WORKFLOW_ID --ref $WORKFLOW_REF --json + env: + WORKFLOW_ID: 'build-nethermind-docker-images.yml' + WORKFLOW_REF: ${{ github.ref }} + GITHUB_USER: ${{ secrets.REPOSITORY_DISPATCH_USER }} + GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} + INPUTS: > + { + "repo": "${{ env.REPO }}", + "tag": "${{ env.CLEAN_REF }}", + "dockerfile": "Dockerfile" + } - name: Set Repo and Org Variables run: | - echo "ORG_NAME=${{ github.repository_owner }}" >> $GITHUB_ENV - echo "REPO_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV - - - name: Check if master branch and default additional_options - id: check_conditions - run: | - if - [[ "${{ github.ref }}" == "refs/heads/master" ]] && - [[ "${{ steps.extract_dockerfile.outputs.dockerfile }}" == "Dockerfile" ]] && - [[ "${{ steps.extract_dockerfile.outputs.build-config }}" == "release" ]]; then - echo "skip_docker_build=true" >> $GITHUB_OUTPUT - else - echo "skip_docker_build=false" >> $GITHUB_OUTPUT - fi + echo "ORG_NAME=$(echo $GITHUB_REPOSITORY | cut -d / -f 1)" >> $GITHUB_ENV + echo "REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d / -f 2)" >> $GITHUB_ENV - - name: Trigger Docker Build Action with Cleaned Ref - if: steps.check_conditions.outputs.skip_docker_build != 'true' - uses: benc-uk/workflow-dispatch@v1 - env: - ADDITIONAL_OPTIONS: ${{ inputs.additional_options }} - with: - workflow: publish-docker.yml - ref: "${{ github.ref }}" - token: "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" - inputs: '{ - "tag": "${{ env.CLEAN_REF }}", - "dockerfile": "${{ steps.extract_dockerfile.outputs.dockerfile }}", - "build-config": "${{ steps.extract_dockerfile.outputs.build-config }}" - }' - - name: Wait for Docker Build Action to complete if: steps.check_conditions.outputs.skip_docker_build != 'true' env: @@ -142,9 +202,11 @@ jobs: trigger_node_and_vm_creation: needs: create_docker_image runs-on: ubuntu-latest + outputs: + run_id: ${{ steps.wait-for-node-creation.outputs.run_id }} steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Prepare docker tag id: prepare_ref @@ -163,23 +225,37 @@ jobs: echo "allowed_ips=$(echo '${{ inputs.additional_options }}' | jq -r .allowed_ips)" >> $GITHUB_OUTPUT - name: Trigger Node creation Repo Action - uses: benc-uk/workflow-dispatch@v1 - with: - workflow: run-single-node.yml - repo: NethermindEth/post-merge-smoke-tests - ref: "main" - token: "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" - inputs: '{ - "github_username": "${{ github.actor }}", - "base_tag": "${{ env.BASE_TAG }}", - "config_file": "${{ inputs.config }}", - "nethermind_branch": "${{ env.CLEAN_REF }}", - "network": "${{ inputs.network }}", - "cl_client": "${{ inputs.cl_client }}", - "additional_options": "{\"cl_custom_image\":\"${{ inputs.cl_custom_image }}\", \"timeout\":\"${{ steps.extract_variables.outputs.timeout }}\", \"non_validator_mode\":${{ inputs.non_validator_mode }}, \"additional_nethermind_flags\":\"${{ inputs.additional_nethermind_flags }}\", \"additional_cl_flags\":\"${{ inputs.additional_cl_flags }}\", \"ssh_keys\":\"${{ steps.extract_variables.outputs.ssh_keys }}\", \"allowed_ips\":\"${{ steps.extract_variables.outputs.allowed_ips }}\"}" - }' + run: | + echo $INPUTS | gh -R $WORKFLOW_REPO workflow run $WORKFLOW_ID --ref $WORKFLOW_REF --json + env: + WORKFLOW_ID: 'run-single-node.yml' + WORKFLOW_REF: main + WORKFLOW_REPO: NethermindEth/post-merge-smoke-tests + GITHUB_USER: ${{ secrets.REPOSITORY_DISPATCH_USER }} + GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} + INPUTS: > + { + "github_username": "${{ github.actor }}", + "base_tag": "${{ env.BASE_TAG }}", + "config_file": "${{ inputs.config }}", + "nethermind_branch": "${{ env.CLEAN_REF }}", + "network": "${{ inputs.network }}", + "cl_client": "${{ inputs.cl_client }}", + "additional_options": + "{ + \"cl_custom_image\":\"${{ inputs.cl_custom_image }}\", + \"timeout\":\"${{ inputs.timeout }}\", + \"non_validator_mode\":\"${{ inputs.non_validator_mode }}\", + \"volume_size\":\"${{ inputs.volume }}\", + \"additional_nethermind_flags\":\"${{ inputs.additional_nethermind_flags }}\", + \"additional_cl_flags\":\"${{ inputs.additional_cl_flags }}\", + \"ssh_keys\":\"${{ inputs.ssh_keys }}\", + \"allowed_ips\":\"${{ inputs.allowed_ips }}\" + }" + } - name: Wait for creation of node + id: wait-for-node-creation env: GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} WORKFLOW_ID: 'run-single-node.yml' diff --git a/.gitignore b/.gitignore index 786949cd2cf..7c30a7bf11e 100644 --- a/.gitignore +++ b/.gitignore @@ -409,3 +409,4 @@ src/Nethermind/Nethermind.BeaconNode.Host/release src/Nethermind/Nethermind.Runner/git-hash keystore/ /.githooks +.vscode diff --git a/scripts/wait-for-workflow-completed.sh b/scripts/wait-for-workflow-completed.sh index 37bcc0d0870..dad6f3677ce 100644 --- a/scripts/wait-for-workflow-completed.sh +++ b/scripts/wait-for-workflow-completed.sh @@ -75,6 +75,8 @@ while true; do exit 1 else echo "✅ The workflow completed successfully! Exiting." + echo "👀 Check workflow details at: https://github.com/${ORG_NAME}/${REPO_NAME}/actions/runs/$run_id" + echo "run_id=$run_id" >> $GITHUB_OUTPUT break fi fi diff --git a/scripts/wireguard.conf.template b/scripts/wireguard.conf.template new file mode 100644 index 00000000000..4d8bce58fca --- /dev/null +++ b/scripts/wireguard.conf.template @@ -0,0 +1,10 @@ +[Interface] +PrivateKey = ${WIREGUARD_PRIVKEY} +Address = ${WIREGUARD_ADDRESS} +DNS = ${WIREGUARD_DNS} + +[Peer] +PublicKey = ${WIREGUARD_PUBKEY} +PresharedKey = ${WIREGUARD_PRESHAREDKEY} +AllowedIPs = ${WIREGUARD_ALLOWED_IPS} +Endpoint = ${WIREGUARD_SERVER_IP}:${WIREGUARD_SERVER_PORT} From 631aee3a6815656a58efd82b0e26988df67c0d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Tue, 8 Aug 2023 18:01:54 +0200 Subject: [PATCH 062/202] Trigger workflow? --- .github/workflows/rpc-comparison.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 234c0c4fe21..4d2a50191af 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -13,7 +13,6 @@ on: required: false jobs: - create_node: name: Create node from current branch uses: ./.github/workflows/run-a-single-node-from-branch.yml From a6576b18d8bcbf075562a529257e952706593519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Tue, 8 Aug 2023 18:11:32 +0200 Subject: [PATCH 063/202] Fix run-a-single-node-from-branch.yml --- .github/workflows/run-a-single-node-from-branch.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 97d2f60d817..57174a3912a 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -57,9 +57,6 @@ on: description: "SSH Keys to be installed in the smoke test nodes (separated by commas without space in-between commas) for example: key1,key2,key3" default: "" required: false - smoke_tests_ref: - description: "Ref of the smoke tests repository to be used for smoke tests" - default: "main" workflow_call: inputs: smoke_tests_ref: From ffc0c53e495e5289c37d85e8731320bd09035f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Wed, 9 Aug 2023 11:39:27 +0200 Subject: [PATCH 064/202] Update branch name --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 4d2a50191af..bd4ba309ad2 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -3,7 +3,7 @@ name: '[JSON-RPC] Compare Nethermind between clients and versions' on: push: branches: - - 'rpc-comparison-testing' + - 'rpc-comparison-testing-v1.20.1' workflow_dispatch: inputs: allowed_ips: From e4d6f9271a021c329ab9d9e3d1b5d0f51aabfa46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Wed, 9 Aug 2023 17:48:20 +0200 Subject: [PATCH 065/202] Wait for the node to sync --- .github/workflows/rpc-comparison.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index bd4ba309ad2..1b93d7ca163 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -71,7 +71,11 @@ jobs: WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Wait for the node to sync + run: | + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' ${{ needs.extract_rpc_url.outputs.rpc_url }} | jq -e '.result' + do sleep 300; done - name: Test equality of responses run: flood all nethermind_current=${{ needs.extract_rpc_url.outputs.rpc_url }} ${{ matrix.rpc_to_compare }}=${{ secrets[matrix.rpc_to_compare] }} --equality - From 488df0a863e2f01cb903ad597909dec6b8d7b6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Tue, 15 Aug 2023 12:27:29 +0200 Subject: [PATCH 066/202] Add a separate job to wait for node sync --- .github/workflows/rpc-comparison.yaml | 36 +++++++++++++++++++++------ 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 1b93d7ca163..2ab16447f36 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -42,11 +42,38 @@ jobs: - name: Get RPC url to the newly created node id: extract_rpc_url run: echo "rpc_url=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT + + wait_for_node_to_sync: + name: Wait for the node to sync + runs-on: ubuntu-latest + needs: extract_rpc_url + steps: + - name: Install WireGuard + run: | + sudo apt update + sudo apt install -y wireguard resolvconf + sudo mkdir -p /etc/wireguard + envsubst < scripts/wireguard.conf.template > wg0.conf + sudo wg-quick up ./wg0.conf + env: + WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Wait for the node to sync + run: | + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' ${{ needs.extract_rpc_url.outputs.rpc_url }} | jq -e '.result' + do sleep 300; done compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - needs: extract_rpc_url + needs: [extract_rpc_url, wait_for_node_to_sync] strategy: matrix: rpc_to_compare: [INFURA_ENDPOINT, NETHERMIND_ARCHIVE_ENDPOINT] @@ -71,11 +98,6 @@ jobs: WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - - - name: Wait for the node to sync - run: | - while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' ${{ needs.extract_rpc_url.outputs.rpc_url }} | jq -e '.result' - do sleep 300; done - + - name: Test equality of responses run: flood all nethermind_current=${{ needs.extract_rpc_url.outputs.rpc_url }} ${{ matrix.rpc_to_compare }}=${{ secrets[matrix.rpc_to_compare] }} --equality From e2057f83023e263c96620b7414f467edf1722d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Tue, 15 Aug 2023 13:15:32 +0200 Subject: [PATCH 067/202] Fix missing checkout --- .github/workflows/rpc-comparison.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 2ab16447f36..d216077b062 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -47,7 +47,8 @@ jobs: name: Wait for the node to sync runs-on: ubuntu-latest needs: extract_rpc_url - steps: + steps: + - uses: actions/checkout@v3 - name: Install WireGuard run: | sudo apt update From 507ecd726b5f7503109315365ce794fbbcd29210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Thu, 17 Aug 2023 12:09:35 +0200 Subject: [PATCH 068/202] Use validator mode and set Pruning to None --- .github/workflows/rpc-comparison.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index d216077b062..059156db59b 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -19,6 +19,8 @@ jobs: secrets: inherit with: allowed_ips: ${{ inputs.allowed_ips }} + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None extract_rpc_url: name: Extract RPC url from artifacts generated by create_node From 84222b7afd819414bce033f4cc7af05c97993b3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Fri, 18 Aug 2023 11:19:08 +0200 Subject: [PATCH 069/202] Increase timeout of wait to sync to 10 hours --- .github/workflows/rpc-comparison.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 059156db59b..f25b1fafeec 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -49,6 +49,7 @@ jobs: name: Wait for the node to sync runs-on: ubuntu-latest needs: extract_rpc_url + timeout-minutes: 600 steps: - uses: actions/checkout@v3 - name: Install WireGuard From 70e5963b7ca391fe8446f32997bb833b1857a982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Fri, 18 Aug 2023 18:12:42 +0200 Subject: [PATCH 070/202] Change step timeout as well --- .github/workflows/rpc-comparison.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index f25b1fafeec..6d1c9d1df7e 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -70,6 +70,7 @@ jobs: WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - name: Wait for the node to sync + timeout-minutes: 600 run: | while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' ${{ needs.extract_rpc_url.outputs.rpc_url }} | jq -e '.result' do sleep 300; done From 4d996bf935a18bb3e05bfdcfc5d10c34816ff650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Mon, 21 Aug 2023 13:17:15 +0200 Subject: [PATCH 071/202] Wait 5.5h before running `wait_for_node_to_sync` For github hosted runners time limit for a job is 6 hours. It is less than a node needs to sync. Thus we wait 5.5 hours before checking the sync status of node. --- .github/workflows/rpc-comparison.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 6d1c9d1df7e..e36ebb0fa0e 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -44,11 +44,18 @@ jobs: - name: Get RPC url to the newly created node id: extract_rpc_url run: echo "rpc_url=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT - + + sleep: + name: Sleep since syncing lasts longer than 6 hours (time limit for a job) + runs-on: ubuntu-latest + needs: extract_rpc_url + steps: + - run: sleep 5h 30m + wait_for_node_to_sync: name: Wait for the node to sync runs-on: ubuntu-latest - needs: extract_rpc_url + needs: sleep timeout-minutes: 600 steps: - uses: actions/checkout@v3 From 4ca6c94add44b70d82cbcefc721fa272d60ab978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Tue, 22 Aug 2023 11:00:27 +0200 Subject: [PATCH 072/202] Fix needs --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index e36ebb0fa0e..84f8051ef3a 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -55,7 +55,7 @@ jobs: wait_for_node_to_sync: name: Wait for the node to sync runs-on: ubuntu-latest - needs: sleep + needs: [sleep, extract_rpc_url] timeout-minutes: 600 steps: - uses: actions/checkout@v3 From 37f2aa40d05ff7e30223475c5c1bb66dd3019eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Wed, 23 Aug 2023 11:41:44 +0200 Subject: [PATCH 073/202] Wait another 5.5h --- .github/workflows/rpc-comparison.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 84f8051ef3a..1d0512c3760 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -51,11 +51,17 @@ jobs: needs: extract_rpc_url steps: - run: sleep 5h 30m + sleep2: + name: Sleep since syncing lasts longer than 6 hours (time limit for a job) + runs-on: ubuntu-latest + needs: sleep + steps: + - run: sleep 5h 30m wait_for_node_to_sync: name: Wait for the node to sync runs-on: ubuntu-latest - needs: [sleep, extract_rpc_url] + needs: [sleep2, extract_rpc_url] timeout-minutes: 600 steps: - uses: actions/checkout@v3 From 4dece6240f0467d7649be0f9fa4a819586eb3e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Thu, 24 Aug 2023 10:10:15 +0200 Subject: [PATCH 074/202] Fix indentation --- .github/workflows/rpc-comparison.yaml | 96 +++++++++++++-------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 1d0512c3760..98ae16c5756 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -50,13 +50,13 @@ jobs: runs-on: ubuntu-latest needs: extract_rpc_url steps: - - run: sleep 5h 30m + - run: sleep 5h 30m sleep2: name: Sleep since syncing lasts longer than 6 hours (time limit for a job) runs-on: ubuntu-latest needs: sleep steps: - - run: sleep 5h 30m + - run: sleep 5h 30m wait_for_node_to_sync: name: Wait for the node to sync @@ -64,29 +64,29 @@ jobs: needs: [sleep2, extract_rpc_url] timeout-minutes: 600 steps: - - uses: actions/checkout@v3 - - name: Install WireGuard - run: | - sudo apt update - sudo apt install -y wireguard resolvconf - sudo mkdir -p /etc/wireguard - envsubst < scripts/wireguard.conf.template > wg0.conf - sudo wg-quick up ./wg0.conf - env: - WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' - WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' - WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' - WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' - WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' - WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' - WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' - WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - - - name: Wait for the node to sync - timeout-minutes: 600 - run: | - while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' ${{ needs.extract_rpc_url.outputs.rpc_url }} | jq -e '.result' - do sleep 300; done + - uses: actions/checkout@v3 + - name: Install WireGuard + run: | + sudo apt update + sudo apt install -y wireguard resolvconf + sudo mkdir -p /etc/wireguard + envsubst < scripts/wireguard.conf.template > wg0.conf + sudo wg-quick up ./wg0.conf + env: + WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Wait for the node to sync + timeout-minutes: 600 + run: | + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' ${{ needs.extract_rpc_url.outputs.rpc_url }} | jq -e '.result' + do sleep 300; done compare: name: Compare JSON-RPC responses between clients and versions @@ -96,26 +96,26 @@ jobs: matrix: rpc_to_compare: [INFURA_ENDPOINT, NETHERMIND_ARCHIVE_ENDPOINT] steps: - - uses: actions/checkout@v3 - - name: Install flood - run: pip install git+https://github.com/piwonskp/flood.git - - - name: Install WireGuard - run: | - sudo apt update - sudo apt install -y wireguard resolvconf - sudo mkdir -p /etc/wireguard - envsubst < scripts/wireguard.conf.template > wg0.conf - sudo wg-quick up ./wg0.conf - env: - WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' - WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' - WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' - WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' - WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' - WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' - WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' - WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - - - name: Test equality of responses - run: flood all nethermind_current=${{ needs.extract_rpc_url.outputs.rpc_url }} ${{ matrix.rpc_to_compare }}=${{ secrets[matrix.rpc_to_compare] }} --equality + - uses: actions/checkout@v3 + - name: Install flood + run: pip install git+https://github.com/piwonskp/flood.git + + - name: Install WireGuard + run: | + sudo apt update + sudo apt install -y wireguard resolvconf + sudo mkdir -p /etc/wireguard + envsubst < scripts/wireguard.conf.template > wg0.conf + sudo wg-quick up ./wg0.conf + env: + WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Test equality of responses + run: flood all nethermind_current=${{ needs.extract_rpc_url.outputs.rpc_url }} ${{ matrix.rpc_to_compare }}=${{ secrets[matrix.rpc_to_compare] }} --equality From 538bf3e88462a12e3fad59728a9e8211f31ebb05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Fri, 25 Aug 2023 11:37:39 +0200 Subject: [PATCH 075/202] Remove sleep2 --- .github/workflows/rpc-comparison.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 98ae16c5756..c33007382d7 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -51,17 +51,11 @@ jobs: needs: extract_rpc_url steps: - run: sleep 5h 30m - sleep2: - name: Sleep since syncing lasts longer than 6 hours (time limit for a job) - runs-on: ubuntu-latest - needs: sleep - steps: - - run: sleep 5h 30m wait_for_node_to_sync: name: Wait for the node to sync runs-on: ubuntu-latest - needs: [sleep2, extract_rpc_url] + needs: [sleep, extract_rpc_url] timeout-minutes: 600 steps: - uses: actions/checkout@v3 From b1595c152c09a3c7b893911d3c3597c0a52ea5c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Piwo=C5=84ski?= Date: Fri, 25 Aug 2023 11:38:49 +0200 Subject: [PATCH 076/202] Remove debug info --- .github/workflows/rpc-comparison.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index c33007382d7..1ce515db4b4 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -38,9 +38,6 @@ jobs: name: "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" repo: NethermindEth/post-merge-smoke-tests - - run: echo "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" - - run: echo "${{ github.actor }}-${{ needs.create_node.outputs.rpc_url }}-smoketests" - - name: Get RPC url to the newly created node id: extract_rpc_url run: echo "rpc_url=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT From 6a25987ea14e2d411c6971b235127461d389ed8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 21:40:05 +0100 Subject: [PATCH 077/202] Change approach to multi nodes --- .github/workflows/rpc-comparison.yaml | 106 ++++++++++++++++++++------ 1 file changed, 82 insertions(+), 24 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 1ce515db4b4..52c58f8ff1c 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -3,7 +3,7 @@ name: '[JSON-RPC] Compare Nethermind between clients and versions' on: push: branches: - - 'rpc-comparison-testing-v1.20.1' + - 'rpc-comparison-1.23.0' workflow_dispatch: inputs: allowed_ips: @@ -11,36 +11,76 @@ on: description: "A comma-separated list of ips allowed to connect to the node" default: '' required: false + what_to_compare: + type: string + description: "A space-separated list of clients/branches. If "infura" then current branch to infura will be compared. If two nethermind branches, then two version will be compared." + default: "infura" + required: true jobs: - create_node: - name: Create node from current branch - uses: ./.github/workflows/run-a-single-node-from-branch.yml - secrets: inherit - with: - allowed_ips: ${{ inputs.allowed_ips }} - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None + parse_input: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Set matrix for branches + id: set-matrix + run: | + what_to_compare="${{ github.event.inputs.what_to_compare }}" + if [[ "$what_to_compare" == "infura" ]]; then + # Extract the current branch name from GITHUB_REF + current_branch=${GITHUB_REF#refs/heads/} + branches=("$current_branch") + else + # Split the input into an array + IFS=' ' read -r -a branches <<< "$what_to_compare" + fi + echo "matrix=${branches}" >> $GITHUB_OUTPUT + + create_node: + needs: parse_input + runs-on: ubuntu-latest + strategy: + matrix: + branch: ${{fromJson(needs.parse_input.outputs.matrix)}} + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: ${{ matrix.branch }} + - name: Run create_node job + uses: ./.github/workflows/run-a-single-node-from-branch.yml + with: + allowed_ips: ${{ github.event.inputs.allowed_ips }} + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None extract_rpc_url: name: Extract RPC url from artifacts generated by create_node runs-on: ubuntu-latest needs: create_node outputs: - rpc_url: ${{ steps.extract_rpc_url.outputs.rpc_url }} + rpc_urls: ${{ steps.aggregate_rpc_urls.outputs.rpc_urls }} steps: - - name: Download artifact - id: download-artifact - uses: dawidd6/action-download-artifact@v2 - with: - github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - run_id: ${{ needs.create_node.outputs.run_id }} - name: "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" - repo: NethermindEth/post-merge-smoke-tests + - name: Checkout code + uses: actions/checkout@v2 - - name: Get RPC url to the newly created node - id: extract_rpc_url - run: echo "rpc_url=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT + - name: Extract RPC URLs + id: aggregate_rpc_urls + run: | + rpc_urls="" + for matrix_val in ${{ fromJson(needs.create_node.result) }} + do + artifact_name="${{ github.actor }}-${matrix_val}-${{ needs.create_node.outputs.base_tag }}-smoketests" + echo "Downloading artifact: $artifact_name" + wget -O artifact.zip --header='Authorization: token ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}' \ + "https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/artifacts/$artifact_name/zip" + unzip artifact.zip + rpc_url=$(cat ./terraform.tfstate | jq -r '.outputs.nodes_data.value[0].rpc_url') + rpc_urls="$rpc_urls$rpc_url," + rm -rf artifact.zip terraform.tfstate + done + echo "rpc_urls=${rpc_urls%?}" >> $GITHUB_OUTPUT sleep: name: Sleep since syncing lasts longer than 6 hours (time limit for a job) @@ -73,11 +113,29 @@ jobs: WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - - name: Wait for the node to sync + - name: Wait for the nodes to sync timeout-minutes: 600 run: | - while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' ${{ needs.extract_rpc_url.outputs.rpc_url }} | jq -e '.result' - do sleep 300; done + rpc_urls=(${{ needs.extract_rpc_url.outputs.rpc_urls }}) + sync_complete_flag=0 + + check_sync() { + rpc_url=$1 + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' $rpc_url | jq -e '.result'; do + sleep 300 + done + echo "Node at $rpc_url synced." + sync_complete_flag=$((sync_complete_flag+1)) + } + + for url in "${rpc_urls[@]}"; do + check_sync "$url" & + done + + # Wait for all nodes to sync + while [ $sync_complete_flag -ne ${#rpc_urls[@]} ]; do + sleep 60 + done compare: name: Compare JSON-RPC responses between clients and versions From f2c0ea58f3f69e034d217f1809deddca2609f06f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 21:43:20 +0100 Subject: [PATCH 078/202] Fix branch name for trigger --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 52c58f8ff1c..629715395b1 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -3,7 +3,7 @@ name: '[JSON-RPC] Compare Nethermind between clients and versions' on: push: branches: - - 'rpc-comparison-1.23.0' + - 'rpc-comparision-1.23.0' workflow_dispatch: inputs: allowed_ips: From 8f7bbe9d8594e7c8f4375da9889ba8be95a7990d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= <43241881+kamilchodola@users.noreply.github.com> Date: Tue, 28 Nov 2023 21:42:41 +0100 Subject: [PATCH 079/202] Fix desc --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 629715395b1..b50e0019993 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -13,7 +13,7 @@ on: required: false what_to_compare: type: string - description: "A space-separated list of clients/branches. If "infura" then current branch to infura will be compared. If two nethermind branches, then two version will be compared." + description: "A space-separated list of clients/branches. If 'infura' then current branch to infura will be compared. If two nethermind branches, then two version will be compared." default: "infura" required: true From 9cb1f6d0f4a3c55966b38218a4d0f75d61c36f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 21:44:29 +0100 Subject: [PATCH 080/202] Add logs --- .github/workflows/rpc-comparison.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index b50e0019993..b81643ac5c6 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -35,6 +35,7 @@ jobs: # Split the input into an array IFS=' ' read -r -a branches <<< "$what_to_compare" fi + echo ${branches} echo "matrix=${branches}" >> $GITHUB_OUTPUT create_node: From 52d173cdb496f8434bbd89c9418d40fdd145327e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 21:46:20 +0100 Subject: [PATCH 081/202] Add hardcoded value --- .github/workflows/rpc-comparison.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index b81643ac5c6..b4532f6ce99 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -26,7 +26,8 @@ jobs: - name: Set matrix for branches id: set-matrix run: | - what_to_compare="${{ github.event.inputs.what_to_compare }}" + # what_to_compare="${{ github.event.inputs.what_to_compare }}" + what_to_compare="infura" if [[ "$what_to_compare" == "infura" ]]; then # Extract the current branch name from GITHUB_REF current_branch=${GITHUB_REF#refs/heads/} From 11065a407c5ed48f50c1dc0783b6b006e1569fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:01:45 +0100 Subject: [PATCH 082/202] Fix matrix --- .github/workflows/rpc-comparison.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index b4532f6ce99..f269529c2c5 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -36,15 +36,15 @@ jobs: # Split the input into an array IFS=' ' read -r -a branches <<< "$what_to_compare" fi - echo ${branches} - echo "matrix=${branches}" >> $GITHUB_OUTPUT + printf -v joined ',"%s"' "${branches[@]}" + json_array="[${joined:1}]" + echo "matrix=$json_array" >> $GITHUB_OUTPUT create_node: needs: parse_input runs-on: ubuntu-latest strategy: - matrix: - branch: ${{fromJson(needs.parse_input.outputs.matrix)}} + matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} steps: - name: Checkout code uses: actions/checkout@v2 From 92fa043ba521f0b861ac2f0b7847ba884766a640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:13:02 +0100 Subject: [PATCH 083/202] Change matrix approach --- .github/workflows/rpc-comparison.yaml | 49 +++++++++++++++++++++------ 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index f269529c2c5..47eb269dea2 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -13,9 +13,14 @@ on: required: false what_to_compare: type: string - description: "A space-separated list of clients/branches. If 'infura' then current branch to infura will be compared. If two nethermind branches, then two version will be compared." - default: "infura" - required: true + description: "A space-separated list of branches. If empty, then selected branch will be used. If multiple specified, those will be compared to themselves." + default: "" + required: false + compare_with: + type: string + description: "A space-separated list of additional comparers. If empty, then nothing else will be added to comparision. Possible options: 'infura', 'archive', 'feature/branch'" + default: "" + required: false jobs: parse_input: @@ -23,22 +28,44 @@ jobs: outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: + - name: Install jq + run: sudo apt-get install jq + - name: Set matrix for branches id: set-matrix run: | - # what_to_compare="${{ github.event.inputs.what_to_compare }}" - what_to_compare="infura" - if [[ "$what_to_compare" == "infura" ]]; then - # Extract the current branch name from GITHUB_REF + #what_to_compare="${{ github.event.inputs.what_to_compare }}" + #compare_with="${{ github.event.inputs.compare_with }}" + + what_to_compare="" + compare_with="infura" + + # Determine the primary branches to compare + if [[ "$what_to_compare" == "" ]]; then current_branch=${GITHUB_REF#refs/heads/} branches=("$current_branch") else - # Split the input into an array - IFS=' ' read -r -a branches <<< "$what_to_compare" + readarray -t branches <<< "$what_to_compare" fi + + # Add additional comparers if specified + if [[ "$compare_with" != "" ]]; then + IFS=' ' read -r -a additional_branches <<< "$compare_with" + for branch in "${additional_branches[@]}"; do + if [[ "$branch" != "infura" && "$branch" != "archive" ]]; then + # Treat as additional branch + branches+=("$branch") + fi + done + fi + + # Convert array to JSON array string printf -v joined ',"%s"' "${branches[@]}" - json_array="[${joined:1}]" - echo "matrix=$json_array" >> $GITHUB_OUTPUT + MATRIX="[${joined:1}]" + + echo $MATRIX > matrix.json + cat matrix.json + echo "matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT create_node: needs: parse_input From a8b7da3313d64a2f133dc2d61c68e24cb62e39e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:17:02 +0100 Subject: [PATCH 084/202] Fix json creation --- .github/workflows/rpc-comparison.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 47eb269dea2..0e463378e0c 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -59,9 +59,9 @@ jobs: done fi - # Convert array to JSON array string - printf -v joined ',"%s"' "${branches[@]}" - MATRIX="[${joined:1}]" + # Convert array to JSON object with named array + printf -v joined ', "%s"' "${branches[@]}" + MATRIX="{\"branch\": [${joined:2}]}" # Ensure the key name 'branch' is used echo $MATRIX > matrix.json cat matrix.json From 8b7a5d2ac2e7399ef23f05d7a0c721868064b714 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:18:51 +0100 Subject: [PATCH 085/202] Fix path --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 0e463378e0c..a2e010f2286 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -78,7 +78,7 @@ jobs: with: ref: ${{ matrix.branch }} - name: Run create_node job - uses: ./.github/workflows/run-a-single-node-from-branch.yml + uses: .github/workflows/run-a-single-node-from-branch.yml with: allowed_ips: ${{ github.event.inputs.allowed_ips }} non_validator_mode: false From a9ec148c246bf017926da47cadd03782a1405d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:23:27 +0100 Subject: [PATCH 086/202] Select branch --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index a2e010f2286..756d0be1360 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -78,7 +78,7 @@ jobs: with: ref: ${{ matrix.branch }} - name: Run create_node job - uses: .github/workflows/run-a-single-node-from-branch.yml + uses: ./.github/workflows/run-a-single-node-from-branch.yml@${{ matrix.branch }} with: allowed_ips: ${{ github.event.inputs.allowed_ips }} non_validator_mode: false From 48bb8a61a619b00496b58eba536aa92a26f2372f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:24:36 +0100 Subject: [PATCH 087/202] Absolut path --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 756d0be1360..f9610fe46fc 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -78,7 +78,7 @@ jobs: with: ref: ${{ matrix.branch }} - name: Run create_node job - uses: ./.github/workflows/run-a-single-node-from-branch.yml@${{ matrix.branch }} + uses: NethermindEth/nethermind/.github/workflows/run-a-single-node-from-branch.yml with: allowed_ips: ${{ github.event.inputs.allowed_ips }} non_validator_mode: false From 83cf2c4c689b13f1767ca7947814c892d642aa83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:28:55 +0100 Subject: [PATCH 088/202] revert path --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index f9610fe46fc..0e463378e0c 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -78,7 +78,7 @@ jobs: with: ref: ${{ matrix.branch }} - name: Run create_node job - uses: NethermindEth/nethermind/.github/workflows/run-a-single-node-from-branch.yml + uses: ./.github/workflows/run-a-single-node-from-branch.yml with: allowed_ips: ${{ github.event.inputs.allowed_ips }} non_validator_mode: false From 6ec181236ea34af7255958ecf579352961ab3a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:32:57 +0100 Subject: [PATCH 089/202] static path --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 0e463378e0c..a55b9827ab3 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -78,7 +78,7 @@ jobs: with: ref: ${{ matrix.branch }} - name: Run create_node job - uses: ./.github/workflows/run-a-single-node-from-branch.yml + uses: /home/runner/work/nethermind/.github/workflows/run-a-single-node-from-branch.yml with: allowed_ips: ${{ github.event.inputs.allowed_ips }} non_validator_mode: false From dfc7efca1dbf6d48347984ccfc5068186d221463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:35:09 +0100 Subject: [PATCH 090/202] Remove ref --- .github/workflows/rpc-comparison.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index a55b9827ab3..caf0f6ee82a 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -75,10 +75,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 - with: - ref: ${{ matrix.branch }} - name: Run create_node job - uses: /home/runner/work/nethermind/.github/workflows/run-a-single-node-from-branch.yml + uses: ./.github/workflows/run-a-single-node-from-branch.yml with: allowed_ips: ${{ github.event.inputs.allowed_ips }} non_validator_mode: false From cc6dbaf5740ffa1c84be09736d83017b77e81bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:37:42 +0100 Subject: [PATCH 091/202] bump checkout --- .github/workflows/rpc-comparison.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index caf0f6ee82a..65d2eb470ec 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -74,7 +74,9 @@ jobs: matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 + with: + ref: ${{ matrix.branch }} - name: Run create_node job uses: ./.github/workflows/run-a-single-node-from-branch.yml with: From 1dc34eeda2a4660749e94595236ee5df4358e71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:40:36 +0100 Subject: [PATCH 092/202] add logs --- .github/workflows/rpc-comparison.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 65d2eb470ec..746cc42cb2d 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -77,6 +77,9 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ matrix.branch }} + - name: Debug tree + run: | + tree - name: Run create_node job uses: ./.github/workflows/run-a-single-node-from-branch.yml with: From 3d1863582e71379a1d56b4fe97e453931a4c4542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:43:27 +0100 Subject: [PATCH 093/202] Add fethc depth --- .github/workflows/rpc-comparison.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 746cc42cb2d..e20ceb7a42f 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -77,6 +77,7 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ matrix.branch }} + fetch-depth: 0 - name: Debug tree run: | tree From 82c383a2800cff984cb23b5440a26f78b19700a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:46:50 +0100 Subject: [PATCH 094/202] change debug log --- .github/workflows/rpc-comparison.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index e20ceb7a42f..09f938be9ea 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -77,10 +77,9 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ matrix.branch }} - fetch-depth: 0 - name: Debug tree run: | - tree + ls -la - name: Run create_node job uses: ./.github/workflows/run-a-single-node-from-branch.yml with: From f2b9e73d2746323ec45acb09d95e345c2c280116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:48:17 +0100 Subject: [PATCH 095/202] More logs --- .github/workflows/rpc-comparison.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 09f938be9ea..d2bedf7ada2 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -79,6 +79,8 @@ jobs: ref: ${{ matrix.branch }} - name: Debug tree run: | + ls -la /home/runner/work/nethermind + ls -la /home/runner/work/nethermind/nethermind ls -la - name: Run create_node job uses: ./.github/workflows/run-a-single-node-from-branch.yml From 79cc8d2276e7a200af556bce9129a2d515beb923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 22:49:47 +0100 Subject: [PATCH 096/202] Change logs --- .github/workflows/rpc-comparison.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index d2bedf7ada2..6ec1de3bc24 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -79,9 +79,8 @@ jobs: ref: ${{ matrix.branch }} - name: Debug tree run: | - ls -la /home/runner/work/nethermind - ls -la /home/runner/work/nethermind/nethermind - ls -la + ls -la /home/runner/work/nethermind/nethermind/.github + ls -la /home/runner/work/nethermind/nethermind/.github/workflows - name: Run create_node job uses: ./.github/workflows/run-a-single-node-from-branch.yml with: From 5411ac6c3613e33a8cf9d96b2d1f68831ddc9b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:01:06 +0100 Subject: [PATCH 097/202] Change back to old version of run0single-node --- .github/workflows/rpc-comparison.yaml | 6 +-- .../run-a-single-node-from-branch.yml | 41 +++++++------------ 2 files changed, 15 insertions(+), 32 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 6ec1de3bc24..98b4f900949 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -74,13 +74,9 @@ jobs: matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ matrix.branch }} - - name: Debug tree - run: | - ls -la /home/runner/work/nethermind/nethermind/.github - ls -la /home/runner/work/nethermind/nethermind/.github/workflows - name: Run create_node job uses: ./.github/workflows/run-a-single-node-from-branch.yml with: diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 57174a3912a..d2b0d9d5ede 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -14,7 +14,6 @@ on: - sepolia - goerli - chiado - - holesky cl_client: description: "Select Consensus Layer Client to run node against" default: "" @@ -45,6 +44,14 @@ on: description: "If checked, node will be started in NonValidator mode (OldBodies and oldReceipts will not be synced)" default: true type: boolean + timeout: + description: "Timeout in hours before triggering the deletion of smoke test instances. Maximum time of node lifetime can be 72 hours." + default: "24" + required: true + volume: + description: "In case custom volume size needs to be applied, put value in GB here)" + required: false + default: "" additional_nethermind_flags: description: "Provide any additional flags to the Nethermind in space-separated format. Example: \"JsonRpc.Enabled=false Sync.SnapSync=false\"." default: "" @@ -150,13 +157,12 @@ jobs: run: | BASE_TAG="${GITHUB_USERNAME:0:1}$(shuf -i 1000-9999 -n 1)" echo "BASE_TAG=$BASE_TAG" >> $GITHUB_ENV - echo "base_tag=$BASE_TAG" >> $GITHUB_OUTPUT + echo "::set-output name=base_tag::$BASE_TAG" - name: Creating a node with NodeName="DevNode-${{ github.actor }}-${{ env.BASE_TAG }}-${{ env.CLEAN_REF }}-${{ inputs.network }}-${{ inputs.cl_client }}" run: echo "NodeName='DevNode-${{ github.actor }}-${{ env.BASE_TAG }}-${{ env.CLEAN_REF }}-${{ inputs.network }}-${{ inputs.cl_client }}'" - - - name: Extract dockerfile from additional_options - id: extract_dockerfile + + - name: Set Repo Variable run: | echo "REPO=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV @@ -181,10 +187,9 @@ jobs: echo "REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d / -f 2)" >> $GITHUB_ENV - name: Wait for Docker Build Action to complete - if: steps.check_conditions.outputs.skip_docker_build != 'true' env: GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - WORKFLOW_ID: 'publish-docker.yml' + WORKFLOW_ID: 'build-nethermind-docker-images.yml' MAX_WAIT_MINUTES: '5' INTERVAL: '5' TIMEOUT: '10' @@ -213,13 +218,9 @@ jobs: echo "CLEAN_REF=$CLEAN_REF" >> $GITHUB_ENV - - name: Extract Variables - id: extract_variables + - name: Use BASE_TAG run: | echo "BASE_TAG=${{ needs.create_docker_image.outputs.base_tag }}" >> $GITHUB_ENV - echo "timeout=$(echo '${{ inputs.additional_options }}' | jq -r .timeout)" >> $GITHUB_OUTPUT - echo "ssh_keys=$(echo '${{ inputs.additional_options }}' | jq -r .ssh_keys)" >> $GITHUB_OUTPUT - echo "allowed_ips=$(echo '${{ inputs.additional_options }}' | jq -r .allowed_ips)" >> $GITHUB_OUTPUT - name: Trigger Node creation Repo Action run: | @@ -264,19 +265,5 @@ jobs: REF: 'main' run: | chmod +x scripts/wait-for-workflow-completed.sh - ./scripts/wait-for-workflow-completed.sh | tee script-output.txt - run_id=$(grep -oP 'Run ID: \K\d+' script-output.txt) - echo "Run ID extracted is: $run_id" - echo "RUN_ID=$run_id" >> $GITHUB_ENV + ./scripts/wait-for-workflow-completed.sh working-directory: ${{ github.workspace }} - - - name: Download machine specs artifact - run: | - ARTIFACT_ID=$(curl -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/runs/${{ env.RUN_ID }}/artifacts | jq '.artifacts[0].id') - curl -L -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" -o artifact.zip https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/artifacts/$ARTIFACT_ID/zip - unzip artifact.zip -d ./downloaded-artifacts/ - - - name: Display machine specs content - run: | - FILE=$(ls downloaded-artifacts/machine-details | head -n 1) - cat "downloaded-artifacts/machine-details/$FILE" From 0325b4842f26a97e632d8e9c1f6ee140273ebef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:01:54 +0100 Subject: [PATCH 098/202] revert changes --- .../run-a-single-node-from-branch.yml | 41 ++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index d2b0d9d5ede..57174a3912a 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -14,6 +14,7 @@ on: - sepolia - goerli - chiado + - holesky cl_client: description: "Select Consensus Layer Client to run node against" default: "" @@ -44,14 +45,6 @@ on: description: "If checked, node will be started in NonValidator mode (OldBodies and oldReceipts will not be synced)" default: true type: boolean - timeout: - description: "Timeout in hours before triggering the deletion of smoke test instances. Maximum time of node lifetime can be 72 hours." - default: "24" - required: true - volume: - description: "In case custom volume size needs to be applied, put value in GB here)" - required: false - default: "" additional_nethermind_flags: description: "Provide any additional flags to the Nethermind in space-separated format. Example: \"JsonRpc.Enabled=false Sync.SnapSync=false\"." default: "" @@ -157,12 +150,13 @@ jobs: run: | BASE_TAG="${GITHUB_USERNAME:0:1}$(shuf -i 1000-9999 -n 1)" echo "BASE_TAG=$BASE_TAG" >> $GITHUB_ENV - echo "::set-output name=base_tag::$BASE_TAG" + echo "base_tag=$BASE_TAG" >> $GITHUB_OUTPUT - name: Creating a node with NodeName="DevNode-${{ github.actor }}-${{ env.BASE_TAG }}-${{ env.CLEAN_REF }}-${{ inputs.network }}-${{ inputs.cl_client }}" run: echo "NodeName='DevNode-${{ github.actor }}-${{ env.BASE_TAG }}-${{ env.CLEAN_REF }}-${{ inputs.network }}-${{ inputs.cl_client }}'" - - - name: Set Repo Variable + + - name: Extract dockerfile from additional_options + id: extract_dockerfile run: | echo "REPO=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV @@ -187,9 +181,10 @@ jobs: echo "REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d / -f 2)" >> $GITHUB_ENV - name: Wait for Docker Build Action to complete + if: steps.check_conditions.outputs.skip_docker_build != 'true' env: GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - WORKFLOW_ID: 'build-nethermind-docker-images.yml' + WORKFLOW_ID: 'publish-docker.yml' MAX_WAIT_MINUTES: '5' INTERVAL: '5' TIMEOUT: '10' @@ -218,9 +213,13 @@ jobs: echo "CLEAN_REF=$CLEAN_REF" >> $GITHUB_ENV - - name: Use BASE_TAG + - name: Extract Variables + id: extract_variables run: | echo "BASE_TAG=${{ needs.create_docker_image.outputs.base_tag }}" >> $GITHUB_ENV + echo "timeout=$(echo '${{ inputs.additional_options }}' | jq -r .timeout)" >> $GITHUB_OUTPUT + echo "ssh_keys=$(echo '${{ inputs.additional_options }}' | jq -r .ssh_keys)" >> $GITHUB_OUTPUT + echo "allowed_ips=$(echo '${{ inputs.additional_options }}' | jq -r .allowed_ips)" >> $GITHUB_OUTPUT - name: Trigger Node creation Repo Action run: | @@ -265,5 +264,19 @@ jobs: REF: 'main' run: | chmod +x scripts/wait-for-workflow-completed.sh - ./scripts/wait-for-workflow-completed.sh + ./scripts/wait-for-workflow-completed.sh | tee script-output.txt + run_id=$(grep -oP 'Run ID: \K\d+' script-output.txt) + echo "Run ID extracted is: $run_id" + echo "RUN_ID=$run_id" >> $GITHUB_ENV working-directory: ${{ github.workspace }} + + - name: Download machine specs artifact + run: | + ARTIFACT_ID=$(curl -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/runs/${{ env.RUN_ID }}/artifacts | jq '.artifacts[0].id') + curl -L -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" -o artifact.zip https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/artifacts/$ARTIFACT_ID/zip + unzip artifact.zip -d ./downloaded-artifacts/ + + - name: Display machine specs content + run: | + FILE=$(ls downloaded-artifacts/machine-details | head -n 1) + cat "downloaded-artifacts/machine-details/$FILE" From 90ae1afd50397510bcaa0c1563f773a5d955a9e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:05:50 +0100 Subject: [PATCH 099/202] Change job --- .github/workflows/rpc-comparison.yaml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 98b4f900949..4687210e0de 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -67,22 +67,17 @@ jobs: cat matrix.json echo "matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT - create_node: - needs: parse_input - runs-on: ubuntu-latest + create_node: + name: Create node from current branch + uses: ./.github/workflows/run-a-single-node-from-branch.yml@${{ matrix.branch }} strategy: matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch }} - - name: Run create_node job - uses: ./.github/workflows/run-a-single-node-from-branch.yml - with: - allowed_ips: ${{ github.event.inputs.allowed_ips }} - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None + secrets: inherit + with: + allowed_ips: ${{ inputs.allowed_ips }} + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + extract_rpc_url: name: Extract RPC url from artifacts generated by create_node From c805dde317c5bedddbe9558cbf9c8f956af4d928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:08:42 +0100 Subject: [PATCH 100/202] Add matrix to path --- .github/workflows/rpc-comparison.yaml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 4687210e0de..9cb9255941d 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -67,17 +67,22 @@ jobs: cat matrix.json echo "matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT - create_node: - name: Create node from current branch - uses: ./.github/workflows/run-a-single-node-from-branch.yml@${{ matrix.branch }} + create_node: + needs: parse_input + runs-on: ubuntu-latest strategy: matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} - secrets: inherit - with: - allowed_ips: ${{ inputs.allowed_ips }} - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None - + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + - name: Run create_node job + uses: ./.github/workflows/run-a-single-node-from-branch.yml@${{ matrix.branch }} + with: + allowed_ips: ${{ github.event.inputs.allowed_ips }} + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None extract_rpc_url: name: Extract RPC url from artifacts generated by create_node From 36a93947ed776421705ffc3ec211b60211e0bf4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:25:11 +0100 Subject: [PATCH 101/202] Adjust ref --- .github/workflows/rpc-comparison.yaml | 23 +++++------- .../run-a-single-node-from-branch.yml | 37 ++++++++----------- 2 files changed, 24 insertions(+), 36 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 9cb9255941d..18b420a1b3e 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -67,22 +67,17 @@ jobs: cat matrix.json echo "matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT - create_node: - needs: parse_input - runs-on: ubuntu-latest + create_node: + name: Create node from current branch + uses: ./.github/workflows/run-a-single-node-from-branch.yml + secrets: inherit strategy: matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch }} - - name: Run create_node job - uses: ./.github/workflows/run-a-single-node-from-branch.yml@${{ matrix.branch }} - with: - allowed_ips: ${{ github.event.inputs.allowed_ips }} - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None + with: + allowed_ips: ${{ inputs.allowed_ips }} + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: ${{ matrix.branch }} extract_rpc_url: name: Extract RPC url from artifacts generated by create_node diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 57174a3912a..5f21a86a51e 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -53,10 +53,9 @@ on: description: "Provide any additional flags to the CL client in space-separated format. Example: \"clflag1=1 clflag2=2\"." default: "" required: false - ssh_keys: - description: "SSH Keys to be installed in the smoke test nodes (separated by commas without space in-between commas) for example: key1,key2,key3" - default: "" - required: false + additional_options: + description: "A Json property which allows to customize node even more" + default: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":""}' workflow_call: inputs: smoke_tests_ref: @@ -64,6 +63,11 @@ on: default: "main" required: false type: string + nethermind_repo_ref: + description: "Ref of the nethermind repo in case it is needed to be changed" + default: "" + required: false + type: string network: description: "Select a network on which You want to run a node" default: "mainnet" @@ -88,16 +92,6 @@ on: description: "If checked, node will be started in NonValidator mode (OldBodies and oldReceipts will not be synced)" default: true type: boolean - timeout: - description: "Timeout in hours before triggering the deletion of smoke test instances. Maximum time of node lifetime can be 72 hours." - default: "24" - required: false - type: string - volume: - description: "In case custom volume size needs to be applied, put value in GB here)" - required: false - default: "" - type: string additional_nethermind_flags: type: string description: "Provide any additional flags to the Nethermind in space-separated format. Example: \"JsonRpc.Enabled=false Sync.SnapSync=false\"." @@ -108,15 +102,10 @@ on: description: "Provide any additional flags to the CL client in space-separated format. Example: \"clflag1=1 clflag2=2\"." default: "" required: false - ssh_keys: + additional_options: type: string - description: "SSH Keys to be installed in the smoke test nodes (separated by commas without space in-between commas) for example: key1,key2,key3" - default: "" - required: false - allowed_ips: - type: string - description: "A comma-separated list of ips allowed to connect to the node" - default: "" + description: "A Json property which allows to customize node even more" + default: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":""}' required: false outputs: base_tag: @@ -135,6 +124,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 + with: + ref: ${{ inputs.nethermind_repo_ref }} - name: Prepare docker tag id: prepare_ref @@ -204,6 +195,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 + with: + ref: ${{ inputs.nethermind_repo_ref }} - name: Prepare docker tag id: prepare_ref From d66e3431ff4fb8b50698bc261a84709c33f44f55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:26:27 +0100 Subject: [PATCH 102/202] fix allowed_ips --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 18b420a1b3e..64e571e42d8 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -74,7 +74,7 @@ jobs: strategy: matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} with: - allowed_ips: ${{ inputs.allowed_ips }} + additional_options: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' non_validator_mode: false additional_nethermind_flags: Pruning.Mode=None nethermind_repo_ref: ${{ matrix.branch }} From c4b5a2bc767b70218cb5051effd2db1c648c9ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:27:03 +0100 Subject: [PATCH 103/202] missing needs --- .github/workflows/rpc-comparison.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 64e571e42d8..ca1bb8d8723 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -67,7 +67,8 @@ jobs: cat matrix.json echo "matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT - create_node: + create_node: + needs: parse_input name: Create node from current branch uses: ./.github/workflows/run-a-single-node-from-branch.yml secrets: inherit From c045d47b7e91ca3a179723bebccbbd1e66ca20a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:29:27 +0100 Subject: [PATCH 104/202] Fix trigger job --- .../run-a-single-node-from-branch.yml | 99 +++++++++---------- 1 file changed, 48 insertions(+), 51 deletions(-) diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 5f21a86a51e..21590983121 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -123,7 +123,7 @@ jobs: base_tag: ${{ steps.set-base-tag.outputs.base_tag }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ inputs.nethermind_repo_ref }} @@ -149,28 +149,41 @@ jobs: - name: Extract dockerfile from additional_options id: extract_dockerfile run: | - echo "REPO=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - - - name: Trigger Docker Build Action with Cleaned Ref - run: | - echo $INPUTS | gh workflow run $WORKFLOW_ID --ref $WORKFLOW_REF --json - env: - WORKFLOW_ID: 'build-nethermind-docker-images.yml' - WORKFLOW_REF: ${{ github.ref }} - GITHUB_USER: ${{ secrets.REPOSITORY_DISPATCH_USER }} - GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - INPUTS: > - { - "repo": "${{ env.REPO }}", - "tag": "${{ env.CLEAN_REF }}", - "dockerfile": "Dockerfile" - } + echo "dockerfile=$(echo '${{ inputs.additional_options }}' | jq -r .default_dockerfile)" >> $GITHUB_OUTPUT + echo "build-config=$(echo '${{ inputs.additional_options }}' | jq -r .default_dockerfile_build_type | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT - name: Set Repo and Org Variables run: | - echo "ORG_NAME=$(echo $GITHUB_REPOSITORY | cut -d / -f 1)" >> $GITHUB_ENV - echo "REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d / -f 2)" >> $GITHUB_ENV + echo "ORG_NAME=${{ github.repository_owner }}" >> $GITHUB_ENV + echo "REPO_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV + + - name: Check if master branch and default additional_options + id: check_conditions + run: | + if + [[ "${{ github.ref }}" == "refs/heads/master" ]] && + [[ "${{ steps.extract_dockerfile.outputs.dockerfile }}" == "Dockerfile" ]] && + [[ "${{ steps.extract_dockerfile.outputs.build-config }}" == "release" ]]; then + echo "skip_docker_build=true" >> $GITHUB_OUTPUT + else + echo "skip_docker_build=false" >> $GITHUB_OUTPUT + fi + - name: Trigger Docker Build Action with Cleaned Ref + if: steps.check_conditions.outputs.skip_docker_build != 'true' + uses: benc-uk/workflow-dispatch@v1 + env: + ADDITIONAL_OPTIONS: ${{ inputs.additional_options }} + with: + workflow: publish-docker.yml + ref: "${{ github.ref }}" + token: "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" + inputs: '{ + "tag": "${{ env.CLEAN_REF }}", + "dockerfile": "${{ steps.extract_dockerfile.outputs.dockerfile }}", + "build-config": "${{ steps.extract_dockerfile.outputs.build-config }}" + }' + - name: Wait for Docker Build Action to complete if: steps.check_conditions.outputs.skip_docker_build != 'true' env: @@ -190,11 +203,9 @@ jobs: trigger_node_and_vm_creation: needs: create_docker_image runs-on: ubuntu-latest - outputs: - run_id: ${{ steps.wait-for-node-creation.outputs.run_id }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ inputs.nethermind_repo_ref }} @@ -215,37 +226,23 @@ jobs: echo "allowed_ips=$(echo '${{ inputs.additional_options }}' | jq -r .allowed_ips)" >> $GITHUB_OUTPUT - name: Trigger Node creation Repo Action - run: | - echo $INPUTS | gh -R $WORKFLOW_REPO workflow run $WORKFLOW_ID --ref $WORKFLOW_REF --json - env: - WORKFLOW_ID: 'run-single-node.yml' - WORKFLOW_REF: main - WORKFLOW_REPO: NethermindEth/post-merge-smoke-tests - GITHUB_USER: ${{ secrets.REPOSITORY_DISPATCH_USER }} - GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - INPUTS: > - { - "github_username": "${{ github.actor }}", - "base_tag": "${{ env.BASE_TAG }}", - "config_file": "${{ inputs.config }}", - "nethermind_branch": "${{ env.CLEAN_REF }}", - "network": "${{ inputs.network }}", - "cl_client": "${{ inputs.cl_client }}", - "additional_options": - "{ - \"cl_custom_image\":\"${{ inputs.cl_custom_image }}\", - \"timeout\":\"${{ inputs.timeout }}\", - \"non_validator_mode\":\"${{ inputs.non_validator_mode }}\", - \"volume_size\":\"${{ inputs.volume }}\", - \"additional_nethermind_flags\":\"${{ inputs.additional_nethermind_flags }}\", - \"additional_cl_flags\":\"${{ inputs.additional_cl_flags }}\", - \"ssh_keys\":\"${{ inputs.ssh_keys }}\", - \"allowed_ips\":\"${{ inputs.allowed_ips }}\" - }" - } + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: run-single-node.yml + repo: NethermindEth/post-merge-smoke-tests + ref: "main" + token: "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" + inputs: '{ + "github_username": "${{ github.actor }}", + "base_tag": "${{ env.BASE_TAG }}", + "config_file": "${{ inputs.config }}", + "nethermind_branch": "${{ env.CLEAN_REF }}", + "network": "${{ inputs.network }}", + "cl_client": "${{ inputs.cl_client }}", + "additional_options": "{\"cl_custom_image\":\"${{ inputs.cl_custom_image }}\", \"timeout\":\"${{ steps.extract_variables.outputs.timeout }}\", \"non_validator_mode\":${{ inputs.non_validator_mode }}, \"additional_nethermind_flags\":\"${{ inputs.additional_nethermind_flags }}\", \"additional_cl_flags\":\"${{ inputs.additional_cl_flags }}\", \"ssh_keys\":\"${{ steps.extract_variables.outputs.ssh_keys }}\", \"allowed_ips\":\"${{ steps.extract_variables.outputs.allowed_ips }}\"}" + }' - name: Wait for creation of node - id: wait-for-node-creation env: GITHUB_TOKEN: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} WORKFLOW_ID: 'run-single-node.yml' From b19ccedb41464c71c23aebcb67c9b3d19fddce7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 28 Nov 2023 23:43:34 +0100 Subject: [PATCH 105/202] Revert bad rebase changes --- src/Nethermind/Directory.Build.props | 4 ++-- src/Nethermind/Directory.Packages.props | 6 +++--- .../Processing/ProcessingStats.cs | 6 +++--- src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs | 4 ++-- .../Nethermind.TxPool/TransactionExtensions.cs | 11 +++++++++++ src/Nethermind/nuget.config | 8 ++++---- 6 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/Nethermind/Directory.Build.props b/src/Nethermind/Directory.Build.props index f7dd5f65268..e9129de653f 100644 --- a/src/Nethermind/Directory.Build.props +++ b/src/Nethermind/Directory.Build.props @@ -9,8 +9,8 @@ Demerzel Solutions Limited Nethermind $(Commit.Substring(0, 8)) - 1.20.1 - + 1.23.0 + unstable diff --git a/src/Nethermind/Directory.Packages.props b/src/Nethermind/Directory.Packages.props index 9a2378d4c79..32559d8eb16 100644 --- a/src/Nethermind/Directory.Packages.props +++ b/src/Nethermind/Directory.Packages.props @@ -42,9 +42,9 @@ - - - + + + diff --git a/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs b/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs index b9fda9e1435..5d36900eb83 100644 --- a/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs +++ b/src/Nethermind/Nethermind.Consensus/Processing/ProcessingStats.cs @@ -176,12 +176,12 @@ public void UpdateStats(Block? block, IBlockTree blockTreeCtx, int recoveryQueue > 75 => whiteText, _ => "" }; - _logger.Info($"- Block{(chunkBlocks > 1 ? "s" : " ")}{(chunkBlocks == 1 ? mgasColor : "")} {chunkMGas,7:F2}{resetColor} MGas | {chunkTx,6:N0} txs | calls {callsColor}{chunkCalls,6:N0}{resetColor} {darkGreyText}({chunkEmptyCalls,3:N0}){resetColor} | sload {chunkSload,7:N0} | sstore {sstoreColor}{chunkSstore,6:N0}{resetColor} | create {createsColor}{chunkCreates,3:N0}{resetColor}{(currentSelfDestructs - _lastSelfDestructs > 0 ? $"{darkGreyText}({-(currentSelfDestructs - _lastSelfDestructs),3:N0}){resetColor}" : "")}"); - _logger.Info($"- Block throughput {mgasPerSecond,7:F2} MGas/s | {txps,9:F2} t/s | {bps,7:F2} b/s | recv {recoveryQueueSize,7:N0} | proc {blockQueueSize,6:N0}"); + _logger.Info($"- Block{(chunkBlocks > 1 ? $"s {chunkBlocks,-9:N0}" : " ")}{(chunkBlocks == 1 ? mgasColor : "")} {chunkMGas,7:F2}{resetColor} MGas | {chunkTx,6:N0} txs | calls {callsColor}{chunkCalls,6:N0}{resetColor} {darkGreyText}({chunkEmptyCalls,3:N0}){resetColor} | sload {chunkSload,7:N0} | sstore {sstoreColor}{chunkSstore,6:N0}{resetColor} | create {createsColor}{chunkCreates,3:N0}{resetColor}{(currentSelfDestructs - _lastSelfDestructs > 0 ? $"{darkGreyText}({-(currentSelfDestructs - _lastSelfDestructs),3:N0}){resetColor}" : "")}"); + _logger.Info($"- Block throughput {mgasPerSecond,7:F2} MGas/s | {txps,9:F2} t/s | {bps,7:F2} Blk/s | recv {recoveryQueueSize,7:N0} | proc {blockQueueSize,6:N0}"); // Only output the total throughput in debug mode if (_logger.IsDebug) { - _logger.Debug($"- Total throughput {totalMgasPerSecond,7:F2} MGas/s | {totalTxPerSecond,9:F2} t/s | {totalBlocksPerSecond,7:F2} b/s | Gas gwei: {Evm.Metrics.MinGasPrice:N2} .. {Math.Max(Evm.Metrics.MinGasPrice, Evm.Metrics.EstMedianGasPrice):N2} ({Evm.Metrics.AveGasPrice:N2}) .. {Evm.Metrics.MaxGasPrice:N2}"); + _logger.Debug($"- Total throughput {totalMgasPerSecond,7:F2} MGas/s | {totalTxPerSecond,9:F2} t/s | {totalBlocksPerSecond,7:F2} Blk/s | Gas gwei: {Evm.Metrics.MinGasPrice:N2} .. {Math.Max(Evm.Metrics.MinGasPrice, Evm.Metrics.EstMedianGasPrice):N2} ({Evm.Metrics.AveGasPrice:N2}) .. {Evm.Metrics.MaxGasPrice:N2}"); } if (_logger.IsTrace) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index c59b04aaa38..6ad0f609cc9 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -598,13 +598,13 @@ public void should_add_tx_if_cost_of_executing_all_txs_in_bucket_exceeds_balance } } - _txPool.GetPendingTransactions().Length.Should().Be(8); // nonces 0-6 and 8 + _txPool.GetPendingTransactionsCount().Should().Be(8); // nonces 0-6 and 8 _txPool.GetPendingTransactions().Last().Nonce.Should().Be(8); _txPool.SubmitTx(transactions[8], TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.AlreadyKnown); _txPool.SubmitTx(transactions[7], TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); - _txPool.GetPendingTransactions().Length.Should().Be(8); // nonces 0-7 - 8 was removed because of not enough balance + _txPool.GetPendingTransactionsCount().Should().Be(8); // nonces 0-7 - 8 was removed because of not enough balance _txPool.GetPendingTransactions().Last().Nonce.Should().Be(7); _txPool.GetPendingTransactions().Should().BeEquivalentTo(transactions.SkipLast(2)); } diff --git a/src/Nethermind/Nethermind.TxPool/TransactionExtensions.cs b/src/Nethermind/Nethermind.TxPool/TransactionExtensions.cs index 6d734de72a9..65102975786 100644 --- a/src/Nethermind/Nethermind.TxPool/TransactionExtensions.cs +++ b/src/Nethermind/Nethermind.TxPool/TransactionExtensions.cs @@ -78,7 +78,18 @@ internal static bool IsOverflowWhenAddingTxCostToCumulative(this Transaction tx, overflow |= UInt256.AddOverflow(currentCost, maxTxCost, out cumulativeCost); overflow |= UInt256.AddOverflow(cumulativeCost, tx.Value, out cumulativeCost); + if (tx.SupportsBlobs) + { + // if tx.SupportsBlobs and has BlobVersionedHashes = null, it will throw on earlier step of validation, in TxValidator + overflow |= UInt256.MultiplyOverflow(Eip4844Constants.GasPerBlob, (UInt256)tx.BlobVersionedHashes!.Length, out UInt256 blobGas); + overflow |= UInt256.MultiplyOverflow(blobGas, tx.MaxFeePerBlobGas ?? UInt256.MaxValue, out UInt256 blobGasCost); + overflow |= UInt256.AddOverflow(cumulativeCost, blobGasCost, out cumulativeCost); + } + return overflow; } + + internal static bool IsOverflowInTxCostAndValue(this Transaction tx, out UInt256 txCost) + => IsOverflowWhenAddingTxCostToCumulative(tx, UInt256.Zero, out txCost); } } diff --git a/src/Nethermind/nuget.config b/src/Nethermind/nuget.config index a4c5094636a..84c8ccf735e 100644 --- a/src/Nethermind/nuget.config +++ b/src/Nethermind/nuget.config @@ -3,14 +3,14 @@ - + - + From 98d219e4c673dd1b714255905d5b75e81d9f292c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 00:23:31 +0100 Subject: [PATCH 106/202] Fixed workflow for testing --- .github/workflows/rpc-comparison.yaml | 50 ++++++++++++--------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index ca1bb8d8723..1d956bf33cc 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -84,35 +84,31 @@ jobs: name: Extract RPC url from artifacts generated by create_node runs-on: ubuntu-latest needs: create_node + strategy: + matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} outputs: - rpc_urls: ${{ steps.aggregate_rpc_urls.outputs.rpc_urls }} + rpc_url: ${{ steps.extract_rpc_url.outputs.rpc_url }} steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Extract RPC URLs - id: aggregate_rpc_urls - run: | - rpc_urls="" - for matrix_val in ${{ fromJson(needs.create_node.result) }} - do - artifact_name="${{ github.actor }}-${matrix_val}-${{ needs.create_node.outputs.base_tag }}-smoketests" - echo "Downloading artifact: $artifact_name" - wget -O artifact.zip --header='Authorization: token ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}' \ - "https://api.github.com/repos/NethermindEth/post-merge-smoke-tests/actions/artifacts/$artifact_name/zip" - unzip artifact.zip - rpc_url=$(cat ./terraform.tfstate | jq -r '.outputs.nodes_data.value[0].rpc_url') - rpc_urls="$rpc_urls$rpc_url," - rm -rf artifact.zip terraform.tfstate - done - echo "rpc_urls=${rpc_urls%?}" >> $GITHUB_OUTPUT - - sleep: - name: Sleep since syncing lasts longer than 6 hours (time limit for a job) - runs-on: ubuntu-latest - needs: extract_rpc_url - steps: - - run: sleep 5h 30m + - name: Download artifact + id: download-artifact + uses: dawidd6/action-download-artifact@v2 + with: + github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} + run_id: ${{ needs.create_node.outputs.run_id }} + name: "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" + repo: NethermindEth/post-merge-smoke-tests + + - name: Get RPC url to the newly created node + id: extract_rpc_url + run: echo "rpc_url=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT + + # Should not be needed anymore since nodes are syncing much faster now + #sleep: + # name: Sleep since syncing lasts longer than 6 hours (time limit for a job) + # runs-on: ubuntu-latest + # needs: extract_rpc_url + # steps: + # - run: sleep 5h 30m wait_for_node_to_sync: name: Wait for the node to sync From c88998e3a7900d7a5cac8a3b44f34720bf06c5b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 00:24:32 +0100 Subject: [PATCH 107/202] Fix needs --- .github/workflows/rpc-comparison.yaml | 56 +++++++++++++++++++-------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 1d956bf33cc..174c3da2510 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -67,18 +67,18 @@ jobs: cat matrix.json echo "matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT - create_node: - needs: parse_input - name: Create node from current branch - uses: ./.github/workflows/run-a-single-node-from-branch.yml - secrets: inherit - strategy: - matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} - with: - additional_options: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None - nethermind_repo_ref: ${{ matrix.branch }} + #create_node: + # needs: parse_input + # name: Create node from current branch + # uses: ./.github/workflows/run-a-single-node-from-branch.yml + # secrets: inherit + # strategy: + # matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} + # with: + # additional_options: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + # non_validator_mode: false + # additional_nethermind_flags: Pruning.Mode=None + # nethermind_repo_ref: ${{ matrix.branch }} extract_rpc_url: name: Extract RPC url from artifacts generated by create_node @@ -94,14 +94,38 @@ jobs: uses: dawidd6/action-download-artifact@v2 with: github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - run_id: ${{ needs.create_node.outputs.run_id }} - name: "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" + #run_id: ${{ needs.create_node.outputs.run_id }} + #name: "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" + run_id: 7025480117 + name: "kamilchodola-k2530-smoketests" repo: NethermindEth/post-merge-smoke-tests - name: Get RPC url to the newly created node id: extract_rpc_url run: echo "rpc_url=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT + aggregate_rpcs: + name: Collect all RPC Urls and pass it further + runs-on: ubuntu-latest + needs: extract_rpc_url + outputs: + rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} + steps: + - name: Fetch urls + id: aggregate_rpcs + run: | + rpc_urls="" + branches=${{ toJson(needs.parse_input.outputs.matrix.branch) }} + for branch in $branches + do + rpc_url_output="rpc_url_$branch" + if [ ! -z "${{ needs.extract_rpc_url.outputs[rpc_url_output] }}" ]; then + rpc_urls+="${{ needs.extract_rpc_url.outputs[rpc_url_output] }}," + fi + done + echo "rpc_urls=${rpc_urls%?}" >> $GITHUB_OUTPUT + + # Should not be needed anymore since nodes are syncing much faster now #sleep: # name: Sleep since syncing lasts longer than 6 hours (time limit for a job) @@ -113,7 +137,7 @@ jobs: wait_for_node_to_sync: name: Wait for the node to sync runs-on: ubuntu-latest - needs: [sleep, extract_rpc_url] + needs: [aggregate_rpcs] timeout-minutes: 600 steps: - uses: actions/checkout@v3 @@ -161,7 +185,7 @@ jobs: compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - needs: [extract_rpc_url, wait_for_node_to_sync] + needs: [aggregate_rpcs, wait_for_node_to_sync] strategy: matrix: rpc_to_compare: [INFURA_ENDPOINT, NETHERMIND_ARCHIVE_ENDPOINT] From 3f5b171ffe0b52755c5d2d5690b4cf0b7625ba41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 00:26:48 +0100 Subject: [PATCH 108/202] Fix outputs --- .github/workflows/rpc-comparison.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 174c3da2510..feaf861fbb7 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -119,8 +119,8 @@ jobs: for branch in $branches do rpc_url_output="rpc_url_$branch" - if [ ! -z "${{ needs.extract_rpc_url.outputs[rpc_url_output] }}" ]; then - rpc_urls+="${{ needs.extract_rpc_url.outputs[rpc_url_output] }}," + if [ ! -z "${{ needs.extract_rpc_url.outputs.rpc_url[rpc_url_output] }}" ]; then + rpc_urls+="${{ needs.extract_rpc_url.outputs.rpc_url[rpc_url_output] }}," fi done echo "rpc_urls=${rpc_urls%?}" >> $GITHUB_OUTPUT From 161768df79b218000ae06515fa15c1c8960198bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 00:27:17 +0100 Subject: [PATCH 109/202] add missing $ --- .github/workflows/rpc-comparison.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index feaf861fbb7..f27822f2aa0 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -119,8 +119,8 @@ jobs: for branch in $branches do rpc_url_output="rpc_url_$branch" - if [ ! -z "${{ needs.extract_rpc_url.outputs.rpc_url[rpc_url_output] }}" ]; then - rpc_urls+="${{ needs.extract_rpc_url.outputs.rpc_url[rpc_url_output] }}," + if [ ! -z "${{ needs.extract_rpc_url.outputs.rpc_url[$rpc_url_output] }}" ]; then + rpc_urls+="${{ needs.extract_rpc_url.outputs.rpc_url[$rpc_url_output] }}," fi done echo "rpc_urls=${rpc_urls%?}" >> $GITHUB_OUTPUT From 6732fd7e02ae7491446e8586d639f9791bd7ea6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 09:35:51 +0100 Subject: [PATCH 110/202] Add more logs --- .github/workflows/rpc-comparison.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index f27822f2aa0..d3620e86879 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -87,7 +87,7 @@ jobs: strategy: matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} outputs: - rpc_url: ${{ steps.extract_rpc_url.outputs.rpc_url }} + rpc_url_${{ matrix.branch }}: ${{ steps.extract_rpc_url.outputs.rpc_url }} steps: - name: Download artifact id: download-artifact @@ -102,7 +102,9 @@ jobs: - name: Get RPC url to the newly created node id: extract_rpc_url - run: echo "rpc_url=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT + run: | + echo $(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url') + echo "rpc_url_${{ matrix.branch }}=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT aggregate_rpcs: name: Collect all RPC Urls and pass it further @@ -123,6 +125,7 @@ jobs: rpc_urls+="${{ needs.extract_rpc_url.outputs.rpc_url[$rpc_url_output] }}," fi done + echo ${rpc_urls%?} echo "rpc_urls=${rpc_urls%?}" >> $GITHUB_OUTPUT From 352b646bc11fa4bb0429e95639bfbb411e4078d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 09:39:44 +0100 Subject: [PATCH 111/202] Change rpc_urls --- .github/workflows/rpc-comparison.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index d3620e86879..499435c6f73 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -120,10 +120,7 @@ jobs: branches=${{ toJson(needs.parse_input.outputs.matrix.branch) }} for branch in $branches do - rpc_url_output="rpc_url_$branch" - if [ ! -z "${{ needs.extract_rpc_url.outputs.rpc_url[$rpc_url_output] }}" ]; then - rpc_urls+="${{ needs.extract_rpc_url.outputs.rpc_url[$rpc_url_output] }}," - fi + rpc_urls+="${{ needs.extract_rpc_url.outputs.rpc_url_$branch }}," done echo ${rpc_urls%?} echo "rpc_urls=${rpc_urls%?}" >> $GITHUB_OUTPUT From 124f2ac89d6d637b3bf32ce6fc67acc3aa377be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 11:44:35 +0100 Subject: [PATCH 112/202] Change approach of node creation --- .github/workflows/rpc-comparison.yaml | 73 ++++++++++--------- .../run-a-single-node-from-branch.yml | 6 ++ 2 files changed, 43 insertions(+), 36 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 499435c6f73..6070f981847 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -67,44 +67,45 @@ jobs: cat matrix.json echo "matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT - #create_node: - # needs: parse_input - # name: Create node from current branch - # uses: ./.github/workflows/run-a-single-node-from-branch.yml - # secrets: inherit - # strategy: - # matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} - # with: - # additional_options: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - # non_validator_mode: false - # additional_nethermind_flags: Pruning.Mode=None - # nethermind_repo_ref: ${{ matrix.branch }} - - extract_rpc_url: - name: Extract RPC url from artifacts generated by create_node - runs-on: ubuntu-latest - needs: create_node + create_node: + needs: parse_input + name: Create node from current branch + uses: ./.github/workflows/run-a-single-node-from-branch.yml + secrets: inherit strategy: matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} - outputs: - rpc_url_${{ matrix.branch }}: ${{ steps.extract_rpc_url.outputs.rpc_url }} - steps: - - name: Download artifact - id: download-artifact - uses: dawidd6/action-download-artifact@v2 - with: - github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - #run_id: ${{ needs.create_node.outputs.run_id }} - #name: "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" - run_id: 7025480117 - name: "kamilchodola-k2530-smoketests" - repo: NethermindEth/post-merge-smoke-tests - - - name: Get RPC url to the newly created node - id: extract_rpc_url - run: | - echo $(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url') - echo "rpc_url_${{ matrix.branch }}=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT + with: + additional_options: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: ${{ matrix.branch }} + + + #extract_rpc_url: + # name: Extract RPC url from artifacts generated by create_node + # runs-on: ubuntu-latest + # needs: create_node + # strategy: + # matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} + # outputs: + # rpc_url: ${{ steps.extract_rpc_url.outputs.rpc_url }} + # steps: + # - name: Download artifact + # id: download-artifact + # uses: dawidd6/action-download-artifact@v2 + # with: + # github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} + # #run_id: ${{ needs.create_node.outputs.run_id }} + # #name: "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" + # run_id: 7025480117 + # name: "kamilchodola-k2530-smoketests" + # repo: NethermindEth/post-merge-smoke-tests + # + # - name: Get RPC url to the newly created node + # id: extract_rpc_url + # run: | + # echo $(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url') + # echo "rpc_url_${{ matrix.branch }}=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT aggregate_rpcs: name: Collect all RPC Urls and pass it further diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 21590983121..bd36d7c15a0 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -114,6 +114,9 @@ on: run_id: description: "" value: ${{ jobs.trigger_node_and_vm_creation.outputs.run_id }} + rpc_url_$nethermind_repo_ref: + description: "" + value: ${{ jobs.trigger_node_and_vm_creation.outputs.rpc_url }} jobs: @@ -270,3 +273,6 @@ jobs: run: | FILE=$(ls downloaded-artifacts/machine-details | head -n 1) cat "downloaded-artifacts/machine-details/$FILE" + rpc_url=$(cat "downloaded-artifacts/machine-details/$FILE" | grep -oP '\s{2,3}RPC URL: \K.+' script-output.txt) + echo "RPC URL extracted is: rpc_url" + echo "RPC_URL_${{ inputs.nethermind_repo_ref }}=$rpc_url" >> $GITHUB_ENV From deeb0de5cdae26bc201cdc23c492991631cde8b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 11:45:12 +0100 Subject: [PATCH 113/202] Comment out --- .github/workflows/rpc-comparison.yaml | 36 +++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 6070f981847..5fc10b8a3f9 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -107,24 +107,24 @@ jobs: # echo $(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url') # echo "rpc_url_${{ matrix.branch }}=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT - aggregate_rpcs: - name: Collect all RPC Urls and pass it further - runs-on: ubuntu-latest - needs: extract_rpc_url - outputs: - rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} - steps: - - name: Fetch urls - id: aggregate_rpcs - run: | - rpc_urls="" - branches=${{ toJson(needs.parse_input.outputs.matrix.branch) }} - for branch in $branches - do - rpc_urls+="${{ needs.extract_rpc_url.outputs.rpc_url_$branch }}," - done - echo ${rpc_urls%?} - echo "rpc_urls=${rpc_urls%?}" >> $GITHUB_OUTPUT + #aggregate_rpcs: + # name: Collect all RPC Urls and pass it further + # runs-on: ubuntu-latest + # needs: extract_rpc_url + # outputs: + # rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} + # steps: + # - name: Fetch urls + # id: aggregate_rpcs + # run: | + # rpc_urls="" + # branches=${{ toJson(needs.parse_input.outputs.matrix.branch) }} + # for branch in $branches + # do + # rpc_urls+="${{ needs.extract_rpc_url.outputs.rpc_url_$branch }}," + # done + # echo ${rpc_urls%?} + # echo "rpc_urls=${rpc_urls%?}" >> $GITHUB_OUTPUT # Should not be needed anymore since nodes are syncing much faster now From b9594ff80dc50a2fe3af1f3446d680a8607f46d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 11:45:41 +0100 Subject: [PATCH 114/202] Fix needs --- .github/workflows/rpc-comparison.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 5fc10b8a3f9..b2f13d435be 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -138,7 +138,7 @@ jobs: wait_for_node_to_sync: name: Wait for the node to sync runs-on: ubuntu-latest - needs: [aggregate_rpcs] + needs: [create_node] timeout-minutes: 600 steps: - uses: actions/checkout@v3 @@ -186,7 +186,7 @@ jobs: compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - needs: [aggregate_rpcs, wait_for_node_to_sync] + needs: [create_node, wait_for_node_to_sync] strategy: matrix: rpc_to_compare: [INFURA_ENDPOINT, NETHERMIND_ARCHIVE_ENDPOINT] From 2479cd4c0e7a2ffd88a744ab2caecbb54da1de3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 12:38:30 +0100 Subject: [PATCH 115/202] Change a way of applying artifacts and rpc_urls --- .github/workflows/rpc-comparison.yaml | 90 ++++++++----------- .../run-a-single-node-from-branch.yml | 24 ++++- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index b2f13d435be..771f67877ac 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -79,61 +79,43 @@ jobs: non_validator_mode: false additional_nethermind_flags: Pruning.Mode=None nethermind_repo_ref: ${{ matrix.branch }} + custom_run_id: ${{ github.run_id }} - - #extract_rpc_url: - # name: Extract RPC url from artifacts generated by create_node - # runs-on: ubuntu-latest - # needs: create_node - # strategy: - # matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} - # outputs: - # rpc_url: ${{ steps.extract_rpc_url.outputs.rpc_url }} - # steps: - # - name: Download artifact - # id: download-artifact - # uses: dawidd6/action-download-artifact@v2 - # with: - # github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - # #run_id: ${{ needs.create_node.outputs.run_id }} - # #name: "${{ github.actor }}-${{ needs.create_node.outputs.base_tag }}-smoketests" - # run_id: 7025480117 - # name: "kamilchodola-k2530-smoketests" - # repo: NethermindEth/post-merge-smoke-tests - # - # - name: Get RPC url to the newly created node - # id: extract_rpc_url - # run: | - # echo $(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url') - # echo "rpc_url_${{ matrix.branch }}=$(cat ./terraform.tfstate | jq '.outputs.nodes_data.value[0].rpc_url')" >> $GITHUB_OUTPUT - - #aggregate_rpcs: - # name: Collect all RPC Urls and pass it further - # runs-on: ubuntu-latest - # needs: extract_rpc_url - # outputs: - # rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} - # steps: - # - name: Fetch urls - # id: aggregate_rpcs - # run: | - # rpc_urls="" - # branches=${{ toJson(needs.parse_input.outputs.matrix.branch) }} - # for branch in $branches - # do - # rpc_urls+="${{ needs.extract_rpc_url.outputs.rpc_url_$branch }}," - # done - # echo ${rpc_urls%?} - # echo "rpc_urls=${rpc_urls%?}" >> $GITHUB_OUTPUT - - - # Should not be needed anymore since nodes are syncing much faster now - #sleep: - # name: Sleep since syncing lasts longer than 6 hours (time limit for a job) - # runs-on: ubuntu-latest - # needs: extract_rpc_url - # steps: - # - run: sleep 5h 30m + aggregate_rpcs: + name: Collect all RPC Urls and pass it further + runs-on: ubuntu-latest + needs: create_node + outputs: + rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} + steps: + - name: Download artifacts using GitHub CLI + id: aggregate_rpcs + run: | + # Install GitHub CLI + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null + sudo apt update + sudo apt install gh + + # Authenticate GitHub CLI + echo "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" | gh auth login --with-token + + rpc_urls="" + branches=${{ toJson(needs.parse_input.outputs.matrix.branch) }} + for branch in $branches; do + artifact_name="rpc-url-$branch-${{ github.run_id }}" + mkdir -p artifacts/$branch + + echo "Downloading artifact: $artifact_name" + gh run download --name "$artifact_name" --repo ${{ github.repository }} --dir artifacts/$branch + + if [ -f "artifacts/$branch/$artifact_name.txt" ]; then + url_content=$(cat "artifacts/$branch/$artifact_name.txt") + rpc_urls+="${url_content}," + fi + done + rpc_urls=${rpc_urls%,} + echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT wait_for_node_to_sync: name: Wait for the node to sync diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index bd36d7c15a0..f809656ba4f 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -68,6 +68,11 @@ on: default: "" required: false type: string + custom_run_id: + description: "Run ID used for artifacts save" + default: "" + required: false + type: string network: description: "Select a network on which You want to run a node" default: "mainnet" @@ -114,7 +119,7 @@ on: run_id: description: "" value: ${{ jobs.trigger_node_and_vm_creation.outputs.run_id }} - rpc_url_$nethermind_repo_ref: + rpc_urly: description: "" value: ${{ jobs.trigger_node_and_vm_creation.outputs.rpc_url }} @@ -274,5 +279,18 @@ jobs: FILE=$(ls downloaded-artifacts/machine-details | head -n 1) cat "downloaded-artifacts/machine-details/$FILE" rpc_url=$(cat "downloaded-artifacts/machine-details/$FILE" | grep -oP '\s{2,3}RPC URL: \K.+' script-output.txt) - echo "RPC URL extracted is: rpc_url" - echo "RPC_URL_${{ inputs.nethermind_repo_ref }}=$rpc_url" >> $GITHUB_ENV + echo "RPC URL extracted is: $rpc_url" + echo "RPC_URL=$rpc_url" >> $GITHUB_ENV + + - name: Save RPC URL to file + if: inputs.custom_run_id != '' + run: | + workflow_id=${{ inputs.custom_run_id }} + echo "$(cat ./terraform.tfstate | jq -r '.outputs.nodes_data.value[0].rpc_url')" > rpc_url_${{ inputs.nethermind_repo_ref }}_${{ inputs.custom_run_id }}.txt + + - name: Upload RPC URL + uses: actions/upload-artifact@v2 + if: inputs.custom_run_id != '' + with: + name: rpc-url-${{ inputs.nethermind_repo_ref }}-${{ inputs.custom_run_id }} + path: rpc_url_${{ inputs.nethermind_repo_ref }}_${{ inputs.custom_run_id }}.txt From 165e8be7b2f9ba161ab3f1a395f3103fceaa01ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 12:39:20 +0100 Subject: [PATCH 116/202] Adjust needs --- .github/workflows/rpc-comparison.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 771f67877ac..01af80a4c9d 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -120,7 +120,7 @@ jobs: wait_for_node_to_sync: name: Wait for the node to sync runs-on: ubuntu-latest - needs: [create_node] + needs: [aggregate_rpcs] timeout-minutes: 600 steps: - uses: actions/checkout@v3 @@ -168,7 +168,7 @@ jobs: compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - needs: [create_node, wait_for_node_to_sync] + needs: [wait_for_node_to_sync] strategy: matrix: rpc_to_compare: [INFURA_ENDPOINT, NETHERMIND_ARCHIVE_ENDPOINT] From ed216a929eedf79b96d00e92e5f609618ca2e838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 13:25:40 +0100 Subject: [PATCH 117/202] Adjust --- .github/workflows/rpc-comparison.yaml | 56 +++++++++++++++---- .../run-a-single-node-from-branch.yml | 4 +- 2 files changed, 46 insertions(+), 14 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 01af80a4c9d..b04a0e94095 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -18,7 +18,7 @@ on: required: false compare_with: type: string - description: "A space-separated list of additional comparers. If empty, then nothing else will be added to comparision. Possible options: 'infura', 'archive', 'feature/branch'" + description: "A space-separated list of additional comparers. If empty, then nothing else will be added to comparision. Possible options: 'INFURA_ENDPOINT', 'NETHERMIND_ARCHIVE_ENDPOINT', 'feature/branch'" default: "" required: false @@ -26,7 +26,8 @@ jobs: parse_input: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} + branch_matrix: ${{ steps.set-matrix.outputs.branch_matrix }} + others_matrix: ${{ steps.set-matrix.outputs.others_matrix }} steps: - name: Install jq run: sudo apt-get install jq @@ -52,20 +53,25 @@ jobs: if [[ "$compare_with" != "" ]]; then IFS=' ' read -r -a additional_branches <<< "$compare_with" for branch in "${additional_branches[@]}"; do - if [[ "$branch" != "infura" && "$branch" != "archive" ]]; then + if [[ "$branch" != "INFURA_ENDPOINT" && "$branch" != "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then # Treat as additional branch branches+=("$branch") + else + others+=("$branch") fi done fi # Convert array to JSON object with named array - printf -v joined ', "%s"' "${branches[@]}" - MATRIX="{\"branch\": [${joined:2}]}" # Ensure the key name 'branch' is used + printf -v joinedbranch ', "%s"' "${branches[@]}" + BRANCH_MATRIX="{\"branch\": [${joinedbranch:2}]}" # Ensure the key name 'branch' is used + + printf -v joinedothers ', "%s"' "${others[@]}" + OTHERS_MATRIX="{\"other\": [${joinedothers:2}]}" # Ensure the key name 'other' is used echo $MATRIX > matrix.json cat matrix.json - echo "matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT + echo "branch_matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT create_node: needs: parse_input @@ -73,7 +79,7 @@ jobs: uses: ./.github/workflows/run-a-single-node-from-branch.yml secrets: inherit strategy: - matrix: ${{ fromJson(needs.parse_input.outputs.matrix) }} + matrix: ${{ fromJson(needs.parse_input.outputs.branch_matrix) }} with: additional_options: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' non_validator_mode: false @@ -101,7 +107,7 @@ jobs: echo "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" | gh auth login --with-token rpc_urls="" - branches=${{ toJson(needs.parse_input.outputs.matrix.branch) }} + branches=${{ toJson(needs.parse_input.outputs.branch_matrix.branch) }} for branch in $branches; do artifact_name="rpc-url-$branch-${{ github.run_id }}" mkdir -p artifacts/$branch @@ -111,7 +117,7 @@ jobs: if [ -f "artifacts/$branch/$artifact_name.txt" ]; then url_content=$(cat "artifacts/$branch/$artifact_name.txt") - rpc_urls+="${url_content}," + rpc_urls+="$branch::${url_content}," fi done rpc_urls=${rpc_urls%,} @@ -144,7 +150,19 @@ jobs: - name: Wait for the nodes to sync timeout-minutes: 600 run: | - rpc_urls=(${{ needs.extract_rpc_url.outputs.rpc_urls }}) + rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" + + # Loop through the array and strip the branch prefix + processed_rpc_urls=() + for url_entry in "${rpc_urls_array[@]}"; do + processed_url="${url_entry#*::}" # Remove everything up to and including "::" + processed_rpc_urls+=("$processed_url") + done + + # Convert the processed URLs back to a comma-separated string + IFS=','; rpc_urls="${processed_rpc_urls[*]}"; unset IFS + sync_complete_flag=0 check_sync() { @@ -171,7 +189,7 @@ jobs: needs: [wait_for_node_to_sync] strategy: matrix: - rpc_to_compare: [INFURA_ENDPOINT, NETHERMIND_ARCHIVE_ENDPOINT] + rpc_to_compare: ${{ fromJson(needs.parse_input.outputs.others_matrix) }} steps: - uses: actions/checkout@v3 - name: Install flood @@ -195,4 +213,18 @@ jobs: WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - name: Test equality of responses - run: flood all nethermind_current=${{ needs.extract_rpc_url.outputs.rpc_url }} ${{ matrix.rpc_to_compare }}=${{ secrets[matrix.rpc_to_compare] }} --equality + run: | + rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" + + nethermind_urls=() + for url_entry in "${rpc_urls_array[@]}"; do + branch="${url_entry%%::*}" # Extract the branch part + url="${url_entry#*::}" # Extract the URL part + nethermind_urls_str+="nethermind_$branch=$url " + done + + # Remove trailing space + nethermind_urls_str="${nethermind_urls_str% }" + + flood all $nethermind_urls_str ${{ matrix.other }}=${{ secrets[matrix.other] }} --equality diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index f809656ba4f..121a239f6b9 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -277,8 +277,8 @@ jobs: - name: Display machine specs content run: | FILE=$(ls downloaded-artifacts/machine-details | head -n 1) - cat "downloaded-artifacts/machine-details/$FILE" - rpc_url=$(cat "downloaded-artifacts/machine-details/$FILE" | grep -oP '\s{2,3}RPC URL: \K.+' script-output.txt) + cat "downloaded-artifacts/machine-details/$FILE" | tee spec-output.txt + rpc_url=$(grep -oP '\s{2,3}RPC URL: \K.+'' spec-output.txt) echo "RPC URL extracted is: $rpc_url" echo "RPC_URL=$rpc_url" >> $GITHUB_ENV From e9ad1a06937cc6f7d28a9b6061db1bf0fd925658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 13:45:26 +0100 Subject: [PATCH 118/202] Add missing variables --- .github/workflows/rpc-comparison.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index b04a0e94095..2d0adc77372 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -69,10 +69,14 @@ jobs: printf -v joinedothers ', "%s"' "${others[@]}" OTHERS_MATRIX="{\"other\": [${joinedothers:2}]}" # Ensure the key name 'other' is used - echo $MATRIX > matrix.json - cat matrix.json + echo $BRANCH_MATRIX > branch_matrix.json + cat branch_matrix.json echo "branch_matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT + echo $OTHERS_MATRIX > others_matrix.json + cat others_matrix.json + echo "others_matrix=$(jq -c . others_matrix.json)" >> $GITHUB_OUTPUT + create_node: needs: parse_input name: Create node from current branch From 60719cfc0c61ae3a0a32c87508bd8f8b1a93c426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 13:54:44 +0100 Subject: [PATCH 119/202] Fix invalid file read --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 2d0adc77372..7c66a2422d4 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -71,7 +71,7 @@ jobs: echo $BRANCH_MATRIX > branch_matrix.json cat branch_matrix.json - echo "branch_matrix=$(jq -c . matrix.json)" >> $GITHUB_OUTPUT + echo "branch_matrix=$(jq -c . branch_matrix.json)" >> $GITHUB_OUTPUT echo $OTHERS_MATRIX > others_matrix.json cat others_matrix.json From 2febe0fd0e8f41679e33bcfe909de462dfde068a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 13:56:12 +0100 Subject: [PATCH 120/202] Fix temp infura value --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 7c66a2422d4..4e5fa501323 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -39,7 +39,7 @@ jobs: #compare_with="${{ github.event.inputs.compare_with }}" what_to_compare="" - compare_with="infura" + compare_with="INFURA_ENDPOINT" # Determine the primary branches to compare if [[ "$what_to_compare" == "" ]]; then From f365556b29413b1ea208f5efb4f40030958eced7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 14:08:45 +0100 Subject: [PATCH 121/202] Fix to much ' --- .github/workflows/run-a-single-node-from-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 121a239f6b9..73d3bbd8a86 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -278,7 +278,7 @@ jobs: run: | FILE=$(ls downloaded-artifacts/machine-details | head -n 1) cat "downloaded-artifacts/machine-details/$FILE" | tee spec-output.txt - rpc_url=$(grep -oP '\s{2,3}RPC URL: \K.+'' spec-output.txt) + rpc_url=$(grep -oP '\s{2,3}RPC URL: \K.+' spec-output.txt) echo "RPC URL extracted is: $rpc_url" echo "RPC_URL=$rpc_url" >> $GITHUB_ENV From 4d109d2faf88d69ff7bd7dfacf3ada8b2c133f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 14:22:05 +0100 Subject: [PATCH 122/202] Fix artifact save --- .github/workflows/rpc-comparison.yaml | 1 + .github/workflows/run-a-single-node-from-branch.yml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 4e5fa501323..538ca584c5f 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -112,6 +112,7 @@ jobs: rpc_urls="" branches=${{ toJson(needs.parse_input.outputs.branch_matrix.branch) }} + echo $branches for branch in $branches; do artifact_name="rpc-url-$branch-${{ github.run_id }}" mkdir -p artifacts/$branch diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 73d3bbd8a86..d82f62154cc 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -119,7 +119,7 @@ on: run_id: description: "" value: ${{ jobs.trigger_node_and_vm_creation.outputs.run_id }} - rpc_urly: + rpc_url: description: "" value: ${{ jobs.trigger_node_and_vm_creation.outputs.rpc_url }} @@ -286,7 +286,7 @@ jobs: if: inputs.custom_run_id != '' run: | workflow_id=${{ inputs.custom_run_id }} - echo "$(cat ./terraform.tfstate | jq -r '.outputs.nodes_data.value[0].rpc_url')" > rpc_url_${{ inputs.nethermind_repo_ref }}_${{ inputs.custom_run_id }}.txt + echo "${{ env.RPC_URL }}" > rpc_url_${{ inputs.nethermind_repo_ref }}_${{ inputs.custom_run_id }}.txt - name: Upload RPC URL uses: actions/upload-artifact@v2 From 9240dd5864a0ac2b482f2025e1709e7b255a1d8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 14:41:48 +0100 Subject: [PATCH 123/202] Fix branches fetching --- .github/workflows/rpc-comparison.yaml | 39 ++++++++++++++++----------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 538ca584c5f..8495f6bc680 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -77,19 +77,19 @@ jobs: cat others_matrix.json echo "others_matrix=$(jq -c . others_matrix.json)" >> $GITHUB_OUTPUT - create_node: - needs: parse_input - name: Create node from current branch - uses: ./.github/workflows/run-a-single-node-from-branch.yml - secrets: inherit - strategy: - matrix: ${{ fromJson(needs.parse_input.outputs.branch_matrix) }} - with: - additional_options: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None - nethermind_repo_ref: ${{ matrix.branch }} - custom_run_id: ${{ github.run_id }} + #create_node: + # needs: parse_input + # name: Create node from current branch + # uses: ./.github/workflows/run-a-single-node-from-branch.yml + # secrets: inherit + # strategy: + # matrix: ${{ fromJson(needs.parse_input.outputs.branch_matrix) }} + # with: + # additional_options: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + # non_validator_mode: false + # additional_nethermind_flags: Pruning.Mode=None + # nethermind_repo_ref: ${{ matrix.branch }} + # custom_run_id: ${{ github.run_id }} aggregate_rpcs: name: Collect all RPC Urls and pass it further @@ -102,19 +102,28 @@ jobs: id: aggregate_rpcs run: | # Install GitHub CLI + echo "Installing Github CLI..." curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null sudo apt update sudo apt install gh + # Install jq if not already available + echo "Installing jq..." + sudo apt-get install -y jq + # Authenticate GitHub CLI + echo "Login to Github with token..." echo "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" | gh auth login --with-token rpc_urls="" - branches=${{ toJson(needs.parse_input.outputs.branch_matrix.branch) }} + # Convert the JSON array to a Bash array + branches=$(echo '${{ needs.parse_input.outputs.branch_matrix.branch }}' | jq -r '.[]') echo $branches + run_id=7033188111 for branch in $branches; do - artifact_name="rpc-url-$branch-${{ github.run_id }}" + artifact_name="rpc-url-$branch-$run_id" + #artifact_name="rpc-url-rpc-comparision-1.23.0-7033188111" mkdir -p artifacts/$branch echo "Downloading artifact: $artifact_name" From 8126cfba69b9f675edc8b18f51db0e2b5e62b722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 14:42:40 +0100 Subject: [PATCH 124/202] Temp remove needs --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 8495f6bc680..1e564b76dab 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -94,7 +94,7 @@ jobs: aggregate_rpcs: name: Collect all RPC Urls and pass it further runs-on: ubuntu-latest - needs: create_node + #needs: create_node outputs: rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} steps: From fcebf0f4591d72184853e282ebcf8df64b657253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 14:43:41 +0100 Subject: [PATCH 125/202] Switch to first job needs --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 1e564b76dab..c5477eaf5a8 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -94,7 +94,7 @@ jobs: aggregate_rpcs: name: Collect all RPC Urls and pass it further runs-on: ubuntu-latest - #needs: create_node + needs: parse_input outputs: rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} steps: From cfa3c6759440dd830528e9dcc7869b73e3745f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 14:46:34 +0100 Subject: [PATCH 126/202] Fix list fill --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index c5477eaf5a8..31584ab81a1 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -118,7 +118,7 @@ jobs: rpc_urls="" # Convert the JSON array to a Bash array - branches=$(echo '${{ needs.parse_input.outputs.branch_matrix.branch }}' | jq -r '.[]') + branches=$(echo '${{ needs.parse_input.outputs.branch_matrix.branch }}' | jq -r '.branch[]') echo $branches run_id=7033188111 for branch in $branches; do From 2a7526532559821d9166a1941423b34e62a96649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 14:48:19 +0100 Subject: [PATCH 127/202] Invalid path --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 31584ab81a1..e0b6892f500 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -118,7 +118,7 @@ jobs: rpc_urls="" # Convert the JSON array to a Bash array - branches=$(echo '${{ needs.parse_input.outputs.branch_matrix.branch }}' | jq -r '.branch[]') + branches=$(echo '${{ needs.parse_input.outputs.branch_matrix }}' | jq -r '.branch[]') echo $branches run_id=7033188111 for branch in $branches; do From 52da7afe21688685536151a1b8f22d6e244a155b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 14:56:52 +0100 Subject: [PATCH 128/202] Add verbose logging --- .github/workflows/rpc-comparison.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index e0b6892f500..3a1a0658566 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -126,9 +126,13 @@ jobs: #artifact_name="rpc-url-rpc-comparision-1.23.0-7033188111" mkdir -p artifacts/$branch - echo "Downloading artifact: $artifact_name" - gh run download --name "$artifact_name" --repo ${{ github.repository }} --dir artifacts/$branch + echo "Check artifacts list..." + gh run list --repo ${{ github.repository }} + echo "Downloading artifact: $artifact_name ..." + gh run download --name "$artifact_name" --repo ${{ github.repository }} --dir artifacts/$branch --verbose + + echo "Processing artifact..." if [ -f "artifacts/$branch/$artifact_name.txt" ]; then url_content=$(cat "artifacts/$branch/$artifact_name.txt") rpc_urls+="$branch::${url_content}," From f225eb46322d1d4e96759aa10b7d348f790cae3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 15:08:19 +0100 Subject: [PATCH 129/202] Adjust --- .github/workflows/rpc-comparison.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 3a1a0658566..4aa1cf8563a 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -126,11 +126,8 @@ jobs: #artifact_name="rpc-url-rpc-comparision-1.23.0-7033188111" mkdir -p artifacts/$branch - echo "Check artifacts list..." - gh run list --repo ${{ github.repository }} - echo "Downloading artifact: $artifact_name ..." - gh run download --name "$artifact_name" --repo ${{ github.repository }} --dir artifacts/$branch --verbose + gh run download --name "$artifact_name" --dir artifacts/$branch echo "Processing artifact..." if [ -f "artifacts/$branch/$artifact_name.txt" ]; then From 09d63233f614d7b3caecf06a3a06a49780d13d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 15:11:22 +0100 Subject: [PATCH 130/202] add missing repo --- .github/workflows/rpc-comparison.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 4aa1cf8563a..5f78114f417 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -126,8 +126,8 @@ jobs: #artifact_name="rpc-url-rpc-comparision-1.23.0-7033188111" mkdir -p artifacts/$branch - echo "Downloading artifact: $artifact_name ..." - gh run download --name "$artifact_name" --dir artifacts/$branch + echo "Downloading artifact: $artifact_name..." + gh run download --name "$artifact_name" --repo ${{ github.repository }} --dir artifacts/$branch echo "Processing artifact..." if [ -f "artifacts/$branch/$artifact_name.txt" ]; then From 30848e9d0d8fa8243c6a5b99036e6551ff586633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 15:20:28 +0100 Subject: [PATCH 131/202] Rollback run_id --- .github/workflows/rpc-comparison.yaml | 32 +++++++++++++-------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 5f78114f417..05886a5eccf 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -77,19 +77,19 @@ jobs: cat others_matrix.json echo "others_matrix=$(jq -c . others_matrix.json)" >> $GITHUB_OUTPUT - #create_node: - # needs: parse_input - # name: Create node from current branch - # uses: ./.github/workflows/run-a-single-node-from-branch.yml - # secrets: inherit - # strategy: - # matrix: ${{ fromJson(needs.parse_input.outputs.branch_matrix) }} - # with: - # additional_options: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - # non_validator_mode: false - # additional_nethermind_flags: Pruning.Mode=None - # nethermind_repo_ref: ${{ matrix.branch }} - # custom_run_id: ${{ github.run_id }} + create_node: + needs: parse_input + name: Create node from current branch + uses: ./.github/workflows/run-a-single-node-from-branch.yml + secrets: inherit + strategy: + matrix: ${{ fromJson(needs.parse_input.outputs.branch_matrix) }} + with: + additional_options: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: ${{ matrix.branch }} + custom_run_id: ${{ github.run_id }} aggregate_rpcs: name: Collect all RPC Urls and pass it further @@ -120,14 +120,12 @@ jobs: # Convert the JSON array to a Bash array branches=$(echo '${{ needs.parse_input.outputs.branch_matrix }}' | jq -r '.branch[]') echo $branches - run_id=7033188111 for branch in $branches; do - artifact_name="rpc-url-$branch-$run_id" - #artifact_name="rpc-url-rpc-comparision-1.23.0-7033188111" + artifact_name="rpc-url-$branch-${{ github.run_id }}" mkdir -p artifacts/$branch echo "Downloading artifact: $artifact_name..." - gh run download --name "$artifact_name" --repo ${{ github.repository }} --dir artifacts/$branch + gh run download --name "$artifact_name" --repo ${{ github.repository }} --dir artifacts/$branch ${{ github.run_id }} echo "Processing artifact..." if [ -f "artifacts/$branch/$artifact_name.txt" ]; then From 43b43f614fa548fefc66759c00e00939a4d04632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 15:22:28 +0100 Subject: [PATCH 132/202] Fix needs --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 05886a5eccf..7be9e55d754 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -94,7 +94,7 @@ jobs: aggregate_rpcs: name: Collect all RPC Urls and pass it further runs-on: ubuntu-latest - needs: parse_input + needs: create_node outputs: rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} steps: From d113bb46ebd0775660e4e912e33a1c7b0e64f264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 16:49:32 +0100 Subject: [PATCH 133/202] Trigger --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 7be9e55d754..4b46145dd18 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -97,7 +97,7 @@ jobs: needs: create_node outputs: rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} - steps: + steps: - name: Download artifacts using GitHub CLI id: aggregate_rpcs run: | From fb169521e7fd0d70e5d268cbd8605a478b427e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 29 Nov 2023 17:12:16 +0100 Subject: [PATCH 134/202] Fix needs --- .github/workflows/rpc-comparison.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 4b46145dd18..53f4919bd25 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -94,7 +94,7 @@ jobs: aggregate_rpcs: name: Collect all RPC Urls and pass it further runs-on: ubuntu-latest - needs: create_node + needs: [create_node, parse_input] outputs: rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} steps: @@ -199,7 +199,7 @@ jobs: compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - needs: [wait_for_node_to_sync] + needs: [wait_for_node_to_sync, parse_input] strategy: matrix: rpc_to_compare: ${{ fromJson(needs.parse_input.outputs.others_matrix) }} From 97fa930dd6606f0ab1a9bb41fe39211f7b7f82b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Thu, 30 Nov 2023 17:08:00 +0100 Subject: [PATCH 135/202] Change apprioach of downloading artifacts --- .github/workflows/rpc-comparison.yaml | 54 +++++++++++++-------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 53f4919bd25..fc5ef819690 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -97,44 +97,42 @@ jobs: needs: [create_node, parse_input] outputs: rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} - steps: - - name: Download artifacts using GitHub CLI - id: aggregate_rpcs + steps: + - name: Retrieve Artifact Names + id: retrieve_artifacts run: | - # Install GitHub CLI - echo "Installing Github CLI..." - curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null - sudo apt update - sudo apt install gh - - # Install jq if not already available echo "Installing jq..." sudo apt-get install -y jq - # Authenticate GitHub CLI - echo "Login to Github with token..." - echo "${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" | gh auth login --with-token - - rpc_urls="" - # Convert the JSON array to a Bash array + artifact_names="" branches=$(echo '${{ needs.parse_input.outputs.branch_matrix }}' | jq -r '.branch[]') - echo $branches for branch in $branches; do artifact_name="rpc-url-$branch-${{ github.run_id }}" - mkdir -p artifacts/$branch - - echo "Downloading artifact: $artifact_name..." - gh run download --name "$artifact_name" --repo ${{ github.repository }} --dir artifacts/$branch ${{ github.run_id }} - - echo "Processing artifact..." - if [ -f "artifacts/$branch/$artifact_name.txt" ]; then - url_content=$(cat "artifacts/$branch/$artifact_name.txt") - rpc_urls+="$branch::${url_content}," + artifact_names+="$artifact_name," + done + artifact_names=${artifact_names%,} + echo "artifact_names=$artifact_names" >> $GITHUB_OUTPUT + + - name: Download Artifacts + uses: dawidd6/action-download-artifact@v2 + with: + github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} + name: ".*-${{ github.run_id }}" + name_is_regexp: true + path: artifacts/ + + - name: Process Artifacts Content + run: | + rpc_urls="" + for file in artifacts/*; do + if [ -f "$file" ]; then + branch=$(basename $file | cut -d '-' -f 3) + url_content=$(cat "$file") + rpc_urls+="$branch::$url_content," fi done rpc_urls=${rpc_urls%,} - echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT + echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT wait_for_node_to_sync: name: Wait for the node to sync From 023d4a8de8f3dc46d32758ea32519a15428c9ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Thu, 30 Nov 2023 17:27:32 +0100 Subject: [PATCH 136/202] Add more params to artifact download --- .github/workflows/rpc-comparison.yaml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index fc5ef819690..8d15d8bdec9 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -98,21 +98,6 @@ jobs: outputs: rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} steps: - - name: Retrieve Artifact Names - id: retrieve_artifacts - run: | - echo "Installing jq..." - sudo apt-get install -y jq - - artifact_names="" - branches=$(echo '${{ needs.parse_input.outputs.branch_matrix }}' | jq -r '.branch[]') - for branch in $branches; do - artifact_name="rpc-url-$branch-${{ github.run_id }}" - artifact_names+="$artifact_name," - done - artifact_names=${artifact_names%,} - echo "artifact_names=$artifact_names" >> $GITHUB_OUTPUT - - name: Download Artifacts uses: dawidd6/action-download-artifact@v2 with: @@ -120,6 +105,9 @@ jobs: name: ".*-${{ github.run_id }}" name_is_regexp: true path: artifacts/ + check_artifacts: true + workflow: run-a-single-node-from-branch.yml + run_id: ${{ github.event.workflow_run.id }} - name: Process Artifacts Content run: | @@ -132,6 +120,7 @@ jobs: fi done rpc_urls=${rpc_urls%,} + echo $rpc_urls echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT wait_for_node_to_sync: From 0ac2dd19a9044aa885bb0efd9d126171ccb13a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Thu, 30 Nov 2023 17:42:08 +0100 Subject: [PATCH 137/202] Download all from current run --- .github/workflows/rpc-comparison.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 8d15d8bdec9..01a920c8a53 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -38,7 +38,7 @@ jobs: #what_to_compare="${{ github.event.inputs.what_to_compare }}" #compare_with="${{ github.event.inputs.compare_with }}" - what_to_compare="" + what_to_compare="master" compare_with="INFURA_ENDPOINT" # Determine the primary branches to compare @@ -102,11 +102,7 @@ jobs: uses: dawidd6/action-download-artifact@v2 with: github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - name: ".*-${{ github.run_id }}" - name_is_regexp: true path: artifacts/ - check_artifacts: true - workflow: run-a-single-node-from-branch.yml run_id: ${{ github.event.workflow_run.id }} - name: Process Artifacts Content From fe3eb415c38956124c34f2b338b8b30e60d5bc76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Thu, 30 Nov 2023 17:51:54 +0100 Subject: [PATCH 138/202] Change the runid --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 01a920c8a53..c9674d5ebc0 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -103,7 +103,7 @@ jobs: with: github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} path: artifacts/ - run_id: ${{ github.event.workflow_run.id }} + run_id: ${{ github.run_id }} - name: Process Artifacts Content run: | From 1cf50234a8e891cc60daf4fbe00d2e540fcf243d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Thu, 30 Nov 2023 18:06:58 +0100 Subject: [PATCH 139/202] Add search --- .github/workflows/rpc-comparison.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index c9674d5ebc0..93cc0caf97e 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -104,6 +104,7 @@ jobs: github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} path: artifacts/ run_id: ${{ github.run_id }} + search_artifact: true - name: Process Artifacts Content run: | From e63c87737209b53206ae919177cc554afb3c0ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Thu, 30 Nov 2023 18:15:35 +0100 Subject: [PATCH 140/202] Fix typo --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 93cc0caf97e..f02f7c204d1 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -104,7 +104,7 @@ jobs: github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} path: artifacts/ run_id: ${{ github.run_id }} - search_artifact: true + search_artifacts: true - name: Process Artifacts Content run: | From 7baf5a341500b1abafe1372630a0d68050d476dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Thu, 30 Nov 2023 19:42:09 +0100 Subject: [PATCH 141/202] Change way of downlaoding artifacts --- .github/workflows/rpc-comparison.yaml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index f02f7c204d1..e317cd18285 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -38,7 +38,7 @@ jobs: #what_to_compare="${{ github.event.inputs.what_to_compare }}" #compare_with="${{ github.event.inputs.compare_with }}" - what_to_compare="master" + what_to_compare="" compare_with="INFURA_ENDPOINT" # Determine the primary branches to compare @@ -98,13 +98,28 @@ jobs: outputs: rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} steps: + - name: Retrieve Artifact Names + id: retrieve_artifacts + run: | + echo "Installing jq..." + sudo apt-get install -y jq + + artifact_names="" + branches=$(echo '${{ needs.parse_input.outputs.branch_matrix }}' | jq -r '.branch[]') + for branch in $branches; do + artifact_name="rpc-url-$branch-${{ github.run_id }}" + artifact_names+="$artifact_name " + done + artifact_names=${artifact_names% } + echo $artifact_names + echo "artifact_names=$artifact_names" >> $GITHUB_OUTPUT + - name: Download Artifacts - uses: dawidd6/action-download-artifact@v2 + uses: marcofaggian/action-download-multiple-artifacts@v1 with: github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} + names: ${{ steps.retrieve_artifacts.outputs.artifact_names }} path: artifacts/ - run_id: ${{ github.run_id }} - search_artifacts: true - name: Process Artifacts Content run: | From b9742cd08897887c534dfb491f314be2d8fd203d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Fri, 1 Dec 2023 20:08:09 +0100 Subject: [PATCH 142/202] Test a different run-id --- .github/workflows/rpc-comparison.yaml | 3 +-- .github/workflows/run-a-single-node-from-branch.yml | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index e317cd18285..2a661028208 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -85,11 +85,10 @@ jobs: strategy: matrix: ${{ fromJson(needs.parse_input.outputs.branch_matrix) }} with: - additional_options: '{"timeout":"24", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' non_validator_mode: false additional_nethermind_flags: Pruning.Mode=None nethermind_repo_ref: ${{ matrix.branch }} - custom_run_id: ${{ github.run_id }} aggregate_rpcs: name: Collect all RPC Urls and pass it further diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index d82f62154cc..fd50e10bedd 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -283,14 +283,14 @@ jobs: echo "RPC_URL=$rpc_url" >> $GITHUB_ENV - name: Save RPC URL to file - if: inputs.custom_run_id != '' + if: inputs.custom_run_id != '2' run: | - workflow_id=${{ inputs.custom_run_id }} - echo "${{ env.RPC_URL }}" > rpc_url_${{ inputs.nethermind_repo_ref }}_${{ inputs.custom_run_id }}.txt + workflow_id=${{ github.run_id }} + echo "${{ env.RPC_URL }}" > rpc_url_${{ inputs.nethermind_repo_ref }}_${{ github.run_id }}.txt - name: Upload RPC URL uses: actions/upload-artifact@v2 - if: inputs.custom_run_id != '' + if: inputs.custom_run_id != '2' with: - name: rpc-url-${{ inputs.nethermind_repo_ref }}-${{ inputs.custom_run_id }} - path: rpc_url_${{ inputs.nethermind_repo_ref }}_${{ inputs.custom_run_id }}.txt + name: rpc-url-${{ inputs.nethermind_repo_ref }}-${{ github.run_id }} + path: rpc_url_${{ inputs.nethermind_repo_ref }}_${{ github.run_id }}.txt From 5b53e8f6765e933eaec9e4535fab22e2375bc6f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Fri, 1 Dec 2023 21:09:33 +0100 Subject: [PATCH 143/202] Change approach --- .github/workflows/rpc-comparison.yaml | 12 +++++------- .github/workflows/run-a-single-node-from-branch.yml | 6 +++--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 2a661028208..51c56131b46 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -38,7 +38,7 @@ jobs: #what_to_compare="${{ github.event.inputs.what_to_compare }}" #compare_with="${{ github.event.inputs.compare_with }}" - what_to_compare="" + what_to_compare="master" compare_with="INFURA_ENDPOINT" # Determine the primary branches to compare @@ -106,7 +106,7 @@ jobs: artifact_names="" branches=$(echo '${{ needs.parse_input.outputs.branch_matrix }}' | jq -r '.branch[]') for branch in $branches; do - artifact_name="rpc-url-$branch-${{ github.run_id }}" + artifact_name="rpc-url::$branch::${{ github.run_id }}" artifact_names+="$artifact_name " done artifact_names=${artifact_names% } @@ -114,18 +114,16 @@ jobs: echo "artifact_names=$artifact_names" >> $GITHUB_OUTPUT - name: Download Artifacts - uses: marcofaggian/action-download-multiple-artifacts@v1 + uses: actions/download-artifact@v3 with: - github_token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} - names: ${{ steps.retrieve_artifacts.outputs.artifact_names }} - path: artifacts/ + name: ${{ steps.retrieve_artifacts.outputs.artifact_names }} - name: Process Artifacts Content run: | rpc_urls="" for file in artifacts/*; do if [ -f "$file" ]; then - branch=$(basename $file | cut -d '-' -f 3) + branch=$(basename $file | cut -d '::' -f 3) url_content=$(cat "$file") rpc_urls+="$branch::$url_content," fi diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index fd50e10bedd..550c1a4c129 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -283,14 +283,14 @@ jobs: echo "RPC_URL=$rpc_url" >> $GITHUB_ENV - name: Save RPC URL to file - if: inputs.custom_run_id != '2' + if: inputs.custom_run_id != '' run: | workflow_id=${{ github.run_id }} echo "${{ env.RPC_URL }}" > rpc_url_${{ inputs.nethermind_repo_ref }}_${{ github.run_id }}.txt - name: Upload RPC URL uses: actions/upload-artifact@v2 - if: inputs.custom_run_id != '2' + if: inputs.custom_run_id != '' with: - name: rpc-url-${{ inputs.nethermind_repo_ref }}-${{ github.run_id }} + name: rpc-url::${{ inputs.nethermind_repo_ref }}::${{ github.run_id }} path: rpc_url_${{ inputs.nethermind_repo_ref }}_${{ github.run_id }}.txt From 1536cdb9d2ef47b4cf8f11e9891c4762e07026a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Fri, 1 Dec 2023 21:23:47 +0100 Subject: [PATCH 144/202] Add mising custom id --- .github/workflows/rpc-comparison.yaml | 1 + .github/workflows/run-a-single-node-from-branch.yml | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 51c56131b46..ce17bd68e7b 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -89,6 +89,7 @@ jobs: non_validator_mode: false additional_nethermind_flags: Pruning.Mode=None nethermind_repo_ref: ${{ matrix.branch }} + custom_run_id: ${{ github.run_id }} aggregate_rpcs: name: Collect all RPC Urls and pass it further diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 550c1a4c129..4d8c61a38f2 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -285,12 +285,12 @@ jobs: - name: Save RPC URL to file if: inputs.custom_run_id != '' run: | - workflow_id=${{ github.run_id }} - echo "${{ env.RPC_URL }}" > rpc_url_${{ inputs.nethermind_repo_ref }}_${{ github.run_id }}.txt + workflow_id=${{ inputs.custom_run_id }} + echo "${{ env.RPC_URL }}" > rpc_url_${{ inputs.nethermind_repo_ref }}_${{ inputs.custom_run_id }}.txt - name: Upload RPC URL - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 if: inputs.custom_run_id != '' with: - name: rpc-url::${{ inputs.nethermind_repo_ref }}::${{ github.run_id }} - path: rpc_url_${{ inputs.nethermind_repo_ref }}_${{ github.run_id }}.txt + name: rpc-url::${{ inputs.nethermind_repo_ref }}::${{ inputs.custom_run_id }} + path: rpc_url_${{ inputs.nethermind_repo_ref }}_${{ inputs.custom_run_id }}.txt From 3241a344a16cb0f473b7142ff2f15e3c6fed3e5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Fri, 1 Dec 2023 22:13:39 +0100 Subject: [PATCH 145/202] Change approach to only 1 branch compare --- .github/workflows/rpc-comparison.yaml | 68 +++++++------------ .../run-a-single-node-from-branch.yml | 2 +- 2 files changed, 26 insertions(+), 44 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index ce17bd68e7b..13eeebd8baa 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -11,7 +11,7 @@ on: description: "A comma-separated list of ips allowed to connect to the node" default: '' required: false - what_to_compare: + branch_to_compare: type: string description: "A space-separated list of branches. If empty, then selected branch will be used. If multiple specified, those will be compared to themselves." default: "" @@ -26,7 +26,6 @@ jobs: parse_input: runs-on: ubuntu-latest outputs: - branch_matrix: ${{ steps.set-matrix.outputs.branch_matrix }} others_matrix: ${{ steps.set-matrix.outputs.others_matrix }} steps: - name: Install jq @@ -35,20 +34,10 @@ jobs: - name: Set matrix for branches id: set-matrix run: | - #what_to_compare="${{ github.event.inputs.what_to_compare }}" #compare_with="${{ github.event.inputs.compare_with }}" - what_to_compare="master" compare_with="INFURA_ENDPOINT" - # Determine the primary branches to compare - if [[ "$what_to_compare" == "" ]]; then - current_branch=${GITHUB_REF#refs/heads/} - branches=("$current_branch") - else - readarray -t branches <<< "$what_to_compare" - fi - # Add additional comparers if specified if [[ "$compare_with" != "" ]]; then IFS=' ' read -r -a additional_branches <<< "$compare_with" @@ -62,69 +51,62 @@ jobs: done fi - # Convert array to JSON object with named array - printf -v joinedbranch ', "%s"' "${branches[@]}" - BRANCH_MATRIX="{\"branch\": [${joinedbranch:2}]}" # Ensure the key name 'branch' is used - printf -v joinedothers ', "%s"' "${others[@]}" OTHERS_MATRIX="{\"other\": [${joinedothers:2}]}" # Ensure the key name 'other' is used - echo $BRANCH_MATRIX > branch_matrix.json - cat branch_matrix.json - echo "branch_matrix=$(jq -c . branch_matrix.json)" >> $GITHUB_OUTPUT - echo $OTHERS_MATRIX > others_matrix.json cat others_matrix.json echo "others_matrix=$(jq -c . others_matrix.json)" >> $GITHUB_OUTPUT - create_node: + create_main_node: + needs: parse_input + name: Create node from current branch + uses: ./.github/workflows/run-a-single-node-from-branch.yml + secrets: inherit + with: + additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: ${{ github.ref }} + custom_run_id: ${{ github.run_id }} + + create_compare_node: needs: parse_input name: Create node from current branch uses: ./.github/workflows/run-a-single-node-from-branch.yml secrets: inherit - strategy: - matrix: ${{ fromJson(needs.parse_input.outputs.branch_matrix) }} with: additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' non_validator_mode: false additional_nethermind_flags: Pruning.Mode=None - nethermind_repo_ref: ${{ matrix.branch }} + nethermind_repo_ref: master#${{ inputs.branch_to_compare }} custom_run_id: ${{ github.run_id }} aggregate_rpcs: name: Collect all RPC Urls and pass it further runs-on: ubuntu-latest - needs: [create_node, parse_input] + needs: [create_node, create_compare_node, parse_input] outputs: rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} steps: - - name: Retrieve Artifact Names - id: retrieve_artifacts - run: | - echo "Installing jq..." - sudo apt-get install -y jq - - artifact_names="" - branches=$(echo '${{ needs.parse_input.outputs.branch_matrix }}' | jq -r '.branch[]') - for branch in $branches; do - artifact_name="rpc-url::$branch::${{ github.run_id }}" - artifact_names+="$artifact_name " - done - artifact_names=${artifact_names% } - echo $artifact_names - echo "artifact_names=$artifact_names" >> $GITHUB_OUTPUT - - name: Download Artifacts + - name: Download RPC Artifact for current branch + uses: actions/download-artifact@v3 + with: + name: rpc-url___${{ github.ref }}___${{ github.run_id }} + + - name: Download RPC Artifact for branch to comapre + if: inputs.branch_to_compare != '' uses: actions/download-artifact@v3 with: - name: ${{ steps.retrieve_artifacts.outputs.artifact_names }} + name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ inputs.branch_to_compare }}___${{ github.run_id }} - name: Process Artifacts Content run: | rpc_urls="" for file in artifacts/*; do if [ -f "$file" ]; then - branch=$(basename $file | cut -d '::' -f 3) + branch=$(basename $file | cut -d '___' -f 3) url_content=$(cat "$file") rpc_urls+="$branch::$url_content," fi diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 4d8c61a38f2..7d5eccbd12c 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -292,5 +292,5 @@ jobs: uses: actions/upload-artifact@v3 if: inputs.custom_run_id != '' with: - name: rpc-url::${{ inputs.nethermind_repo_ref }}::${{ inputs.custom_run_id }} + name: rpc-url___${{ inputs.nethermind_repo_ref }}___${{ inputs.custom_run_id }} path: rpc_url_${{ inputs.nethermind_repo_ref }}_${{ inputs.custom_run_id }}.txt From 6dd7c2907ad93dc56ab90f6e1d7f62bd757c6d4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Fri, 1 Dec 2023 23:20:51 +0100 Subject: [PATCH 146/202] Fix --- .github/workflows/rpc-comparison.yaml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 13eeebd8baa..c9e7653d345 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -18,7 +18,7 @@ on: required: false compare_with: type: string - description: "A space-separated list of additional comparers. If empty, then nothing else will be added to comparision. Possible options: 'INFURA_ENDPOINT', 'NETHERMIND_ARCHIVE_ENDPOINT', 'feature/branch'" + description: "A space-separated list of additional comparers. If empty, then nothing else will be added to comparision. Possible options: 'INFURA_ENDPOINT', 'NETHERMIND_ARCHIVE_ENDPOINT'" default: "" required: false @@ -85,7 +85,7 @@ jobs: aggregate_rpcs: name: Collect all RPC Urls and pass it further runs-on: ubuntu-latest - needs: [create_node, create_compare_node, parse_input] + needs: [create_main_node, create_compare_node, parse_input] outputs: rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} steps: @@ -178,10 +178,7 @@ jobs: compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - needs: [wait_for_node_to_sync, parse_input] - strategy: - matrix: - rpc_to_compare: ${{ fromJson(needs.parse_input.outputs.others_matrix) }} + needs: [wait_for_node_to_sync] steps: - uses: actions/checkout@v3 - name: Install flood @@ -207,16 +204,26 @@ jobs: - name: Test equality of responses run: | rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" - - nethermind_urls=() + IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str"; unset IFS + + nethermind_urls_str=() for url_entry in "${rpc_urls_array[@]}"; do branch="${url_entry%%::*}" # Extract the branch part url="${url_entry#*::}" # Extract the URL part nethermind_urls_str+="nethermind_$branch=$url " done + + others_str="${{ github.event.inputs.compare_with }}" + IFS=' ' read -r -a others_str_array <<< "$others_str"; unset IFS + + others_prepared_str=() + for other in "${others_str_array[@]}"; do + others_prepared_str+="$other=${{ secrets[$other] }} " + done # Remove trailing space nethermind_urls_str="${nethermind_urls_str% }" + others_prepared_str="${others_prepared_str% }" - flood all $nethermind_urls_str ${{ matrix.other }}=${{ secrets[matrix.other] }} --equality + echo "flood all $nethermind_urls_str $others_prepared_str --equality"" + flood all $nethermind_urls_str $others_prepared_str --equality From 01ad1b49819456826b65af585f4c4f1b0c6b5837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Fri, 1 Dec 2023 23:27:56 +0100 Subject: [PATCH 147/202] Fix2 --- .github/workflows/rpc-comparison.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index c9e7653d345..57f716596f7 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -200,6 +200,8 @@ jobs: WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + INFURA_ENDPOINT: '${{ secrets.INFURA_ENDPOINT }}' + NETHERMIND_ARCHIVE_ENDPOINT: '${{ secrets.NETHERMIND_ARCHIVE_ENDPOINT }}' - name: Test equality of responses run: | @@ -218,7 +220,11 @@ jobs: others_prepared_str=() for other in "${others_str_array[@]}"; do - others_prepared_str+="$other=${{ secrets[$other] }} " + if [[ "$other" == "INFURA_ENDPOINT" ]]; then + others_prepared_str+="$other=${INFURA_ENDPOINT} " + else [[ "$other" == "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then + others_prepared_str+="$other=${NETHERMIND_ARCHIVE_ENDPOINT} " + fi done # Remove trailing space From 8fc7714fa9cabf86c0b19f8052a98795b193cf40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Fri, 1 Dec 2023 23:29:31 +0100 Subject: [PATCH 148/202] add if commented --- .github/workflows/rpc-comparison.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 57f716596f7..4c1b9729cac 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -74,12 +74,13 @@ jobs: needs: parse_input name: Create node from current branch uses: ./.github/workflows/run-a-single-node-from-branch.yml + #if: inputs.branch_to_compare != '' secrets: inherit with: additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' non_validator_mode: false additional_nethermind_flags: Pruning.Mode=None - nethermind_repo_ref: master#${{ inputs.branch_to_compare }} + nethermind_repo_ref: master #${{ inputs.branch_to_compare }} custom_run_id: ${{ github.run_id }} aggregate_rpcs: From 07a807e5468a428cc519f512e5885d2713cd0456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Fri, 1 Dec 2023 23:41:59 +0100 Subject: [PATCH 149/202] Fetch only most recent run for selected ref --- scripts/wait-for-workflow-completed.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/wait-for-workflow-completed.sh b/scripts/wait-for-workflow-completed.sh index dad6f3677ce..a724801b3c1 100644 --- a/scripts/wait-for-workflow-completed.sh +++ b/scripts/wait-for-workflow-completed.sh @@ -43,7 +43,7 @@ else fi run_id=$(echo "$response" | \ jq -r --arg ref "$(echo "$REF" | sed 's/refs\/heads\///')" --arg current_time "$current_time" \ - '.workflow_runs[] | select(.head_branch == $ref and .created_at >= $current_time) | .id') + '.workflow_runs[] | select(.head_branch == $ref and .created_at >= $current_time) | .id' | sort -r | head -n 1) if [ -n "$run_id" ]; then echo "🎉 Workflow triggered! Run ID: $run_id" break From b510ab83ae7a5adc711dc2def28951d0ebe9378f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Fri, 1 Dec 2023 23:56:13 +0100 Subject: [PATCH 150/202] Change name of job --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 4c1b9729cac..d54e529fb06 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -72,7 +72,7 @@ jobs: create_compare_node: needs: parse_input - name: Create node from current branch + name: Create node from branch to compare uses: ./.github/workflows/run-a-single-node-from-branch.yml #if: inputs.branch_to_compare != '' secrets: inherit From d3c81a738e4f105dac6d4e11155c37bb39ca0633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Sat, 2 Dec 2023 00:02:26 +0100 Subject: [PATCH 151/202] Fix a ref_name displayed --- .github/workflows/rpc-comparison.yaml | 2 -- .github/workflows/run-a-single-node-from-branch.yml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index d54e529fb06..472bb193b9a 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -59,7 +59,6 @@ jobs: echo "others_matrix=$(jq -c . others_matrix.json)" >> $GITHUB_OUTPUT create_main_node: - needs: parse_input name: Create node from current branch uses: ./.github/workflows/run-a-single-node-from-branch.yml secrets: inherit @@ -71,7 +70,6 @@ jobs: custom_run_id: ${{ github.run_id }} create_compare_node: - needs: parse_input name: Create node from branch to compare uses: ./.github/workflows/run-a-single-node-from-branch.yml #if: inputs.branch_to_compare != '' diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 7d5eccbd12c..1b7991a6ef3 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -220,7 +220,7 @@ jobs: - name: Prepare docker tag id: prepare_ref run: | - REF_NAME=${{ github.ref }} + REF_NAME=${{ inputs.nethermind_repo_ref || github.ref }} CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') echo "CLEAN_REF=$CLEAN_REF" >> $GITHUB_ENV From adb199c677fcaf44625765fc2a951fa9e46b8313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Sat, 2 Dec 2023 00:24:49 +0100 Subject: [PATCH 152/202] Fix ref name --- .github/workflows/run-a-single-node-from-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 1b7991a6ef3..06c7f1c10dc 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -138,7 +138,7 @@ jobs: - name: Prepare docker tag id: prepare_ref run: | - REF_NAME=${{ github.ref }} + REF_NAME=${{ inputs.nethermind_repo_ref || github.ref }} CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') echo "CLEAN_REF=$CLEAN_REF" >> $GITHUB_ENV From f77041011a7cc0e0e9960c1a68ebeec7ec887e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 12:21:09 +0100 Subject: [PATCH 153/202] Cleanup --- .github/workflows/rpc-comparison.yaml | 37 +-------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 472bb193b9a..c4e8003c08c 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -23,41 +23,6 @@ on: required: false jobs: - parse_input: - runs-on: ubuntu-latest - outputs: - others_matrix: ${{ steps.set-matrix.outputs.others_matrix }} - steps: - - name: Install jq - run: sudo apt-get install jq - - - name: Set matrix for branches - id: set-matrix - run: | - #compare_with="${{ github.event.inputs.compare_with }}" - - compare_with="INFURA_ENDPOINT" - - # Add additional comparers if specified - if [[ "$compare_with" != "" ]]; then - IFS=' ' read -r -a additional_branches <<< "$compare_with" - for branch in "${additional_branches[@]}"; do - if [[ "$branch" != "INFURA_ENDPOINT" && "$branch" != "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then - # Treat as additional branch - branches+=("$branch") - else - others+=("$branch") - fi - done - fi - - printf -v joinedothers ', "%s"' "${others[@]}" - OTHERS_MATRIX="{\"other\": [${joinedothers:2}]}" # Ensure the key name 'other' is used - - echo $OTHERS_MATRIX > others_matrix.json - cat others_matrix.json - echo "others_matrix=$(jq -c . others_matrix.json)" >> $GITHUB_OUTPUT - create_main_node: name: Create node from current branch uses: ./.github/workflows/run-a-single-node-from-branch.yml @@ -84,7 +49,7 @@ jobs: aggregate_rpcs: name: Collect all RPC Urls and pass it further runs-on: ubuntu-latest - needs: [create_main_node, create_compare_node, parse_input] + needs: [create_main_node, create_compare_node] outputs: rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} steps: From 71106007725de5e83ba9df888d4e04e74813ec73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 12:45:53 +0100 Subject: [PATCH 154/202] Fix typo --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index c4e8003c08c..66643c30dc9 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -59,7 +59,7 @@ jobs: with: name: rpc-url___${{ github.ref }}___${{ github.run_id }} - - name: Download RPC Artifact for branch to comapre + - name: Download RPC Artifact for branch to compare if: inputs.branch_to_compare != '' uses: actions/download-artifact@v3 with: From afc0e0b1a6a86bd590ebedc0cef2bed6fc33ae1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 13:00:42 +0100 Subject: [PATCH 155/202] Clean refs --- .github/workflows/rpc-comparison.yaml | 21 ++++++++++++++++--- .../run-a-single-node-from-branch.yml | 6 +++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 66643c30dc9..959d959f8c1 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -54,16 +54,31 @@ jobs: rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} steps: + - name: Prepare clean main ref + id: prepare_main_ref + run: | + REF_NAME=${{ github.ref }} + CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV + + - name: Prepare clean compare ref + id: prepare_compare_ref + #if: inputs.branch_to_compare != '' + run: | + REF_NAME=${{ inputs.nethermind_repo_ref }} + CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV + - name: Download RPC Artifact for current branch uses: actions/download-artifact@v3 with: - name: rpc-url___${{ github.ref }}___${{ github.run_id }} + name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - name: Download RPC Artifact for branch to compare - if: inputs.branch_to_compare != '' + #if: inputs.branch_to_compare != '' uses: actions/download-artifact@v3 with: - name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ inputs.branch_to_compare }}___${{ github.run_id }} + name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - name: Process Artifacts Content run: | diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 06c7f1c10dc..a988246e593 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -286,11 +286,11 @@ jobs: if: inputs.custom_run_id != '' run: | workflow_id=${{ inputs.custom_run_id }} - echo "${{ env.RPC_URL }}" > rpc_url_${{ inputs.nethermind_repo_ref }}_${{ inputs.custom_run_id }}.txt + echo "${{ env.RPC_URL }}" > rpc_url_${{ env.CLEAN_REF }}_${{ inputs.custom_run_id }}.txt - name: Upload RPC URL uses: actions/upload-artifact@v3 if: inputs.custom_run_id != '' with: - name: rpc-url___${{ inputs.nethermind_repo_ref }}___${{ inputs.custom_run_id }} - path: rpc_url_${{ inputs.nethermind_repo_ref }}_${{ inputs.custom_run_id }}.txt + name: rpc-url___${{ env.CLEAN_REF }}___${{ inputs.custom_run_id }} + path: rpc_url_${{ env.CLEAN_REF }}_${{ inputs.custom_run_id }}.txt From bc2e998981f447a28b0b1fc848af29fbaf2acb99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 13:17:59 +0100 Subject: [PATCH 156/202] Change artifacts download path --- .github/workflows/rpc-comparison.yaml | 60 ++++++++++++++------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 959d959f8c1..a163abaa171 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -23,33 +23,33 @@ on: required: false jobs: - create_main_node: - name: Create node from current branch - uses: ./.github/workflows/run-a-single-node-from-branch.yml - secrets: inherit - with: - additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None - nethermind_repo_ref: ${{ github.ref }} - custom_run_id: ${{ github.run_id }} - - create_compare_node: - name: Create node from branch to compare - uses: ./.github/workflows/run-a-single-node-from-branch.yml - #if: inputs.branch_to_compare != '' - secrets: inherit - with: - additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None - nethermind_repo_ref: master #${{ inputs.branch_to_compare }} - custom_run_id: ${{ github.run_id }} + #create_main_node: + # name: Create node from current branch + # uses: ./.github/workflows/run-a-single-node-from-branch.yml + # secrets: inherit + # with: + # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + # non_validator_mode: false + # additional_nethermind_flags: Pruning.Mode=None + # nethermind_repo_ref: ${{ github.ref }} + # custom_run_id: ${{ github.run_id }} + # + #create_compare_node: + # name: Create node from branch to compare + # uses: ./.github/workflows/run-a-single-node-from-branch.yml + # #if: inputs.branch_to_compare != '' + # secrets: inherit + # with: + # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + # non_validator_mode: false + # additional_nethermind_flags: Pruning.Mode=None + # nethermind_repo_ref: master #${{ inputs.branch_to_compare }} + # custom_run_id: ${{ github.run_id }} aggregate_rpcs: name: Collect all RPC Urls and pass it further runs-on: ubuntu-latest - needs: [create_main_node, create_compare_node] + #needs: [create_main_node, create_compare_node] outputs: rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} steps: @@ -60,7 +60,7 @@ jobs: REF_NAME=${{ github.ref }} CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV - + - name: Prepare clean compare ref id: prepare_compare_ref #if: inputs.branch_to_compare != '' @@ -68,17 +68,19 @@ jobs: REF_NAME=${{ inputs.nethermind_repo_ref }} CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV - + - name: Download RPC Artifact for current branch uses: actions/download-artifact@v3 with: - name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - + #name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} + name: artifacts/rpc-url___${{ env.CLEAN_MAIN_REF }}___7086240832 + - name: Download RPC Artifact for branch to compare #if: inputs.branch_to_compare != '' uses: actions/download-artifact@v3 with: - name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + #name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + name: artifacts/rpc-url___master___7086240832 #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - name: Process Artifacts Content run: | @@ -95,7 +97,7 @@ jobs: echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT wait_for_node_to_sync: - name: Wait for the node to sync + name: Wait for the nodes to sync runs-on: ubuntu-latest needs: [aggregate_rpcs] timeout-minutes: 600 From 294a5d06c50dc6809aca3ecc620b9016ae854864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 13:27:57 +0100 Subject: [PATCH 157/202] Change action temporarily --- .github/workflows/rpc-comparison.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index a163abaa171..9122457f7ac 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -70,14 +70,16 @@ jobs: echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV - name: Download RPC Artifact for current branch - uses: actions/download-artifact@v3 + #uses: actions/download-artifact@v3 + uses: dawidd6/action-download-artifact@v2 with: #name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} name: artifacts/rpc-url___${{ env.CLEAN_MAIN_REF }}___7086240832 - name: Download RPC Artifact for branch to compare #if: inputs.branch_to_compare != '' - uses: actions/download-artifact@v3 + #uses: actions/download-artifact@v3 + uses: dawidd6/action-download-artifact@v2 with: #name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} name: artifacts/rpc-url___master___7086240832 #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} From 38a1249cbf22feddb57333172901f9330c6bfcf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 13:30:46 +0100 Subject: [PATCH 158/202] Add path param --- .github/workflows/rpc-comparison.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 9122457f7ac..7e5f115c1a6 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -70,19 +70,19 @@ jobs: echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV - name: Download RPC Artifact for current branch - #uses: actions/download-artifact@v3 - uses: dawidd6/action-download-artifact@v2 + uses: actions/download-artifact@v3 with: #name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - name: artifacts/rpc-url___${{ env.CLEAN_MAIN_REF }}___7086240832 + name: rpc-url___${{ env.CLEAN_MAIN_REF }}___7086240832 + path: artifacts/rpc-url___${{ env.CLEAN_MAIN_REF }}___7086240832 - name: Download RPC Artifact for branch to compare #if: inputs.branch_to_compare != '' - #uses: actions/download-artifact@v3 - uses: dawidd6/action-download-artifact@v2 + uses: actions/download-artifact@v3 with: #name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - name: artifacts/rpc-url___master___7086240832 #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + name: rpc-url___master___7086240832 #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + path: artifacts/rpc-url___master___7086240832 #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - name: Process Artifacts Content run: | From 49c795bafdbdd4daa466a55ced936a1d0f711e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 13:32:39 +0100 Subject: [PATCH 159/202] Switch to david action type --- .github/workflows/rpc-comparison.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 7e5f115c1a6..b4fdbf46b62 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -70,7 +70,7 @@ jobs: echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV - name: Download RPC Artifact for current branch - uses: actions/download-artifact@v3 + uses: dawidd6/action-download-artifact@v2 with: #name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} name: rpc-url___${{ env.CLEAN_MAIN_REF }}___7086240832 @@ -78,7 +78,7 @@ jobs: - name: Download RPC Artifact for branch to compare #if: inputs.branch_to_compare != '' - uses: actions/download-artifact@v3 + uses: dawidd6/action-download-artifact@v2 with: #name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} name: rpc-url___master___7086240832 #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} From c8fd4a1d6851b0d3d37f7e3487a508656740f9f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 13:35:40 +0100 Subject: [PATCH 160/202] Trigger new nodes --- .github/workflows/rpc-comparison.yaml | 54 +++++++++++++-------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index b4fdbf46b62..0ab2cc94b1c 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -23,28 +23,28 @@ on: required: false jobs: - #create_main_node: - # name: Create node from current branch - # uses: ./.github/workflows/run-a-single-node-from-branch.yml - # secrets: inherit - # with: - # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - # non_validator_mode: false - # additional_nethermind_flags: Pruning.Mode=None - # nethermind_repo_ref: ${{ github.ref }} - # custom_run_id: ${{ github.run_id }} - # - #create_compare_node: - # name: Create node from branch to compare - # uses: ./.github/workflows/run-a-single-node-from-branch.yml - # #if: inputs.branch_to_compare != '' - # secrets: inherit - # with: - # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - # non_validator_mode: false - # additional_nethermind_flags: Pruning.Mode=None - # nethermind_repo_ref: master #${{ inputs.branch_to_compare }} - # custom_run_id: ${{ github.run_id }} + create_main_node: + name: Create node from current branch + uses: ./.github/workflows/run-a-single-node-from-branch.yml + secrets: inherit + with: + additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: ${{ github.ref }} + custom_run_id: ${{ github.run_id }} + + create_compare_node: + name: Create node from branch to compare + uses: ./.github/workflows/run-a-single-node-from-branch.yml + #if: inputs.branch_to_compare != '' + secrets: inherit + with: + additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: master #${{ inputs.branch_to_compare }} + custom_run_id: ${{ github.run_id }} aggregate_rpcs: name: Collect all RPC Urls and pass it further @@ -72,17 +72,15 @@ jobs: - name: Download RPC Artifact for current branch uses: dawidd6/action-download-artifact@v2 with: - #name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - name: rpc-url___${{ env.CLEAN_MAIN_REF }}___7086240832 - path: artifacts/rpc-url___${{ env.CLEAN_MAIN_REF }}___7086240832 + name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} + path: artifacts/rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - name: Download RPC Artifact for branch to compare #if: inputs.branch_to_compare != '' uses: dawidd6/action-download-artifact@v2 with: - #name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - name: rpc-url___master___7086240832 #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - path: artifacts/rpc-url___master___7086240832 #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + path: artifacts/rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - name: Process Artifacts Content run: | From d639b3d6c2d7939779f5d30b18a2a83009efb1aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 13:37:17 +0100 Subject: [PATCH 161/202] Rollback needs --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 0ab2cc94b1c..68769e0b4a6 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -49,7 +49,7 @@ jobs: aggregate_rpcs: name: Collect all RPC Urls and pass it further runs-on: ubuntu-latest - #needs: [create_main_node, create_compare_node] + needs: [create_main_node, create_compare_node] outputs: rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} steps: From 943bfb2326d9ba596df0c07417e887b12003cc8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 13:39:49 +0100 Subject: [PATCH 162/202] Fix if check for docker build creation --- .github/workflows/run-a-single-node-from-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index a988246e593..04a70db266e 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -169,7 +169,7 @@ jobs: id: check_conditions run: | if - [[ "${{ github.ref }}" == "refs/heads/master" ]] && + [[ "${{ inputs.nethermind_repo_ref || github.ref }}" == "refs/heads/master" ]] && [[ "${{ steps.extract_dockerfile.outputs.dockerfile }}" == "Dockerfile" ]] && [[ "${{ steps.extract_dockerfile.outputs.build-config }}" == "release" ]]; then echo "skip_docker_build=true" >> $GITHUB_OUTPUT From 384063778c5a27bc853d009ba18f287c5227ba90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 14:09:27 +0100 Subject: [PATCH 163/202] Rolback to classic artifacts downoad --- .github/workflows/rpc-comparison.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 68769e0b4a6..305fac20102 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -70,14 +70,14 @@ jobs: echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV - name: Download RPC Artifact for current branch - uses: dawidd6/action-download-artifact@v2 + uses: actions/download-artifact@v3 with: name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} path: artifacts/rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - name: Download RPC Artifact for branch to compare #if: inputs.branch_to_compare != '' - uses: dawidd6/action-download-artifact@v2 + uses: actions/download-artifact@v3 with: name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} path: artifacts/rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} From b914ac993e7347a5c5d830f52a40c6f710e208e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 14:34:47 +0100 Subject: [PATCH 164/202] Add better docker image check --- .github/workflows/run-a-single-node-from-branch.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 04a70db266e..404bf6bdf6a 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -168,6 +168,15 @@ jobs: - name: Check if master branch and default additional_options id: check_conditions run: | + ref="${{ inputs.nethermind_repo_ref || github.ref }}" + if [ -z "$ref" ]; then + ref="${{ github.ref }}" + fi + # Append "refs/heads/" prefix if it's not already there + if [[ $ref != refs/heads/* ]]; then + ref="refs/heads/$ref" + fi + if [[ "${{ inputs.nethermind_repo_ref || github.ref }}" == "refs/heads/master" ]] && [[ "${{ steps.extract_dockerfile.outputs.dockerfile }}" == "Dockerfile" ]] && From eb5a81ca7e9a94057e095c9b1d653c2bb15f8c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 14:35:30 +0100 Subject: [PATCH 165/202] Add missing if condition --- .github/workflows/run-a-single-node-from-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 404bf6bdf6a..5993a324fd2 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -178,7 +178,7 @@ jobs: fi if - [[ "${{ inputs.nethermind_repo_ref || github.ref }}" == "refs/heads/master" ]] && + [[ "$ref" == "refs/heads/master" ]] && [[ "${{ steps.extract_dockerfile.outputs.dockerfile }}" == "Dockerfile" ]] && [[ "${{ steps.extract_dockerfile.outputs.build-config }}" == "release" ]]; then echo "skip_docker_build=true" >> $GITHUB_OUTPUT From 7a24bd94e7ae2cedd00a771ffa1f02a1bfaf77d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 17:51:26 +0100 Subject: [PATCH 166/202] Fix paths and add temp sepolia --- .github/workflows/rpc-comparison.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 305fac20102..21dbddd554c 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -33,6 +33,7 @@ jobs: additional_nethermind_flags: Pruning.Mode=None nethermind_repo_ref: ${{ github.ref }} custom_run_id: ${{ github.run_id }} + network: sepolia #to be removed create_compare_node: name: Create node from branch to compare @@ -45,6 +46,7 @@ jobs: additional_nethermind_flags: Pruning.Mode=None nethermind_repo_ref: master #${{ inputs.branch_to_compare }} custom_run_id: ${{ github.run_id }} + network: sepolia #to be removed aggregate_rpcs: name: Collect all RPC Urls and pass it further @@ -73,18 +75,19 @@ jobs: uses: actions/download-artifact@v3 with: name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - path: artifacts/rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} + path: artifacts - name: Download RPC Artifact for branch to compare #if: inputs.branch_to_compare != '' uses: actions/download-artifact@v3 with: name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - path: artifacts/rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + path: artifacts - name: Process Artifacts Content run: | rpc_urls="" + ls artifacts for file in artifacts/*; do if [ -f "$file" ]; then branch=$(basename $file | cut -d '___' -f 3) From 44c86aa1d70826e32537ca8c1907cd21b30e863e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 18:02:41 +0100 Subject: [PATCH 167/202] Change delimiter --- .github/workflows/rpc-comparison.yaml | 2 +- .github/workflows/run-a-single-node-from-branch.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 21dbddd554c..accd2bc8b0d 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -90,7 +90,7 @@ jobs: ls artifacts for file in artifacts/*; do if [ -f "$file" ]; then - branch=$(basename $file | cut -d '___' -f 3) + branch=$(basename $file | cut -d '%' -f 2) url_content=$(cat "$file") rpc_urls+="$branch::$url_content," fi diff --git a/.github/workflows/run-a-single-node-from-branch.yml b/.github/workflows/run-a-single-node-from-branch.yml index 5993a324fd2..5caf4594466 100644 --- a/.github/workflows/run-a-single-node-from-branch.yml +++ b/.github/workflows/run-a-single-node-from-branch.yml @@ -295,11 +295,11 @@ jobs: if: inputs.custom_run_id != '' run: | workflow_id=${{ inputs.custom_run_id }} - echo "${{ env.RPC_URL }}" > rpc_url_${{ env.CLEAN_REF }}_${{ inputs.custom_run_id }}.txt + echo "${{ env.RPC_URL }}" > rpc_url%${{ env.CLEAN_REF }}%${{ inputs.custom_run_id }}.txt - name: Upload RPC URL uses: actions/upload-artifact@v3 if: inputs.custom_run_id != '' with: name: rpc-url___${{ env.CLEAN_REF }}___${{ inputs.custom_run_id }} - path: rpc_url_${{ env.CLEAN_REF }}_${{ inputs.custom_run_id }}.txt + path: rpc_url%${{ env.CLEAN_REF }}%${{ inputs.custom_run_id }}.txt From 1803f066abdf42a6e919aafcc041107f97c90920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 18:23:29 +0100 Subject: [PATCH 168/202] Adjust waiting for node --- .github/workflows/rpc-comparison.yaml | 35 ++++++++++++++++++--------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index accd2bc8b0d..8c10810cd20 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -33,7 +33,7 @@ jobs: additional_nethermind_flags: Pruning.Mode=None nethermind_repo_ref: ${{ github.ref }} custom_run_id: ${{ github.run_id }} - network: sepolia #to be removed + network: holesky #to be removed create_compare_node: name: Create node from branch to compare @@ -46,7 +46,7 @@ jobs: additional_nethermind_flags: Pruning.Mode=None nethermind_repo_ref: master #${{ inputs.branch_to_compare }} custom_run_id: ${{ github.run_id }} - network: sepolia #to be removed + network: holesky #to be removed aggregate_rpcs: name: Collect all RPC Urls and pass it further @@ -136,29 +136,40 @@ jobs: processed_rpc_urls+=("$processed_url") done - # Convert the processed URLs back to a comma-separated string - IFS=','; rpc_urls="${processed_rpc_urls[*]}"; unset IFS - + # Assuming rpc_urls_str is a comma-separated string of URLs + rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" + + # Loop through the array and strip the branch prefix + processed_rpc_urls=() + for url_entry in "${rpc_urls_array[@]}"; do + processed_url="${url_entry#*::}" # Remove everything up to and including "::" + processed_rpc_urls+=("$processed_url") + done + sync_complete_flag=0 - + check_sync() { rpc_url=$1 - while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' $rpc_url | jq -e '.result'; do - sleep 300 + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do + echo "Still waiting for node to be sync at RPC: $rpc_url ." + sleep 60 done echo "Node at $rpc_url synced." sync_complete_flag=$((sync_complete_flag+1)) } - - for url in "${rpc_urls[@]}"; do + + # Iterate over the processed array of URLs + for url in "${processed_rpc_urls[@]}"; do check_sync "$url" & done - + # Wait for all nodes to sync - while [ $sync_complete_flag -ne ${#rpc_urls[@]} ]; do + while [ $sync_complete_flag -ne ${#processed_rpc_urls[@]} ]; do sleep 60 done + compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest From 09f6dbad41a8e6b469bfdcd8e1362d1af0ff880f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 18:44:08 +0100 Subject: [PATCH 169/202] Fix wrong output --- .github/workflows/rpc-comparison.yaml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 8c10810cd20..71e85b09ac5 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -53,7 +53,7 @@ jobs: runs-on: ubuntu-latest needs: [create_main_node, create_compare_node] outputs: - rpc_urls: ${{ steps.aggregate_rpcs.outputs.rpc_urls }} + rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} steps: - name: Prepare clean main ref @@ -85,6 +85,7 @@ jobs: path: artifacts - name: Process Artifacts Content + id: process_artifacts run: | rpc_urls="" ls artifacts @@ -125,17 +126,7 @@ jobs: - name: Wait for the nodes to sync timeout-minutes: 600 - run: | - rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" - - # Loop through the array and strip the branch prefix - processed_rpc_urls=() - for url_entry in "${rpc_urls_array[@]}"; do - processed_url="${url_entry#*::}" # Remove everything up to and including "::" - processed_rpc_urls+=("$processed_url") - done - + run: | # Assuming rpc_urls_str is a comma-separated string of URLs rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" From 0a67a581389c95aed4a6ab299fbcfdb1d441c7af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 19:09:49 +0100 Subject: [PATCH 170/202] Mock and test --- .github/workflows/rpc-comparison.yaml | 166 +++++++++++++------------- 1 file changed, 84 insertions(+), 82 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 71e85b09ac5..d1de9792cf2 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -23,87 +23,87 @@ on: required: false jobs: - create_main_node: - name: Create node from current branch - uses: ./.github/workflows/run-a-single-node-from-branch.yml - secrets: inherit - with: - additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None - nethermind_repo_ref: ${{ github.ref }} - custom_run_id: ${{ github.run_id }} - network: holesky #to be removed - - create_compare_node: - name: Create node from branch to compare - uses: ./.github/workflows/run-a-single-node-from-branch.yml - #if: inputs.branch_to_compare != '' - secrets: inherit - with: - additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None - nethermind_repo_ref: master #${{ inputs.branch_to_compare }} - custom_run_id: ${{ github.run_id }} - network: holesky #to be removed - - aggregate_rpcs: - name: Collect all RPC Urls and pass it further - runs-on: ubuntu-latest - needs: [create_main_node, create_compare_node] - outputs: - rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} - steps: - - - name: Prepare clean main ref - id: prepare_main_ref - run: | - REF_NAME=${{ github.ref }} - CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV - - - name: Prepare clean compare ref - id: prepare_compare_ref - #if: inputs.branch_to_compare != '' - run: | - REF_NAME=${{ inputs.nethermind_repo_ref }} - CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV - - - name: Download RPC Artifact for current branch - uses: actions/download-artifact@v3 - with: - name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - path: artifacts - - - name: Download RPC Artifact for branch to compare - #if: inputs.branch_to_compare != '' - uses: actions/download-artifact@v3 - with: - name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - path: artifacts - - - name: Process Artifacts Content - id: process_artifacts - run: | - rpc_urls="" - ls artifacts - for file in artifacts/*; do - if [ -f "$file" ]; then - branch=$(basename $file | cut -d '%' -f 2) - url_content=$(cat "$file") - rpc_urls+="$branch::$url_content," - fi - done - rpc_urls=${rpc_urls%,} - echo $rpc_urls - echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT + #create_main_node: + # name: Create node from current branch + # uses: ./.github/workflows/run-a-single-node-from-branch.yml + # secrets: inherit + # with: + # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + # non_validator_mode: false + # additional_nethermind_flags: Pruning.Mode=None + # nethermind_repo_ref: ${{ github.ref }} + # custom_run_id: ${{ github.run_id }} + # network: holesky #to be removed + # + #create_compare_node: + # name: Create node from branch to compare + # uses: ./.github/workflows/run-a-single-node-from-branch.yml + # #if: inputs.branch_to_compare != '' + # secrets: inherit + # with: + # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + # non_validator_mode: false + # additional_nethermind_flags: Pruning.Mode=None + # nethermind_repo_ref: master #${{ inputs.branch_to_compare }} + # custom_run_id: ${{ github.run_id }} + # network: holesky #to be removed + # + #aggregate_rpcs: + # name: Collect all RPC Urls and pass it further + # runs-on: ubuntu-latest + # needs: [create_main_node, create_compare_node] + # outputs: + # rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} + # steps: + # + # - name: Prepare clean main ref + # id: prepare_main_ref + # run: | + # REF_NAME=${{ github.ref }} + # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + # echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV + # + # - name: Prepare clean compare ref + # id: prepare_compare_ref + # #if: inputs.branch_to_compare != '' + # run: | + # REF_NAME=${{ inputs.nethermind_repo_ref }} + # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + # echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV + # + # - name: Download RPC Artifact for current branch + # uses: actions/download-artifact@v3 + # with: + # name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} + # path: artifacts + # + # - name: Download RPC Artifact for branch to compare + # #if: inputs.branch_to_compare != '' + # uses: actions/download-artifact@v3 + # with: + # name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + # path: artifacts + # + # - name: Process Artifacts Content + # id: process_artifacts + # run: | + # rpc_urls="" + # ls artifacts + # for file in artifacts/*; do + # if [ -f "$file" ]; then + # branch=$(basename $file | cut -d '%' -f 2) + # url_content=$(cat "$file") + # rpc_urls+="$branch::$url_content," + # fi + # done + # rpc_urls=${rpc_urls%,} + # echo $rpc_urls + # echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT wait_for_node_to_sync: name: Wait for the nodes to sync runs-on: ubuntu-latest - needs: [aggregate_rpcs] + #needs: [aggregate_rpcs] timeout-minutes: 600 steps: - uses: actions/checkout@v3 @@ -128,7 +128,8 @@ jobs: timeout-minutes: 600 run: | # Assuming rpc_urls_str is a comma-separated string of URLs - rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + #rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + rpc_urls_str="master::http://172.105.153.109:8545,rpc-comparision-1.23.0::http://172.105.153.200:8545" IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" # Loop through the array and strip the branch prefix @@ -142,9 +143,9 @@ jobs: check_sync() { rpc_url=$1 - while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do - echo "Still waiting for node to be sync at RPC: $rpc_url ." - sleep 60 + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" > /dev/null 2>&1 | jq -e '.result'; do + echo "Still waiting for node to be synced at RPC: $rpc_url ." + sleep 30 done echo "Node at $rpc_url synced." sync_complete_flag=$((sync_complete_flag+1)) @@ -191,7 +192,8 @@ jobs: - name: Test equality of responses run: | - rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + #rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + rpc_urls_str="master::http://172.105.153.109:8545,rpc-comparision-1.23.0::http://172.105.153.200:8545" IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str"; unset IFS nethermind_urls_str=() From 2f7bc958c41f7f2eca1e4236cef8a49b911521a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 19:29:02 +0100 Subject: [PATCH 171/202] Fix issue --- .github/workflows/rpc-comparison.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index d1de9792cf2..988a4717435 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -144,7 +144,7 @@ jobs: check_sync() { rpc_url=$1 while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" > /dev/null 2>&1 | jq -e '.result'; do - echo "Still waiting for node to be synced at RPC: $rpc_url ." + echo "Still waiting for node to be synced at RPC: $rpc_url." sleep 30 done echo "Node at $rpc_url synced." @@ -153,12 +153,7 @@ jobs: # Iterate over the processed array of URLs for url in "${processed_rpc_urls[@]}"; do - check_sync "$url" & - done - - # Wait for all nodes to sync - while [ $sync_complete_flag -ne ${#processed_rpc_urls[@]} ]; do - sleep 60 + check_sync "$url" done From 73b5f542b9016f23e68842406e14ef04a9bb699b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 19:32:01 +0100 Subject: [PATCH 172/202] Fix issue2 --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 988a4717435..cc9e67460ac 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -143,7 +143,7 @@ jobs: check_sync() { rpc_url=$1 - while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" > /dev/null 2>&1 | jq -e '.result'; do + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do echo "Still waiting for node to be synced at RPC: $rpc_url." sleep 30 done From e4fbe66f8ef7c87d50e0bc2d9cb761338ceabd0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 19:47:44 +0100 Subject: [PATCH 173/202] Fix issue --- .github/workflows/rpc-comparison.yaml | 112 +++++++++++++------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index cc9e67460ac..c4a6f0278ae 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -100,61 +100,61 @@ jobs: # echo $rpc_urls # echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT - wait_for_node_to_sync: - name: Wait for the nodes to sync - runs-on: ubuntu-latest - #needs: [aggregate_rpcs] - timeout-minutes: 600 - steps: - - uses: actions/checkout@v3 - - name: Install WireGuard - run: | - sudo apt update - sudo apt install -y wireguard resolvconf - sudo mkdir -p /etc/wireguard - envsubst < scripts/wireguard.conf.template > wg0.conf - sudo wg-quick up ./wg0.conf - env: - WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' - WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' - WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' - WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' - WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' - WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' - WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' - WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - - - name: Wait for the nodes to sync - timeout-minutes: 600 - run: | - # Assuming rpc_urls_str is a comma-separated string of URLs - #rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - rpc_urls_str="master::http://172.105.153.109:8545,rpc-comparision-1.23.0::http://172.105.153.200:8545" - IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" - - # Loop through the array and strip the branch prefix - processed_rpc_urls=() - for url_entry in "${rpc_urls_array[@]}"; do - processed_url="${url_entry#*::}" # Remove everything up to and including "::" - processed_rpc_urls+=("$processed_url") - done - - sync_complete_flag=0 - - check_sync() { - rpc_url=$1 - while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do - echo "Still waiting for node to be synced at RPC: $rpc_url." - sleep 30 - done - echo "Node at $rpc_url synced." - sync_complete_flag=$((sync_complete_flag+1)) - } - - # Iterate over the processed array of URLs - for url in "${processed_rpc_urls[@]}"; do - check_sync "$url" - done + #wait_for_node_to_sync: + # name: Wait for the nodes to sync + # runs-on: ubuntu-latest + # #needs: [aggregate_rpcs] + # timeout-minutes: 600 + # steps: + # - uses: actions/checkout@v3 + # - name: Install WireGuard + # run: | + # sudo apt update + # sudo apt install -y wireguard resolvconf + # sudo mkdir -p /etc/wireguard + # envsubst < scripts/wireguard.conf.template > wg0.conf + # sudo wg-quick up ./wg0.conf + # env: + # WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + # WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + # WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + # WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + # WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + # WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + # WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + # WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + # + # - name: Wait for the nodes to sync + # timeout-minutes: 600 + # run: | + # # Assuming rpc_urls_str is a comma-separated string of URLs + # #rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + # rpc_urls_str="master::http://172.105.153.109:8545,rpc-comparision-1.23.0::http://172.105.153.200:8545" + # IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" + # + # # Loop through the array and strip the branch prefix + # processed_rpc_urls=() + # for url_entry in "${rpc_urls_array[@]}"; do + # processed_url="${url_entry#*::}" # Remove everything up to and including "::" + # processed_rpc_urls+=("$processed_url") + # done + # + # sync_complete_flag=0 + # + # check_sync() { + # rpc_url=$1 + # while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do + # echo "Still waiting for node to be synced at RPC: $rpc_url." + # sleep 30 + # done + # echo "Node at $rpc_url synced." + # sync_complete_flag=$((sync_complete_flag+1)) + # } + # + # # Iterate over the processed array of URLs + # for url in "${processed_rpc_urls[@]}"; do + # check_sync "$url" + # done compare: @@ -205,7 +205,7 @@ jobs: for other in "${others_str_array[@]}"; do if [[ "$other" == "INFURA_ENDPOINT" ]]; then others_prepared_str+="$other=${INFURA_ENDPOINT} " - else [[ "$other" == "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then + elif [[ "$other" == "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then # Use 'elif' instead of 'else' others_prepared_str+="$other=${NETHERMIND_ARCHIVE_ENDPOINT} " fi done From fe2373d87108d9a63a79b303870ca766cc986a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 19:52:14 +0100 Subject: [PATCH 174/202] Remove deps --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index c4a6f0278ae..39dbc05722a 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -160,7 +160,7 @@ jobs: compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - needs: [wait_for_node_to_sync] + #needs: [wait_for_node_to_sync] steps: - uses: actions/checkout@v3 - name: Install flood From fe9b95bb8aa428e0609391ca7d8ca9e52cbc67e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 20:02:04 +0100 Subject: [PATCH 175/202] Fix invalid " --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 39dbc05722a..d38dc994374 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -214,5 +214,5 @@ jobs: nethermind_urls_str="${nethermind_urls_str% }" others_prepared_str="${others_prepared_str% }" - echo "flood all $nethermind_urls_str $others_prepared_str --equality"" + echo "flood all $nethermind_urls_str $others_prepared_str --equality" flood all $nethermind_urls_str $others_prepared_str --equality From 59798808198fd7465183a8059b4baa18773f49ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 20:09:00 +0100 Subject: [PATCH 176/202] Revert comments back --- .github/workflows/rpc-comparison.yaml | 269 +++++++++++++------------- 1 file changed, 134 insertions(+), 135 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index d38dc994374..310cee3aebf 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -23,144 +23,143 @@ on: required: false jobs: - #create_main_node: - # name: Create node from current branch - # uses: ./.github/workflows/run-a-single-node-from-branch.yml - # secrets: inherit - # with: - # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - # non_validator_mode: false - # additional_nethermind_flags: Pruning.Mode=None - # nethermind_repo_ref: ${{ github.ref }} - # custom_run_id: ${{ github.run_id }} - # network: holesky #to be removed - # - #create_compare_node: - # name: Create node from branch to compare - # uses: ./.github/workflows/run-a-single-node-from-branch.yml - # #if: inputs.branch_to_compare != '' - # secrets: inherit - # with: - # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - # non_validator_mode: false - # additional_nethermind_flags: Pruning.Mode=None - # nethermind_repo_ref: master #${{ inputs.branch_to_compare }} - # custom_run_id: ${{ github.run_id }} - # network: holesky #to be removed - # - #aggregate_rpcs: - # name: Collect all RPC Urls and pass it further - # runs-on: ubuntu-latest - # needs: [create_main_node, create_compare_node] - # outputs: - # rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} - # steps: - # - # - name: Prepare clean main ref - # id: prepare_main_ref - # run: | - # REF_NAME=${{ github.ref }} - # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - # echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV - # - # - name: Prepare clean compare ref - # id: prepare_compare_ref - # #if: inputs.branch_to_compare != '' - # run: | - # REF_NAME=${{ inputs.nethermind_repo_ref }} - # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - # echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV - # - # - name: Download RPC Artifact for current branch - # uses: actions/download-artifact@v3 - # with: - # name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - # path: artifacts - # - # - name: Download RPC Artifact for branch to compare - # #if: inputs.branch_to_compare != '' - # uses: actions/download-artifact@v3 - # with: - # name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - # path: artifacts - # - # - name: Process Artifacts Content - # id: process_artifacts - # run: | - # rpc_urls="" - # ls artifacts - # for file in artifacts/*; do - # if [ -f "$file" ]; then - # branch=$(basename $file | cut -d '%' -f 2) - # url_content=$(cat "$file") - # rpc_urls+="$branch::$url_content," - # fi - # done - # rpc_urls=${rpc_urls%,} - # echo $rpc_urls - # echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT + create_main_node: + name: Create node from current branch + uses: ./.github/workflows/run-a-single-node-from-branch.yml + secrets: inherit + with: + additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: ${{ github.ref }} + custom_run_id: ${{ github.run_id }} + network: holesky #to be removed + + create_compare_node: + name: Create node from branch to compare + uses: ./.github/workflows/run-a-single-node-from-branch.yml + #if: inputs.branch_to_compare != '' + secrets: inherit + with: + additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: master #${{ inputs.branch_to_compare }} + custom_run_id: ${{ github.run_id }} + network: holesky #to be removed + + aggregate_rpcs: + name: Collect all RPC Urls and pass it further + runs-on: ubuntu-latest + needs: [create_main_node, create_compare_node] + outputs: + rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} + steps: + + - name: Prepare clean main ref + id: prepare_main_ref + run: | + REF_NAME=${{ github.ref }} + CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV + + - name: Prepare clean compare ref + id: prepare_compare_ref + #if: inputs.branch_to_compare != '' + run: | + REF_NAME=${{ inputs.nethermind_repo_ref }} + CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV + + - name: Download RPC Artifact for current branch + uses: actions/download-artifact@v3 + with: + name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} + path: artifacts + + - name: Download RPC Artifact for branch to compare + #if: inputs.branch_to_compare != '' + uses: actions/download-artifact@v3 + with: + name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + path: artifacts + + - name: Process Artifacts Content + id: process_artifacts + run: | + rpc_urls="" + ls artifacts + for file in artifacts/*; do + if [ -f "$file" ]; then + branch=$(basename $file | cut -d '%' -f 2) + url_content=$(cat "$file") + rpc_urls+="$branch::$url_content," + fi + done + rpc_urls=${rpc_urls%,} + echo $rpc_urls + echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT - #wait_for_node_to_sync: - # name: Wait for the nodes to sync - # runs-on: ubuntu-latest - # #needs: [aggregate_rpcs] - # timeout-minutes: 600 - # steps: - # - uses: actions/checkout@v3 - # - name: Install WireGuard - # run: | - # sudo apt update - # sudo apt install -y wireguard resolvconf - # sudo mkdir -p /etc/wireguard - # envsubst < scripts/wireguard.conf.template > wg0.conf - # sudo wg-quick up ./wg0.conf - # env: - # WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' - # WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' - # WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' - # WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' - # WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' - # WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' - # WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' - # WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - # - # - name: Wait for the nodes to sync - # timeout-minutes: 600 - # run: | - # # Assuming rpc_urls_str is a comma-separated string of URLs - # #rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - # rpc_urls_str="master::http://172.105.153.109:8545,rpc-comparision-1.23.0::http://172.105.153.200:8545" - # IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" - # - # # Loop through the array and strip the branch prefix - # processed_rpc_urls=() - # for url_entry in "${rpc_urls_array[@]}"; do - # processed_url="${url_entry#*::}" # Remove everything up to and including "::" - # processed_rpc_urls+=("$processed_url") - # done - # - # sync_complete_flag=0 - # - # check_sync() { - # rpc_url=$1 - # while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do - # echo "Still waiting for node to be synced at RPC: $rpc_url." - # sleep 30 - # done - # echo "Node at $rpc_url synced." - # sync_complete_flag=$((sync_complete_flag+1)) - # } - # - # # Iterate over the processed array of URLs - # for url in "${processed_rpc_urls[@]}"; do - # check_sync "$url" - # done + wait_for_node_to_sync: + name: Wait for the nodes to sync + runs-on: ubuntu-latest + needs: [aggregate_rpcs] + timeout-minutes: 600 + steps: + - uses: actions/checkout@v3 + - name: Install WireGuard + run: | + sudo apt update + sudo apt install -y wireguard resolvconf + sudo mkdir -p /etc/wireguard + envsubst < scripts/wireguard.conf.template > wg0.conf + sudo wg-quick up ./wg0.conf + env: + WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Wait for the nodes to sync + timeout-minutes: 600 + run: | + # Assuming rpc_urls_str is a comma-separated string of URLs + rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" + + # Loop through the array and strip the branch prefix + processed_rpc_urls=() + for url_entry in "${rpc_urls_array[@]}"; do + processed_url="${url_entry#*::}" # Remove everything up to and including "::" + processed_rpc_urls+=("$processed_url") + done + + sync_complete_flag=0 + + check_sync() { + rpc_url=$1 + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do + echo "Still waiting for node to be synced at RPC: $rpc_url." + sleep 30 + done + echo "Node at $rpc_url synced." + sync_complete_flag=$((sync_complete_flag+1)) + } + + # Iterate over the processed array of URLs + for url in "${processed_rpc_urls[@]}"; do + check_sync "$url" + done compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - #needs: [wait_for_node_to_sync] + needs: [wait_for_node_to_sync] steps: - uses: actions/checkout@v3 - name: Install flood @@ -187,8 +186,7 @@ jobs: - name: Test equality of responses run: | - #rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - rpc_urls_str="master::http://172.105.153.109:8545,rpc-comparision-1.23.0::http://172.105.153.200:8545" + rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str"; unset IFS nethermind_urls_str=() @@ -198,7 +196,8 @@ jobs: nethermind_urls_str+="nethermind_$branch=$url " done - others_str="${{ github.event.inputs.compare_with }}" + #others_str="${{ github.event.inputs.compare_with }}" + others_str="INFURA_ENDPOINT NETHERMIND_ARCHIVE_ENDPOINT" IFS=' ' read -r -a others_str_array <<< "$others_str"; unset IFS others_prepared_str=() From e340e676ffd1c1911841d0cd07e1a23ee1c55778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 20:35:57 +0100 Subject: [PATCH 177/202] Test on existing infra --- .github/workflows/rpc-comparison.yaml | 275 +++++++++++++------------- 1 file changed, 138 insertions(+), 137 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 310cee3aebf..e183650879e 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -23,143 +23,143 @@ on: required: false jobs: - create_main_node: - name: Create node from current branch - uses: ./.github/workflows/run-a-single-node-from-branch.yml - secrets: inherit - with: - additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None - nethermind_repo_ref: ${{ github.ref }} - custom_run_id: ${{ github.run_id }} - network: holesky #to be removed - - create_compare_node: - name: Create node from branch to compare - uses: ./.github/workflows/run-a-single-node-from-branch.yml - #if: inputs.branch_to_compare != '' - secrets: inherit - with: - additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None - nethermind_repo_ref: master #${{ inputs.branch_to_compare }} - custom_run_id: ${{ github.run_id }} - network: holesky #to be removed - - aggregate_rpcs: - name: Collect all RPC Urls and pass it further - runs-on: ubuntu-latest - needs: [create_main_node, create_compare_node] - outputs: - rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} - steps: - - - name: Prepare clean main ref - id: prepare_main_ref - run: | - REF_NAME=${{ github.ref }} - CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV - - - name: Prepare clean compare ref - id: prepare_compare_ref - #if: inputs.branch_to_compare != '' - run: | - REF_NAME=${{ inputs.nethermind_repo_ref }} - CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV - - - name: Download RPC Artifact for current branch - uses: actions/download-artifact@v3 - with: - name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - path: artifacts - - - name: Download RPC Artifact for branch to compare - #if: inputs.branch_to_compare != '' - uses: actions/download-artifact@v3 - with: - name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - path: artifacts - - - name: Process Artifacts Content - id: process_artifacts - run: | - rpc_urls="" - ls artifacts - for file in artifacts/*; do - if [ -f "$file" ]; then - branch=$(basename $file | cut -d '%' -f 2) - url_content=$(cat "$file") - rpc_urls+="$branch::$url_content," - fi - done - rpc_urls=${rpc_urls%,} - echo $rpc_urls - echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT - - wait_for_node_to_sync: - name: Wait for the nodes to sync - runs-on: ubuntu-latest - needs: [aggregate_rpcs] - timeout-minutes: 600 - steps: - - uses: actions/checkout@v3 - - name: Install WireGuard - run: | - sudo apt update - sudo apt install -y wireguard resolvconf - sudo mkdir -p /etc/wireguard - envsubst < scripts/wireguard.conf.template > wg0.conf - sudo wg-quick up ./wg0.conf - env: - WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' - WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' - WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' - WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' - WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' - WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' - WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' - WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - - - name: Wait for the nodes to sync - timeout-minutes: 600 - run: | - # Assuming rpc_urls_str is a comma-separated string of URLs - rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" - - # Loop through the array and strip the branch prefix - processed_rpc_urls=() - for url_entry in "${rpc_urls_array[@]}"; do - processed_url="${url_entry#*::}" # Remove everything up to and including "::" - processed_rpc_urls+=("$processed_url") - done - - sync_complete_flag=0 - - check_sync() { - rpc_url=$1 - while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do - echo "Still waiting for node to be synced at RPC: $rpc_url." - sleep 30 - done - echo "Node at $rpc_url synced." - sync_complete_flag=$((sync_complete_flag+1)) - } - - # Iterate over the processed array of URLs - for url in "${processed_rpc_urls[@]}"; do - check_sync "$url" - done - - + #create_main_node: + # name: Create node from current branch + # uses: ./.github/workflows/run-a-single-node-from-branch.yml + # secrets: inherit + # with: + # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + # non_validator_mode: false + # additional_nethermind_flags: Pruning.Mode=None + # nethermind_repo_ref: ${{ github.ref }} + # custom_run_id: ${{ github.run_id }} + # network: holesky #to be removed + # + #create_compare_node: + # name: Create node from branch to compare + # uses: ./.github/workflows/run-a-single-node-from-branch.yml + # #if: inputs.branch_to_compare != '' + # secrets: inherit + # with: + # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + # non_validator_mode: false + # additional_nethermind_flags: Pruning.Mode=None + # nethermind_repo_ref: master #${{ inputs.branch_to_compare }} + # custom_run_id: ${{ github.run_id }} + # network: holesky #to be removed + # + #aggregate_rpcs: + # name: Collect all RPC Urls and pass it further + # runs-on: ubuntu-latest + # needs: [create_main_node, create_compare_node] + # outputs: + # rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} + # steps: + # + # - name: Prepare clean main ref + # id: prepare_main_ref + # run: | + # REF_NAME=${{ github.ref }} + # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + # echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV + # + # - name: Prepare clean compare ref + # id: prepare_compare_ref + # #if: inputs.branch_to_compare != '' + # run: | + # REF_NAME=${{ inputs.nethermind_repo_ref }} + # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + # echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV + # + # - name: Download RPC Artifact for current branch + # uses: actions/download-artifact@v3 + # with: + # name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} + # path: artifacts + # + # - name: Download RPC Artifact for branch to compare + # #if: inputs.branch_to_compare != '' + # uses: actions/download-artifact@v3 + # with: + # name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + # path: artifacts + # + # - name: Process Artifacts Content + # id: process_artifacts + # run: | + # rpc_urls="" + # ls artifacts + # for file in artifacts/*; do + # if [ -f "$file" ]; then + # branch=$(basename $file | cut -d '%' -f 2) + # url_content=$(cat "$file") + # rpc_urls+="$branch::$url_content," + # fi + # done + # rpc_urls=${rpc_urls%,} + # echo $rpc_urls + # echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT + # + #wait_for_node_to_sync: + # name: Wait for the nodes to sync + # runs-on: ubuntu-latest + # needs: [aggregate_rpcs] + # timeout-minutes: 600 + # steps: + # - uses: actions/checkout@v3 + # - name: Install WireGuard + # run: | + # sudo apt update + # sudo apt install -y wireguard resolvconf + # sudo mkdir -p /etc/wireguard + # envsubst < scripts/wireguard.conf.template > wg0.conf + # sudo wg-quick up ./wg0.conf + # env: + # WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + # WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + # WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + # WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + # WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + # WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + # WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + # WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + # + # - name: Wait for the nodes to sync + # timeout-minutes: 600 + # run: | + # # Assuming rpc_urls_str is a comma-separated string of URLs + # rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + # IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" + # + # # Loop through the array and strip the branch prefix + # processed_rpc_urls=() + # for url_entry in "${rpc_urls_array[@]}"; do + # processed_url="${url_entry#*::}" # Remove everything up to and including "::" + # processed_rpc_urls+=("$processed_url") + # done + # + # sync_complete_flag=0 + # + # check_sync() { + # rpc_url=$1 + # while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do + # echo "Still waiting for node to be synced at RPC: $rpc_url." + # sleep 30 + # done + # echo "Node at $rpc_url synced." + # sync_complete_flag=$((sync_complete_flag+1)) + # } + # + # # Iterate over the processed array of URLs + # for url in "${processed_rpc_urls[@]}"; do + # check_sync "$url" + # done + # + # compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - needs: [wait_for_node_to_sync] + #needs: [wait_for_node_to_sync, aggregate_rpcs] steps: - uses: actions/checkout@v3 - name: Install flood @@ -186,7 +186,8 @@ jobs: - name: Test equality of responses run: | - rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + #rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + rpc_urls_str="master::http://139.144.63.90:8545,rpc-comparision-1.23.0::http://45.79.192.245:8545" IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str"; unset IFS nethermind_urls_str=() @@ -203,9 +204,9 @@ jobs: others_prepared_str=() for other in "${others_str_array[@]}"; do if [[ "$other" == "INFURA_ENDPOINT" ]]; then - others_prepared_str+="$other=${INFURA_ENDPOINT} " + others_prepared_str+="$other=${env.INFURA_ENDPOINT} " elif [[ "$other" == "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then # Use 'elif' instead of 'else' - others_prepared_str+="$other=${NETHERMIND_ARCHIVE_ENDPOINT} " + others_prepared_str+="$other=${env.NETHERMIND_ARCHIVE_ENDPOINT} " fi done From 14f1515ea73bf97761fa6a983c306df8500ca744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 20:39:30 +0100 Subject: [PATCH 178/202] Fix bad replace --- .github/workflows/rpc-comparison.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index e183650879e..9dded12bdbb 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -204,9 +204,9 @@ jobs: others_prepared_str=() for other in "${others_str_array[@]}"; do if [[ "$other" == "INFURA_ENDPOINT" ]]; then - others_prepared_str+="$other=${env.INFURA_ENDPOINT} " + others_prepared_str+="$other=${{ env.INFURA_ENDPOINT }} " elif [[ "$other" == "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then # Use 'elif' instead of 'else' - others_prepared_str+="$other=${env.NETHERMIND_ARCHIVE_ENDPOINT} " + others_prepared_str+="$other=${{ env.NETHERMIND_ARCHIVE_ENDPOINT }} " fi done From 2e253cea8517a1aad7498cdc9a1e67c019597dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 21:21:33 +0100 Subject: [PATCH 179/202] Change aproach of running --- .github/workflows/rpc-comparison.yaml | 285 ++++++++++++++------------ 1 file changed, 150 insertions(+), 135 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 9dded12bdbb..9400ab12aa9 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -23,143 +23,146 @@ on: required: false jobs: - #create_main_node: - # name: Create node from current branch - # uses: ./.github/workflows/run-a-single-node-from-branch.yml - # secrets: inherit - # with: - # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - # non_validator_mode: false - # additional_nethermind_flags: Pruning.Mode=None - # nethermind_repo_ref: ${{ github.ref }} - # custom_run_id: ${{ github.run_id }} - # network: holesky #to be removed - # - #create_compare_node: - # name: Create node from branch to compare - # uses: ./.github/workflows/run-a-single-node-from-branch.yml - # #if: inputs.branch_to_compare != '' - # secrets: inherit - # with: - # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - # non_validator_mode: false - # additional_nethermind_flags: Pruning.Mode=None - # nethermind_repo_ref: master #${{ inputs.branch_to_compare }} - # custom_run_id: ${{ github.run_id }} - # network: holesky #to be removed - # - #aggregate_rpcs: - # name: Collect all RPC Urls and pass it further - # runs-on: ubuntu-latest - # needs: [create_main_node, create_compare_node] - # outputs: - # rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} - # steps: - # - # - name: Prepare clean main ref - # id: prepare_main_ref - # run: | - # REF_NAME=${{ github.ref }} - # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - # echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV - # - # - name: Prepare clean compare ref - # id: prepare_compare_ref - # #if: inputs.branch_to_compare != '' - # run: | - # REF_NAME=${{ inputs.nethermind_repo_ref }} - # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - # echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV - # - # - name: Download RPC Artifact for current branch - # uses: actions/download-artifact@v3 - # with: - # name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - # path: artifacts - # - # - name: Download RPC Artifact for branch to compare - # #if: inputs.branch_to_compare != '' - # uses: actions/download-artifact@v3 - # with: - # name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - # path: artifacts - # - # - name: Process Artifacts Content - # id: process_artifacts - # run: | - # rpc_urls="" - # ls artifacts - # for file in artifacts/*; do - # if [ -f "$file" ]; then - # branch=$(basename $file | cut -d '%' -f 2) - # url_content=$(cat "$file") - # rpc_urls+="$branch::$url_content," - # fi - # done - # rpc_urls=${rpc_urls%,} - # echo $rpc_urls - # echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT - # - #wait_for_node_to_sync: - # name: Wait for the nodes to sync - # runs-on: ubuntu-latest - # needs: [aggregate_rpcs] - # timeout-minutes: 600 - # steps: - # - uses: actions/checkout@v3 - # - name: Install WireGuard - # run: | - # sudo apt update - # sudo apt install -y wireguard resolvconf - # sudo mkdir -p /etc/wireguard - # envsubst < scripts/wireguard.conf.template > wg0.conf - # sudo wg-quick up ./wg0.conf - # env: - # WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' - # WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' - # WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' - # WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' - # WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' - # WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' - # WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' - # WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - # - # - name: Wait for the nodes to sync - # timeout-minutes: 600 - # run: | - # # Assuming rpc_urls_str is a comma-separated string of URLs - # rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - # IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" - # - # # Loop through the array and strip the branch prefix - # processed_rpc_urls=() - # for url_entry in "${rpc_urls_array[@]}"; do - # processed_url="${url_entry#*::}" # Remove everything up to and including "::" - # processed_rpc_urls+=("$processed_url") - # done - # - # sync_complete_flag=0 - # - # check_sync() { - # rpc_url=$1 - # while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do - # echo "Still waiting for node to be synced at RPC: $rpc_url." - # sleep 30 - # done - # echo "Node at $rpc_url synced." - # sync_complete_flag=$((sync_complete_flag+1)) - # } - # - # # Iterate over the processed array of URLs - # for url in "${processed_rpc_urls[@]}"; do - # check_sync "$url" - # done - # - # + create_main_node: + name: Create node from current branch + uses: ./.github/workflows/run-a-single-node-from-branch.yml + secrets: inherit + with: + additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: ${{ github.ref }} + custom_run_id: ${{ github.run_id }} + network: holesky #to be removed + + create_compare_node: + name: Create node from branch to compare + uses: ./.github/workflows/run-a-single-node-from-branch.yml + #if: inputs.branch_to_compare != '' + secrets: inherit + with: + additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: master #${{ inputs.branch_to_compare }} + custom_run_id: ${{ github.run_id }} + network: holesky #to be removed + + aggregate_rpcs: + name: Collect all RPC Urls and pass it further + runs-on: ubuntu-latest + needs: [create_main_node, create_compare_node] + outputs: + rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} + steps: + + - name: Prepare clean main ref + id: prepare_main_ref + run: | + REF_NAME=${{ github.ref }} + CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV + + - name: Prepare clean compare ref + id: prepare_compare_ref + #if: inputs.branch_to_compare != '' + run: | + REF_NAME=${{ inputs.nethermind_repo_ref }} + CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV + + - name: Download RPC Artifact for current branch + uses: actions/download-artifact@v3 + with: + name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} + path: artifacts + + - name: Download RPC Artifact for branch to compare + #if: inputs.branch_to_compare != '' + uses: actions/download-artifact@v3 + with: + name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + path: artifacts + + - name: Process Artifacts Content + id: process_artifacts + run: | + rpc_urls="" + ls artifacts + for file in artifacts/*; do + if [ -f "$file" ]; then + branch=$(basename $file | cut -d '%' -f 2) + url_content=$(cat "$file") + rpc_urls+="$branch::$url_content," + fi + done + rpc_urls=${rpc_urls%,} + echo $rpc_urls + echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT + + wait_for_node_to_sync: + name: Wait for the nodes to sync + runs-on: ubuntu-latest + needs: [aggregate_rpcs] + timeout-minutes: 600 + steps: + - uses: actions/checkout@v3 + - name: Install WireGuard + run: | + sudo apt update + sudo apt install -y wireguard resolvconf + sudo mkdir -p /etc/wireguard + envsubst < scripts/wireguard.conf.template > wg0.conf + sudo wg-quick up ./wg0.conf + env: + WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Wait for the nodes to sync + timeout-minutes: 600 + run: | + # Assuming rpc_urls_str is a comma-separated string of URLs + rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" + + # Loop through the array and strip the branch prefix + processed_rpc_urls=() + for url_entry in "${rpc_urls_array[@]}"; do + processed_url="${url_entry#*::}" # Remove everything up to and including "::" + processed_rpc_urls+=("$processed_url") + done + + sync_complete_flag=0 + + check_sync() { + rpc_url=$1 + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do + echo "Still waiting for node to be synced at RPC: $rpc_url." + sleep 30 + done + echo "Node at $rpc_url synced." + sync_complete_flag=$((sync_complete_flag+1)) + } + + # Iterate over the processed array of URLs + for url in "${processed_rpc_urls[@]}"; do + check_sync "$url" + done + + compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest #needs: [wait_for_node_to_sync, aggregate_rpcs] + strategy: + matrix: + rpc_to_compare: needs.aggregate_rpcs.outputs.rpc_urls steps: - uses: actions/checkout@v3 - name: Install flood @@ -214,5 +217,17 @@ jobs: nethermind_urls_str="${nethermind_urls_str% }" others_prepared_str="${others_prepared_str% }" - echo "flood all $nethermind_urls_str $others_prepared_str --equality" - flood all $nethermind_urls_str $others_prepared_str --equality + # Check if there is at least one URL in rpc_urls_str + if [ ${#nethermind_urls_str[@]} -gt 0 ]; then + # Compare the first rpc_url with each other rpc_url if there are more than one + for (( i = 1; i < ${#nethermind_urls_str[@]}; i++ )); do + echo "flood all ${nethermind_urls_str[0]} ${nethermind_urls_str[i]}" + flood all "${nethermind_urls_str[0]}" "${nethermind_urls_str[i]}" + done + + # Compare the first rpc_url with each others_url + for (( j = 0; j < ${#others_prepared_str[@]}; j++ )); do + echo "flood all ${nethermind_urls_str[0]} ${others_prepared_str[j]}" + flood all "${nethermind_urls_str[0]}" "${others_prepared_str[j]}" + done + fi From 0c4e9d1472941464b0d95fab62b14a6b6030a12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Mon, 4 Dec 2023 21:22:36 +0100 Subject: [PATCH 180/202] Fix failure --- .github/workflows/rpc-comparison.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 9400ab12aa9..86436838865 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -159,10 +159,7 @@ jobs: compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - #needs: [wait_for_node_to_sync, aggregate_rpcs] - strategy: - matrix: - rpc_to_compare: needs.aggregate_rpcs.outputs.rpc_urls + needs: [wait_for_node_to_sync, aggregate_rpcs] steps: - uses: actions/checkout@v3 - name: Install flood From 371c90600dfafcef3b0c2f4fbf44829683c1cac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 11:02:15 +0100 Subject: [PATCH 181/202] Add a better order of artifacts on a rpc_list --- .github/workflows/rpc-comparison.yaml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 86436838865..95b1b41c296 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -88,14 +88,21 @@ jobs: id: process_artifacts run: | rpc_urls="" - ls artifacts - for file in artifacts/*; do - if [ -f "$file" ]; then - branch=$(basename $file | cut -d '%' -f 2) - url_content=$(cat "$file") - rpc_urls+="$branch::$url_content," - fi - done + main_branch_file="rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }}" + compare_branch_file=or "rpc-url___master___${{ github.run_id }}" #"rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }}" + + # Check and add the main branch file + if [ -f "artifacts/$main_branch_file" ]; then + url_content=$(cat "artifacts/$main_branch_file") + rpc_urls+="${{ env.CLEAN_MAIN_REF }}::$url_content," + fi + + # Check and add the compare branch file + if [ -f "artifacts/$compare_branch_file" ]; then + url_content=$(cat "artifacts/$compare_branch_file") + rpc_urls+="${{ env.CLEAN_COMPARE_REF }}::$url_content," + fi + rpc_urls=${rpc_urls%,} echo $rpc_urls echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT @@ -186,8 +193,7 @@ jobs: - name: Test equality of responses run: | - #rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - rpc_urls_str="master::http://139.144.63.90:8545,rpc-comparision-1.23.0::http://45.79.192.245:8545" + rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str"; unset IFS nethermind_urls_str=() From 8e5f93ffacd7cf0faaa1ed661d81ba58dc29e50c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 11:21:48 +0100 Subject: [PATCH 182/202] Adjust --- .github/workflows/rpc-comparison.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 95b1b41c296..4b2fc2e2fa4 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -193,6 +193,8 @@ jobs: - name: Test equality of responses run: | + #others_str="${{ github.event.inputs.compare_with }}" + others_str="INFURA_ENDPOINT NETHERMIND_ARCHIVE_ENDPOINT" rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str"; unset IFS @@ -203,16 +205,14 @@ jobs: nethermind_urls_str+="nethermind_$branch=$url " done - #others_str="${{ github.event.inputs.compare_with }}" - others_str="INFURA_ENDPOINT NETHERMIND_ARCHIVE_ENDPOINT" IFS=' ' read -r -a others_str_array <<< "$others_str"; unset IFS others_prepared_str=() for other in "${others_str_array[@]}"; do if [[ "$other" == "INFURA_ENDPOINT" ]]; then - others_prepared_str+="$other=${{ env.INFURA_ENDPOINT }} " + others_prepared_str+="$other=${{ secrets["INFURA_ENDPOINT"] }} " elif [[ "$other" == "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then # Use 'elif' instead of 'else' - others_prepared_str+="$other=${{ env.NETHERMIND_ARCHIVE_ENDPOINT }} " + others_prepared_str+="$other=${{ secrets["NETHERMIND_ARCHIVE_ENDPOINT"] }} " fi done From 5102b132d8e659e00fa3778f5db69f8514070754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 11:22:53 +0100 Subject: [PATCH 183/202] Fix --- .github/workflows/rpc-comparison.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 4b2fc2e2fa4..161b5166a03 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -210,9 +210,9 @@ jobs: others_prepared_str=() for other in "${others_str_array[@]}"; do if [[ "$other" == "INFURA_ENDPOINT" ]]; then - others_prepared_str+="$other=${{ secrets["INFURA_ENDPOINT"] }} " + others_prepared_str+="$other=${{ secrets[INFURA_ENDPOINT] }} " elif [[ "$other" == "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then # Use 'elif' instead of 'else' - others_prepared_str+="$other=${{ secrets["NETHERMIND_ARCHIVE_ENDPOINT"] }} " + others_prepared_str+="$other=${{ secrets[NETHERMIND_ARCHIVE_ENDPOINT] }} " fi done From 124607e56f27edda2ec8374e386896c41366d907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 11:23:34 +0100 Subject: [PATCH 184/202] Rollback to env --- .github/workflows/rpc-comparison.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 161b5166a03..856aea79b77 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -210,9 +210,9 @@ jobs: others_prepared_str=() for other in "${others_str_array[@]}"; do if [[ "$other" == "INFURA_ENDPOINT" ]]; then - others_prepared_str+="$other=${{ secrets[INFURA_ENDPOINT] }} " + others_prepared_str+="$other=${{ env.INFURA_ENDPOINT }} " elif [[ "$other" == "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then # Use 'elif' instead of 'else' - others_prepared_str+="$other=${{ secrets[NETHERMIND_ARCHIVE_ENDPOINT] }} " + others_prepared_str+="$other=${{ env.NETHERMIND_ARCHIVE_ENDPOINT }} " fi done From 1597f1e12f54a300651b1caf2657cdddfe650626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 11:29:04 +0100 Subject: [PATCH 185/202] Adjust flood script --- .github/workflows/rpc-comparison.yaml | 37 ++++++++++++++------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 856aea79b77..eb151e55c16 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -188,47 +188,48 @@ jobs: WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - INFURA_ENDPOINT: '${{ secrets.INFURA_ENDPOINT }}' - NETHERMIND_ARCHIVE_ENDPOINT: '${{ secrets.NETHERMIND_ARCHIVE_ENDPOINT }}' - name: Test equality of responses + env: + INFURA_ENDPOINT: '${{ secrets.INFURA_ENDPOINT }}' + NETHERMIND_ARCHIVE_ENDPOINT: '${{ secrets.NETHERMIND_ARCHIVE_ENDPOINT }}' run: | #others_str="${{ github.event.inputs.compare_with }}" others_str="INFURA_ENDPOINT NETHERMIND_ARCHIVE_ENDPOINT" rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str"; unset IFS - + # Convert rpc_urls_str into an array + IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" + unset IFS + + # Construct nethermind_urls_str as an array nethermind_urls_str=() for url_entry in "${rpc_urls_array[@]}"; do branch="${url_entry%%::*}" # Extract the branch part url="${url_entry#*::}" # Extract the URL part - nethermind_urls_str+="nethermind_$branch=$url " + nethermind_urls_str+=("nethermind_$branch=$url") done - - IFS=' ' read -r -a others_str_array <<< "$others_str"; unset IFS - + + # Convert others_str into an array + IFS=' ' read -r -a others_str_array <<< "$others_str" + unset IFS + + # Construct others_prepared_str as an array others_prepared_str=() for other in "${others_str_array[@]}"; do if [[ "$other" == "INFURA_ENDPOINT" ]]; then - others_prepared_str+="$other=${{ env.INFURA_ENDPOINT }} " - elif [[ "$other" == "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then # Use 'elif' instead of 'else' - others_prepared_str+="$other=${{ env.NETHERMIND_ARCHIVE_ENDPOINT }} " + others_prepared_str+=("$other=${INFURA_ENDPOINT}") + elif [[ "$other" == "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then + others_prepared_str+=("$other=${NETHERMIND_ARCHIVE_ENDPOINT}") fi done - # Remove trailing space - nethermind_urls_str="${nethermind_urls_str% }" - others_prepared_str="${others_prepared_str% }" - - # Check if there is at least one URL in rpc_urls_str + # Perform the comparisons if [ ${#nethermind_urls_str[@]} -gt 0 ]; then - # Compare the first rpc_url with each other rpc_url if there are more than one for (( i = 1; i < ${#nethermind_urls_str[@]}; i++ )); do echo "flood all ${nethermind_urls_str[0]} ${nethermind_urls_str[i]}" flood all "${nethermind_urls_str[0]}" "${nethermind_urls_str[i]}" done - # Compare the first rpc_url with each others_url for (( j = 0; j < ${#others_prepared_str[@]}; j++ )); do echo "flood all ${nethermind_urls_str[0]} ${others_prepared_str[j]}" flood all "${nethermind_urls_str[0]}" "${others_prepared_str[j]}" From ae552ae99ccf626955f5dd8b1c10ce5152cee2d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 11:54:30 +0100 Subject: [PATCH 186/202] Fix rpc_urls creation --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index eb151e55c16..f7e077cfd6b 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -89,7 +89,7 @@ jobs: run: | rpc_urls="" main_branch_file="rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }}" - compare_branch_file=or "rpc-url___master___${{ github.run_id }}" #"rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }}" + compare_branch_file="rpc-url___master___${{ github.run_id }}" #"rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }}" # Check and add the main branch file if [ -f "artifacts/$main_branch_file" ]; then From 115c7458f4b3183250377951c148a9bf06da3a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 12:11:09 +0100 Subject: [PATCH 187/202] Hardcode urls for test --- .github/workflows/rpc-comparison.yaml | 280 +++++++++++++------------- 1 file changed, 141 insertions(+), 139 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index f7e077cfd6b..589300147bc 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -23,144 +23,144 @@ on: required: false jobs: - create_main_node: - name: Create node from current branch - uses: ./.github/workflows/run-a-single-node-from-branch.yml - secrets: inherit - with: - additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None - nethermind_repo_ref: ${{ github.ref }} - custom_run_id: ${{ github.run_id }} - network: holesky #to be removed - - create_compare_node: - name: Create node from branch to compare - uses: ./.github/workflows/run-a-single-node-from-branch.yml - #if: inputs.branch_to_compare != '' - secrets: inherit - with: - additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None - nethermind_repo_ref: master #${{ inputs.branch_to_compare }} - custom_run_id: ${{ github.run_id }} - network: holesky #to be removed - - aggregate_rpcs: - name: Collect all RPC Urls and pass it further - runs-on: ubuntu-latest - needs: [create_main_node, create_compare_node] - outputs: - rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} - steps: - - - name: Prepare clean main ref - id: prepare_main_ref - run: | - REF_NAME=${{ github.ref }} - CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV - - - name: Prepare clean compare ref - id: prepare_compare_ref - #if: inputs.branch_to_compare != '' - run: | - REF_NAME=${{ inputs.nethermind_repo_ref }} - CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV - - - name: Download RPC Artifact for current branch - uses: actions/download-artifact@v3 - with: - name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - path: artifacts - - - name: Download RPC Artifact for branch to compare - #if: inputs.branch_to_compare != '' - uses: actions/download-artifact@v3 - with: - name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - path: artifacts - - - name: Process Artifacts Content - id: process_artifacts - run: | - rpc_urls="" - main_branch_file="rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }}" - compare_branch_file="rpc-url___master___${{ github.run_id }}" #"rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }}" - - # Check and add the main branch file - if [ -f "artifacts/$main_branch_file" ]; then - url_content=$(cat "artifacts/$main_branch_file") - rpc_urls+="${{ env.CLEAN_MAIN_REF }}::$url_content," - fi - - # Check and add the compare branch file - if [ -f "artifacts/$compare_branch_file" ]; then - url_content=$(cat "artifacts/$compare_branch_file") - rpc_urls+="${{ env.CLEAN_COMPARE_REF }}::$url_content," - fi - - rpc_urls=${rpc_urls%,} - echo $rpc_urls - echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT - - wait_for_node_to_sync: - name: Wait for the nodes to sync - runs-on: ubuntu-latest - needs: [aggregate_rpcs] - timeout-minutes: 600 - steps: - - uses: actions/checkout@v3 - - name: Install WireGuard - run: | - sudo apt update - sudo apt install -y wireguard resolvconf - sudo mkdir -p /etc/wireguard - envsubst < scripts/wireguard.conf.template > wg0.conf - sudo wg-quick up ./wg0.conf - env: - WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' - WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' - WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' - WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' - WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' - WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' - WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' - WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - - - name: Wait for the nodes to sync - timeout-minutes: 600 - run: | - # Assuming rpc_urls_str is a comma-separated string of URLs - rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" - - # Loop through the array and strip the branch prefix - processed_rpc_urls=() - for url_entry in "${rpc_urls_array[@]}"; do - processed_url="${url_entry#*::}" # Remove everything up to and including "::" - processed_rpc_urls+=("$processed_url") - done - - sync_complete_flag=0 - - check_sync() { - rpc_url=$1 - while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do - echo "Still waiting for node to be synced at RPC: $rpc_url." - sleep 30 - done - echo "Node at $rpc_url synced." - sync_complete_flag=$((sync_complete_flag+1)) - } - - # Iterate over the processed array of URLs - for url in "${processed_rpc_urls[@]}"; do - check_sync "$url" - done + #create_main_node: + # name: Create node from current branch + # uses: ./.github/workflows/run-a-single-node-from-branch.yml + # secrets: inherit + # with: + # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + # non_validator_mode: false + # additional_nethermind_flags: Pruning.Mode=None + # nethermind_repo_ref: ${{ github.ref }} + # custom_run_id: ${{ github.run_id }} + # network: holesky #to be removed + # + #create_compare_node: + # name: Create node from branch to compare + # uses: ./.github/workflows/run-a-single-node-from-branch.yml + # #if: inputs.branch_to_compare != '' + # secrets: inherit + # with: + # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + # non_validator_mode: false + # additional_nethermind_flags: Pruning.Mode=None + # nethermind_repo_ref: master #${{ inputs.branch_to_compare }} + # custom_run_id: ${{ github.run_id }} + # network: holesky #to be removed + # + #aggregate_rpcs: + # name: Collect all RPC Urls and pass it further + # runs-on: ubuntu-latest + # needs: [create_main_node, create_compare_node] + # outputs: + # rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} + # steps: + # + # - name: Prepare clean main ref + # id: prepare_main_ref + # run: | + # REF_NAME=${{ github.ref }} + # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + # echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV + # + # - name: Prepare clean compare ref + # id: prepare_compare_ref + # #if: inputs.branch_to_compare != '' + # run: | + # REF_NAME=${{ inputs.nethermind_repo_ref }} + # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + # echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV + # + # - name: Download RPC Artifact for current branch + # uses: actions/download-artifact@v3 + # with: + # name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} + # path: artifacts + # + # - name: Download RPC Artifact for branch to compare + # #if: inputs.branch_to_compare != '' + # uses: actions/download-artifact@v3 + # with: + # name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + # path: artifacts + # + # - name: Process Artifacts Content + # id: process_artifacts + # run: | + # rpc_urls="" + # main_branch_file="rpc-url%${{ env.CLEAN_MAIN_REF }}%${{ github.run_id }}" + # compare_branch_file="rpc-url%master%${{ github.run_id }}" #"rpc-url%${{ env.CLEAN_COMPARE_REF }}%${{ github.run_id }}" + # + # # Check and add the main branch file + # if [ -f "artifacts/$main_branch_file" ]; then + # url_content=$(cat "artifacts/$main_branch_file") + # rpc_urls+="${{ env.CLEAN_MAIN_REF }}::$url_content," + # fi + # + # # Check and add the compare branch file + # if [ -f "artifacts/$compare_branch_file" ]; then + # url_content=$(cat "artifacts/$compare_branch_file") + # rpc_urls+="${{ env.CLEAN_COMPARE_REF }}::$url_content," + # fi + # + # rpc_urls=${rpc_urls%,} + # echo $rpc_urls + # echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT + # + #wait_for_node_to_sync: + # name: Wait for the nodes to sync + # runs-on: ubuntu-latest + # needs: [aggregate_rpcs] + # timeout-minutes: 600 + # steps: + # - uses: actions/checkout@v3 + # - name: Install WireGuard + # run: | + # sudo apt update + # sudo apt install -y wireguard resolvconf + # sudo mkdir -p /etc/wireguard + # envsubst < scripts/wireguard.conf.template > wg0.conf + # sudo wg-quick up ./wg0.conf + # env: + # WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + # WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + # WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + # WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + # WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + # WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + # WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + # WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + # + # - name: Wait for the nodes to sync + # timeout-minutes: 600 + # run: | + # # Assuming rpc_urls_str is a comma-separated string of URLs + # rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + # IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" + # + # # Loop through the array and strip the branch prefix + # processed_rpc_urls=() + # for url_entry in "${rpc_urls_array[@]}"; do + # processed_url="${url_entry#*::}" # Remove everything up to and including "::" + # processed_rpc_urls+=("$processed_url") + # done + # + # sync_complete_flag=0 + # + # check_sync() { + # rpc_url=$1 + # while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do + # echo "Still waiting for node to be synced at RPC: $rpc_url." + # sleep 30 + # done + # echo "Node at $rpc_url synced." + # sync_complete_flag=$((sync_complete_flag+1)) + # } + # + # # Iterate over the processed array of URLs + # for url in "${processed_rpc_urls[@]}"; do + # check_sync "$url" + # done compare: @@ -196,7 +196,9 @@ jobs: run: | #others_str="${{ github.event.inputs.compare_with }}" others_str="INFURA_ENDPOINT NETHERMIND_ARCHIVE_ENDPOINT" - rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + #rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + rpc_urls_str="rpc-comparision-1.23.0::http://23.92.29.197:8545,master::http://45.33.98.194:8545" + # Convert rpc_urls_str into an array IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" unset IFS From 288db72ab78f3ec319df94081646c14c0ba18a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 12:11:43 +0100 Subject: [PATCH 188/202] Comment out needs --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 589300147bc..fec7ee95bc6 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -166,7 +166,7 @@ jobs: compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - needs: [wait_for_node_to_sync, aggregate_rpcs] + #needs: [wait_for_node_to_sync, aggregate_rpcs] steps: - uses: actions/checkout@v3 - name: Install flood From 359fdf1f5fc546fe06a923efef55cc8b2ddd804f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 12:15:10 +0100 Subject: [PATCH 189/202] Add missing equality tests --- .github/workflows/rpc-comparison.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index fec7ee95bc6..ab71834c6e3 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -228,12 +228,12 @@ jobs: # Perform the comparisons if [ ${#nethermind_urls_str[@]} -gt 0 ]; then for (( i = 1; i < ${#nethermind_urls_str[@]}; i++ )); do - echo "flood all ${nethermind_urls_str[0]} ${nethermind_urls_str[i]}" - flood all "${nethermind_urls_str[0]}" "${nethermind_urls_str[i]}" + echo "flood all ${nethermind_urls_str[0]} ${nethermind_urls_str[i]} --equality" + flood all "${nethermind_urls_str[0]}" "${nethermind_urls_str[i]} --equality" done for (( j = 0; j < ${#others_prepared_str[@]}; j++ )); do - echo "flood all ${nethermind_urls_str[0]} ${others_prepared_str[j]}" - flood all "${nethermind_urls_str[0]}" "${others_prepared_str[j]}" + echo "flood all ${nethermind_urls_str[0]} ${others_prepared_str[j]} --equality" + flood all "${nethermind_urls_str[0]}" "${others_prepared_str[j]}" --equality done fi From f06f0510d3e283718795a347cdc599d83452db35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 13:04:56 +0100 Subject: [PATCH 190/202] Change to kch flood fork --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index ab71834c6e3..44445a9f7da 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -170,7 +170,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install flood - run: pip install git+https://github.com/piwonskp/flood.git + run: pip install git+https://github.com/kamilchodola/flood.git - name: Install WireGuard run: | From 665bed5fd93d5b71996cba7a9342d9c8224644ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 13:20:59 +0100 Subject: [PATCH 191/202] Rollback to official flood --- .github/workflows/rpc-comparison.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 44445a9f7da..ecd867e6918 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -170,7 +170,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install flood - run: pip install git+https://github.com/kamilchodola/flood.git + run: pip install git+https://github.com/paradigmxyz/flood.git - name: Install WireGuard run: | From e796222d6792c21020858c016c9e3009040cbec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 13:52:08 +0100 Subject: [PATCH 192/202] Generate new nodes --- .github/workflows/rpc-comparison.yaml | 282 +++++++++++++------------- 1 file changed, 141 insertions(+), 141 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index ecd867e6918..23fc8f5a130 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -23,150 +23,150 @@ on: required: false jobs: - #create_main_node: - # name: Create node from current branch - # uses: ./.github/workflows/run-a-single-node-from-branch.yml - # secrets: inherit - # with: - # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - # non_validator_mode: false - # additional_nethermind_flags: Pruning.Mode=None - # nethermind_repo_ref: ${{ github.ref }} - # custom_run_id: ${{ github.run_id }} - # network: holesky #to be removed - # - #create_compare_node: - # name: Create node from branch to compare - # uses: ./.github/workflows/run-a-single-node-from-branch.yml - # #if: inputs.branch_to_compare != '' - # secrets: inherit - # with: - # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - # non_validator_mode: false - # additional_nethermind_flags: Pruning.Mode=None - # nethermind_repo_ref: master #${{ inputs.branch_to_compare }} - # custom_run_id: ${{ github.run_id }} - # network: holesky #to be removed - # - #aggregate_rpcs: - # name: Collect all RPC Urls and pass it further - # runs-on: ubuntu-latest - # needs: [create_main_node, create_compare_node] - # outputs: - # rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} - # steps: - # - # - name: Prepare clean main ref - # id: prepare_main_ref - # run: | - # REF_NAME=${{ github.ref }} - # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - # echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV - # - # - name: Prepare clean compare ref - # id: prepare_compare_ref - # #if: inputs.branch_to_compare != '' - # run: | - # REF_NAME=${{ inputs.nethermind_repo_ref }} - # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - # echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV - # - # - name: Download RPC Artifact for current branch - # uses: actions/download-artifact@v3 - # with: - # name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - # path: artifacts - # - # - name: Download RPC Artifact for branch to compare - # #if: inputs.branch_to_compare != '' - # uses: actions/download-artifact@v3 - # with: - # name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - # path: artifacts - # - # - name: Process Artifacts Content - # id: process_artifacts - # run: | - # rpc_urls="" - # main_branch_file="rpc-url%${{ env.CLEAN_MAIN_REF }}%${{ github.run_id }}" - # compare_branch_file="rpc-url%master%${{ github.run_id }}" #"rpc-url%${{ env.CLEAN_COMPARE_REF }}%${{ github.run_id }}" - # - # # Check and add the main branch file - # if [ -f "artifacts/$main_branch_file" ]; then - # url_content=$(cat "artifacts/$main_branch_file") - # rpc_urls+="${{ env.CLEAN_MAIN_REF }}::$url_content," - # fi - # - # # Check and add the compare branch file - # if [ -f "artifacts/$compare_branch_file" ]; then - # url_content=$(cat "artifacts/$compare_branch_file") - # rpc_urls+="${{ env.CLEAN_COMPARE_REF }}::$url_content," - # fi - # - # rpc_urls=${rpc_urls%,} - # echo $rpc_urls - # echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT - # - #wait_for_node_to_sync: - # name: Wait for the nodes to sync - # runs-on: ubuntu-latest - # needs: [aggregate_rpcs] - # timeout-minutes: 600 - # steps: - # - uses: actions/checkout@v3 - # - name: Install WireGuard - # run: | - # sudo apt update - # sudo apt install -y wireguard resolvconf - # sudo mkdir -p /etc/wireguard - # envsubst < scripts/wireguard.conf.template > wg0.conf - # sudo wg-quick up ./wg0.conf - # env: - # WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' - # WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' - # WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' - # WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' - # WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' - # WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' - # WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' - # WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - # - # - name: Wait for the nodes to sync - # timeout-minutes: 600 - # run: | - # # Assuming rpc_urls_str is a comma-separated string of URLs - # rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - # IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" - # - # # Loop through the array and strip the branch prefix - # processed_rpc_urls=() - # for url_entry in "${rpc_urls_array[@]}"; do - # processed_url="${url_entry#*::}" # Remove everything up to and including "::" - # processed_rpc_urls+=("$processed_url") - # done - # - # sync_complete_flag=0 - # - # check_sync() { - # rpc_url=$1 - # while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do - # echo "Still waiting for node to be synced at RPC: $rpc_url." - # sleep 30 - # done - # echo "Node at $rpc_url synced." - # sync_complete_flag=$((sync_complete_flag+1)) - # } - # - # # Iterate over the processed array of URLs - # for url in "${processed_rpc_urls[@]}"; do - # check_sync "$url" - # done + create_main_node: + name: Create node from current branch + uses: ./.github/workflows/run-a-single-node-from-branch.yml + secrets: inherit + with: + additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: ${{ github.ref }} + custom_run_id: ${{ github.run_id }} + network: holesky #to be removed + + create_compare_node: + name: Create node from branch to compare + uses: ./.github/workflows/run-a-single-node-from-branch.yml + #if: inputs.branch_to_compare != '' + secrets: inherit + with: + additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: master #${{ inputs.branch_to_compare }} + custom_run_id: ${{ github.run_id }} + network: holesky #to be removed + + aggregate_rpcs: + name: Collect all RPC Urls and pass it further + runs-on: ubuntu-latest + needs: [create_main_node, create_compare_node] + outputs: + rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} + steps: + + - name: Prepare clean main ref + id: prepare_main_ref + run: | + REF_NAME=${{ github.ref }} + CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV + + - name: Prepare clean compare ref + id: prepare_compare_ref + #if: inputs.branch_to_compare != '' + run: | + REF_NAME=${{ inputs.nethermind_repo_ref }} + CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV + + - name: Download RPC Artifact for current branch + uses: actions/download-artifact@v3 + with: + name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} + path: artifacts + + - name: Download RPC Artifact for branch to compare + #if: inputs.branch_to_compare != '' + uses: actions/download-artifact@v3 + with: + name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + path: artifacts + + - name: Process Artifacts Content + id: process_artifacts + run: | + rpc_urls="" + main_branch_file="rpc-url%${{ env.CLEAN_MAIN_REF }}%${{ github.run_id }}" + compare_branch_file="rpc-url%master%${{ github.run_id }}" #"rpc-url%${{ env.CLEAN_COMPARE_REF }}%${{ github.run_id }}" + + # Check and add the main branch file + if [ -f "artifacts/$main_branch_file" ]; then + url_content=$(cat "artifacts/$main_branch_file") + rpc_urls+="${{ env.CLEAN_MAIN_REF }}::$url_content," + fi + + # Check and add the compare branch file + if [ -f "artifacts/$compare_branch_file" ]; then + url_content=$(cat "artifacts/$compare_branch_file") + rpc_urls+="${{ env.CLEAN_COMPARE_REF }}::$url_content," + fi + + rpc_urls=${rpc_urls%,} + echo $rpc_urls + echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT + + wait_for_node_to_sync: + name: Wait for the nodes to sync + runs-on: ubuntu-latest + needs: [aggregate_rpcs] + timeout-minutes: 600 + steps: + - uses: actions/checkout@v3 + - name: Install WireGuard + run: | + sudo apt update + sudo apt install -y wireguard resolvconf + sudo mkdir -p /etc/wireguard + envsubst < scripts/wireguard.conf.template > wg0.conf + sudo wg-quick up ./wg0.conf + env: + WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Wait for the nodes to sync + timeout-minutes: 600 + run: | + # Assuming rpc_urls_str is a comma-separated string of URLs + rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" + + # Loop through the array and strip the branch prefix + processed_rpc_urls=() + for url_entry in "${rpc_urls_array[@]}"; do + processed_url="${url_entry#*::}" # Remove everything up to and including "::" + processed_rpc_urls+=("$processed_url") + done + + sync_complete_flag=0 + + check_sync() { + rpc_url=$1 + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do + echo "Still waiting for node to be synced at RPC: $rpc_url." + sleep 30 + done + echo "Node at $rpc_url synced." + sync_complete_flag=$((sync_complete_flag+1)) + } + + # Iterate over the processed array of URLs + for url in "${processed_rpc_urls[@]}"; do + check_sync "$url" + done compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - #needs: [wait_for_node_to_sync, aggregate_rpcs] + needs: [wait_for_node_to_sync, aggregate_rpcs] steps: - uses: actions/checkout@v3 - name: Install flood @@ -196,8 +196,8 @@ jobs: run: | #others_str="${{ github.event.inputs.compare_with }}" others_str="INFURA_ENDPOINT NETHERMIND_ARCHIVE_ENDPOINT" - #rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - rpc_urls_str="rpc-comparision-1.23.0::http://23.92.29.197:8545,master::http://45.33.98.194:8545" + rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + #rpc_urls_str="rpc-comparision-1.23.0::http://23.92.29.197:8545,master::http://45.33.98.194:8545" # Convert rpc_urls_str into an array IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" From 1bf351d6a4350539c28b799535f05a29b30afb9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 14:01:03 +0100 Subject: [PATCH 193/202] Add misiing extension --- .github/workflows/rpc-comparison.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 23fc8f5a130..a4f7a272c96 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -88,9 +88,10 @@ jobs: id: process_artifacts run: | rpc_urls="" - main_branch_file="rpc-url%${{ env.CLEAN_MAIN_REF }}%${{ github.run_id }}" - compare_branch_file="rpc-url%master%${{ github.run_id }}" #"rpc-url%${{ env.CLEAN_COMPARE_REF }}%${{ github.run_id }}" - + main_branch_file="rpc-url%${{ env.CLEAN_MAIN_REF }}%${{ github.run_id }}.txt" + compare_branch_file="rpc-url%master%${{ github.run_id }}.txt" #"rpc-url%${{ env.CLEAN_COMPARE_REF }}%${{ github.run_id }}" + + ls artifacts # Check and add the main branch file if [ -f "artifacts/$main_branch_file" ]; then url_content=$(cat "artifacts/$main_branch_file") From 05d48e639ca511553e1f00044ffc1b1681721404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 14:28:21 +0100 Subject: [PATCH 194/202] adjist script and add logs --- .github/workflows/rpc-comparison.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index a4f7a272c96..0d36b751e95 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -95,13 +95,16 @@ jobs: # Check and add the main branch file if [ -f "artifacts/$main_branch_file" ]; then url_content=$(cat "artifacts/$main_branch_file") + echo $url_content rpc_urls+="${{ env.CLEAN_MAIN_REF }}::$url_content," fi # Check and add the compare branch file if [ -f "artifacts/$compare_branch_file" ]; then url_content=$(cat "artifacts/$compare_branch_file") - rpc_urls+="${{ env.CLEAN_COMPARE_REF }}::$url_content," + echo $url_content + #rpc_urls+="${{ env.CLEAN_COMPARE_REF }}::$url_content," + rpc_urls+="master::$url_content," fi rpc_urls=${rpc_urls%,} From 747684a5d07f339723ade12c4ad7e37705280746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 14:42:48 +0100 Subject: [PATCH 195/202] Fix typo --- .github/workflows/rpc-comparison.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 0d36b751e95..b419f5e61c1 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -88,8 +88,8 @@ jobs: id: process_artifacts run: | rpc_urls="" - main_branch_file="rpc-url%${{ env.CLEAN_MAIN_REF }}%${{ github.run_id }}.txt" - compare_branch_file="rpc-url%master%${{ github.run_id }}.txt" #"rpc-url%${{ env.CLEAN_COMPARE_REF }}%${{ github.run_id }}" + main_branch_file="rpc_url%${{ env.CLEAN_MAIN_REF }}%${{ github.run_id }}.txt" + compare_branch_file="rpc_url%master%${{ github.run_id }}.txt" #"rpc_url%${{ env.CLEAN_COMPARE_REF }}%${{ github.run_id }}" ls artifacts # Check and add the main branch file From 99f714d411d05639f0d1472adafcd3ac95046329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 15:30:21 +0100 Subject: [PATCH 196/202] Test --- .github/workflows/rpc-comparison.yaml | 298 +++++++++++++------------- 1 file changed, 149 insertions(+), 149 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index b419f5e61c1..2eeb3c1b15e 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -23,154 +23,154 @@ on: required: false jobs: - create_main_node: - name: Create node from current branch - uses: ./.github/workflows/run-a-single-node-from-branch.yml - secrets: inherit - with: - additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None - nethermind_repo_ref: ${{ github.ref }} - custom_run_id: ${{ github.run_id }} - network: holesky #to be removed - - create_compare_node: - name: Create node from branch to compare - uses: ./.github/workflows/run-a-single-node-from-branch.yml - #if: inputs.branch_to_compare != '' - secrets: inherit - with: - additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None - nethermind_repo_ref: master #${{ inputs.branch_to_compare }} - custom_run_id: ${{ github.run_id }} - network: holesky #to be removed - - aggregate_rpcs: - name: Collect all RPC Urls and pass it further - runs-on: ubuntu-latest - needs: [create_main_node, create_compare_node] - outputs: - rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} - steps: - - - name: Prepare clean main ref - id: prepare_main_ref - run: | - REF_NAME=${{ github.ref }} - CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV - - - name: Prepare clean compare ref - id: prepare_compare_ref - #if: inputs.branch_to_compare != '' - run: | - REF_NAME=${{ inputs.nethermind_repo_ref }} - CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV - - - name: Download RPC Artifact for current branch - uses: actions/download-artifact@v3 - with: - name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - path: artifacts - - - name: Download RPC Artifact for branch to compare - #if: inputs.branch_to_compare != '' - uses: actions/download-artifact@v3 - with: - name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - path: artifacts - - - name: Process Artifacts Content - id: process_artifacts - run: | - rpc_urls="" - main_branch_file="rpc_url%${{ env.CLEAN_MAIN_REF }}%${{ github.run_id }}.txt" - compare_branch_file="rpc_url%master%${{ github.run_id }}.txt" #"rpc_url%${{ env.CLEAN_COMPARE_REF }}%${{ github.run_id }}" - - ls artifacts - # Check and add the main branch file - if [ -f "artifacts/$main_branch_file" ]; then - url_content=$(cat "artifacts/$main_branch_file") - echo $url_content - rpc_urls+="${{ env.CLEAN_MAIN_REF }}::$url_content," - fi - - # Check and add the compare branch file - if [ -f "artifacts/$compare_branch_file" ]; then - url_content=$(cat "artifacts/$compare_branch_file") - echo $url_content - #rpc_urls+="${{ env.CLEAN_COMPARE_REF }}::$url_content," - rpc_urls+="master::$url_content," - fi - - rpc_urls=${rpc_urls%,} - echo $rpc_urls - echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT - - wait_for_node_to_sync: - name: Wait for the nodes to sync - runs-on: ubuntu-latest - needs: [aggregate_rpcs] - timeout-minutes: 600 - steps: - - uses: actions/checkout@v3 - - name: Install WireGuard - run: | - sudo apt update - sudo apt install -y wireguard resolvconf - sudo mkdir -p /etc/wireguard - envsubst < scripts/wireguard.conf.template > wg0.conf - sudo wg-quick up ./wg0.conf - env: - WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' - WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' - WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' - WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' - WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' - WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' - WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' - WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - - - name: Wait for the nodes to sync - timeout-minutes: 600 - run: | - # Assuming rpc_urls_str is a comma-separated string of URLs - rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" - - # Loop through the array and strip the branch prefix - processed_rpc_urls=() - for url_entry in "${rpc_urls_array[@]}"; do - processed_url="${url_entry#*::}" # Remove everything up to and including "::" - processed_rpc_urls+=("$processed_url") - done - - sync_complete_flag=0 - - check_sync() { - rpc_url=$1 - while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do - echo "Still waiting for node to be synced at RPC: $rpc_url." - sleep 30 - done - echo "Node at $rpc_url synced." - sync_complete_flag=$((sync_complete_flag+1)) - } - - # Iterate over the processed array of URLs - for url in "${processed_rpc_urls[@]}"; do - check_sync "$url" - done - - + #create_main_node: + # name: Create node from current branch + # uses: ./.github/workflows/run-a-single-node-from-branch.yml + # secrets: inherit + # with: + # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + # non_validator_mode: false + # additional_nethermind_flags: Pruning.Mode=None + # nethermind_repo_ref: ${{ github.ref }} + # custom_run_id: ${{ github.run_id }} + # network: holesky #to be removed + # + #create_compare_node: + # name: Create node from branch to compare + # uses: ./.github/workflows/run-a-single-node-from-branch.yml + # #if: inputs.branch_to_compare != '' + # secrets: inherit + # with: + # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + # non_validator_mode: false + # additional_nethermind_flags: Pruning.Mode=None + # nethermind_repo_ref: master #${{ inputs.branch_to_compare }} + # custom_run_id: ${{ github.run_id }} + # network: holesky #to be removed + # + #aggregate_rpcs: + # name: Collect all RPC Urls and pass it further + # runs-on: ubuntu-latest + # needs: [create_main_node, create_compare_node] + # outputs: + # rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} + # steps: + # + # - name: Prepare clean main ref + # id: prepare_main_ref + # run: | + # REF_NAME=${{ github.ref }} + # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + # echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV + # + # - name: Prepare clean compare ref + # id: prepare_compare_ref + # #if: inputs.branch_to_compare != '' + # run: | + # REF_NAME=${{ inputs.nethermind_repo_ref }} + # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + # echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV + # + # - name: Download RPC Artifact for current branch + # uses: actions/download-artifact@v3 + # with: + # name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} + # path: artifacts + # + # - name: Download RPC Artifact for branch to compare + # #if: inputs.branch_to_compare != '' + # uses: actions/download-artifact@v3 + # with: + # name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + # path: artifacts + # + # - name: Process Artifacts Content + # id: process_artifacts + # run: | + # rpc_urls="" + # main_branch_file="rpc_url%${{ env.CLEAN_MAIN_REF }}%${{ github.run_id }}.txt" + # compare_branch_file="rpc_url%master%${{ github.run_id }}.txt" #"rpc_url%${{ env.CLEAN_COMPARE_REF }}%${{ github.run_id }}" + # + # ls artifacts + # # Check and add the main branch file + # if [ -f "artifacts/$main_branch_file" ]; then + # url_content=$(cat "artifacts/$main_branch_file") + # echo $url_content + # rpc_urls+="${{ env.CLEAN_MAIN_REF }}::$url_content," + # fi + # + # # Check and add the compare branch file + # if [ -f "artifacts/$compare_branch_file" ]; then + # url_content=$(cat "artifacts/$compare_branch_file") + # echo $url_content + # #rpc_urls+="${{ env.CLEAN_COMPARE_REF }}::$url_content," + # rpc_urls+="master::$url_content," + # fi + # + # rpc_urls=${rpc_urls%,} + # echo $rpc_urls + # echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT + # + #wait_for_node_to_sync: + # name: Wait for the nodes to sync + # runs-on: ubuntu-latest + # needs: [aggregate_rpcs] + # timeout-minutes: 600 + # steps: + # - uses: actions/checkout@v3 + # - name: Install WireGuard + # run: | + # sudo apt update + # sudo apt install -y wireguard resolvconf + # sudo mkdir -p /etc/wireguard + # envsubst < scripts/wireguard.conf.template > wg0.conf + # sudo wg-quick up ./wg0.conf + # env: + # WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + # WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + # WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + # WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + # WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + # WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + # WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + # WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + # + # - name: Wait for the nodes to sync + # timeout-minutes: 600 + # run: | + # # Assuming rpc_urls_str is a comma-separated string of URLs + # rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + # IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" + # + # # Loop through the array and strip the branch prefix + # processed_rpc_urls=() + # for url_entry in "${rpc_urls_array[@]}"; do + # processed_url="${url_entry#*::}" # Remove everything up to and including "::" + # processed_rpc_urls+=("$processed_url") + # done + # + # sync_complete_flag=0 + # + # check_sync() { + # rpc_url=$1 + # while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do + # echo "Still waiting for node to be synced at RPC: $rpc_url." + # sleep 30 + # done + # echo "Node at $rpc_url synced." + # sync_complete_flag=$((sync_complete_flag+1)) + # } + # + # # Iterate over the processed array of URLs + # for url in "${processed_rpc_urls[@]}"; do + # check_sync "$url" + # done + # + # compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - needs: [wait_for_node_to_sync, aggregate_rpcs] + #needs: [wait_for_node_to_sync, aggregate_rpcs] steps: - uses: actions/checkout@v3 - name: Install flood @@ -200,8 +200,8 @@ jobs: run: | #others_str="${{ github.event.inputs.compare_with }}" others_str="INFURA_ENDPOINT NETHERMIND_ARCHIVE_ENDPOINT" - rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - #rpc_urls_str="rpc-comparision-1.23.0::http://23.92.29.197:8545,master::http://45.33.98.194:8545" + #rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + rpc_urls_str="rpc-comparision-1.23.0::http://45.79.222.118:8545,master::http://45.79.222.59:8545" # Convert rpc_urls_str into an array IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" @@ -233,11 +233,11 @@ jobs: if [ ${#nethermind_urls_str[@]} -gt 0 ]; then for (( i = 1; i < ${#nethermind_urls_str[@]}; i++ )); do echo "flood all ${nethermind_urls_str[0]} ${nethermind_urls_str[i]} --equality" - flood all "${nethermind_urls_str[0]}" "${nethermind_urls_str[i]} --equality" + flood all ${nethermind_urls_str[0]} ${nethermind_urls_str[i]} --equality done for (( j = 0; j < ${#others_prepared_str[@]}; j++ )); do echo "flood all ${nethermind_urls_str[0]} ${others_prepared_str[j]} --equality" - flood all "${nethermind_urls_str[0]}" "${others_prepared_str[j]}" --equality + flood all ${nethermind_urls_str[0]} ${others_prepared_str[j]} --equality done fi From 4db31b8ced46d960771d7288ae08663f75bb857e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 16:23:13 +0100 Subject: [PATCH 197/202] Change approach slightly --- .github/workflows/rpc-comparison.yaml | 359 +++++++++++++++----------- 1 file changed, 214 insertions(+), 145 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 2eeb3c1b15e..2832963fb5b 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -23,154 +23,154 @@ on: required: false jobs: - #create_main_node: - # name: Create node from current branch - # uses: ./.github/workflows/run-a-single-node-from-branch.yml - # secrets: inherit - # with: - # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - # non_validator_mode: false - # additional_nethermind_flags: Pruning.Mode=None - # nethermind_repo_ref: ${{ github.ref }} - # custom_run_id: ${{ github.run_id }} - # network: holesky #to be removed - # - #create_compare_node: - # name: Create node from branch to compare - # uses: ./.github/workflows/run-a-single-node-from-branch.yml - # #if: inputs.branch_to_compare != '' - # secrets: inherit - # with: - # additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' - # non_validator_mode: false - # additional_nethermind_flags: Pruning.Mode=None - # nethermind_repo_ref: master #${{ inputs.branch_to_compare }} - # custom_run_id: ${{ github.run_id }} - # network: holesky #to be removed - # - #aggregate_rpcs: - # name: Collect all RPC Urls and pass it further - # runs-on: ubuntu-latest - # needs: [create_main_node, create_compare_node] - # outputs: - # rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} - # steps: - # - # - name: Prepare clean main ref - # id: prepare_main_ref - # run: | - # REF_NAME=${{ github.ref }} - # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - # echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV - # - # - name: Prepare clean compare ref - # id: prepare_compare_ref - # #if: inputs.branch_to_compare != '' - # run: | - # REF_NAME=${{ inputs.nethermind_repo_ref }} - # CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') - # echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV - # - # - name: Download RPC Artifact for current branch - # uses: actions/download-artifact@v3 - # with: - # name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} - # path: artifacts - # - # - name: Download RPC Artifact for branch to compare - # #if: inputs.branch_to_compare != '' - # uses: actions/download-artifact@v3 - # with: - # name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} - # path: artifacts - # - # - name: Process Artifacts Content - # id: process_artifacts - # run: | - # rpc_urls="" - # main_branch_file="rpc_url%${{ env.CLEAN_MAIN_REF }}%${{ github.run_id }}.txt" - # compare_branch_file="rpc_url%master%${{ github.run_id }}.txt" #"rpc_url%${{ env.CLEAN_COMPARE_REF }}%${{ github.run_id }}" - # - # ls artifacts - # # Check and add the main branch file - # if [ -f "artifacts/$main_branch_file" ]; then - # url_content=$(cat "artifacts/$main_branch_file") - # echo $url_content - # rpc_urls+="${{ env.CLEAN_MAIN_REF }}::$url_content," - # fi - # - # # Check and add the compare branch file - # if [ -f "artifacts/$compare_branch_file" ]; then - # url_content=$(cat "artifacts/$compare_branch_file") - # echo $url_content - # #rpc_urls+="${{ env.CLEAN_COMPARE_REF }}::$url_content," - # rpc_urls+="master::$url_content," - # fi - # - # rpc_urls=${rpc_urls%,} - # echo $rpc_urls - # echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT - # - #wait_for_node_to_sync: - # name: Wait for the nodes to sync - # runs-on: ubuntu-latest - # needs: [aggregate_rpcs] - # timeout-minutes: 600 - # steps: - # - uses: actions/checkout@v3 - # - name: Install WireGuard - # run: | - # sudo apt update - # sudo apt install -y wireguard resolvconf - # sudo mkdir -p /etc/wireguard - # envsubst < scripts/wireguard.conf.template > wg0.conf - # sudo wg-quick up ./wg0.conf - # env: - # WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' - # WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' - # WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' - # WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' - # WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' - # WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' - # WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' - # WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' - # - # - name: Wait for the nodes to sync - # timeout-minutes: 600 - # run: | - # # Assuming rpc_urls_str is a comma-separated string of URLs - # rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - # IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" - # - # # Loop through the array and strip the branch prefix - # processed_rpc_urls=() - # for url_entry in "${rpc_urls_array[@]}"; do - # processed_url="${url_entry#*::}" # Remove everything up to and including "::" - # processed_rpc_urls+=("$processed_url") - # done - # - # sync_complete_flag=0 - # - # check_sync() { - # rpc_url=$1 - # while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do - # echo "Still waiting for node to be synced at RPC: $rpc_url." - # sleep 30 - # done - # echo "Node at $rpc_url synced." - # sync_complete_flag=$((sync_complete_flag+1)) - # } - # - # # Iterate over the processed array of URLs - # for url in "${processed_rpc_urls[@]}"; do - # check_sync "$url" - # done - # - # + create_main_node: + name: Create node from current branch + uses: ./.github/workflows/run-a-single-node-from-branch.yml + secrets: inherit + with: + additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: ${{ github.ref }} + custom_run_id: ${{ github.run_id }} + network: holesky #to be removed + + create_compare_node: + name: Create node from branch to compare + uses: ./.github/workflows/run-a-single-node-from-branch.yml + #if: inputs.branch_to_compare != '' + secrets: inherit + with: + additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + non_validator_mode: false + additional_nethermind_flags: Pruning.Mode=None + nethermind_repo_ref: master #${{ inputs.branch_to_compare }} + custom_run_id: ${{ github.run_id }} + network: holesky #to be removed + + aggregate_rpcs: + name: Collect all RPC Urls and pass it further + runs-on: ubuntu-latest + needs: [create_main_node, create_compare_node] + outputs: + rpc_urls: ${{ steps.process_artifacts.outputs.rpc_urls }} + steps: + + - name: Prepare clean main ref + id: prepare_main_ref + run: | + REF_NAME=${{ github.ref }} + CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + echo "CLEAN_MAIN_REF=$CLEAN_REF" >> $GITHUB_ENV + + - name: Prepare clean compare ref + id: prepare_compare_ref + #if: inputs.branch_to_compare != '' + run: | + REF_NAME=${{ inputs.nethermind_repo_ref }} + CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') + echo "CLEAN_COMPARE_REF=$CLEAN_REF" >> $GITHUB_ENV + + - name: Download RPC Artifact for current branch + uses: actions/download-artifact@v3 + with: + name: rpc-url___${{ env.CLEAN_MAIN_REF }}___${{ github.run_id }} + path: artifacts + + - name: Download RPC Artifact for branch to compare + #if: inputs.branch_to_compare != '' + uses: actions/download-artifact@v3 + with: + name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + path: artifacts + + - name: Process Artifacts Content + id: process_artifacts + run: | + rpc_urls="" + main_branch_file="rpc_url%${{ env.CLEAN_MAIN_REF }}%${{ github.run_id }}.txt" + compare_branch_file="rpc_url%master%${{ github.run_id }}.txt" #"rpc_url%${{ env.CLEAN_COMPARE_REF }}%${{ github.run_id }}" + + ls artifacts + # Check and add the main branch file + if [ -f "artifacts/$main_branch_file" ]; then + url_content=$(cat "artifacts/$main_branch_file") + echo $url_content + rpc_urls+="${{ env.CLEAN_MAIN_REF }}::$url_content," + fi + + # Check and add the compare branch file + if [ -f "artifacts/$compare_branch_file" ]; then + url_content=$(cat "artifacts/$compare_branch_file") + echo $url_content + #rpc_urls+="${{ env.CLEAN_COMPARE_REF }}::$url_content," + rpc_urls+="master::$url_content," + fi + + rpc_urls=${rpc_urls%,} + echo $rpc_urls + echo "rpc_urls=$rpc_urls" >> $GITHUB_OUTPUT + + wait_for_node_to_sync: + name: Wait for the nodes to sync + runs-on: ubuntu-latest + needs: [aggregate_rpcs] + timeout-minutes: 600 + steps: + - uses: actions/checkout@v3 + - name: Install WireGuard + run: | + sudo apt update + sudo apt install -y wireguard resolvconf + sudo mkdir -p /etc/wireguard + envsubst < scripts/wireguard.conf.template > wg0.conf + sudo wg-quick up ./wg0.conf + env: + WIREGUARD_PRIVKEY: '${{ secrets.WIREGUARD_PRIVKEY }}' + WIREGUARD_ADDRESS: '${{ secrets.WIREGUARD_ADDRESS }}' + WIREGUARD_DNS: '${{ secrets.WIREGUARD_DNS }}' + WIREGUARD_PUBKEY: '${{ secrets.WIREGUARD_PUBKEY }}' + WIREGUARD_PRESHAREDKEY: '${{ secrets.WIREGUARD_PRESHAREDKEY }}' + WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' + WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' + WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Wait for the nodes to sync + timeout-minutes: 600 + run: | + # Assuming rpc_urls_str is a comma-separated string of URLs + rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" + + # Loop through the array and strip the branch prefix + processed_rpc_urls=() + for url_entry in "${rpc_urls_array[@]}"; do + processed_url="${url_entry#*::}" # Remove everything up to and including "::" + processed_rpc_urls+=("$processed_url") + done + + sync_complete_flag=0 + + check_sync() { + rpc_url=$1 + while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do + echo "Still waiting for node to be synced at RPC: $rpc_url." + sleep 30 + done + echo "Node at $rpc_url synced." + sync_complete_flag=$((sync_complete_flag+1)) + } + + # Iterate over the processed array of URLs + for url in "${processed_rpc_urls[@]}"; do + check_sync "$url" + done + + compare: name: Compare JSON-RPC responses between clients and versions runs-on: ubuntu-latest - #needs: [wait_for_node_to_sync, aggregate_rpcs] + needs: [wait_for_node_to_sync, aggregate_rpcs] steps: - uses: actions/checkout@v3 - name: Install flood @@ -192,6 +192,75 @@ jobs: WIREGUARD_ALLOWED_IPS: '${{ secrets.WIREGUARD_ALLOWED_IPS }}' WIREGUARD_SERVER_IP: '${{ secrets.WIREGUARD_SERVER_IP }}' WIREGUARD_SERVER_PORT: '${{ secrets.WIREGUARD_SERVER_PORT }}' + + - name: Prepare Comparison Flags + id: prep_comparison + run: | + #others_str="${{ github.event.inputs.compare_with }}" + others_str="INFURA_ENDPOINT NETHERMIND_ARCHIVE_ENDPOINT" + rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" + #rpc_urls_str="rpc-comparision-1.23.0::http://45.79.222.118:8545,master::http://45.79.222.59:8545" + + IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" + unset IFS + IFS=' ' read -r -a others_str_array <<< "$others_str" + unset IFS + + # Construct nethermind_urls_str as an array + nethermind_urls_str=() + for url_entry in "${rpc_urls_array[@]}"; do + branch="${url_entry%%::*}" # Extract the branch part + url="${url_entry#*::}" # Extract the URL part + nethermind_urls_str+=("nethermind_$branch=$url") + done + + # Construct others_prepared_str as an array + others_prepared_str=() + for other in "${others_str_array[@]}"; do + if [[ "$other" == "INFURA_ENDPOINT" ]]; then + others_prepared_str+=("$other=${INFURA_ENDPOINT}") + elif [[ "$other" == "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then + others_prepared_str+=("$other=${NETHERMIND_ARCHIVE_ENDPOINT}") + fi + done + + # Flag for comparing to other branch + if [ ${#rpc_urls_array[@]} -gt 1 ]; then + echo "compare_to_other_branch=true" >> $GITHUB_ENV + echo "compare_to_other_branch_params=${nethermind_urls_str[0]} ${nethermind_urls_str[1]}" >> $GITHUB_ENV + else + echo "compare_to_other_branch=false" >> $GITHUB_ENV + fi + + # Flags for comparing to INFURA and ARCHIVE endpoints + compare_to_infura=false + compare_to_archive=false + for (( j = 0; j < ${#others_prepared_str[@]}; j++ )); do + if [[ "$others_prepared_str[j]" == "INFURA_ENDPOINT" ]]; then + compare_to_infura=true + echo "compare_to_infura_params=${nethermind_urls_str[0]} ${others_prepared_str[0]}" >> $GITHUB_ENV + elif [[ "$others_prepared_str[j]" == "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then + compare_to_archive=true + echo "compare_to_archive_params=${nethermind_urls_str[0]} ${others_prepared_str[j]}" >> $GITHUB_ENV + fi + done + echo "compare_to_infura=$compare_to_infura" >> $GITHUB_ENV + echo "compare_to_archive=$compare_to_archive" >> $GITHUB_ENV + + - name: Compare to Other Branch + if: env.compare_to_other_branch == 'true' + run: | + flood all ${compare_to_other_branch_params} --equality + + - name: Compare to INFURA Endpoint + if: env.compare_to_infura == 'true' + run: | + flood all ${compare_to_infura_params} --equality + + - name: Compare to Nethermind Archive Endpoint + if: env.compare_to_archive == 'true' + run: | + flood all ${compare_to_archive_params} --equality - name: Test equality of responses env: From f3bcb1185cfa3145944a111f15f1a50849c52afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 16:25:53 +0100 Subject: [PATCH 198/202] One mroe adjustment --- .github/workflows/rpc-comparison.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 2832963fb5b..b8ffad48b77 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -225,7 +225,7 @@ jobs: done # Flag for comparing to other branch - if [ ${#rpc_urls_array[@]} -gt 1 ]; then + if [ ${#nethermind_urls_str[@]} -gt 1 ]; then echo "compare_to_other_branch=true" >> $GITHUB_ENV echo "compare_to_other_branch_params=${nethermind_urls_str[0]} ${nethermind_urls_str[1]}" >> $GITHUB_ENV else @@ -236,16 +236,16 @@ jobs: compare_to_infura=false compare_to_archive=false for (( j = 0; j < ${#others_prepared_str[@]}; j++ )); do - if [[ "$others_prepared_str[j]" == "INFURA_ENDPOINT" ]]; then + if [[ "${others_prepared_str[j]}" == "INFURA_ENDPOINT=${INFURA_ENDPOINT}" ]]; then compare_to_infura=true - echo "compare_to_infura_params=${nethermind_urls_str[0]} ${others_prepared_str[0]}" >> $GITHUB_ENV - elif [[ "$others_prepared_str[j]" == "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then + echo "compare_to_infura_params=${nethermind_urls_str[0]} ${others_prepared_str[j]}" >> $GITHUB_ENV + elif [[ "${others_prepared_str[j]}" == "NETHERMIND_ARCHIVE_ENDPOINT=${NETHERMIND_ARCHIVE_ENDPOINT}" ]]; then compare_to_archive=true echo "compare_to_archive_params=${nethermind_urls_str[0]} ${others_prepared_str[j]}" >> $GITHUB_ENV fi done echo "compare_to_infura=$compare_to_infura" >> $GITHUB_ENV - echo "compare_to_archive=$compare_to_archive" >> $GITHUB_ENV + echo "compare_to_archive=$compare_to_archive" >> $GITHUB_ENV - name: Compare to Other Branch if: env.compare_to_other_branch == 'true' From c3d829081e050bf31e0ab2e73ba5b59a8974acaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 16:57:31 +0100 Subject: [PATCH 199/202] Adjust to mainnet and add missing envs --- .github/workflows/rpc-comparison.yaml | 58 +++------------------------ 1 file changed, 5 insertions(+), 53 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index b8ffad48b77..58fb2a8f3c8 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -30,10 +30,9 @@ jobs: with: additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None + additional_nethermind_flags: Pruning.Mode=None JsonRpc.EnabledModules=[Eth,Subscribe,Trace,TxPool,Web3,Personal,Proof,Net,Parity,Health,Rpc,Debug,Admin] nethermind_repo_ref: ${{ github.ref }} custom_run_id: ${{ github.run_id }} - network: holesky #to be removed create_compare_node: name: Create node from branch to compare @@ -43,10 +42,9 @@ jobs: with: additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' non_validator_mode: false - additional_nethermind_flags: Pruning.Mode=None + additional_nethermind_flags: Pruning.Mode=None JsonRpc.EnabledModules=[Eth,Subscribe,Trace,TxPool,Web3,Personal,Proof,Net,Parity,Health,Rpc,Debug,Admin] nethermind_repo_ref: master #${{ inputs.branch_to_compare }} custom_run_id: ${{ github.run_id }} - network: holesky #to be removed aggregate_rpcs: name: Collect all RPC Urls and pass it further @@ -195,6 +193,9 @@ jobs: - name: Prepare Comparison Flags id: prep_comparison + env: + INFURA_ENDPOINT: '${{ secrets.INFURA_ENDPOINT }}' + NETHERMIND_ARCHIVE_ENDPOINT: '${{ secrets.NETHERMIND_ARCHIVE_ENDPOINT }}' run: | #others_str="${{ github.event.inputs.compare_with }}" others_str="INFURA_ENDPOINT NETHERMIND_ARCHIVE_ENDPOINT" @@ -261,52 +262,3 @@ jobs: if: env.compare_to_archive == 'true' run: | flood all ${compare_to_archive_params} --equality - - - name: Test equality of responses - env: - INFURA_ENDPOINT: '${{ secrets.INFURA_ENDPOINT }}' - NETHERMIND_ARCHIVE_ENDPOINT: '${{ secrets.NETHERMIND_ARCHIVE_ENDPOINT }}' - run: | - #others_str="${{ github.event.inputs.compare_with }}" - others_str="INFURA_ENDPOINT NETHERMIND_ARCHIVE_ENDPOINT" - #rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - rpc_urls_str="rpc-comparision-1.23.0::http://45.79.222.118:8545,master::http://45.79.222.59:8545" - - # Convert rpc_urls_str into an array - IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" - unset IFS - - # Construct nethermind_urls_str as an array - nethermind_urls_str=() - for url_entry in "${rpc_urls_array[@]}"; do - branch="${url_entry%%::*}" # Extract the branch part - url="${url_entry#*::}" # Extract the URL part - nethermind_urls_str+=("nethermind_$branch=$url") - done - - # Convert others_str into an array - IFS=' ' read -r -a others_str_array <<< "$others_str" - unset IFS - - # Construct others_prepared_str as an array - others_prepared_str=() - for other in "${others_str_array[@]}"; do - if [[ "$other" == "INFURA_ENDPOINT" ]]; then - others_prepared_str+=("$other=${INFURA_ENDPOINT}") - elif [[ "$other" == "NETHERMIND_ARCHIVE_ENDPOINT" ]]; then - others_prepared_str+=("$other=${NETHERMIND_ARCHIVE_ENDPOINT}") - fi - done - - # Perform the comparisons - if [ ${#nethermind_urls_str[@]} -gt 0 ]; then - for (( i = 1; i < ${#nethermind_urls_str[@]}; i++ )); do - echo "flood all ${nethermind_urls_str[0]} ${nethermind_urls_str[i]} --equality" - flood all ${nethermind_urls_str[0]} ${nethermind_urls_str[i]} --equality - done - - for (( j = 0; j < ${#others_prepared_str[@]}; j++ )); do - echo "flood all ${nethermind_urls_str[0]} ${others_prepared_str[j]} --equality" - flood all ${nethermind_urls_str[0]} ${others_prepared_str[j]} --equality - done - fi From 331ffa85daee075891c4751f062a8766ff29656f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 16:59:08 +0100 Subject: [PATCH 200/202] Bump timeout to something higher to fit tests --- .github/workflows/rpc-comparison.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 58fb2a8f3c8..ceae5f7c0f8 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -28,7 +28,7 @@ jobs: uses: ./.github/workflows/run-a-single-node-from-branch.yml secrets: inherit with: - additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + additional_options: '{"timeout":"12", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' non_validator_mode: false additional_nethermind_flags: Pruning.Mode=None JsonRpc.EnabledModules=[Eth,Subscribe,Trace,TxPool,Web3,Personal,Proof,Net,Parity,Health,Rpc,Debug,Admin] nethermind_repo_ref: ${{ github.ref }} @@ -40,7 +40,7 @@ jobs: #if: inputs.branch_to_compare != '' secrets: inherit with: - additional_options: '{"timeout":"1", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' + additional_options: '{"timeout":"12", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' non_validator_mode: false additional_nethermind_flags: Pruning.Mode=None JsonRpc.EnabledModules=[Eth,Subscribe,Trace,TxPool,Web3,Personal,Proof,Net,Parity,Health,Rpc,Debug,Admin] nethermind_repo_ref: master #${{ inputs.branch_to_compare }} From c8bdf0411b1bfd8f8f548712c3d7e476c4f48c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Tue, 5 Dec 2023 17:18:23 +0100 Subject: [PATCH 201/202] Clean Up --- .github/workflows/rpc-comparison.yaml | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index ceae5f7c0f8..8839acd2d4e 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -1,9 +1,6 @@ name: '[JSON-RPC] Compare Nethermind between clients and versions' on: - push: - branches: - - 'rpc-comparision-1.23.0' workflow_dispatch: inputs: allowed_ips: @@ -37,7 +34,7 @@ jobs: create_compare_node: name: Create node from branch to compare uses: ./.github/workflows/run-a-single-node-from-branch.yml - #if: inputs.branch_to_compare != '' + if: inputs.branch_to_compare != '' secrets: inherit with: additional_options: '{"timeout":"12", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' @@ -63,7 +60,7 @@ jobs: - name: Prepare clean compare ref id: prepare_compare_ref - #if: inputs.branch_to_compare != '' + if: inputs.branch_to_compare != '' run: | REF_NAME=${{ inputs.nethermind_repo_ref }} CLEAN_REF=$(echo "${REF_NAME/refs\/heads\//}" | sed 's/[^a-zA-Z0-9._-]/-/g') @@ -76,10 +73,10 @@ jobs: path: artifacts - name: Download RPC Artifact for branch to compare - #if: inputs.branch_to_compare != '' + if: inputs.branch_to_compare != '' uses: actions/download-artifact@v3 with: - name: rpc-url___master___${{ github.run_id }} #rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} + name: rpc-url___${{ env.CLEAN_COMPARE_REF }}___${{ github.run_id }} path: artifacts - name: Process Artifacts Content @@ -87,7 +84,7 @@ jobs: run: | rpc_urls="" main_branch_file="rpc_url%${{ env.CLEAN_MAIN_REF }}%${{ github.run_id }}.txt" - compare_branch_file="rpc_url%master%${{ github.run_id }}.txt" #"rpc_url%${{ env.CLEAN_COMPARE_REF }}%${{ github.run_id }}" + compare_branch_file="rpc_url%${{ env.CLEAN_COMPARE_REF }}%${{ github.run_id }}" ls artifacts # Check and add the main branch file @@ -101,8 +98,7 @@ jobs: if [ -f "artifacts/$compare_branch_file" ]; then url_content=$(cat "artifacts/$compare_branch_file") echo $url_content - #rpc_urls+="${{ env.CLEAN_COMPARE_REF }}::$url_content," - rpc_urls+="master::$url_content," + rpc_urls+="${{ env.CLEAN_COMPARE_REF }}::$url_content," fi rpc_urls=${rpc_urls%,} @@ -153,12 +149,15 @@ jobs: rpc_url=$1 while curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' "$rpc_url" | jq -e '.result'; do echo "Still waiting for node to be synced at RPC: $rpc_url." - sleep 30 + sleep 60 done echo "Node at $rpc_url synced." sync_complete_flag=$((sync_complete_flag+1)) } - + + # Just an RPC warmup - to make sure no faulty info reached a check + sleep 60 + # Iterate over the processed array of URLs for url in "${processed_rpc_urls[@]}"; do check_sync "$url" @@ -197,10 +196,8 @@ jobs: INFURA_ENDPOINT: '${{ secrets.INFURA_ENDPOINT }}' NETHERMIND_ARCHIVE_ENDPOINT: '${{ secrets.NETHERMIND_ARCHIVE_ENDPOINT }}' run: | - #others_str="${{ github.event.inputs.compare_with }}" - others_str="INFURA_ENDPOINT NETHERMIND_ARCHIVE_ENDPOINT" + others_str="${{ github.event.inputs.compare_with }}" rpc_urls_str="${{ needs.aggregate_rpcs.outputs.rpc_urls }}" - #rpc_urls_str="rpc-comparision-1.23.0::http://45.79.222.118:8545,master::http://45.79.222.59:8545" IFS=',' read -r -a rpc_urls_array <<< "$rpc_urls_str" unset IFS From c70e31b8527560f60dfad43b2f7cd82df40e8bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Chodo=C5=82a?= Date: Wed, 6 Dec 2023 18:58:10 +0100 Subject: [PATCH 202/202] Add missing changes --- .github/workflows/rpc-comparison.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-comparison.yaml b/.github/workflows/rpc-comparison.yaml index 8839acd2d4e..2b06af057f5 100644 --- a/.github/workflows/rpc-comparison.yaml +++ b/.github/workflows/rpc-comparison.yaml @@ -40,7 +40,7 @@ jobs: additional_options: '{"timeout":"12", "default_dockerfile":"Dockerfile", "default_dockerfile_build_type":"release", "ssh_keys":"", "allowed_ips":"${{ inputs.allowed_ips }}"}' non_validator_mode: false additional_nethermind_flags: Pruning.Mode=None JsonRpc.EnabledModules=[Eth,Subscribe,Trace,TxPool,Web3,Personal,Proof,Net,Parity,Health,Rpc,Debug,Admin] - nethermind_repo_ref: master #${{ inputs.branch_to_compare }} + nethermind_repo_ref: ${{ inputs.branch_to_compare }} custom_run_id: ${{ github.run_id }} aggregate_rpcs: @@ -171,7 +171,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install flood - run: pip install git+https://github.com/paradigmxyz/flood.git + run: pip install git+https://github.com/piwonskp/flood.git - name: Install WireGuard run: |