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

[tracking] fork diffs #12

Draft
wants to merge 95 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
f040c7f
chore: rename package
merklefruit Apr 15, 2024
2e97e8e
feat: mev-sidecar added
merklefruit Apr 15, 2024
e2082f0
chore: typo
merklefruit Apr 15, 2024
99b1a0b
chore: fix starlark error
merklefruit Apr 15, 2024
4475e64
chore: fix starlark error
merklefruit Apr 15, 2024
ef0b76f
chore: fix starlark error
merklefruit Apr 15, 2024
b825eae
chore: fix starlark error
merklefruit Apr 15, 2024
7decde3
chore: fix starlark error
merklefruit Apr 15, 2024
f50ec98
chore: small fix
merklefruit Apr 15, 2024
fd9c6f3
feat: use tx-fuzz image with configurable slot time
thedevbirb Apr 26, 2024
9799868
Merge pull request #1 from chainbound/feat/tx-fuzz
merklefruit Apr 26, 2024
d586726
fix(spammer): config
thedevbirb Apr 26, 2024
8f748e7
Merge pull request #2 from chainbound/feat/tx-fuzz
thedevbirb Apr 26, 2024
4ebbf0a
fix(spammer): config again
thedevbirb Apr 26, 2024
8a708e1
Merge pull request #3 from chainbound/fix/tx-fuzz
thedevbirb Apr 26, 2024
5fb46ef
feat: add new cli flags to bolt sidecar
merklefruit Jun 6, 2024
1212395
Merge branch 'main' of github.com:chainbound/ethereum-package
merklefruit Jun 6, 2024
07c631a
fix: import
merklefruit Jun 6, 2024
09ff0a3
fix: rm 0x prefix
merklefruit Jun 6, 2024
bdcc7b8
feat(mev-sidecar): launch with beacon client url
thedevbirb Jun 6, 2024
a508f25
chore(boost): inherit slot time from network params
thedevbirb Jun 7, 2024
d689404
feat(mev-boost): proxy with sidecar
thedevbirb Jun 27, 2024
b729f97
feat(sidecar): add execution api url, engine api url
thedevbirb Jun 27, 2024
3ed75ee
feat(sidecar): add mevboost proxy port
thedevbirb Jun 27, 2024
b46b7b8
fix: format
thedevbirb Jun 27, 2024
54318cb
fix: imports; flags name
thedevbirb Jun 27, 2024
45df492
fix(sidecar): conversion to string
thedevbirb Jun 27, 2024
7478597
chore: log level for debugging
merklefruit Jun 27, 2024
db7d982
chore: update mev url to point to bolt sidecar
merklefruit Jun 27, 2024
287a090
wip: mev boost proxy port
merklefruit Jun 27, 2024
3b51b19
feat(sidecar): add fee-recipient and jwt
thedevbirb Jun 28, 2024
58ce03b
chore: sidecar logs
thedevbirb Jun 28, 2024
0774e90
chore(mev-sidecar): commitment deadline for testnet
thedevbirb Jul 2, 2024
6bf9fea
feat(mev-sidecar): seconds per slot flag
thedevbirb Jul 2, 2024
7cb2fc8
chore: add chain option
merklefruit Jul 2, 2024
dc068bb
fix: launch command of sidecar
thedevbirb Jul 15, 2024
a338730
chore(sidecar): commitment deadline of 100ms for devnet
thedevbirb Jul 16, 2024
6f379ea
chore(sidecar): slot time cli
thedevbirb Jul 16, 2024
d3e6dcc
Merge pull request #6 from chainbound/feat/mev-boost-proxy
thedevbirb Aug 22, 2024
31d826e
chore(sidecar): add metrics port config
thedevbirb Aug 22, 2024
6bd27b8
fix(builder): remove mev_sidecar_endpoint flag
thedevbirb Aug 22, 2024
6ebee25
feat(sidecar): prometheus integration
thedevbirb Aug 22, 2024
133a3f0
feat: grafana dashboard stub
thedevbirb Aug 28, 2024
b36207f
Merge pull request #7 from chainbound/lore/feat/metrics
thedevbirb Sep 2, 2024
81d19b4
feat: helix config stub
thedevbirb Sep 27, 2024
fba4a89
chore(helix): test sleep before starting it
thedevbirb Sep 30, 2024
e5e9456
fix(helix): add it to builder
thedevbirb Sep 30, 2024
869b437
chore(helix): log level
thedevbirb Oct 1, 2024
7c85491
test: logs
thedevbirb Oct 1, 2024
351ecbd
test: beacon uris
thedevbirb Oct 1, 2024
c29e4bf
feat(bolt-boost): toml tmpl config file stub
thedevbirb Oct 2, 2024
a7d243e
chore(bolt-boost): update static files constants
thedevbirb Oct 2, 2024
3d48b98
feat(bolt-boost): launcher stub
thedevbirb Oct 2, 2024
fea7f34
chore(bolt-boost): support in input parser
thedevbirb Oct 2, 2024
f1b0479
feat!(bolt-boost): support in main.star; refactor of mev_sidecar_laun…
thedevbirb Oct 2, 2024
9e835a4
Merge pull request #9 from chainbound/lore/feat/bolt-boost
thedevbirb Oct 3, 2024
493eef6
chore: mev_sidecar -> bolt_sidecar etc
thedevbirb Oct 3, 2024
b42e1f8
Merge pull request #13 from chainbound/lore/chore/refactor
thedevbirb Oct 3, 2024
a707420
fix: ports in bolt sidecar and bolt boost
thedevbirb Oct 3, 2024
9e754c6
chore(bolt-boost): trace debug
merklefruit Oct 4, 2024
9e39a24
chore(bolt-boost): update chain config
thedevbirb Oct 4, 2024
f89d6dc
Merge pull request #15 from chainbound/lore/chore/update-bb-config
merklefruit Oct 4, 2024
fb44151
fix(main): indentation
thedevbirb Oct 7, 2024
6cb74a0
chore(mev): choose between mev-boost and bolt-boost
thedevbirb Oct 7, 2024
b2f42bf
Merge pull request #16 from chainbound/chore/restore-mev-boost-sidecar
thedevbirb Oct 7, 2024
6ef6ae9
chore: service name on bolt boost
thedevbirb Oct 7, 2024
54fe27b
fix(mev): mev url on cl
thedevbirb Oct 7, 2024
a0da2d5
feat: add keystore folder to sidecar
thedevbirb Oct 11, 2024
3ec365c
Merge pull request #17 from chainbound/feat/keystore
merklefruit Oct 14, 2024
3585fbd
chore: add builder private key flag
namn-grg Oct 18, 2024
1f25f1f
Merge pull request #19 from chainbound/naman/chore/default-cli-flag
thedevbirb Oct 18, 2024
e07bc2a
feat(sidecar): keystore secrets path
thedevbirb Oct 18, 2024
1e124ce
chore: restore eth2-val-tools image
thedevbirb Oct 18, 2024
30300ec
chore(bolt-sidecar): cli arguments
thedevbirb Oct 18, 2024
001b26f
Merge pull request #20 from chainbound/feat/keystore-secrets-path
thedevbirb Oct 18, 2024
4847328
fix(helix): envs
thedevbirb Nov 5, 2024
f2e91ff
chore(mev-boost): add genesis timestamp
thedevbirb Nov 5, 2024
93c32aa
fix: bolt sidecar port
thedevbirb Nov 5, 2024
77ad917
Merge pull request #22 from chainbound/fix/sidecar-ports
thedevbirb Nov 6, 2024
141aac7
chore(helix): update config adding builder
thedevbirb Nov 7, 2024
101766e
chore: rm validator indexes from sidecar config
merklefruit Nov 7, 2024
9d6ad18
Merge pull request #24 from chainbound/nico/chore/rm-val-indexes
thedevbirb Nov 8, 2024
9534442
Merge pull request #23 from chainbound/lore/chore/update-helix-config
thedevbirb Nov 8, 2024
ca4822a
fix(bolt-sidecar): remove validator indexes flag also there
thedevbirb Nov 8, 2024
398796c
chore: add helix website configs
merklefruit Nov 11, 2024
00e3fac
feat(helix): allow to extend config from kurtosis config file
thedevbirb Nov 11, 2024
761c788
chore: add mev_params to output of main
thedevbirb Nov 11, 2024
21caf21
chore(helix): log running config
thedevbirb Nov 11, 2024
db24256
fix: enrich_mev_params logic
thedevbirb Nov 11, 2024
82833cb
fix: rm helix website port (temp)
merklefruit Nov 11, 2024
1a8ec7e
Merge pull request #25 from chainbound/lore/feat/helix-constraints-ap…
thedevbirb Nov 12, 2024
137abc2
chore(bolt): update grafana dash
thedevbirb Nov 26, 2024
cffb5bf
fix(bolt): prometheus datasource uid
thedevbirb Nov 26, 2024
c4add4a
fix(bolt): grafana dash name
thedevbirb Nov 26, 2024
b50382b
Merge pull request #26 from chainbound/lore/chore/update-grafana-dash
merklefruit Nov 26, 2024
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
2 changes: 1 addition & 1 deletion kurtosis.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
name: "github.com/kurtosis-tech/ethereum-package"
name: "github.com/chainbound/ethereum-package"
143 changes: 113 additions & 30 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ blockscout = import_module("./src/blockscout/blockscout_launcher.star")
prometheus = import_module("./src/prometheus/prometheus_launcher.star")
grafana = import_module("./src/grafana/grafana_launcher.star")
mev_boost = import_module("./src/mev/mev_boost/mev_boost_launcher.star")
bolt_boost = import_module("./src/mev/bolt_boost/bolt_boost_launcher.star")
mock_mev = import_module("./src/mev/mock_mev/mock_mev_launcher.star")
mev_relay = import_module("./src/mev/mev_relay/mev_relay_launcher.star")
helix_relay = import_module("./src/mev/mev_relay/helix_launcher.star")
mev_flood = import_module("./src/mev/mev_flood/mev_flood_launcher.star")
mev_custom_flood = import_module(
"./src/mev/mev_custom_flood/mev_custom_flood_launcher.star"
)
broadcaster = import_module("./src/broadcaster/broadcaster.star")
assertoor = import_module("./src/assertoor/assertoor_launcher.star")
bolt_sidecar = import_module("./src/mev/bolt_sidecar/bolt_sidecar_launcher.star")

