From d0f12246f117ce0c25ceb5a5fd8c3d75f9a73e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Tubal=20P=C3=A1ez=20Ruiz?= Date: Thu, 13 Nov 2025 14:37:42 +0100 Subject: [PATCH 1/5] feat: add Surge chain to evm networks and profiles (#2) --- chainbench/profile/surge/general.py | 39 +++++++++++++++++++++++++++++ chainbench/test_data/evm.py | 5 ++++ 2 files changed, 44 insertions(+) create mode 100644 chainbench/profile/surge/general.py diff --git a/chainbench/profile/surge/general.py b/chainbench/profile/surge/general.py new file mode 100644 index 0000000..cc8d4cd --- /dev/null +++ b/chainbench/profile/surge/general.py @@ -0,0 +1,39 @@ +from chainbench.user import EvmUser +from chainbench.util.rng import get_rng +from locust import task, constant_pacing + + +class SurgeProfile(EvmUser): + wait_time = constant_pacing(2) + + @task + def get_block_by_number_task(self): + self.make_rpc_call( + name="eth_getBlockByNumber", + method="eth_getBlockByNumber", + params=["0xa", True], + ), + + @task + def get_balance_task(self): + self.make_rpc_call( + name="eth_getBalance", + method="eth_getBalance", + params=[self.test_data.get_random_account(get_rng()), "latest"], + ), + + @task + def get_transaction_receipt_task(self): + self.make_rpc_call( + name="eth_getTransactionReceipt", + method="eth_getTransactionReceipt", + params=[self.test_data.get_random_tx_hash(get_rng())], + ), + + @task + def get_storage_at_task(self): + self.make_rpc_call( + name="eth_getStorageAt", + method="eth_getStorageAt", + params=[self.test_data.get_random_account(get_rng()), "0x0", "latest"], + ), diff --git a/chainbench/test_data/evm.py b/chainbench/test_data/evm.py index 69ae08d..78c8089 100644 --- a/chainbench/test_data/evm.py +++ b/chainbench/test_data/evm.py @@ -416,6 +416,11 @@ def get_random_contract(self, rng: RNG) -> Erc20Contract: "0x928e4e3dFb1c39a6deE26506Cde76875E3a25ea4", ], }, + 763374: { + "name": "surge-testnet", + "start_block": 1, + "contract_addresses": [], + }, } From 5892d4cbecf9a43716a2eb73c502af0798a02556 Mon Sep 17 00:00:00 2001 From: Adrian Date: Thu, 13 Nov 2025 19:22:03 +0100 Subject: [PATCH 2/5] feat: enhance SurgeProfile with additional RPC tasks for Ethereum --- chainbench/profile/surge/general.py | 78 +++++++++++++++++++++++++---- 1 file changed, 67 insertions(+), 11 deletions(-) diff --git a/chainbench/profile/surge/general.py b/chainbench/profile/surge/general.py index cc8d4cd..4fee691 100644 --- a/chainbench/profile/surge/general.py +++ b/chainbench/profile/surge/general.py @@ -6,12 +6,60 @@ class SurgeProfile(EvmUser): wait_time = constant_pacing(2) + @task + def get_gas_price_task(self): + self.make_rpc_call( + name="eth_gasPrice", + method="eth_gasPrice", + params=[], + ), + + @task + def get_chain_id_task(self): + self.make_rpc_call( + name="eth_chainId", + method="eth_chainId", + params=[], + ), + + @task + def net_version_task(self): + self.make_rpc_call( + name="net_version", + method="net_version", + params=[], + ), + + @task + def syncing_task(self): + self.make_rpc_call( + name="eth_syncing", + method="eth_syncing", + params=[], + ), + + @task + def get_max_priority_fee_per_gas_task(self): + self.make_rpc_call( + name="eth_maxPriorityFeePerGas", + method="eth_maxPriorityFeePerGas", + params=[], + ), + + @task + def get_fee_history_task(self): + self.make_rpc_call( + name="eth_feeHistory", + method="eth_feeHistory", + params=["0x5", "latest", [50, 90]], + ), + @task def get_block_by_number_task(self): self.make_rpc_call( name="eth_getBlockByNumber", method="eth_getBlockByNumber", - params=["0xa", True], + params=["latest", True], ), @task @@ -19,21 +67,29 @@ def get_balance_task(self): self.make_rpc_call( name="eth_getBalance", method="eth_getBalance", - params=[self.test_data.get_random_account(get_rng()), "latest"], + params=["0x0742D35Cc6634c0532925A3b844bc9e7595f3574", "latest"], ), @task - def get_transaction_receipt_task(self): + def get_block_number_task(self): self.make_rpc_call( - name="eth_getTransactionReceipt", - method="eth_getTransactionReceipt", - params=[self.test_data.get_random_tx_hash(get_rng())], + name="eth_blockNumber", + method="eth_blockNumber", + params=[], ), - + @task - def get_storage_at_task(self): + def get_block_receipts_task(self): self.make_rpc_call( - name="eth_getStorageAt", - method="eth_getStorageAt", - params=[self.test_data.get_random_account(get_rng()), "0x0", "latest"], + name="eth_getBlockReceipts", + method="eth_getBlockReceipts", + params=["latest"], ), + + @task + def get_block_transaction_count_by_number_task(self): + self.make_rpc_call( + name="eth_getBlockTransactionCountByNumber", + method="eth_getBlockTransactionCountByNumber", + params=["latest"], + ), \ No newline at end of file From aa0ba6eb10261c93889d29980d45ce1b4427f7a7 Mon Sep 17 00:00:00 2001 From: Adrian Date: Fri, 14 Nov 2025 14:19:58 +0100 Subject: [PATCH 3/5] feat: update SurgeProfile with refined task distribution and additional RPC methods --- chainbench/profile/surge/general.py | 92 +++++++++++++++++++++-------- 1 file changed, 66 insertions(+), 26 deletions(-) diff --git a/chainbench/profile/surge/general.py b/chainbench/profile/surge/general.py index 4fee691..15ec667 100644 --- a/chainbench/profile/surge/general.py +++ b/chainbench/profile/surge/general.py @@ -4,9 +4,65 @@ class SurgeProfile(EvmUser): - wait_time = constant_pacing(2) + wait_time = constant_pacing(1) - @task + @task(35) + def eth_call_task(self): + self.make_rpc_call( + name="eth_call", + method="eth_call", + params=[{"to": "0xE837861567a541EFbcf0a8A6C56aEb61dD7A2C20", "data": "0x20965255"}, "latest"], + ), + + @task(15) + def get_logs_task(self): + self.make_rpc_call( + name="eth_getLogs", + method="eth_getLogs", + params=self._get_logs_params_factory(self.rng.get_rng()), + ), + + @task(5) + def estimate_gas_task(self): + self.make_rpc_call( + name="eth_estimateGas", + method="eth_estimateGas", + params=[{"to": "0xE837861567a541EFbcf0a8A6C56aEb61dD7A2C20", "data": "0x20965255"}], + ), + + @task(10) + def get_block_by_number_task(self): + self.make_rpc_call( + name="eth_getBlockByNumber", + method="eth_getBlockByNumber", + params=self._block_params_factory(), + ), + + @task(8) + def get_balance_task(self): + self.make_rpc_call( + name="eth_getBalance", + method="eth_getBalance", + params=["0x0742D35Cc6634c0532925A3b844bc9e7595f3574", "latest"], + ), + + @task(7) + def get_transaction_receipt_task(self): + self.make_rpc_call( + name="eth_getTransactionReceipt", + method="eth_getTransactionReceipt", + params=self._transaction_by_hash_params_factory(self.rng.get_rng()), + ), + + @task(5) + def get_storage_at_task(self): + self.make_rpc_call( + name="eth_getStorageAt", + method="eth_getStorageAt", + params=["0x0742D35Cc6634c0532925A3b844bc9e7595f3574", "0x0", "latest"], + ), + + @task(5) def get_gas_price_task(self): self.make_rpc_call( name="eth_gasPrice", @@ -14,7 +70,7 @@ def get_gas_price_task(self): params=[], ), - @task + @task(2) def get_chain_id_task(self): self.make_rpc_call( name="eth_chainId", @@ -22,7 +78,7 @@ def get_chain_id_task(self): params=[], ), - @task + @task(1) def net_version_task(self): self.make_rpc_call( name="net_version", @@ -30,7 +86,7 @@ def net_version_task(self): params=[], ), - @task + @task(1) def syncing_task(self): self.make_rpc_call( name="eth_syncing", @@ -38,7 +94,7 @@ def syncing_task(self): params=[], ), - @task + @task(1) def get_max_priority_fee_per_gas_task(self): self.make_rpc_call( name="eth_maxPriorityFeePerGas", @@ -46,7 +102,7 @@ def get_max_priority_fee_per_gas_task(self): params=[], ), - @task + @task(2) def get_fee_history_task(self): self.make_rpc_call( name="eth_feeHistory", @@ -54,23 +110,7 @@ def get_fee_history_task(self): params=["0x5", "latest", [50, 90]], ), - @task - def get_block_by_number_task(self): - self.make_rpc_call( - name="eth_getBlockByNumber", - method="eth_getBlockByNumber", - params=["latest", True], - ), - - @task - def get_balance_task(self): - self.make_rpc_call( - name="eth_getBalance", - method="eth_getBalance", - params=["0x0742D35Cc6634c0532925A3b844bc9e7595f3574", "latest"], - ), - - @task + @task(1) def get_block_number_task(self): self.make_rpc_call( name="eth_blockNumber", @@ -78,7 +118,7 @@ def get_block_number_task(self): params=[], ), - @task + @task(1) def get_block_receipts_task(self): self.make_rpc_call( name="eth_getBlockReceipts", @@ -86,7 +126,7 @@ def get_block_receipts_task(self): params=["latest"], ), - @task + @task(1) def get_block_transaction_count_by_number_task(self): self.make_rpc_call( name="eth_getBlockTransactionCountByNumber", From 32161b4928135b0564825b3446ab0b483f332e99 Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 15 Dec 2025 11:50:04 +0100 Subject: [PATCH 4/5] refactor: clean up SurgeProfile RPC call formatting and update test network block number --- chainbench/profile/surge/general.py | 53 ++++++++++++++--------------- chainbench/test_data/evm.py | 2 +- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/chainbench/profile/surge/general.py b/chainbench/profile/surge/general.py index 15ec667..b4c88bd 100644 --- a/chainbench/profile/surge/general.py +++ b/chainbench/profile/surge/general.py @@ -1,6 +1,5 @@ from chainbench.user import EvmUser -from chainbench.util.rng import get_rng -from locust import task, constant_pacing +from locust import constant_pacing, task class SurgeProfile(EvmUser): @@ -8,35 +7,35 @@ class SurgeProfile(EvmUser): @task(35) def eth_call_task(self): - self.make_rpc_call( - name="eth_call", - method="eth_call", - params=[{"to": "0xE837861567a541EFbcf0a8A6C56aEb61dD7A2C20", "data": "0x20965255"}, "latest"], - ), - + self.make_rpc_call( + name="eth_call", + method="eth_call", + params=[{"to": "0xE837861567a541EFbcf0a8A6C56aEb61dD7A2C20", "data": "0x20965255"}, "latest"], + ) + @task(15) def get_logs_task(self): self.make_rpc_call( name="eth_getLogs", method="eth_getLogs", params=self._get_logs_params_factory(self.rng.get_rng()), - ), - + ) + @task(5) def estimate_gas_task(self): self.make_rpc_call( name="eth_estimateGas", method="eth_estimateGas", params=[{"to": "0xE837861567a541EFbcf0a8A6C56aEb61dD7A2C20", "data": "0x20965255"}], - ), - + ) + @task(10) def get_block_by_number_task(self): self.make_rpc_call( name="eth_getBlockByNumber", method="eth_getBlockByNumber", params=self._block_params_factory(), - ), + ) @task(8) def get_balance_task(self): @@ -44,7 +43,7 @@ def get_balance_task(self): name="eth_getBalance", method="eth_getBalance", params=["0x0742D35Cc6634c0532925A3b844bc9e7595f3574", "latest"], - ), + ) @task(7) def get_transaction_receipt_task(self): @@ -52,7 +51,7 @@ def get_transaction_receipt_task(self): name="eth_getTransactionReceipt", method="eth_getTransactionReceipt", params=self._transaction_by_hash_params_factory(self.rng.get_rng()), - ), + ) @task(5) def get_storage_at_task(self): @@ -60,7 +59,7 @@ def get_storage_at_task(self): name="eth_getStorageAt", method="eth_getStorageAt", params=["0x0742D35Cc6634c0532925A3b844bc9e7595f3574", "0x0", "latest"], - ), + ) @task(5) def get_gas_price_task(self): @@ -68,7 +67,7 @@ def get_gas_price_task(self): name="eth_gasPrice", method="eth_gasPrice", params=[], - ), + ) @task(2) def get_chain_id_task(self): @@ -76,7 +75,7 @@ def get_chain_id_task(self): name="eth_chainId", method="eth_chainId", params=[], - ), + ) @task(1) def net_version_task(self): @@ -84,7 +83,7 @@ def net_version_task(self): name="net_version", method="net_version", params=[], - ), + ) @task(1) def syncing_task(self): @@ -92,15 +91,15 @@ def syncing_task(self): name="eth_syncing", method="eth_syncing", params=[], - ), - + ) + @task(1) def get_max_priority_fee_per_gas_task(self): self.make_rpc_call( name="eth_maxPriorityFeePerGas", method="eth_maxPriorityFeePerGas", params=[], - ), + ) @task(2) def get_fee_history_task(self): @@ -108,7 +107,7 @@ def get_fee_history_task(self): name="eth_feeHistory", method="eth_feeHistory", params=["0x5", "latest", [50, 90]], - ), + ) @task(1) def get_block_number_task(self): @@ -116,7 +115,7 @@ def get_block_number_task(self): name="eth_blockNumber", method="eth_blockNumber", params=[], - ), + ) @task(1) def get_block_receipts_task(self): @@ -124,12 +123,12 @@ def get_block_receipts_task(self): name="eth_getBlockReceipts", method="eth_getBlockReceipts", params=["latest"], - ), - + ) + @task(1) def get_block_transaction_count_by_number_task(self): self.make_rpc_call( name="eth_getBlockTransactionCountByNumber", method="eth_getBlockTransactionCountByNumber", params=["latest"], - ), \ No newline at end of file + ) \ No newline at end of file diff --git a/chainbench/test_data/evm.py b/chainbench/test_data/evm.py index 78c8089..78f1cd4 100644 --- a/chainbench/test_data/evm.py +++ b/chainbench/test_data/evm.py @@ -416,7 +416,7 @@ def get_random_contract(self, rng: RNG) -> Erc20Contract: "0x928e4e3dFb1c39a6deE26506Cde76875E3a25ea4", ], }, - 763374: { + 763375: { "name": "surge-testnet", "start_block": 1, "contract_addresses": [], From 01985490ec2da608b8154aae558d49da0942510a Mon Sep 17 00:00:00 2001 From: "angelo.ross" Date: Tue, 9 Jun 2026 16:14:15 -0300 Subject: [PATCH 5/5] Maybe add hoodi support --- .github/workflows/docker-publish.yml | 83 ++++++++++++---------------- chainbench/test_data/evm.py | 5 ++ 2 files changed, 41 insertions(+), 47 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 980a6b0..913d510 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,59 +1,48 @@ name: Docker -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - on: - release: - types: [published] - pull_request: - branches: [ "main" ] + push: + branches: + - main jobs: - build: + version: runs-on: ubuntu-latest + outputs: + tag: ${{ steps.tag.outputs.tag }} + steps: + - name: Generate version tag + id: tag + run: echo "tag=$(date -u +'%-Y.%-m.%-d')-${{ github.run_number }}" >> "$GITHUB_OUTPUT" + + build-and-push: + needs: version permissions: + id-token: write + attestations: write contents: read - packages: write + uses: NethermindEth/github-workflows/.github/workflows/docker-build-push-jfrog.yaml@stable + with: + group_name: angkor + repo_name: "angkor-oci-local-staging" + additional_tags: ${{ needs.version.outputs.tag }} + release: + needs: [version, build-and-push] + runs-on: ubuntu-latest + permissions: + contents: write steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 + - name: Create GitHub release + uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0 with: - # list of Docker images to use as base name for tags - images: | - ${{ vars.DOCKERHUB_ID }}/chainbench - # generate Docker tags based on the following events/attributes - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + tag_name: ${{ needs.version.outputs.tag }} + generate_release_notes: true + body: | + Release ${{ needs.version.outputs.tag }} - # Build and push Docker image with Buildx (don't push on PR) - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + Container images are available at: + ```bash + docker pull nethermind.jfrog.io/angkor-oci-local-staging/chainbench:${{ needs.version.outputs.tag }} + docker pull nethermind.jfrog.io/angkor-oci-local-staging/chainbench:latest + ``` diff --git a/chainbench/test_data/evm.py b/chainbench/test_data/evm.py index 78f1cd4..cac6074 100644 --- a/chainbench/test_data/evm.py +++ b/chainbench/test_data/evm.py @@ -421,6 +421,11 @@ def get_random_contract(self, rng: RNG) -> Erc20Contract: "start_block": 1, "contract_addresses": [], }, + 560048: { + "name": "ethereum-hoodi-testnet", + "start_block": 1, + "contract_addresses": [], + }, }