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

refactor!: merge eth-network-package onto eth2-package #228

Merged
merged 15 commits into from
Sep 27, 2023
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
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ executors:

parameters:
# To enable/disabled the check_latest_version workflow execution which will be triggered by this scheduled pipeline: https://app.circleci.com/settings/project/github/kurtosis-tech/eth2-package/triggers
# TODO revert this - setting this to true to get all existing tests to run on CI during merge
should-enable-check-latest-version-workflow:
type: boolean
default: false
default: true
# To enable/disabled the check_code workflow execution which will be triggered by the PR's checkers
should-enable-build-workflow:
type: boolean
Expand Down
29 changes: 21 additions & 8 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ parse_input = import_module(
"github.com/kurtosis-tech/eth2-package/src/package_io/parse_input.star"
)

participant_network = import_module(
"github.com/kurtosis-tech/eth2-package/src/participant_network.star"
)

static_files = import_module(
"github.com/kurtosis-tech/eth2-package/src/static_files/static_files.star"
)
genesis_constants = import_module(
"github.com/kurtosis-tech/eth-network-package/src/prelaunch_data_generator/genesis_constants/genesis_constants.star"
"github.com/kurtosis-tech/eth2-package/src/prelaunch_data_generator/genesis_constants/genesis_constants.star"
)

eth_network_module = import_module(
"github.com/kurtosis-tech/eth-network-package/main.star"
)
transaction_spammer = import_module(
"github.com/kurtosis-tech/eth2-package/src/transaction_spammer/transaction_spammer.star"
)
Expand Down Expand Up @@ -66,13 +67,12 @@ PATH_TO_PARSED_BEACON_STATE = "/genesis/output/parsedBeaconState.json"


def run(plan, args={}):
args_with_right_defaults, args_with_defaults_dict = parse_input.parse_input(
plan, args
)
args_with_right_defaults = parse_input.parse_input(plan, args)

num_participants = len(args_with_right_defaults.participants)
network_params = args_with_right_defaults.network_params
mev_params = args_with_right_defaults.mev_params
parallel_keystore_generation = args_with_right_defaults.parallel_keystore_generation

grafana_datasource_config_template = read_file(
static_files.GRAFANA_DATASOURCE_CONFIG_TEMPLATE_FILEPATH
Expand All @@ -95,7 +95,20 @@ def run(plan, args={}):
all_participants,
cl_genesis_timestamp,
genesis_validators_root,
) = eth_network_module.run(plan, args_with_defaults_dict)
) = participant_network.launch_participant_network(
plan,
args_with_right_defaults.participants,
network_params,
args_with_right_defaults.global_client_log_level,
parallel_keystore_generation,
)

plan.print(
"NODE JSON RPC URI: '{0}:{1}'".format(
all_participants[0].el_client_context.ip_addr,
all_participants[0].el_client_context.rpc_port_num,
)
)

all_el_client_contexts = []
all_cl_client_contexts = []
Expand Down
26 changes: 26 additions & 0 deletions src/cl/cl_client_context.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
def new_cl_client_context(
client_name,
enr,
ip_addr,
http_port_num,
cl_nodes_metrics_info,
beacon_service_name,
validator_service_name="",
multiaddr="",
peer_id="",
snooper_enabled=False,
snooper_engine_context=None,
):
return struct(
client_name=client_name,
enr=enr,
ip_addr=ip_addr,
http_port_num=http_port_num,
cl_nodes_metrics_info=cl_nodes_metrics_info,
beacon_service_name=beacon_service_name,
validator_service_name=validator_service_name,
multiaddr=multiaddr,
peer_id=peer_id,
snooper_enabled=snooper_enabled,
snooper_engine_context=snooper_engine_context,
)
12 changes: 12 additions & 0 deletions src/cl/cl_node_ready_conditions.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def get_ready_conditions(port_id):
recipe = GetHttpRequestRecipe(endpoint="/eth/v1/node/health", port_id=port_id)

ready_conditions = ReadyCondition(
recipe=recipe,
field="code",
assertion="IN",
target_value=[200, 206],
timeout="15m",
)

return ready_conditions
Loading