Skip to content

Commit

Permalink
feat: introduce devnet_repo override (#686)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa authored Jun 20, 2024
1 parent 26a7618 commit 9952361
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/per-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
"./.github/tests/mix-with-tools.yaml",
"./.github/tests/mix-persistence.yaml",
"./.github/tests/mix-public.yaml",
"./.github/tests/minimal.yaml",
"./network_params.yaml"
]
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,10 @@ network_params:
# nonce: 0
# secretKey: "0x"
# Repository override for devnet networks
# Default: ethpandaops
devnet_repo: ethpandaops
# Global parameters for the network
# By default includes
Expand Down
4 changes: 2 additions & 2 deletions src/network_launcher/devnet.star
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ el_cl_genesis_data = import_module(
)


def launch(plan, network, cancun_time, prague_time):
def launch(plan, network, cancun_time, prague_time, repo):
# We are running a devnet
url = shared_utils.calculate_devnet_url(network)
url = shared_utils.calculate_devnet_url(network, repo)
el_cl_genesis_uuid = plan.upload_files(
src=url,
name="el_cl_genesis",
Expand Down
3 changes: 3 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ def input_parser(plan, input_args):
additional_preloaded_contracts=result["network_params"][
"additional_preloaded_contracts"
],
devnet_repo=result["network_params"]["devnet_repo"],
),
mev_params=struct(
mev_relay_image=result["mev_params"]["mev_relay_image"],
Expand Down Expand Up @@ -795,6 +796,7 @@ def default_network_params():
"target_number_of_peers": 70,
"preset": "mainnet",
"additional_preloaded_contracts": {},
"devnet_repo": "ethpandaops",
}


Expand Down Expand Up @@ -826,6 +828,7 @@ def default_minimal_network_params():
"target_number_of_peers": 70,
"preset": "minimal",
"additional_preloaded_contracts": {},
"devnet_repo": "ethpandaops",
}


Expand Down
8 changes: 7 additions & 1 deletion src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ def launch_participant_network(
final_genesis_timestamp,
network_id,
validator_data,
) = launch_devnet.launch(plan, network_params.network, cancun_time, prague_time)
) = launch_devnet.launch(
plan,
network_params.network,
cancun_time,
prague_time,
network_params.devnet_repo,
)

# Launch all execution layer clients
all_el_contexts = el_client_launcher.launch(
Expand Down
6 changes: 3 additions & 3 deletions src/shared_utils/shared_utils.star
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ print(int(time.time()+padding), end="")
return result.output


def calculate_devnet_url(network):
def calculate_devnet_url(network, repo):
sf_suffix_mapping = {"hsf": "-hsf-", "gsf": "-gsf-", "ssf": "-ssf-"}
shadowfork = "sf-" in network

Expand All @@ -211,8 +211,8 @@ def calculate_devnet_url(network):
devnet_name.split("-")[1] + "-" if len(devnet_name.split("-")) > 1 else ""
)

return "github.com/ethpandaops/{0}-devnets/network-configs/{1}{2}-{3}".format(
devnet_category, devnet_subname, network_type, devnet_number
return "github.com/{0}/{1}-devnets/network-configs/{2}{3}-{4}".format(
repo, devnet_category, devnet_subname, network_type, devnet_number
)


Expand Down

0 comments on commit 9952361

Please sign in to comment.