From b62c5f2e74f67d4eb5d235cd0dd05da9b22a2bf6 Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 28 Sep 2023 03:14:30 +0200 Subject: [PATCH 1/5] rename light-beaconchain-explorer to dora --- README.md | 2 +- main.star | 18 +++++++++--------- .../dora_launcher.star} | 18 +++++++++--------- src/package_io/parse_input.star | 2 +- src/static_files/static_files.star | 4 ++-- .../config.yaml.tmpl | 15 ++++++--------- 6 files changed, 28 insertions(+), 31 deletions(-) rename src/{light_beaconchain/light_beaconchain_launcher.star => dora/dora_launcher.star} (80%) rename static_files/{light-beaconchain-config => dora-config}/config.yaml.tmpl (85%) diff --git a/README.md b/README.md index b9fd6aefe..9534200fd 100644 --- a/README.md +++ b/README.md @@ -226,7 +226,7 @@ To configure the package behaviour, you can modify your `network_params.json` fi "cl_forkmon", "el_forkmon", "beacon_metrics_gazer", - "light_beaconchain_explorer", + "dora", "prometheus_grafana", ], diff --git a/main.star b/main.star index 143dc8e67..52d782047 100644 --- a/main.star +++ b/main.star @@ -28,8 +28,8 @@ el_forkmon = import_module( beacon_metrics_gazer = import_module( "github.com/kurtosis-tech/ethereum-package/src/beacon_metrics_gazer/beacon_metrics_gazer_launcher.star" ) -light_beaconchain_explorer = import_module( - "github.com/kurtosis-tech/ethereum-package/src/light_beaconchain/light_beaconchain_launcher.star" +dora = import_module( + "github.com/kurtosis-tech/ethereum-package/src/dora/dora_launcher.star" ) prometheus = import_module( "github.com/kurtosis-tech/ethereum-package/src/prometheus/prometheus_launcher.star" @@ -299,15 +299,15 @@ def run(plan, args={}): beacon_metrics_gazer_prometheus_metrics_job ) plan.print("Succesfully launched beacon metrics gazer") - elif additional_service == "light_beaconchain_explorer": - plan.print("Launching light-beaconchain-explorer") - light_beaconchain_explorer_config_template = read_file( - static_files.LIGHT_BEACONCHAIN_CONFIG_TEMPLATE_FILEPATH + elif additional_service == "dora": + plan.print("Launching dora") + dora_config_template = read_file( + static_files.DORA_CONFIG_TEMPLATE_FILEPATH ) - light_beaconchain_explorer.launch_light_beacon( - plan, light_beaconchain_explorer_config_template, all_cl_client_contexts + dora.launch_dora( + plan, dora_config_template, all_cl_client_contexts ) - plan.print("Succesfully light-beaconchain-explorer") + plan.print("Succesfully launched dora") elif additional_service == "prometheus_grafana": # Allow prometheus to be launched last so is able to collect metrics from other services launch_prometheus_grafana = True diff --git a/src/light_beaconchain/light_beaconchain_launcher.star b/src/dora/dora_launcher.star similarity index 80% rename from src/light_beaconchain/light_beaconchain_launcher.star rename to src/dora/dora_launcher.star index f49606925..b5afe9883 100644 --- a/src/light_beaconchain/light_beaconchain_launcher.star +++ b/src/dora/dora_launcher.star @@ -3,15 +3,15 @@ shared_utils = import_module( ) -SERVICE_NAME = "light-beaconchain" +SERVICE_NAME = "dora" IMAGE_NAME = "ethpandaops/dora-the-explorer:master" HTTP_PORT_ID = "http" HTTP_PORT_NUMBER = 8080 -LIGHT_BEACONCHAIN_CONFIG_FILENAME = "light-beaconchain-config.yaml" +DORA_CONFIG_FILENAME = "dora-config.yaml" -LIGHT_BEACONCHAIN_CONFIG_MOUNT_DIRPATH_ON_SERVICE = "/config" +DORA_CONFIG_MOUNT_DIRPATH_ON_SERVICE = "/config" VALIDATOR_RANGES_MOUNT_DIRPATH_ON_SERVICE = "/validator-ranges" VALIDATOR_RANGES_ARTIFACT_NAME = "validator-ranges" @@ -29,7 +29,7 @@ USED_PORTS = { } -def launch_light_beacon( +def launch_dora( plan, config_template, cl_client_contexts, @@ -49,11 +49,11 @@ def launch_light_beacon( ) template_and_data_by_rel_dest_filepath = {} template_and_data_by_rel_dest_filepath[ - LIGHT_BEACONCHAIN_CONFIG_FILENAME + DORA_CONFIG_FILENAME ] = template_and_data config_files_artifact_name = plan.render_templates( - template_and_data_by_rel_dest_filepath, "light-beaconchain-config" + template_and_data_by_rel_dest_filepath, "dora-config" ) config = get_config(config_files_artifact_name) @@ -63,14 +63,14 @@ def launch_light_beacon( def get_config(config_files_artifact_name): config_file_path = shared_utils.path_join( - LIGHT_BEACONCHAIN_CONFIG_MOUNT_DIRPATH_ON_SERVICE, - LIGHT_BEACONCHAIN_CONFIG_FILENAME, + DORA_CONFIG_MOUNT_DIRPATH_ON_SERVICE, + DORA_CONFIG_FILENAME, ) return ServiceConfig( image=IMAGE_NAME, ports=USED_PORTS, files={ - LIGHT_BEACONCHAIN_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name, + DORA_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name, VALIDATOR_RANGES_MOUNT_DIRPATH_ON_SERVICE: VALIDATOR_RANGES_ARTIFACT_NAME, CL_CONFIG_MOUNT_DIRPATH_ON_SERVICE: CL_CONFIG_ARTIFACT_NAME, }, diff --git a/src/package_io/parse_input.star b/src/package_io/parse_input.star index c8e0e3c14..7ab4e411b 100644 --- a/src/package_io/parse_input.star +++ b/src/package_io/parse_input.star @@ -33,7 +33,7 @@ DEFAULT_ADDITIONAL_SERVICES = [ "cl_forkmon", "el_forkmon", "beacon_metrics_gazer", - "light_beaconchain_explorer", + "dora", "prometheus_grafana", ] diff --git a/src/static_files/static_files.star b/src/static_files/static_files.star index d13377cca..01e6c20be 100644 --- a/src/static_files/static_files.star +++ b/src/static_files/static_files.star @@ -21,8 +21,8 @@ BEACON_METRICS_GAZER_CONFIG_TEMPLATE_FILEPATH = ( STATIC_FILES_DIRPATH + "/beacon-metrics-gazer-config/config.yaml.tmpl" ) -LIGHT_BEACONCHAIN_CONFIG_TEMPLATE_FILEPATH = ( - STATIC_FILES_DIRPATH + "/light-beaconchain-config/config.yaml.tmpl" +DORA_CONFIG_TEMPLATE_FILEPATH = ( + STATIC_FILES_DIRPATH + "/dora-config/config.yaml.tmpl" ) # Grafana config diff --git a/static_files/light-beaconchain-config/config.yaml.tmpl b/static_files/dora-config/config.yaml.tmpl similarity index 85% rename from static_files/light-beaconchain-config/config.yaml.tmpl rename to static_files/dora-config/config.yaml.tmpl index 1b63681ab..508003bbd 100644 --- a/static_files/light-beaconchain-config/config.yaml.tmpl +++ b/static_files/dora-config/config.yaml.tmpl @@ -23,7 +23,7 @@ frontend: minimize: false # minimize html templates # Name of the site, displayed in the title tag - siteName: "Beaconchain Light" + siteName: "Dora the Explorer" siteSubtitle: "Kurtosis Testnet" # link to EL Explorer @@ -41,7 +41,7 @@ beaconapi: archive: true {{- end }} # local cache for page models - localCacheSize: 100 # 100MB + localCacheSize: 10 # 100MB # remote cache for page models redisCacheAddr: "" @@ -49,14 +49,11 @@ beaconapi: # indexer keeps track of the latest epochs in memory. indexer: - # number of epochs to load on startup - prepopulateEpochs: 2 - # max number of epochs to keep in memory - inMemoryEpochs: 3 + inMemoryEpochs: 5 - # epoch processing delay (should be >= 2) - epochProcessingDelay: 2 + # number of epochs to wait before storing unfinalized blocks to db + cachePersistenceDelay: 5 # disable synchronizing and everything that writes to the db (indexer just maintains local cache) disableIndexWriter: false @@ -68,4 +65,4 @@ indexer: database: engine: "sqlite" sqlite: - file: ":memory:" + file: "/dora-database.sqlite" From d5ce35f00b56fc3a2b48b487201d2a1b02c2c3a9 Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 28 Sep 2023 05:25:49 +0200 Subject: [PATCH 2/5] config fine-tuning for local testnets --- static_files/dora-config/config.yaml.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static_files/dora-config/config.yaml.tmpl b/static_files/dora-config/config.yaml.tmpl index 508003bbd..155bdbdc5 100644 --- a/static_files/dora-config/config.yaml.tmpl +++ b/static_files/dora-config/config.yaml.tmpl @@ -50,16 +50,16 @@ beaconapi: # indexer keeps track of the latest epochs in memory. indexer: # max number of epochs to keep in memory - inMemoryEpochs: 5 + inMemoryEpochs: 8 # number of epochs to wait before storing unfinalized blocks to db - cachePersistenceDelay: 5 + cachePersistenceDelay: 8 # disable synchronizing and everything that writes to the db (indexer just maintains local cache) disableIndexWriter: false # number of seconds to wait between each epoch (don't overload CL client) - syncEpochCooldown: 2 + syncEpochCooldown: 1 database: From dccd7c3c1f7a9897a736d914cdeb840fff075a65 Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 28 Sep 2023 05:38:48 +0200 Subject: [PATCH 3/5] kurtosis lint --format --- main.star | 8 ++------ src/dora/dora_launcher.star | 4 +--- src/static_files/static_files.star | 4 +--- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/main.star b/main.star index 52d782047..2ea8259b2 100644 --- a/main.star +++ b/main.star @@ -301,12 +301,8 @@ def run(plan, args={}): plan.print("Succesfully launched beacon metrics gazer") elif additional_service == "dora": plan.print("Launching dora") - dora_config_template = read_file( - static_files.DORA_CONFIG_TEMPLATE_FILEPATH - ) - dora.launch_dora( - plan, dora_config_template, all_cl_client_contexts - ) + dora_config_template = read_file(static_files.DORA_CONFIG_TEMPLATE_FILEPATH) + dora.launch_dora(plan, dora_config_template, all_cl_client_contexts) plan.print("Succesfully launched dora") elif additional_service == "prometheus_grafana": # Allow prometheus to be launched last so is able to collect metrics from other services diff --git a/src/dora/dora_launcher.star b/src/dora/dora_launcher.star index b5afe9883..960f3be28 100644 --- a/src/dora/dora_launcher.star +++ b/src/dora/dora_launcher.star @@ -48,9 +48,7 @@ def launch_dora( config_template, template_data ) template_and_data_by_rel_dest_filepath = {} - template_and_data_by_rel_dest_filepath[ - DORA_CONFIG_FILENAME - ] = template_and_data + template_and_data_by_rel_dest_filepath[DORA_CONFIG_FILENAME] = template_and_data config_files_artifact_name = plan.render_templates( template_and_data_by_rel_dest_filepath, "dora-config" diff --git a/src/static_files/static_files.star b/src/static_files/static_files.star index 01e6c20be..9a2252ce5 100644 --- a/src/static_files/static_files.star +++ b/src/static_files/static_files.star @@ -21,9 +21,7 @@ BEACON_METRICS_GAZER_CONFIG_TEMPLATE_FILEPATH = ( STATIC_FILES_DIRPATH + "/beacon-metrics-gazer-config/config.yaml.tmpl" ) -DORA_CONFIG_TEMPLATE_FILEPATH = ( - STATIC_FILES_DIRPATH + "/dora-config/config.yaml.tmpl" -) +DORA_CONFIG_TEMPLATE_FILEPATH = STATIC_FILES_DIRPATH + "/dora-config/config.yaml.tmpl" # Grafana config GRAFANA_CONFIG_DIRPATH = "/grafana-config" From 96874dfe6d48f599e499a47333f044438f97a932 Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 28 Sep 2023 05:41:31 +0200 Subject: [PATCH 4/5] cleanup dora config --- static_files/dora-config/config.yaml.tmpl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/static_files/dora-config/config.yaml.tmpl b/static_files/dora-config/config.yaml.tmpl index 155bdbdc5..5157d1b3d 100644 --- a/static_files/dora-config/config.yaml.tmpl +++ b/static_files/dora-config/config.yaml.tmpl @@ -1,10 +1,6 @@ logging: outputLevel: "info" - #outputStderr: false - - #filePath: "explorer.log" - #fileLevel: "warn" # Chain network configuration chain: @@ -41,7 +37,7 @@ beaconapi: archive: true {{- end }} # local cache for page models - localCacheSize: 10 # 100MB + localCacheSize: 10 # 10MB # remote cache for page models redisCacheAddr: "" @@ -61,7 +57,6 @@ indexer: # number of seconds to wait between each epoch (don't overload CL client) syncEpochCooldown: 1 - database: engine: "sqlite" sqlite: From 628a82bdf157ba5812ae6511eadd5d1c101f934b Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 28 Sep 2023 16:18:54 +0200 Subject: [PATCH 5/5] fixed merge conflict --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9d862f0d4..4c152c47c 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,7 @@ To configure the package behaviour, you can modify your `network_params.json` fi "beacon_metrics_gazer", "dora", "prometheus_grafana" + ], // If set, the package will block until a finalized epoch has occurred. "wait_for_finalization": false,