GRAFANA_USER = "admin"
GRAFANA_PASSWORD = "admin"
Expand Down Expand Up @@ -125,6 +128,11 @@ def run(plan, args={}):
)
)

#bolt_sidecar_context=struct(
# ip_addr="",
# metrics_port_num=0,
#)
bolt_sidecar_context = None
all_el_contexts = []
all_cl_contexts = []
all_vc_contexts = []
Expand Down Expand Up @@ -207,6 +215,7 @@ def run(plan, args={}):
beacon_uris = ",".join(
["{0}".format(context.beacon_http_url) for context in all_cl_contexts]
)
plan.print(beacon_uris)

first_cl_client = all_cl_contexts[0]
first_client_beacon_name = first_cl_client.beacon_service_name
Expand All @@ -232,15 +241,16 @@ def run(plan, args={}):
timeout="20m",
service_name=first_client_beacon_name,
)
endpoint = mev_relay.launch_mev_relay(
helix_endpoint = helix_relay.launch_helix_relay(
plan,
mev_params,
network_params.network_id,
network_params,
beacon_uris,
genesis_validators_root,
builder_uri,
network_params.seconds_per_slot,
persistent,
final_genesis_timestamp,
global_node_selectors,
)
mev_flood.spam_in_background(
Expand All @@ -251,36 +261,106 @@ def run(plan, args={}):
contract_owner.private_key,
normal_user.private_key,
)
mev_endpoints.append(endpoint)
mev_endpoints.append(helix_endpoint)

# spin up the mev boost contexts if some endpoints for relays have been passed
all_mevboost_contexts = []
if mev_endpoints:
for index, participant in enumerate(all_participants):
index_str = shared_utils.zfill_custom(
index + 1, len(str(len(all_participants)))
)
if args_with_right_defaults.participants[index].validator_count != 0:
mev_boost_launcher = mev_boost.new_mev_boost_launcher(
MEV_BOOST_SHOULD_CHECK_RELAY,
mev_endpoints,
)
mev_boost_service_name = "{0}-{1}-{2}-{3}".format(
input_parser.MEV_BOOST_SERVICE_NAME_PREFIX,
index_str,
participant.cl_type,
participant.el_type,
# spin up the mev boost contexts if some endpoints for relays have been passed
all_mevboost_contexts = []
if mev_endpoints:
for index, participant in enumerate(all_participants):
index_str = shared_utils.zfill_custom(
index + 1, len(str(len(all_participants)))
)
mev_boost_context = mev_boost.launch(
plan,
mev_boost_launcher,
mev_boost_service_name,
network_params.network_id,
mev_params.mev_boost_image,
mev_params.mev_boost_args,
global_node_selectors,
)
all_mevboost_contexts.append(mev_boost_context)
if args_with_right_defaults.participants[index].validator_count != 0:
# Initialize the Bolt Sidecar configure if needed
bolt_sidecar_config = None
if mev_params.bolt_sidecar_image != None:
# NOTE: this is a stub missing the `"constraints_api_url"` entry
bolt_sidecar_config = {
"beacon_api_url": participant.cl_context.beacon_http_url,
"execution_api_url": "http://{0}:{1}".format(
participant.el_context.ip_addr,
participant.el_context.rpc_port_num,
),
"engine_api_url": "http://{0}:{1}".format(
participant.el_context.ip_addr,
participant.el_context.engine_rpc_port_num
),
"jwt_hex": raw_jwt_secret,
"metrics_port": bolt_sidecar.BOLT_SIDECAR_METRICS_PORT,
"validator_keystore_files_artifact_uuid": participant.cl_context.validator_keystore_files_artifact_uuid,
"participant_index": index,
}

if mev_params.bolt_boost_image == None:
mev_boost_launcher = mev_boost.new_mev_boost_launcher(
MEV_BOOST_SHOULD_CHECK_RELAY,
mev_endpoints,
)
mev_boost_service_name = "{0}-{1}-{2}-{3}".format(
input_parser.MEV_BOOST_SERVICE_NAME_PREFIX,
index_str,
participant.cl_type,
participant.el_type,
)
mev_boost_context = mev_boost.launch(
plan,
mev_boost_launcher,
mev_boost_service_name,
network_params.network_id,
mev_params.mev_boost_image,
mev_params.mev_boost_args,
network_params,
final_genesis_timestamp,
global_node_selectors,
)
if bolt_sidecar_config != None:
bolt_sidecar_config["constraints_api_url"] = "http://{0}:{1}".format(
mev_boost_context.private_ip_address, mev_boost_context.port
)
all_mevboost_contexts.append(mev_boost_context)

else:
bolt_boost_service_name = "{0}-{1}-{2}-{3}".format(
input_parser.BOLT_BOOST_SERVICE_NAME_PREFIX,
index_str,
participant.cl_type,
participant.el_type,
)
relays_config = [{
"id": "helix_relay",
"url": helix_endpoint,
}]
if bolt_sidecar_config != None:
bolt_sidecar_config["constraints_api_url"] = "http://{0}:{1}".format(
bolt_boost_service_name, input_parser.FLASHBOTS_MEV_BOOST_PORT
)
bolt_boost_context = bolt_boost.launch(
plan,
bolt_boost_service_name,
mev_params.bolt_boost_image,
relays_config,
bolt_sidecar_config,
network_params,
final_genesis_timestamp,
global_node_selectors,
)
all_mevboost_contexts.append(bolt_boost_context)

if bolt_sidecar_config != None:
service_name = "{0}-{1}-{2}-{3}".format(
input_parser.BOLT_SIDECAR_SERVICE_NAME_PREFIX,
index_str,
participant.cl_type,
participant.el_type,
)
bolt_sidecar_config["service_name"] = service_name
bolt_sidecar_context = bolt_sidecar.launch_bolt_sidecar(
plan,
mev_params.bolt_sidecar_image,
bolt_sidecar_config,
network_params,
global_node_selectors,
)

if len(args_with_right_defaults.additional_services) == 0:
output = struct(
Expand All @@ -303,6 +383,7 @@ def run(plan, args={}):
tx_spammer_params,
network_params.electra_fork_epoch,
global_node_selectors,
network_params
)
plan.print("Successfully launched transaction spammer")
elif additional_service == "blob_spammer":
Expand Down Expand Up @@ -449,6 +530,7 @@ def run(plan, args={}):
all_ethereum_metrics_exporter_contexts,
all_xatu_sentry_contexts,
global_node_selectors,
bolt_sidecar_context,
)

plan.print("Launching grafana...")
Expand Down Expand Up @@ -495,6 +577,7 @@ def run(plan, args={}):
all_participants=all_participants,
final_genesis_timestamp=final_genesis_timestamp,
genesis_validators_root=genesis_validators_root,
mev_params=mev_params,
)

