From a2fb27f7f08dda9693f8f30ca90035a4d37acc24 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Tue, 8 Oct 2024 18:12:10 -0300 Subject: [PATCH 01/20] Initial assertoor test --- .github/workflows/assertoor.yml | 20 ++++++++++++++++++++ .github/workflows/assertoor/test-config.yml | 19 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/assertoor.yml create mode 100644 .github/workflows/assertoor/test-config.yml diff --git a/.github/workflows/assertoor.yml b/.github/workflows/assertoor.yml new file mode 100644 index 000000000..7bba83cf0 --- /dev/null +++ b/.github/workflows/assertoor.yml @@ -0,0 +1,20 @@ +jobs: + ethereum-testnet: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + load: true # Important for building without pushing + - uses: actions/checkout@v4 + - name: Setup kurtosis testnet and run assertoor tests + uses: ethpandaops/kurtosis-assertoor-github-action@v1 + with: + ethereum_package_url: 'https://github.com/lambdaclass/ethereum-package.git#lecc-integration' + ethereum_package_args: './assertoor/test-config.yml' + # Additional configurations as needed \ No newline at end of file diff --git a/.github/workflows/assertoor/test-config.yml b/.github/workflows/assertoor/test-config.yml new file mode 100644 index 000000000..a1b809ca0 --- /dev/null +++ b/.github/workflows/assertoor/test-config.yml @@ -0,0 +1,19 @@ +participants: + - el_type: geth + cl_type: teku + - el_type: nethermind + cl_type: prysm + - el_type: erigon + cl_type: nimbus + - el_type: besu + cl_type: lighthouse + - el_type: reth + cl_type: lodestar + - el_type: geth + cl_type: lambda + cl_image: lambda_ethereum_consensus:latest +additional_services: + - assertoor +assertoor_params: + run_stability_check: true + run_block_proposal_check: false \ No newline at end of file From 7382a6cd6e12346b9d0e24d8e0728876c78fc3a5 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Tue, 8 Oct 2024 18:23:02 -0300 Subject: [PATCH 02/20] Added the assertoor task to the CI --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a67e74cc..d59d91b40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,6 +147,27 @@ jobs: file: ./Dockerfile load: true # Important for building without pushing + ethereum-testnet: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + tags: lambda_ethereum_consensus:latest + load: true # Important for building without pushing + - uses: actions/checkout@v4 + - name: Setup kurtosis testnet and run assertoor tests + uses: ethpandaops/kurtosis-assertoor-github-action@v1 + with: + ethereum_package_url: 'https://github.com/lambdaclass/ethereum-package.git#lecc-integration' + ethereum_package_args: './assertoor/test-config.yml' + # Additional configurations as needed + smoke: name: Start and stop the node needs: [compile-native, download-beacon-node-oapi] From 96fe806dc07bfdad9956eee2e9ecfbd83ed02427 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Tue, 8 Oct 2024 18:29:38 -0300 Subject: [PATCH 03/20] added branch to the ethereum package url --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d59d91b40..fb671edfd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,11 +160,11 @@ jobs: file: ./Dockerfile tags: lambda_ethereum_consensus:latest load: true # Important for building without pushing - - uses: actions/checkout@v4 - name: Setup kurtosis testnet and run assertoor tests uses: ethpandaops/kurtosis-assertoor-github-action@v1 with: - ethereum_package_url: 'https://github.com/lambdaclass/ethereum-package.git#lecc-integration' + ethereum_package_url: 'https://github.com/lambdaclass/ethereum-package.git' + ethereum_package_branch: 'lecc-integration' ethereum_package_args: './assertoor/test-config.yml' # Additional configurations as needed From dbab9545a868ed775799c042875b90be1fb7d4a9 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Tue, 8 Oct 2024 18:33:00 -0300 Subject: [PATCH 04/20] removed jobs from CI and put them in their own file --- .github/workflows/assertoor.yml | 18 ++++++++++++++++-- .github/workflows/ci.yml | 23 +---------------------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/.github/workflows/assertoor.yml b/.github/workflows/assertoor.yml index 7bba83cf0..840d4e172 100644 --- a/.github/workflows/assertoor.yml +++ b/.github/workflows/assertoor.yml @@ -1,3 +1,16 @@ +name: Assertoor tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ '*' ] + paths-ignore: + - 'docs/**' + - '.all-contributorsrc' + - 'README.md' + - 'LICENSE' + - 'metrics/**' jobs: ethereum-testnet: runs-on: ubuntu-latest @@ -10,11 +23,12 @@ jobs: with: context: . file: ./Dockerfile + tags: lambda_ethereum_consensus:latest load: true # Important for building without pushing - - uses: actions/checkout@v4 - name: Setup kurtosis testnet and run assertoor tests uses: ethpandaops/kurtosis-assertoor-github-action@v1 with: - ethereum_package_url: 'https://github.com/lambdaclass/ethereum-package.git#lecc-integration' + ethereum_package_url: 'https://github.com/lambdaclass/ethereum-package.git' + ethereum_package_branch: 'lecc-integration' ethereum_package_args: './assertoor/test-config.yml' # Additional configurations as needed \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb671edfd..3e40ba36d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,28 +146,7 @@ jobs: context: . file: ./Dockerfile load: true # Important for building without pushing - - ethereum-testnet: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build Docker image - uses: docker/build-push-action@v6 - with: - context: . - file: ./Dockerfile - tags: lambda_ethereum_consensus:latest - load: true # Important for building without pushing - - name: Setup kurtosis testnet and run assertoor tests - uses: ethpandaops/kurtosis-assertoor-github-action@v1 - with: - ethereum_package_url: 'https://github.com/lambdaclass/ethereum-package.git' - ethereum_package_branch: 'lecc-integration' - ethereum_package_args: './assertoor/test-config.yml' - # Additional configurations as needed - + smoke: name: Start and stop the node needs: [compile-native, download-beacon-node-oapi] From 87ced43c5f4ac801bf6a31406e54638ffc591c5b Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Tue, 8 Oct 2024 18:41:43 -0300 Subject: [PATCH 05/20] test without our fork --- .github/workflows/assertoor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/assertoor.yml b/.github/workflows/assertoor.yml index 840d4e172..6b6d4f83b 100644 --- a/.github/workflows/assertoor.yml +++ b/.github/workflows/assertoor.yml @@ -28,7 +28,7 @@ jobs: - name: Setup kurtosis testnet and run assertoor tests uses: ethpandaops/kurtosis-assertoor-github-action@v1 with: - ethereum_package_url: 'https://github.com/lambdaclass/ethereum-package.git' - ethereum_package_branch: 'lecc-integration' + # ethereum_package_url: 'https://github.com/lambdaclass/ethereum-package.git' + # ethereum_package_branch: 'lecc-integration' ethereum_package_args: './assertoor/test-config.yml' # Additional configurations as needed \ No newline at end of file From 32f783e62839992a675f71e39cf6ba67a2f28419 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Tue, 8 Oct 2024 18:59:41 -0300 Subject: [PATCH 06/20] add our eth pkg fork again --- .github/workflows/assertoor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/assertoor.yml b/.github/workflows/assertoor.yml index 6b6d4f83b..48a5c316e 100644 --- a/.github/workflows/assertoor.yml +++ b/.github/workflows/assertoor.yml @@ -28,7 +28,7 @@ jobs: - name: Setup kurtosis testnet and run assertoor tests uses: ethpandaops/kurtosis-assertoor-github-action@v1 with: - # ethereum_package_url: 'https://github.com/lambdaclass/ethereum-package.git' + ethereum_package_url: 'github.com/lambdaclass/ethereum-package' # ethereum_package_branch: 'lecc-integration' ethereum_package_args: './assertoor/test-config.yml' # Additional configurations as needed \ No newline at end of file From b21ca2d9216e945bd8548f4d9565fe22cd0a84b0 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Wed, 9 Oct 2024 10:36:21 -0300 Subject: [PATCH 07/20] check now that branch is correctly picked up --- .github/workflows/assertoor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/assertoor.yml b/.github/workflows/assertoor.yml index 48a5c316e..7c097394b 100644 --- a/.github/workflows/assertoor.yml +++ b/.github/workflows/assertoor.yml @@ -29,6 +29,6 @@ jobs: uses: ethpandaops/kurtosis-assertoor-github-action@v1 with: ethereum_package_url: 'github.com/lambdaclass/ethereum-package' - # ethereum_package_branch: 'lecc-integration' + ethereum_package_branch: 'lecc-integration' ethereum_package_args: './assertoor/test-config.yml' # Additional configurations as needed \ No newline at end of file From cce3bbdf0337991a19f034797cdc099c028582f1 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Wed, 9 Oct 2024 10:37:42 -0300 Subject: [PATCH 08/20] Change file path to config --- .github/workflows/assertoor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/assertoor.yml b/.github/workflows/assertoor.yml index 7c097394b..f2376e20e 100644 --- a/.github/workflows/assertoor.yml +++ b/.github/workflows/assertoor.yml @@ -30,5 +30,5 @@ jobs: with: ethereum_package_url: 'github.com/lambdaclass/ethereum-package' ethereum_package_branch: 'lecc-integration' - ethereum_package_args: './assertoor/test-config.yml' + ethereum_package_args: './.github/assertoor/test-config.yml' # Additional configurations as needed \ No newline at end of file From 54495264b78a83b4390e71ae69ae10caa2bcf547 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Wed, 9 Oct 2024 11:07:30 -0300 Subject: [PATCH 09/20] changing config file to the root of the project --- .github/workflows/assertoor.yml | 2 +- .../workflows/assertoor/test-config.yml => assertoor-config.yml | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/assertoor/test-config.yml => assertoor-config.yml (100%) diff --git a/.github/workflows/assertoor.yml b/.github/workflows/assertoor.yml index f2376e20e..da0c8d572 100644 --- a/.github/workflows/assertoor.yml +++ b/.github/workflows/assertoor.yml @@ -30,5 +30,5 @@ jobs: with: ethereum_package_url: 'github.com/lambdaclass/ethereum-package' ethereum_package_branch: 'lecc-integration' - ethereum_package_args: './.github/assertoor/test-config.yml' + ethereum_package_args: './assertoor-config.yml' # Additional configurations as needed \ No newline at end of file diff --git a/.github/workflows/assertoor/test-config.yml b/assertoor-config.yml similarity index 100% rename from .github/workflows/assertoor/test-config.yml rename to assertoor-config.yml From 89abeb606e166a0e08a085f653f90f7ce51307b6 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Wed, 9 Oct 2024 11:58:41 -0300 Subject: [PATCH 10/20] Change in the ethereum-package branch --- .github/workflows/assertoor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/assertoor.yml b/.github/workflows/assertoor.yml index da0c8d572..06b38c9d6 100644 --- a/.github/workflows/assertoor.yml +++ b/.github/workflows/assertoor.yml @@ -29,6 +29,6 @@ jobs: uses: ethpandaops/kurtosis-assertoor-github-action@v1 with: ethereum_package_url: 'github.com/lambdaclass/ethereum-package' - ethereum_package_branch: 'lecc-integration' + ethereum_package_branch: 'lecc-integration-and-assertoor' ethereum_package_args: './assertoor-config.yml' # Additional configurations as needed \ No newline at end of file From 0be4b292300aed4b2c35c0cc16f11ffbe941dc6d Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Wed, 9 Oct 2024 12:40:57 -0300 Subject: [PATCH 11/20] Testing with the participant config --- assertoor-config.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/assertoor-config.yml b/assertoor-config.yml index a1b809ca0..86f99a2f0 100644 --- a/assertoor-config.yml +++ b/assertoor-config.yml @@ -7,11 +7,16 @@ participants: cl_type: nimbus - el_type: besu cl_type: lighthouse - - el_type: reth - cl_type: lodestar - el_type: geth cl_type: lambda cl_image: lambda_ethereum_consensus:latest + use_separate_vc: false + count: 1 + validator_count: 32 + cl_max_mem: 4096 + keymanager_enabled: true + - el_type: reth + cl_type: lodestar additional_services: - assertoor assertoor_params: From 7414d9be472c2ec2164e9179fa5c9d23cc2df23f Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Wed, 9 Oct 2024 12:44:21 -0300 Subject: [PATCH 12/20] Making the file more near to network_params for testing --- assertoor-config.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/assertoor-config.yml b/assertoor-config.yml index 86f99a2f0..8c89259e8 100644 --- a/assertoor-config.yml +++ b/assertoor-config.yml @@ -1,12 +1,17 @@ +# participants: + # - el_type: geth + # cl_type: teku + # - el_type: nethermind + # cl_type: prysm + # - el_type: erigon + # cl_type: nimbus + # - el_type: besu + # cl_type: lighthouse participants: - el_type: geth - cl_type: teku - - el_type: nethermind - cl_type: prysm - - el_type: erigon - cl_type: nimbus - - el_type: besu cl_type: lighthouse + count: 2 + validator_count: 32 - el_type: geth cl_type: lambda cl_image: lambda_ethereum_consensus:latest @@ -15,8 +20,8 @@ participants: validator_count: 32 cl_max_mem: 4096 keymanager_enabled: true - - el_type: reth - cl_type: lodestar +# network_params: +# preset: minimal additional_services: - assertoor assertoor_params: From df8d22d18baff9dbd53dd4a0c7d93a81c22fee9c Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Wed, 9 Oct 2024 18:40:45 -0300 Subject: [PATCH 13/20] Added syncing and peers endpoint to valdiate assertoor execution --- assertoor-config.yml | 18 ++----- .../controllers/v1/node_controller.ex | 48 +++++++++++++++++-- lib/beacon_api/router.ex | 2 + .../beacon/sync_blocks.ex | 21 ++++++++ network_params.yaml | 15 +++++- 5 files changed, 83 insertions(+), 21 deletions(-) diff --git a/assertoor-config.yml b/assertoor-config.yml index 8c89259e8..cc8a7c127 100644 --- a/assertoor-config.yml +++ b/assertoor-config.yml @@ -1,27 +1,15 @@ -# participants: - # - el_type: geth - # cl_type: teku - # - el_type: nethermind - # cl_type: prysm - # - el_type: erigon - # cl_type: nimbus - # - el_type: besu - # cl_type: lighthouse participants: - - el_type: geth + - el_type: nethermind + cl_type: prysm + - el_type: reth cl_type: lighthouse - count: 2 - validator_count: 32 - el_type: geth cl_type: lambda cl_image: lambda_ethereum_consensus:latest use_separate_vc: false count: 1 - validator_count: 32 cl_max_mem: 4096 keymanager_enabled: true -# network_params: -# preset: minimal additional_services: - assertoor assertoor_params: diff --git a/lib/beacon_api/controllers/v1/node_controller.ex b/lib/beacon_api/controllers/v1/node_controller.ex index 334501d83..a42996c7f 100644 --- a/lib/beacon_api/controllers/v1/node_controller.ex +++ b/lib/beacon_api/controllers/v1/node_controller.ex @@ -3,6 +3,7 @@ defmodule BeaconApi.V1.NodeController do alias BeaconApi.ApiSpec alias BeaconApi.Utils + alias LambdaEthereumConsensus.Beacon.SyncBlocks alias LambdaEthereumConsensus.Libp2pPort alias LambdaEthereumConsensus.P2P.Metadata @@ -19,12 +20,20 @@ defmodule BeaconApi.V1.NodeController do def open_api_operation(:version), do: ApiSpec.spec().paths["/eth/v1/node/version"].get + def open_api_operation(:syncing), + do: ApiSpec.spec().paths["/eth/v1/node/syncing"].get + + def open_api_operation(:peers), + do: ApiSpec.spec().paths["/eth/v1/node/peers"].get + @spec health(Plug.Conn.t(), any) :: Plug.Conn.t() - def health(conn, params) do - # TODO: respond with syncing status if we're still syncing - _syncing_status = Map.get(params, :syncing_status, 206) + def health(conn, _params) do + %{is_syncing: syncing?} = SyncBlocks.status() + syncing_status = if syncing?, do: 206, else: 200 - send_resp(conn, 200, "") + send_resp(conn, syncing_status, "") + rescue + _ -> send_resp(conn, 503, "") end @spec identity(Plug.Conn.t(), any) :: Plug.Conn.t() @@ -62,4 +71,35 @@ defmodule BeaconApi.V1.NodeController do } }) end + + @spec syncing(Plug.Conn.t(), any) :: Plug.Conn.t() + def syncing(conn, _params) do + %{ + is_syncing: is_syncing, + is_optimistic: is_optimistic, + el_offline: el_offline, + head_slot: head_slot, + sync_distance: sync_distance + } = SyncBlocks.status() + + json(conn, %{"data" => %{ + "is_syncing" => is_syncing, + "is_optimistic" => is_optimistic, + "el_offline" => el_offline, + "head_slot" => head_slot |> Integer.to_string(), + "sync_distance" => sync_distance |> Integer.to_string() + }}) + end + + @spec peers(Plug.Conn.t(), any) :: Plug.Conn.t() + def peers(conn, _params) do + # TODO: (#1325) This is a stub. + conn + |> json(%{ + "data" => [%{}], + "meta" => %{ + "count" => 0 + } + }) + end end diff --git a/lib/beacon_api/router.ex b/lib/beacon_api/router.ex index df36dda97..1d50b8421 100644 --- a/lib/beacon_api/router.ex +++ b/lib/beacon_api/router.ex @@ -21,6 +21,8 @@ defmodule BeaconApi.Router do get("/health", NodeController, :health) get("/identity", NodeController, :identity) get("/version", NodeController, :version) + get("/syncing", NodeController, :syncing) + get("/peers", NodeController, :peers) end end diff --git a/lib/lambda_ethereum_consensus/beacon/sync_blocks.ex b/lib/lambda_ethereum_consensus/beacon/sync_blocks.ex index 6050bbb73..76778bcc2 100644 --- a/lib/lambda_ethereum_consensus/beacon/sync_blocks.ex +++ b/lib/lambda_ethereum_consensus/beacon/sync_blocks.ex @@ -8,6 +8,7 @@ defmodule LambdaEthereumConsensus.Beacon.SyncBlocks do alias LambdaEthereumConsensus.ForkChoice alias LambdaEthereumConsensus.Libp2pPort alias LambdaEthereumConsensus.P2P.BlockDownloader + alias LambdaEthereumConsensus.Store.StoreDb @blocks_per_chunk 16 @retries 50 @@ -68,4 +69,24 @@ defmodule LambdaEthereumConsensus.Beacon.SyncBlocks do Libp2pPort.notify_block_download_failed(range, reason) {:ok, store} end + + @doc """ + Returns the current syncing status. + + TODO: (#1325) This is a semi-stub. This is not the final implementation, + just in place for start using assertoor. Probably need to be moved to Libp2pPort. + """ + def status() do + {:ok, %{head_slot: head_slot}} = StoreDb.fetch_store() + initial_slot = head_slot + 1 + last_slot = ForkChoice.get_current_chain_slot() + distance = last_slot - initial_slot + 1 + syncing? = distance > 0 + + %{is_syncing: syncing?, + is_optimistic: syncing?, + el_offline: false, + head_slot: head_slot, + sync_distance: distance} + end end diff --git a/network_params.yaml b/network_params.yaml index 76f0325e1..9527a096f 100644 --- a/network_params.yaml +++ b/network_params.yaml @@ -11,5 +11,16 @@ participants: validator_count: 32 cl_max_mem: 4096 keymanager_enabled: true -network_params: - preset: minimal +# network_params: +# preset: minimal +additional_services: + - assertoor + - tx_spammer + - blob_spammer + - el_forkmon + - dora + - beacon_metrics_gazer + - prometheus_grafana +assertoor_params: + run_stability_check: true + run_block_proposal_check: false From a18768f3251bf2ff80e93d4d1a0aae40c4bd22ae Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Fri, 11 Oct 2024 17:50:29 -0300 Subject: [PATCH 14/20] Push consensus file to take it form the repo --- consensus-test.yaml | 32 ++++++++++++++++++++++++++++++++ network_params.yaml | 4 +++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 consensus-test.yaml diff --git a/consensus-test.yaml b/consensus-test.yaml new file mode 100644 index 000000000..9d1f40348 --- /dev/null +++ b/consensus-test.yaml @@ -0,0 +1,32 @@ +id: stability-check +name: "Check chain stability" +timeout: 2h +tasks: +- name: check_clients_are_healthy + title: "Check if all clients are ready" + timeout: 5m + config: + minClientCount: 3 + +- name: run_tasks_concurrent + title: "Check chain stability" + timeout: 1h + config: + tasks: + - name: check_consensus_finality + title: "Check consensus chain finality" + config: + minFinalizedEpochs: 2 + maxUnfinalizedEpochs: 3 + - name: check_consensus_attestation_stats + title: "Check consensus attestation stats" + config: + minTargetPercent: 98 + minHeadPercent: 80 + - name: check_consensus_reorgs + title: "Check consensus reorgs" + config: + maxReorgsPerEpoch: 2 + minCheckEpochCount: 1 + - name: check_consensus_forks + title: "Check consensus forks" \ No newline at end of file diff --git a/network_params.yaml b/network_params.yaml index 9527a096f..741e816e1 100644 --- a/network_params.yaml +++ b/network_params.yaml @@ -22,5 +22,7 @@ additional_services: - beacon_metrics_gazer - prometheus_grafana assertoor_params: - run_stability_check: true + run_stability_check: false run_block_proposal_check: false + tests: + - file: "./consensus-test.yaml" From ea945ac21a42631fce996e575c1046776288562d Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Fri, 11 Oct 2024 18:15:47 -0300 Subject: [PATCH 15/20] cleaned-up unnedded diffs to have a minimal version of assertoor running --- assertoor-config.yml | 5 +- .../controllers/v1/node_controller.ex | 48 ++----------------- lib/beacon_api/router.ex | 2 - .../beacon/sync_blocks.ex | 21 -------- network_params.yaml | 17 +------ 5 files changed, 7 insertions(+), 86 deletions(-) diff --git a/assertoor-config.yml b/assertoor-config.yml index cc8a7c127..5986450ff 100644 --- a/assertoor-config.yml +++ b/assertoor-config.yml @@ -11,7 +11,4 @@ participants: cl_max_mem: 4096 keymanager_enabled: true additional_services: - - assertoor -assertoor_params: - run_stability_check: true - run_block_proposal_check: false \ No newline at end of file + - assertoor \ No newline at end of file diff --git a/lib/beacon_api/controllers/v1/node_controller.ex b/lib/beacon_api/controllers/v1/node_controller.ex index a42996c7f..334501d83 100644 --- a/lib/beacon_api/controllers/v1/node_controller.ex +++ b/lib/beacon_api/controllers/v1/node_controller.ex @@ -3,7 +3,6 @@ defmodule BeaconApi.V1.NodeController do alias BeaconApi.ApiSpec alias BeaconApi.Utils - alias LambdaEthereumConsensus.Beacon.SyncBlocks alias LambdaEthereumConsensus.Libp2pPort alias LambdaEthereumConsensus.P2P.Metadata @@ -20,20 +19,12 @@ defmodule BeaconApi.V1.NodeController do def open_api_operation(:version), do: ApiSpec.spec().paths["/eth/v1/node/version"].get - def open_api_operation(:syncing), - do: ApiSpec.spec().paths["/eth/v1/node/syncing"].get - - def open_api_operation(:peers), - do: ApiSpec.spec().paths["/eth/v1/node/peers"].get - @spec health(Plug.Conn.t(), any) :: Plug.Conn.t() - def health(conn, _params) do - %{is_syncing: syncing?} = SyncBlocks.status() - syncing_status = if syncing?, do: 206, else: 200 + def health(conn, params) do + # TODO: respond with syncing status if we're still syncing + _syncing_status = Map.get(params, :syncing_status, 206) - send_resp(conn, syncing_status, "") - rescue - _ -> send_resp(conn, 503, "") + send_resp(conn, 200, "") end @spec identity(Plug.Conn.t(), any) :: Plug.Conn.t() @@ -71,35 +62,4 @@ defmodule BeaconApi.V1.NodeController do } }) end - - @spec syncing(Plug.Conn.t(), any) :: Plug.Conn.t() - def syncing(conn, _params) do - %{ - is_syncing: is_syncing, - is_optimistic: is_optimistic, - el_offline: el_offline, - head_slot: head_slot, - sync_distance: sync_distance - } = SyncBlocks.status() - - json(conn, %{"data" => %{ - "is_syncing" => is_syncing, - "is_optimistic" => is_optimistic, - "el_offline" => el_offline, - "head_slot" => head_slot |> Integer.to_string(), - "sync_distance" => sync_distance |> Integer.to_string() - }}) - end - - @spec peers(Plug.Conn.t(), any) :: Plug.Conn.t() - def peers(conn, _params) do - # TODO: (#1325) This is a stub. - conn - |> json(%{ - "data" => [%{}], - "meta" => %{ - "count" => 0 - } - }) - end end diff --git a/lib/beacon_api/router.ex b/lib/beacon_api/router.ex index 1d50b8421..df36dda97 100644 --- a/lib/beacon_api/router.ex +++ b/lib/beacon_api/router.ex @@ -21,8 +21,6 @@ defmodule BeaconApi.Router do get("/health", NodeController, :health) get("/identity", NodeController, :identity) get("/version", NodeController, :version) - get("/syncing", NodeController, :syncing) - get("/peers", NodeController, :peers) end end diff --git a/lib/lambda_ethereum_consensus/beacon/sync_blocks.ex b/lib/lambda_ethereum_consensus/beacon/sync_blocks.ex index 76778bcc2..6050bbb73 100644 --- a/lib/lambda_ethereum_consensus/beacon/sync_blocks.ex +++ b/lib/lambda_ethereum_consensus/beacon/sync_blocks.ex @@ -8,7 +8,6 @@ defmodule LambdaEthereumConsensus.Beacon.SyncBlocks do alias LambdaEthereumConsensus.ForkChoice alias LambdaEthereumConsensus.Libp2pPort alias LambdaEthereumConsensus.P2P.BlockDownloader - alias LambdaEthereumConsensus.Store.StoreDb @blocks_per_chunk 16 @retries 50 @@ -69,24 +68,4 @@ defmodule LambdaEthereumConsensus.Beacon.SyncBlocks do Libp2pPort.notify_block_download_failed(range, reason) {:ok, store} end - - @doc """ - Returns the current syncing status. - - TODO: (#1325) This is a semi-stub. This is not the final implementation, - just in place for start using assertoor. Probably need to be moved to Libp2pPort. - """ - def status() do - {:ok, %{head_slot: head_slot}} = StoreDb.fetch_store() - initial_slot = head_slot + 1 - last_slot = ForkChoice.get_current_chain_slot() - distance = last_slot - initial_slot + 1 - syncing? = distance > 0 - - %{is_syncing: syncing?, - is_optimistic: syncing?, - el_offline: false, - head_slot: head_slot, - sync_distance: distance} - end end diff --git a/network_params.yaml b/network_params.yaml index 741e816e1..76f0325e1 100644 --- a/network_params.yaml +++ b/network_params.yaml @@ -11,18 +11,5 @@ participants: validator_count: 32 cl_max_mem: 4096 keymanager_enabled: true -# network_params: -# preset: minimal -additional_services: - - assertoor - - tx_spammer - - blob_spammer - - el_forkmon - - dora - - beacon_metrics_gazer - - prometheus_grafana -assertoor_params: - run_stability_check: false - run_block_proposal_check: false - tests: - - file: "./consensus-test.yaml" +network_params: + preset: minimal From dbadb492c48713405b3ee395a452fa6aef2ef05b Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Fri, 11 Oct 2024 18:23:03 -0300 Subject: [PATCH 16/20] removed unnedded diffs --- .github/workflows/ci.yml | 2 +- consensus-test.yaml | 32 -------------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 consensus-test.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e40ba36d..4a67e74cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,7 +146,7 @@ jobs: context: . file: ./Dockerfile load: true # Important for building without pushing - + smoke: name: Start and stop the node needs: [compile-native, download-beacon-node-oapi] diff --git a/consensus-test.yaml b/consensus-test.yaml deleted file mode 100644 index 9d1f40348..000000000 --- a/consensus-test.yaml +++ /dev/null @@ -1,32 +0,0 @@ -id: stability-check -name: "Check chain stability" -timeout: 2h -tasks: -- name: check_clients_are_healthy - title: "Check if all clients are ready" - timeout: 5m - config: - minClientCount: 3 - -- name: run_tasks_concurrent - title: "Check chain stability" - timeout: 1h - config: - tasks: - - name: check_consensus_finality - title: "Check consensus chain finality" - config: - minFinalizedEpochs: 2 - maxUnfinalizedEpochs: 3 - - name: check_consensus_attestation_stats - title: "Check consensus attestation stats" - config: - minTargetPercent: 98 - minHeadPercent: 80 - - name: check_consensus_reorgs - title: "Check consensus reorgs" - config: - maxReorgsPerEpoch: 2 - minCheckEpochCount: 1 - - name: check_consensus_forks - title: "Check consensus forks" \ No newline at end of file From 0aa41f3dc24c6944ed49a064deb8bc003bb738f9 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Fri, 11 Oct 2024 18:33:39 -0300 Subject: [PATCH 17/20] Remove stability check --- assertoor-config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assertoor-config.yml b/assertoor-config.yml index 5986450ff..4da0aa7ca 100644 --- a/assertoor-config.yml +++ b/assertoor-config.yml @@ -11,4 +11,7 @@ participants: cl_max_mem: 4096 keymanager_enabled: true additional_services: - - assertoor \ No newline at end of file + - assertoor +assertoor_params: + run_stability_check: false + run_block_proposal_check: false \ No newline at end of file From a0e096bbb87c65b54dffa675abb1579bd4df9af0 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Mon, 14 Oct 2024 12:39:34 -0300 Subject: [PATCH 18/20] Set to false all checks --- assertoor-config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assertoor-config.yml b/assertoor-config.yml index 4da0aa7ca..9145cdf19 100644 --- a/assertoor-config.yml +++ b/assertoor-config.yml @@ -14,4 +14,8 @@ additional_services: - assertoor assertoor_params: run_stability_check: false - run_block_proposal_check: false \ No newline at end of file + run_block_proposal_check: false + run_transaction_test: false + run_blob_transaction_test: false + run_opcodes_transaction_test: false + run_lifecycle_test: false \ No newline at end of file From 27a9d429cd3415de0a5aee3f8bff0c5911132163 Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Mon, 14 Oct 2024 13:39:24 -0300 Subject: [PATCH 19/20] set test to [] in assertoor config --- assertoor-config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assertoor-config.yml b/assertoor-config.yml index 9145cdf19..cf3b80cdb 100644 --- a/assertoor-config.yml +++ b/assertoor-config.yml @@ -18,4 +18,5 @@ assertoor_params: run_transaction_test: false run_blob_transaction_test: false run_opcodes_transaction_test: false - run_lifecycle_test: false \ No newline at end of file + run_lifecycle_test: false + test: [] \ No newline at end of file From b93e0d39b6a991c3e830d380cddade4aee3e18bd Mon Sep 17 00:00:00 2001 From: Rodrigo Oliveri Date: Mon, 14 Oct 2024 13:54:14 -0300 Subject: [PATCH 20/20] Testing without assertoor as additional service because it stills run tests not in the file. --- assertoor-config.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/assertoor-config.yml b/assertoor-config.yml index cf3b80cdb..446eb3a16 100644 --- a/assertoor-config.yml +++ b/assertoor-config.yml @@ -10,13 +10,13 @@ participants: count: 1 cl_max_mem: 4096 keymanager_enabled: true -additional_services: - - assertoor -assertoor_params: - run_stability_check: false - run_block_proposal_check: false - run_transaction_test: false - run_blob_transaction_test: false - run_opcodes_transaction_test: false - run_lifecycle_test: false - test: [] \ No newline at end of file +additional_services: [] +# - assertoor +# assertoor_params: +# run_stability_check: false +# run_block_proposal_check: false +# run_transaction_test: false +# run_blob_transaction_test: false +# run_opcodes_transaction_test: false +# run_lifecycle_test: false +# test: []