Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
60c03c3
feat!: add mev-rs relay/builder/boost
barnabasbusa Apr 30, 2024
0af4eb1
fix flashbots
barnabasbusa Apr 30, 2024
34b39aa
fix mev-rs
barnabasbusa Apr 30, 2024
e83b92f
fix all
barnabasbusa Apr 30, 2024
3fd8168
fix lint, fix img
barnabasbusa Apr 30, 2024
999c615
use newer egg, and update mev-rs
barnabasbusa Apr 30, 2024
c10e558
add genesis to relay and boost
barnabasbusa Apr 30, 2024
5ee4098
update to fix mev rs version, fix lint
barnabasbusa May 1, 2024
6bd8bc7
enable mev flood, add minimal support, add test case
barnabasbusa May 1, 2024
c9fbeb9
fix lint
barnabasbusa May 1, 2024
434b909
Merge branch 'main' into bbusa/mev-rs
barnabasbusa May 1, 2024
759ac65
Merge branch 'main' into bbusa/mev-rs
barnabasbusa May 1, 2024
f4d6941
fix lint
barnabasbusa May 1, 2024
c9be313
enable automatic image selection based on preset
barnabasbusa May 2, 2024
d2e95ba
fix some stuff
barnabasbusa May 2, 2024
4c6efaa
fix minimal image set
barnabasbusa May 3, 2024
e6b96e1
fix rename
barnabasbusa May 3, 2024
dca5752
default to more stable images
barnabasbusa May 3, 2024
b8f6da4
add notice about rename
barnabasbusa May 3, 2024
e75acfb
fix else
barnabasbusa May 3, 2024
65958ff
fix else
barnabasbusa May 3, 2024
e86779d
fix input arg parser
barnabasbusa May 3, 2024
469b3df
change to multi arch images
barnabasbusa May 3, 2024
676ce26
remove tx spammer
barnabasbusa May 3, 2024
86295e9
fix image
barnabasbusa May 3, 2024
d342ed6
feat: add enr/enode to apache
barnabasbusa May 3, 2024
b4719a4
push some stuff
barnabasbusa May 6, 2024
6d46046
fix based on feedback
barnabasbusa May 6, 2024
5e68b10
Merge branch 'main' into bbusa/mev-rs
barnabasbusa May 6, 2024
1d019b9
Merge branch 'bbusa/mev-rs' into bbusa/enode
barnabasbusa May 6, 2024
84b9e2c
Merge branch 'main' into bbusa/enode
barnabasbusa May 6, 2024
66ad563
add all bootnode files
barnabasbusa May 6, 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: 2 additions & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ def run(plan, args={}):
apache.launch_apache(
plan,
el_cl_data_files_artifact_uuid,
all_participants,
args_with_right_defaults.participants,
global_node_selectors,
)
plan.print("Successfully launched apache")
Expand Down
82 changes: 82 additions & 0 deletions src/apache/apache_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ HTTP_PORT_ID = "http"
HTTP_PORT_NUMBER = 80

APACHE_CONFIG_FILENAME = "index.html"
APACHE_ENR_FILENAME = "boot_enr.yaml"
APACHE_ENODE_FILENAME = "bootnode.txt"
APACHE_ENR_LIST_FILENAME = "bootstrap_nodes.txt"

APACHE_CONFIG_MOUNT_DIRPATH_ON_SERVICE = "/usr/local/apache2/htdocs/"

Expand All @@ -27,15 +30,60 @@ USED_PORTS = {
def launch_apache(
plan,
el_cl_genesis_data,
participant_contexts,
participant_configs,
global_node_selectors,
):
config_files_artifact_name = plan.upload_files(
src=static_files.APACHE_CONFIG_FILEPATH, name="apache-config"
)

all_cl_client_info = []
all_el_client_info = []
for index, participant in enumerate(participant_contexts):
_, cl_client, el_client, _ = shared_utils.get_client_names(
participant, index, participant_contexts, participant_configs
)
all_cl_client_info.append(new_cl_client_info(cl_client.enr))
all_el_client_info.append(new_el_client_info(el_client.enode))

template_data = new_config_template_data(
all_cl_client_info,
all_el_client_info,
)

enr_template_and_data = shared_utils.new_template_and_data(
read_file(static_files.APACHE_ENR_FILEPATH),
template_data,
)

enr_list_template_and_data = shared_utils.new_template_and_data(
read_file(static_files.APACHE_ENR_LIST_FILEPATH),
template_data,
)

enode_template_and_data = shared_utils.new_template_and_data(
read_file(static_files.APACHE_ENODE_FILEPATH),
template_data,
)

template_and_data_by_rel_dest_filepath = {}
template_and_data_by_rel_dest_filepath[APACHE_ENR_FILENAME] = enr_template_and_data
template_and_data_by_rel_dest_filepath[
APACHE_ENR_LIST_FILENAME
] = enr_list_template_and_data
template_and_data_by_rel_dest_filepath[
APACHE_ENODE_FILENAME
] = enode_template_and_data

bootstrap_info_files_artifact_name = plan.render_templates(
template_and_data_by_rel_dest_filepath, "bootstrap-info"
)

config = get_config(
config_files_artifact_name,
el_cl_genesis_data,
bootstrap_info_files_artifact_name,
global_node_selectors,
)

Expand All @@ -45,10 +93,13 @@ def launch_apache(
def get_config(
config_files_artifact_name,
el_cl_genesis_data,
bootstrap_info_files_artifact_name,
node_selectors,
):
files = {
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data,
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS
+ "/boot": bootstrap_info_files_artifact_name,
APACHE_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name,
}

Expand All @@ -58,6 +109,18 @@ def get_config(
">>",
"/usr/local/apache2/conf/httpd.conf",
"&&",
"mv",
"/network-configs/boot/" + APACHE_ENR_FILENAME,
"/network-configs/" + APACHE_ENR_FILENAME,
"&&",
"mv",
"/network-configs/boot/" + APACHE_ENODE_FILENAME,
"/network-configs/" + APACHE_ENODE_FILENAME,
"&&",
"mv",
"/network-configs/boot/" + APACHE_ENR_LIST_FILENAME,
"/network-configs/" + APACHE_ENR_LIST_FILENAME,
"&&",
"tar",
"-czvf",
"/usr/local/apache2/htdocs/network-config.tar",
Expand All @@ -82,3 +145,22 @@ def get_config(
max_memory=MAX_MEMORY,
node_selectors=node_selectors,
)


def new_config_template_data(cl_client, el_client):
return {
"CLClient": cl_client,
"ELClient": el_client,
}


def new_cl_client_info(enr):
return {
"Enr": enr,
}


def new_el_client_info(enode):
return {
"Enode": enode,
}
3 changes: 3 additions & 0 deletions src/static_files/static_files.star
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ VALIDATOR_RANGES_CONFIG_TEMPLATE_FILEPATH = (
)

APACHE_CONFIG_FILEPATH = STATIC_FILES_DIRPATH + "/apache-config/index.html"
APACHE_ENR_FILEPATH = STATIC_FILES_DIRPATH + "/apache-config/enr.txt.tmpl"
APACHE_ENR_LIST_FILEPATH = STATIC_FILES_DIRPATH + "/apache-config/enr_list.txt.tmpl"
APACHE_ENODE_FILEPATH = STATIC_FILES_DIRPATH + "/apache-config/enode.txt.tmpl"

DORA_CONFIG_TEMPLATE_FILEPATH = STATIC_FILES_DIRPATH + "/dora-config/config.yaml.tmpl"
DUGTRIO_CONFIG_TEMPLATE_FILEPATH = (
Expand Down
3 changes: 3 additions & 0 deletions static_files/apache-config/enode.txt.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ range $elClient := .ELClient }}
{{ $elClient.Enode }}
{{- end }}
3 changes: 3 additions & 0 deletions static_files/apache-config/enr.txt.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ range $clClient := .CLClient }}
- {{ $clClient.Enr }}
{{- end }}
3 changes: 3 additions & 0 deletions static_files/apache-config/enr_list.txt.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ range $clClient := .CLClient }}
{{ $clClient.Enr }}
{{- end }}