return output
2 changes: 1 addition & 1 deletion src/grafana/grafana_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ static_files = import_module("../static_files/static_files.star")

SERVICE_NAME = "grafana"

IMAGE_NAME = "grafana/grafana-enterprise:9.5.12"
IMAGE_NAME = "grafana/grafana-enterprise:11.1.0"

HTTP_PORT_ID = "http"
HTTP_PORT_NUMBER_UINT16 = 3000
Expand Down
138 changes: 138 additions & 0 deletions src/mev/bolt_boost/bolt_boost_launcher.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
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")
input_parser = import_module("../../package_io/input_parser.star")

BOLT_BOOST_CONFIG_FILENAME="cb-bolt-config.toml"
BOLT_BOOST_CONFIG_MOUNT_DIRPATH_ON_SERVICE="/config"

USED_PORTS = {
"api": shared_utils.new_port_spec(
input_parser.FLASHBOTS_MEV_BOOST_PORT, "TCP", wait="5s"
)
}

# The min/max CPU/memory that mev-boost can use
MIN_CPU = 10
MAX_CPU = 500
MIN_MEMORY = 16
MAX_MEMORY = 256


def launch(
plan,
service_name,
bolt_boost_image,
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,
)

bolt_boost_service = plan.add_service(service_name, config)

