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

feat: add op-reth #10

Merged
merged 5 commits into from
Jun 7, 2024
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
69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,72 @@ ethereum_package:
- dora
- blockscout
```


## Configuration

To configure the package behaviour, you can modify your `network_params.yaml` file. The full YAML schema that can be passed in is as follows with the defaults provided:

```yaml
optimism_package:
# Specification of the optimism-participants in the network
participants:
# EL(Execution Layer) Specific flags
# The type of EL client that should be started
# Valid values are op-geth, op-reth
- el_type: geth

# The Docker image that should be used for the EL client; leave blank to use the default for the client type
# Defaults by client:
# - op-geth: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:latest
# - op-reth: parithoshj/op-reth:latest
el_image: ""

# CL(Consensus Layer) Specific flags
# The type of CL client that should be started
# Valid values are op-node, ?
cl_type: op-node

# The Docker image that should be used for the CL client; leave blank to use the default for the client type
# Defaults by client:
# - op-node: parithoshj/op-node:v1
cl_image: ""

# Count of nodes to spin up for this participant
# Default to 1
count: 1

# Default configuration parameters for the network
network_params:
# Network name, used to enable syncing of alternative networks
# Defaults to "kurtosis"
# You can sync any public network by setting this to the network name (e.g. "mainnet", "sepolia", "holesky")
# You can sync any devnet by setting this to the network name (e.g. "dencun-devnet-12", "verkle-gen-devnet-2")
network: "kurtosis"

# The network ID of the network.
network_id: "2151908"

# Seconds per slots
seconds_per_slot: 2
```

### Additional configuration recommendations

It is required you to launch an L1 Ethereum node to interact with the L2 network. You can use the `ethereum_package` to launch an Ethereum node. The `ethereum_package` configuration is as follows:

```yaml
optimism_package:
participants:
- el_type: op-geth
cl_type: op-node
ethereum_package:
participants:
- el_type: geth
- el_type: reth
network_params:
preset: minimal
additional_services:
- dora
- blockscout
```
2 changes: 2 additions & 0 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ optimism_package:
participants:
- el_type: op-geth
cl_type: op-node
count: 3
- el_type: op-reth
ethereum_package:
participants:
- el_type: geth
Expand Down
72 changes: 0 additions & 72 deletions src/cl/cl_launcher.star

This file was deleted.

17 changes: 10 additions & 7 deletions src/cl/op-node/op_node_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def launch(
existing_cl_clients,
l1_config_env_vars,
gs_sequencer_private_key,
sequencer_enabled,
):
network_name = shared_utils.get_network_name(launcher.network)

Expand All @@ -91,6 +92,7 @@ def launch(
l1_config_env_vars,
gs_sequencer_private_key,
beacon_node_identity_recipe,
sequencer_enabled,
)

beacon_service = plan.add_service(service_name, config)
Expand Down Expand Up @@ -132,6 +134,7 @@ def get_beacon_config(
l1_config_env_vars,
gs_sequencer_private_key,
beacon_node_identity_recipe,
sequencer_enabled,
):
EXECUTION_ENGINE_ENDPOINT = "http://{0}:{1}".format(
el_context.ip_addr,
Expand All @@ -148,27 +151,27 @@ def get_beacon_config(
"--rpc.addr=0.0.0.0",
"--rpc.port={0}".format(BEACON_HTTP_PORT_NUM),
"--rpc.enable-admin",
"--p2p.sequencer.key=" + gs_sequencer_private_key,
"--l1={0}".format(l1_config_env_vars["L1_RPC_URL"]),
"--l1.rpckind={0}".format(l1_config_env_vars["L1_RPC_KIND"]),
"--l1.beacon={0}".format(l1_config_env_vars["CL_RPC_URL"]),
"--p2p.advertise.ip=" + constants.PRIVATE_IP_ADDRESS_PLACEHOLDER,
"--p2p.advertise.tcp={0}".format(BEACON_DISCOVERY_PORT_NUM),
"--p2p.advertise.udp={0}".format(BEACON_DISCOVERY_PORT_NUM),
"--p2p.listen.ip=0.0.0.0",
"--p2p.listen.tcp={0}".format(BEACON_DISCOVERY_PORT_NUM),
"--p2p.listen.udp={0}".format(BEACON_DISCOVERY_PORT_NUM),
]

if len(existing_cl_clients) == 0:
if sequencer_enabled:
cmd.append("--p2p.sequencer.key=" + gs_sequencer_private_key)
cmd.append("--sequencer.enabled")
cmd.append("--sequencer.l1-confs=5")

if len(existing_cl_clients) > 0:
cmd.append(
"--p2p.static="
"--p2p.bootnodes="
+ ",".join(
[
ctx.beacon_multiaddr
for ctx in existing_cl_clients[: constants.MAX_ENR_ENTRIES]
]
[ctx.enr for ctx in existing_cl_clients[: constants.MAX_ENR_ENTRIES]]
)
)

Expand Down
65 changes: 0 additions & 65 deletions src/el/el_launcher.star

This file was deleted.

Loading
Loading