Skip to content

Commit ed3982b

Browse files
authored
fix: roll out persistence for postgres on ethereum-package (#421)
1 parent f957f85 commit ed3982b

File tree

8 files changed

+19
-4
lines changed

8 files changed

+19
-4
lines changed

.github/tests/mix-with-tools-mev.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ snooper_enabled: true
2626
mev_type: full
2727
mev_params:
2828
mev_relay_image: flashbots/mev-boost-relay:0.27
29+
persistent: True

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ disable_peer_scoring: false
323323
# A list of locators for grafana dashboards to be loaded be the grafana service
324324
grafana_additional_dashboards: []
325325

326+
# Whether the environment should be persistent; this is WIP and is slowly being rolled out accross services
327+
# Note this requires Kurtosis greater than 0.85.49 to work
328+
# Defaults to False
329+
persistent: False
330+
326331
# Supports three valeus
327332
# Default: "null" - no mev boost, mev builder, mev flood or relays are spun up
328333
# "mock" - mock-builder & mev-boost are spun up

main.star

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def run(plan, args={}):
5959
network_params = args_with_right_defaults.network_params
6060
mev_params = args_with_right_defaults.mev_params
6161
parallel_keystore_generation = args_with_right_defaults.parallel_keystore_generation
62+
persistent = args_with_right_defaults.persistent
6263

6364
grafana_datasource_config_template = read_file(
6465
static_files.GRAFANA_DATASOURCE_CONFIG_TEMPLATE_FILEPATH
@@ -222,6 +223,7 @@ def run(plan, args={}):
222223
genesis_validators_root,
223224
builder_uri,
224225
network_params.seconds_per_slot,
226+
persistent,
225227
)
226228
mev_flood.spam_in_background(
227229
plan,
@@ -345,6 +347,7 @@ def run(plan, args={}):
345347
all_cl_client_contexts,
346348
all_el_client_contexts,
347349
network_params.network_id,
350+
persistent,
348351
)
349352
plan.print("Successfully launched blobscan")
350353
elif additional_service == "full_beaconchain_explorer":
@@ -357,6 +360,7 @@ def run(plan, args={}):
357360
full_beaconchain_explorer_config_template,
358361
all_cl_client_contexts,
359362
all_el_client_contexts,
363+
persistent,
360364
)
361365
plan.print("Successfully launched full-beaconchain-explorer")
362366
elif additional_service == "prometheus_grafana":

network_params.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@ mev_params:
7474
mev_flood_extra_args: []
7575
mev_flood_seconds_per_bundle: 15
7676
grafana_additional_dashboards: []
77+
persistent: False

src/blobscan/blobscan_launcher.star

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def launch_blobscan(
5858
cl_client_contexts,
5959
el_client_contexts,
6060
chain_id,
61+
persistent,
6162
):
6263
beacon_node_rpc_uri = "http://{0}:{1}".format(
6364
cl_client_contexts[0].ip_addr, cl_client_contexts[0].http_port_num
@@ -73,7 +74,7 @@ def launch_blobscan(
7374
max_cpu=POSTGRES_MAX_CPU,
7475
min_memory=POSTGRES_MIN_MEMORY,
7576
max_memory=POSTGRES_MAX_MEMORY,
76-
persistent=False,
77+
persistent=persistent,
7778
)
7879
api_config = get_api_config(postgres_output.url, beacon_node_rpc_uri, chain_id)
7980
blobscan_config = plan.add_service(API_SERVICE_NAME, api_config)

src/full_beaconchain/full_beaconchain_launcher.star

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def launch_full_beacon(
9696
config_template,
9797
cl_client_contexts,
9898
el_client_contexts,
99+
persistent,
99100
):
100101
postgres_output = postgres.run(
101102
plan,
@@ -108,7 +109,7 @@ def launch_full_beacon(
108109
max_cpu=POSTGRES_MAX_CPU,
109110
min_memory=POSTGRES_MIN_MEMORY,
110111
max_memory=POSTGRES_MAX_MEMORY,
111-
persistent=False,
112+
persistent=persistent,
112113
)
113114
redis_output = redis.run(
114115
plan,

src/mev/mev_relay/mev_relay_launcher.star

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ NETWORK_ID_TO_NAME = {
1818
"3": "ropsten",
1919
}
2020

21-
DONT_PERSIST_TO_DISK = False
2221
LAUNCH_ADMINER = True
2322

2423
# The min/max CPU/memory that mev-relay can use
@@ -48,6 +47,7 @@ def launch_mev_relay(
4847
validator_root,
4948
builder_uri,
5049
seconds_per_slot,
50+
persistent,
5151
):
5252
redis = redis_module.run(
5353
plan,
@@ -64,7 +64,7 @@ def launch_mev_relay(
6464
user="postgres",
6565
database="postgres",
6666
service_name="mev-relay-postgres",
67-
persistent=DONT_PERSIST_TO_DISK,
67+
persistent=persistent,
6868
launch_adminer=LAUNCH_ADMINER,
6969
min_cpu=POSTGRES_MIN_CPU,
7070
max_cpu=POSTGRES_MAX_CPU,

src/package_io/input_parser.star

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def input_parser(plan, input_args):
6969
result["tx_spammer_params"] = get_default_tx_spammer_params()
7070
result["custom_flood_params"] = get_default_custom_flood_params()
7171
result["disable_peer_scoring"] = False
72+
result["persistent"] = False
7273

7374
for attr in input_args:
7475
value = input_args[attr]
@@ -216,6 +217,7 @@ def input_parser(plan, input_args):
216217
parallel_keystore_generation=result["parallel_keystore_generation"],
217218
grafana_additional_dashboards=result["grafana_additional_dashboards"],
218219
disable_peer_scoring=result["disable_peer_scoring"],
220+
persistent=result["persistent"],
219221
)
220222

221223

0 commit comments

Comments
 (0)