Commit 63f7ff3c authored by Barnabas Busa's avatar Barnabas Busa Committed by GitHub

feat: add "disable_peer_scoring" global flag (#311)

Closes: #304
parent d4bec9e7
...@@ -276,6 +276,12 @@ jobs: ...@@ -276,6 +276,12 @@ jobs:
- <<: *setup_kurtosis - <<: *setup_kurtosis
- checkout - checkout
- run: kurtosis run ${PWD} "$(cat ./.circleci/tests/parallel-keystores-3.json)" - run: kurtosis run ${PWD} "$(cat ./.circleci/tests/parallel-keystores-3.json)"
disable_peer_scoring:
executor: ubuntu_vm
steps:
- <<: *setup_kurtosis
- checkout
- run: kurtosis run ${PWD} "$(cat ./.circleci/tests/disable-peer-scoring.json)"
workflows: workflows:
check_latest_version: check_latest_version:
...@@ -318,11 +324,13 @@ workflows: ...@@ -318,11 +324,13 @@ workflows:
branches: branches:
ignore: ignore:
- main - main
- run_starlark: - run_starlark:
filters: filters:
branches: branches:
ignore: ignore:
- main - main
- run_starlark_arm64: - run_starlark_arm64:
filters: filters:
branches: branches:
...@@ -363,13 +371,21 @@ workflows: ...@@ -363,13 +371,21 @@ workflows:
branches: branches:
ignore: ignore:
- main - main
- parallel_key_store_generation_2: - parallel_key_store_generation_2:
filters: filters:
branches: branches:
ignore: ignore:
- main - main
- parallel_key_store_generation_3: - parallel_key_store_generation_3:
filters: filters:
branches: branches:
ignore: ignore:
- main - main
- disable_peer_scoring:
filters:
branches:
ignore:
- main
{
"participants": [
{
"el_client_type": "geth",
"cl_client_type": "teku"
},
{
"el_client_type": "besu",
"cl_client_type": "lighthouse"
},
{
"el_client_type": "reth",
"cl_client_type": "lodestar"
},
{
"el_client_type": "erigon",
"cl_client_type": "nimbus"
},
{
"el_client_type": "nethermind",
"cl_client_type": "prysm"
},
{
"el_client_type": "ethereumjs",
"cl_client_type": "teku"
}
],
"launch_additional_services": false,
"disable_peer_scoring": true
}
...@@ -286,6 +286,9 @@ To configure the package behaviour, you can modify your `network_params.json` fi ...@@ -286,6 +286,9 @@ To configure the package behaviour, you can modify your `network_params.json` fi
// This will result in a large number of containers being spun up than normal. We advise users to only enable this on a sufficiently large machine or in the cloud as it can be resource consuming on a single machine. // This will result in a large number of containers being spun up than normal. We advise users to only enable this on a sufficiently large machine or in the cloud as it can be resource consuming on a single machine.
"parallel_keystore_generation": false, "parallel_keystore_generation": false,
// Disable peer scoring to prevent nodes impacted by faults from being permanently ejected from the network
// Default to false
"disable_peer_scoring": false,
// Supports three valeus // Supports three valeus
// Default: "None" - no mev boost, mev builder, mev flood or relays are spun up // Default: "None" - no mev boost, mev builder, mev flood or relays are spun up
......
...@@ -69,6 +69,7 @@ def parse_input(plan, input_args): ...@@ -69,6 +69,7 @@ def parse_input(plan, input_args):
result["grafana_additional_dashboards"] = [] result["grafana_additional_dashboards"] = []
result["tx_spammer_params"] = get_default_tx_spammer_params() result["tx_spammer_params"] = get_default_tx_spammer_params()
result["custom_flood_params"] = get_default_custom_flood_params() result["custom_flood_params"] = get_default_custom_flood_params()
result["disable_peer_scoring"] = False
for attr in input_args: for attr in input_args:
value = input_args[attr] value = input_args[attr]
...@@ -89,6 +90,9 @@ def parse_input(plan, input_args): ...@@ -89,6 +90,9 @@ def parse_input(plan, input_args):
sub_value = input_args["custom_flood_params"][sub_attr] sub_value = input_args["custom_flood_params"][sub_attr]
result["custom_flood_params"][sub_attr] = sub_value result["custom_flood_params"][sub_attr] = sub_value
if result.get("disable_peer_scoring"):
result = enrich_disable_peer_scoring(result)
if result.get("mev_type") in ("mock", "full"): if result.get("mev_type") in ("mock", "full"):
result = enrich_mev_extra_params( result = enrich_mev_extra_params(
result, result,
...@@ -199,6 +203,7 @@ def parse_input(plan, input_args): ...@@ -199,6 +203,7 @@ def parse_input(plan, input_args):
snooper_enabled=result["snooper_enabled"], snooper_enabled=result["snooper_enabled"],
parallel_keystore_generation=result["parallel_keystore_generation"], parallel_keystore_generation=result["parallel_keystore_generation"],
grafana_additional_dashboards=result["grafana_additional_dashboards"], grafana_additional_dashboards=result["grafana_additional_dashboards"],
disable_peer_scoring=result["disable_peer_scoring"],
) )
...@@ -352,6 +357,7 @@ def default_input_args(): ...@@ -352,6 +357,7 @@ def default_input_args():
"global_client_log_level": "info", "global_client_log_level": "info",
"snooper_enabled": False, "snooper_enabled": False,
"parallel_keystore_generation": False, "parallel_keystore_generation": False,
"disable_peer_scoring": False,
} }
...@@ -433,6 +439,19 @@ def get_default_custom_flood_params(): ...@@ -433,6 +439,19 @@ def get_default_custom_flood_params():
return {"interval_between_transactions": 1} return {"interval_between_transactions": 1}
def enrich_disable_peer_scoring(parsed_arguments_dict):
for index, participant in enumerate(parsed_arguments_dict["participants"]):
if participant["cl_client_type"] == "lighthouse":
participant["beacon_extra_params"].append("--disable-peer-scoring")
if participant["cl_client_type"] == "prysm":
participant["beacon_extra_params"].append("--disable-peer-scorer")
if participant["cl_client_type"] == "teku":
participant["beacon_extra_params"].append("--Xp2p-gossip-scoring-enabled")
if participant["cl_client_type"] == "lodestar":
participant["beacon_extra_params"].append("--disablePeerScoring")
return parsed_arguments_dict
# TODO perhaps clean this up into a map # TODO perhaps clean this up into a map
def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_type): def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_type):
for index, participant in enumerate(parsed_arguments_dict["participants"]): for index, participant in enumerate(parsed_arguments_dict["participants"]):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment