Skip to content

Commit

Permalink
feat: firewall rpcs on mev params
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevbirb committed Dec 16, 2024
1 parent b50382b commit 97c6e21
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 36 deletions.
1 change: 1 addition & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ def run(plan, args={}):
"metrics_port": bolt_sidecar.BOLT_SIDECAR_METRICS_PORT,
"validator_keystore_files_artifact_uuid": participant.cl_context.validator_keystore_files_artifact_uuid,
"participant_index": index,
"firewall_rpcs": mev_params.bolt_sidecar_firewall_rpcs,
}

if mev_params.bolt_boost_image == None:
Expand Down
81 changes: 45 additions & 36 deletions src/mev/bolt_sidecar/bolt_sidecar_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -29,46 +29,55 @@ def launch_bolt_sidecar(
full_keystore_path = "{0}{1}/keys".format(BOLT_SIDECAR_KEYS_DIRMOUNT_PATH_ON_SERVICE, node_keystore_path)
full_keystore_secrets_path = "{0}{1}/secrets".format(BOLT_SIDECAR_KEYS_DIRMOUNT_PATH_ON_SERVICE, node_keystore_path)

cmd = [
"--port",
str(BOLT_SIDECAR_COMMITMENTS_API_PORT),
"--execution-api-url",
sidecar_config["execution_api_url"],
"--beacon-api-url",
sidecar_config["beacon_api_url"],
"--engine-api-url",
sidecar_config["engine_api_url"],
"--constraints-api-url",
sidecar_config["constraints_api_url"],
"--constraints-proxy-port",
str(input_parser.BOLT_SIDECAR_CONSTRAINTS_PROXY_PORT),
"--engine-jwt-hex",
sidecar_config["jwt_hex"],
"--fee-recipient",
"0x0000000000000000000000000000000000000000",
"--builder-private-key", # Random private key for testing
"0x20c815cb2d37561479c7b6cae9737356b144760d00f1387bff17df4a3712c262",
"--commitment-deadline",
str(100),
"--chain",
network_params.network,
"--slot-time",
str(network_params.seconds_per_slot),
# "--keystore-password",
# validator_keystore_generator.PRYSM_PASSWORD,
"--keystore-secrets-path",
full_keystore_secrets_path,
"--keystore-path",
full_keystore_path,
"--metrics-port",
str(BOLT_SIDECAR_METRICS_PORT),
]

if len(sidecar_config["firewall_rpcs"]) > 0:
cmd.append("--firewall-rpcs")
cmd.append(",".join(sidecar_config["firewall_rpcs"]))
else:
# Random private key for testing
cmd.append("--commitment-private-key")
cmd.append("0x18d1c5302e734fd6fbfaa51828d42c4c6d3cbe020c42bab7dd15a2799cf00b82")


api = plan.add_service(
name=sidecar_config["service_name"],
config=ServiceConfig(
image=image,
cmd=[
"--port",
str(BOLT_SIDECAR_COMMITMENTS_API_PORT),
"--execution-api-url",
sidecar_config["execution_api_url"],
"--beacon-api-url",
sidecar_config["beacon_api_url"],
"--engine-api-url",
sidecar_config["engine_api_url"],
"--constraints-api-url",
sidecar_config["constraints_api_url"],
"--constraints-proxy-port",
str(input_parser.BOLT_SIDECAR_CONSTRAINTS_PROXY_PORT),
"--engine-jwt-hex",
sidecar_config["jwt_hex"],
"--fee-recipient",
"0x0000000000000000000000000000000000000000",
"--builder-private-key", # Random private key for testing
"0x20c815cb2d37561479c7b6cae9737356b144760d00f1387bff17df4a3712c262",
"--commitment-private-key", # Random private key for testing
"0x18d1c5302e734fd6fbfaa51828d42c4c6d3cbe020c42bab7dd15a2799cf00b82",
"--commitment-deadline",
str(100),
"--chain",
network_params.network,
"--slot-time",
str(network_params.seconds_per_slot),
# "--keystore-password",
# validator_keystore_generator.PRYSM_PASSWORD,
"--keystore-secrets-path",
full_keystore_secrets_path,
"--keystore-path",
full_keystore_path,
"--metrics-port",
str(BOLT_SIDECAR_METRICS_PORT),
],
cmd=cmd,
# + mev_params.mev_relay_api_extra_args,
ports={
"api": PortSpec(
Expand Down
2 changes: 2 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ def input_parser(plan, input_args):
mev_builder_cl_image=result["mev_params"]["mev_builder_cl_image"],
mev_boost_image=result["mev_params"]["mev_boost_image"],
bolt_sidecar_image=result["mev_params"]["bolt_sidecar_image"],
bolt_sidecar_firewall_rpcs=result["mev_params"]["bolt_sidecar_firewall_rpcs"],
mev_boost_args=result["mev_params"]["mev_boost_args"],
mev_relay_api_extra_args=result["mev_params"]["mev_relay_api_extra_args"],
mev_relay_housekeeper_extra_args=result["mev_params"][
Expand Down Expand Up @@ -732,6 +733,7 @@ def get_default_mev_params():
"mev_relay_api_extra_args": [],
"mev_relay_housekeeper_extra_args": [],
"mev_relay_website_extra_args": [],
"bolt_sidecar_firewall_rpcs": [],
"helix_relay_config_extension": None,
"mev_builder_extra_args": None,
"mev_flood_image": "flashbots/mev-flood",
Expand Down

0 comments on commit 97c6e21

Please sign in to comment.