return mev_boost_context_module.new_mev_boost_context(
bolt_boost_service.ip_address, bolt_boost_service.ports["api"].number
)


def get_bolt_boost_config(
plan,
image,
relays_config,
bolt_sidecar_config,
network_params,
final_genesis_timestamp,
node_selectors,
):
# Read the template file for Bolt Boost configuration
bolt_boost_config_template = read_file(
static_files.BOLT_BOOST_CONFIG_TEMPLATE_FILEPATH
)

# 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,
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
)

# Map the relative destination filepaths to the template/data pairs
template_and_data_by_rel_dest_filepath = {}
template_and_data_by_rel_dest_filepath[BOLT_BOOST_CONFIG_FILENAME] = bolt_boost_config_template_and_data

# Render the templates to files in the artifact directory
config_files_artifact_name = plan.render_templates(
template_and_data_by_rel_dest_filepath
)

return ServiceConfig(
image=image,
ports=USED_PORTS,
files={
BOLT_BOOST_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name
},
env_vars={
"RUST_LOG": "debug",
"CB_CONFIG": shared_utils.path_join(
BOLT_BOOST_CONFIG_MOUNT_DIRPATH_ON_SERVICE,
BOLT_BOOST_CONFIG_FILENAME,
)
},
min_cpu=MIN_CPU,
max_cpu=MAX_CPU,
min_memory=MIN_MEMORY,
max_memory=MAX_MEMORY,
node_selectors=node_selectors,
)

def new_bolt_boost_config_template_data(
image,
relays_config,
bolt_sidecar_config,
network_params,
final_genesis_timestamp,
):
return {
"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": input_parser.FLASHBOTS_MEV_BOOST_PORT,
"relays_config": [
{
"id": relay_config["id"],
"url": relay_config["url"],
} for relay_config in relays_config
],
"bolt_sidecar_config": {
"constraints_api_url": bolt_sidecar_config["constraints_api_url"],
"beacon_api_url": bolt_sidecar_config["beacon_api_url"],
"execution_api_url": bolt_sidecar_config["execution_api_url"],
"engine_api_url": bolt_sidecar_config["engine_api_url"],
"jwt_hex": bolt_sidecar_config["jwt_hex"],
"metrics_port": bolt_sidecar_config["metrics_port"],
"builder_proxy_port": input_parser.FLASHBOTS_MEV_BOOST_PORT,
}
}
Loading
Loading