Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ethereum-package
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
ethereum-package
Commits
3d01b50b
Commit
3d01b50b
authored
Jan 02, 2025
by
luxq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add bunnyfinder service.
parent
485ac616
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
82 deletions
+54
-82
main.star
main.star
+2
-0
bunnyfinder_launcher.star
src/bunnyfinder/bunnyfinder_launcher.star
+34
-8
input_parser.star
src/package_io/input_parser.star
+8
-0
sanity_check.star
src/package_io/sanity_check.star
+4
-0
config.toml.tmpl
static_files/bunnyfinder-config/config.toml.tmpl
+6
-0
config.yaml.tmpl
static_files/bunnyfinder-config/config.yaml.tmpl
+0
-74
No files found.
main.star
View file @
3d01b50b
...
@@ -706,6 +706,8 @@ def run(plan, args={}):
...
@@ -706,6 +706,8 @@ def run(plan, args={}):
bunnyfinder.launch_bunnyfinder(
bunnyfinder.launch_bunnyfinder(
plan,
plan,
bunnyfinder_config_template,
bunnyfinder_config_template,
all_participants,
args_with_right_defaults.participants,
network_params,
network_params,
bunnyfinder_params,
bunnyfinder_params,
global_node_selectors,
global_node_selectors,
...
...
src/bunnyfinder/bunnyfinder_launcher.star
View file @
3d01b50b
...
@@ -5,8 +5,6 @@ SERVICE_NAME = "bunnyfinder"
...
@@ -5,8 +5,6 @@ SERVICE_NAME = "bunnyfinder"
HTTP_PORT_ID = "http"
HTTP_PORT_ID = "http"
HTTP_PORT_NUMBER = 19000
HTTP_PORT_NUMBER = 19000
SWAG_PORT_ID = "http"
SWAG_PORT_NUMBER = 19001
BUNNYFINDER_CONFIG_FILENAME = "bunnyfinder-config.yaml"
BUNNYFINDER_CONFIG_FILENAME = "bunnyfinder-config.yaml"
...
@@ -27,22 +25,45 @@ USED_PORTS = {
...
@@ -27,22 +25,45 @@ USED_PORTS = {
)
)
}
}
def launch_bunnyfinder(
def launch_bunnyfinder(
plan,
plan,
config_template,
config_template,
participant_contexts,
participant_configs,
network_params,
network_params,
bunnyfinder_params,
bunnyfinder_params,
global_node_selectors,
global_node_selectors,
):
):
# check bunnyfinder_params.dbconnect is set an valid value
if bunnyfinder_params.dbconnect is None or bunnyfinder_params.dbconnect == "":
fail(
"dbconnect is required in bunnyfinder_params"
)
participant = participant_contexts[0]
(
full_name,
cl_client,
el_client,
participant_config,
) = shared_utils.get_client_names(
participant, 0, participant_contexts, participant_configs
)
el_http_url = "http://{0}:{1}".format(
el_client.ip_addr,
el_client.rpc_port_num,
)
template_data = new_config_template_data(
template_data = new_config_template_data(
HTTP_PORT_NUMBER,
HTTP_PORT_NUMBER,
cl_client.beacon_http_url,
el_http_url,
bunnyfinder_params,
bunnyfinder_params,
)
)
template_and_data = shared_utils.new_template_and_data(
template_and_data = shared_utils.new_template_and_data(
config_template, template_data
config_template, template_data
)
)
template_and_data_by_rel_dest_filepath = {}
template_and_data_by_rel_dest_filepath = {}
template_and_data_by_rel_dest_filepath[
template_and_data_by_rel_dest_filepath[
BUNNYFINDER_CONFIG_FILENAME
BUNNYFINDER_CONFIG_FILENAME
...
@@ -80,10 +101,12 @@ def get_config(
...
@@ -80,10 +101,12 @@ def get_config(
ports=USED_PORTS,
ports=USED_PORTS,
files={
files={
BUNNYFINDER_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name,
BUNNYFINDER_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name,
BUNNYFINDER_TESTS_MOUNT_DIRPATH_ON_SERVICE: tests_config_artifacts_name,
VALIDATOR_RANGES_MOUNT_DIRPATH_ON_SERVICE: VALIDATOR_RANGES_ARTIFACT_NAME,
},
},
cmd=["--config", config_file_path],
cmd=["--config", config_file_path,
"--strategy", bunnyfinder_params.strategy,
"--duration-per-strategy-run", bunnyfinder_params.duration_per_strategy,
"--max-hack-idx", bunnyfinder_params.max_malicious_idx,
"--min-hack-idx", bunnyfinder_params.min_malicious_idx,],
min_cpu=MIN_CPU,
min_cpu=MIN_CPU,
max_cpu=MAX_CPU,
max_cpu=MAX_CPU,
min_memory=MIN_MEMORY,
min_memory=MIN_MEMORY,
...
@@ -94,10 +117,13 @@ def get_config(
...
@@ -94,10 +117,13 @@ def get_config(
def new_config_template_data(
def new_config_template_data(
listen_port_num,
listen_port_num,
beacon_http_url,
execution_http_url,
bunnyfinder_params,
bunnyfinder_params,
):
):
strategy = bunnyfinder_params.strategy
return {
return {
"DBConnect": bunnyfinder_params.dbconnect,
"ListenPortNum": listen_port_num,
"ListenPortNum": listen_port_num,
"Strategy": strategy,
"CL_HTTP_URL": beacon_http_url,
"EL_HTTP_URL": execution_http_url,
}
}
src/package_io/input_parser.star
View file @
3d01b50b
...
@@ -466,6 +466,10 @@ def input_parser(plan, input_args):
...
@@ -466,6 +466,10 @@ def input_parser(plan, input_args):
bunnyfinder_params=struct(
bunnyfinder_params=struct(
image=result["bunnyfinder_params"]["image"],
image=result["bunnyfinder_params"]["image"],
strategy=result["bunnyfinder_params"]["strategy"],
strategy=result["bunnyfinder_params"]["strategy"],
dbconnect=result["bunnyfinder_params"]["dbconnect"],
duration_per_strategy=result["bunnyfinder_params"]["duration_per_strategy"],
min_malicious_idx=result["bunnyfinder_params"]["min_malicious_idx"],
max_malicious_idx=result["bunnyfinder_params"]["max_malicious_idx"],
),
),
additional_services=result["additional_services"],
additional_services=result["additional_services"],
wait_for_finalization=result["wait_for_finalization"],
wait_for_finalization=result["wait_for_finalization"],
...
@@ -1207,6 +1211,10 @@ def get_default_bunnyfinder_params():
...
@@ -1207,6 +1211,10 @@ def get_default_bunnyfinder_params():
return {
return {
"image": "tscel/bunnyfinder:latest",
"image": "tscel/bunnyfinder:latest",
"strategy": "random",
"strategy": "random",
"dbconnect": "",
"duration_per_strategy": 60,
"min_malicious_idx": 0,
"max_malicious_idx": 20,
}
}
...
...
src/package_io/sanity_check.star
View file @
3d01b50b
...
@@ -257,6 +257,10 @@ SUBCATEGORY_PARAMS = {
...
@@ -257,6 +257,10 @@ SUBCATEGORY_PARAMS = {
"bunnyfinder_params": [
"bunnyfinder_params": [
"image",
"image",
"strategy",
"strategy",
"dbconnect",
"duration_per_strategy",
"max_malicious_idx",
"min_malicious_idx",
],
],
"port_publisher": [
"port_publisher": [
"nat_exit_ip",
"nat_exit_ip",
...
...
static_files/bunnyfinder-config/config.toml.tmpl
0 → 100644
View file @
3d01b50b
http_port = {{ .ListenPortNum }} # rpc port, rest api port is http_port+1.
execute_rpc = "{{ .EL_HTTP_URL }}"
beacon_rpc = "{{ .CL_HTTP_URL }}"
dbconnect = "{{ .DBConnect }}"
reward_file = "/root/reward.csv"
swag_host = "127.0.0.1:12100"
static_files/bunnyfinder-config/config.yaml.tmpl
deleted
100644 → 0
View file @
485ac616
endpoints:
{{ range $client := .ClientInfo }}
- name: "{{ $client.Name }}"
consensusUrl: "{{ $client.CL_HTTP_URL }}"
executionUrl: "http://{{ $client.ELIPAddr }}:{{ $client.ELPortNum }}"
{{- if .ELSnooperEnabled }}
executionSnooperUrl: "{{ $client.ELSnooperUrl }}"
{{- end }}
{{- if .CLSnooperEnabled }}
consensusSnooperUrl: "{{ $client.CLSnooperUrl }}"
{{- end }}
{{- end }}
web:
server:
host: "0.0.0.0"
port: 8080
frontend:
enabled: true
debug: true
pprof: true
api:
enabled: true
database:
engine: "sqlite"
sqlite:
file: "/assertoor-database.sqlite"
validatorNames:
inventoryYaml: "/validator-ranges/validator-ranges.yaml"
globalVars:
walletPrivkey: "850643a0224065ecce3882673c21f56bcf6eef86274cc21cadff15930b59fc8c"
clientPairNames:
{{- range $client := .ClientInfo }}
- "{{ $client.Name }}"
{{- end }}
validatorPairNames: {{ if eq (len .ValidatorClientInfo) 0 }}[]{{ end }}
{{- range $client := .ValidatorClientInfo }}
- "{{ $client.Name }}"
{{- end }}
elSnooperClientPairNames: {{ if eq (len .ElSnooperClientInfo) 0 }}[]{{ end }}
{{- range $client := .ElSnooperClientInfo }}
- "{{ $client.Name }}"
{{- end }}
clSnooperClientPairNames: {{ if eq (len .ClSnooperClientInfo) 0 }}[]{{ end }}
{{- range $client := .ClSnooperClientInfo }}
- "{{ $client.Name }}"
{{- end }}
externalTests:
{{- if .RunStabilityCheck }}
- file: /tests/stability-check.yaml
{{- end }}
{{- if .RunBlockProposalCheck }}
- file: /tests/block-proposal-check.yaml
{{- end }}
{{- if .RunTransactionTest }}
- file: /tests/eoa-transactions-test.yaml
{{- end }}
{{- if .RunBlobTransactionTest }}
- file: /tests/blob-transactions-test.yaml
{{- end }}
{{- if .RunOpcodesTransactionTest }}
- file: /tests/all-opcodes-transaction-test.yaml
{{- end }}
{{- if .RunLifecycleTest }}
- file: /tests/validator-lifecycle-test.yaml
{{- end }}
{{- range $test := .AdditionalTests }}
- {{ $test }}
{{- end }}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment