Commit ed3982b5 authored by Gyanendra Mishra's avatar Gyanendra Mishra Committed by GitHub

fix: roll out persistence for postgres on ethereum-package (#421)

parent f957f851
...@@ -26,3 +26,4 @@ snooper_enabled: true ...@@ -26,3 +26,4 @@ snooper_enabled: true
mev_type: full mev_type: full
mev_params: mev_params:
mev_relay_image: flashbots/mev-boost-relay:0.27 mev_relay_image: flashbots/mev-boost-relay:0.27
persistent: True
...@@ -323,6 +323,11 @@ disable_peer_scoring: false ...@@ -323,6 +323,11 @@ disable_peer_scoring: false
# A list of locators for grafana dashboards to be loaded be the grafana service # A list of locators for grafana dashboards to be loaded be the grafana service
grafana_additional_dashboards: [] grafana_additional_dashboards: []
# Whether the environment should be persistent; this is WIP and is slowly being rolled out accross services
# Note this requires Kurtosis greater than 0.85.49 to work
# Defaults to False
persistent: False
# Supports three valeus # Supports three valeus
# Default: "null" - no mev boost, mev builder, mev flood or relays are spun up # Default: "null" - no mev boost, mev builder, mev flood or relays are spun up
# "mock" - mock-builder & mev-boost are spun up # "mock" - mock-builder & mev-boost are spun up
......
...@@ -59,6 +59,7 @@ def run(plan, args={}): ...@@ -59,6 +59,7 @@ def run(plan, args={}):
network_params = args_with_right_defaults.network_params network_params = args_with_right_defaults.network_params
mev_params = args_with_right_defaults.mev_params mev_params = args_with_right_defaults.mev_params
parallel_keystore_generation = args_with_right_defaults.parallel_keystore_generation parallel_keystore_generation = args_with_right_defaults.parallel_keystore_generation
persistent = args_with_right_defaults.persistent
grafana_datasource_config_template = read_file( grafana_datasource_config_template = read_file(
static_files.GRAFANA_DATASOURCE_CONFIG_TEMPLATE_FILEPATH static_files.GRAFANA_DATASOURCE_CONFIG_TEMPLATE_FILEPATH
...@@ -222,6 +223,7 @@ def run(plan, args={}): ...@@ -222,6 +223,7 @@ def run(plan, args={}):
genesis_validators_root, genesis_validators_root,
builder_uri, builder_uri,
network_params.seconds_per_slot, network_params.seconds_per_slot,
persistent,
) )
mev_flood.spam_in_background( mev_flood.spam_in_background(
plan, plan,
...@@ -345,6 +347,7 @@ def run(plan, args={}): ...@@ -345,6 +347,7 @@ def run(plan, args={}):
all_cl_client_contexts, all_cl_client_contexts,
all_el_client_contexts, all_el_client_contexts,
network_params.network_id, network_params.network_id,
persistent,
) )
plan.print("Successfully launched blobscan") plan.print("Successfully launched blobscan")
elif additional_service == "full_beaconchain_explorer": elif additional_service == "full_beaconchain_explorer":
...@@ -357,6 +360,7 @@ def run(plan, args={}): ...@@ -357,6 +360,7 @@ def run(plan, args={}):
full_beaconchain_explorer_config_template, full_beaconchain_explorer_config_template,
all_cl_client_contexts, all_cl_client_contexts,
all_el_client_contexts, all_el_client_contexts,
persistent,
) )
plan.print("Successfully launched full-beaconchain-explorer") plan.print("Successfully launched full-beaconchain-explorer")
elif additional_service == "prometheus_grafana": elif additional_service == "prometheus_grafana":
......
...@@ -74,3 +74,4 @@ mev_params: ...@@ -74,3 +74,4 @@ mev_params:
mev_flood_extra_args: [] mev_flood_extra_args: []
mev_flood_seconds_per_bundle: 15 mev_flood_seconds_per_bundle: 15
grafana_additional_dashboards: [] grafana_additional_dashboards: []
persistent: False
...@@ -58,6 +58,7 @@ def launch_blobscan( ...@@ -58,6 +58,7 @@ def launch_blobscan(
cl_client_contexts, cl_client_contexts,
el_client_contexts, el_client_contexts,
chain_id, chain_id,
persistent,
): ):
beacon_node_rpc_uri = "http://{0}:{1}".format( beacon_node_rpc_uri = "http://{0}:{1}".format(
cl_client_contexts[0].ip_addr, cl_client_contexts[0].http_port_num cl_client_contexts[0].ip_addr, cl_client_contexts[0].http_port_num
...@@ -73,7 +74,7 @@ def launch_blobscan( ...@@ -73,7 +74,7 @@ def launch_blobscan(
max_cpu=POSTGRES_MAX_CPU, max_cpu=POSTGRES_MAX_CPU,
min_memory=POSTGRES_MIN_MEMORY, min_memory=POSTGRES_MIN_MEMORY,
max_memory=POSTGRES_MAX_MEMORY, max_memory=POSTGRES_MAX_MEMORY,
persistent=False, persistent=persistent,
) )
api_config = get_api_config(postgres_output.url, beacon_node_rpc_uri, chain_id) api_config = get_api_config(postgres_output.url, beacon_node_rpc_uri, chain_id)
blobscan_config = plan.add_service(API_SERVICE_NAME, api_config) blobscan_config = plan.add_service(API_SERVICE_NAME, api_config)
......
...@@ -96,6 +96,7 @@ def launch_full_beacon( ...@@ -96,6 +96,7 @@ def launch_full_beacon(
config_template, config_template,
cl_client_contexts, cl_client_contexts,
el_client_contexts, el_client_contexts,
persistent,
): ):
postgres_output = postgres.run( postgres_output = postgres.run(
plan, plan,
...@@ -108,7 +109,7 @@ def launch_full_beacon( ...@@ -108,7 +109,7 @@ def launch_full_beacon(
max_cpu=POSTGRES_MAX_CPU, max_cpu=POSTGRES_MAX_CPU,
min_memory=POSTGRES_MIN_MEMORY, min_memory=POSTGRES_MIN_MEMORY,
max_memory=POSTGRES_MAX_MEMORY, max_memory=POSTGRES_MAX_MEMORY,
persistent=False, persistent=persistent,
) )
redis_output = redis.run( redis_output = redis.run(
plan, plan,
......
...@@ -18,7 +18,6 @@ NETWORK_ID_TO_NAME = { ...@@ -18,7 +18,6 @@ NETWORK_ID_TO_NAME = {
"3": "ropsten", "3": "ropsten",
} }
DONT_PERSIST_TO_DISK = False
LAUNCH_ADMINER = True LAUNCH_ADMINER = True
# The min/max CPU/memory that mev-relay can use # The min/max CPU/memory that mev-relay can use
...@@ -48,6 +47,7 @@ def launch_mev_relay( ...@@ -48,6 +47,7 @@ def launch_mev_relay(
validator_root, validator_root,
builder_uri, builder_uri,
seconds_per_slot, seconds_per_slot,
persistent,
): ):
redis = redis_module.run( redis = redis_module.run(
plan, plan,
...@@ -64,7 +64,7 @@ def launch_mev_relay( ...@@ -64,7 +64,7 @@ def launch_mev_relay(
user="postgres", user="postgres",
database="postgres", database="postgres",
service_name="mev-relay-postgres", service_name="mev-relay-postgres",
persistent=DONT_PERSIST_TO_DISK, persistent=persistent,
launch_adminer=LAUNCH_ADMINER, launch_adminer=LAUNCH_ADMINER,
min_cpu=POSTGRES_MIN_CPU, min_cpu=POSTGRES_MIN_CPU,
max_cpu=POSTGRES_MAX_CPU, max_cpu=POSTGRES_MAX_CPU,
......
...@@ -69,6 +69,7 @@ def input_parser(plan, input_args): ...@@ -69,6 +69,7 @@ def input_parser(plan, input_args):
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 result["disable_peer_scoring"] = False
result["persistent"] = False
for attr in input_args: for attr in input_args:
value = input_args[attr] value = input_args[attr]
...@@ -216,6 +217,7 @@ def input_parser(plan, input_args): ...@@ -216,6 +217,7 @@ def input_parser(plan, input_args):
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"], disable_peer_scoring=result["disable_peer_scoring"],
persistent=result["persistent"],
) )
......
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