Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Bolt Boost chain config #15

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ def run(plan, args={}):
relays_config,
bolt_sidecar_config,
network_params,
final_genesis_timestamp,
global_node_selectors,
)
all_mevboost_contexts.append(bolt_boost_context)
Expand Down
30 changes: 27 additions & 3 deletions src/mev/bolt_boost/bolt_boost_launcher.star
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
shared_utils = import_module("../../shared_utils/shared_utils.star")
mev_boost_context_module = import_module("../mev_boost/mev_boost_context.star")
static_files = import_module("../../static_files/static_files.star")
constants = import_module("../../package_io/constants.star")

FLASHBOTS_MEV_BOOST_PROTOCOL = "TCP"

Expand Down Expand Up @@ -30,13 +31,17 @@ def launch(
relays_config,
bolt_sidecar_config,
network_params,
final_genesis_timestamp,
global_node_selectors,
):
plan.print(network_params)
config = get_bolt_boost_config(
plan,
bolt_boost_image,
relays_config,
bolt_sidecar_config,
network_params,
final_genesis_timestamp,
global_node_selectors,
)

Expand All @@ -52,6 +57,8 @@ def get_bolt_boost_config(
image,
relays_config,
bolt_sidecar_config,
network_params,
final_genesis_timestamp,
node_selectors,
):
# Read the template file for Bolt Boost configuration
Expand All @@ -61,7 +68,13 @@ def get_bolt_boost_config(

# Generate the data to be used in the Bolt Boost configuration,
# wrap them together in a struct
bolt_boost_config_template_data = new_bolt_boost_config_template_data(image, relays_config, bolt_sidecar_config)
bolt_boost_config_template_data = new_bolt_boost_config_template_data(
image,
relays_config,
bolt_sidecar_config,
network_params,
final_genesis_timestamp,
)
bolt_boost_config_template_and_data = shared_utils.new_template_and_data(
bolt_boost_config_template, bolt_boost_config_template_data
)
Expand Down Expand Up @@ -95,9 +108,20 @@ def get_bolt_boost_config(
node_selectors=node_selectors,
)

def new_bolt_boost_config_template_data(image, relays_config, bolt_sidecar_config):
def new_bolt_boost_config_template_data(
image,
relays_config,
bolt_sidecar_config,
network_params,
final_genesis_timestamp,
):
return {
"chain": "Holesky",
"chain_config": {
"name": network_params.network.capitalize(),
"genesis_timestamp": final_genesis_timestamp,
"seconds_per_slot": network_params.seconds_per_slot,
"genesis_fork_version": constants.GENESIS_FORK_VERSION,
},
"image": image,
"port": BOLT_BOOST_PORT,
"relays_config": [
Expand Down
11 changes: 9 additions & 2 deletions static_files/bolt-boost-config/cb-bolt-boost-config.toml.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# The main configuration file for the Commit-Boost sidecar.
# Some fields are optional and can be omitted, in which case the default value, if present, will be used.

# Chain spec id. Supported values: Mainnet, Holesky, Helder
chain = "{{ or .chain "Mainnet" }}"
# Chain spec id. Supported values: Mainnet, Holesky, Helder, Custom
{{- if eq .chain_config.name "Kurtosis" }}
[chain]
genesis_time_secs = {{ .chain_config.genesis_timestamp }}
slot_time_secs = {{ .chain_config.seconds_per_slot }}
genesis_fork_version = "{{ .chain_config.genesis_fork_version }}"
{{- else }}
chain = "{{ .chain_config.name }}"
{{- end }}

# Configuration for the PBS module
[pbs]
Expand Down
Loading