Skip to content

Commit 3222d0f

Browse files
authored
Merge pull request #8 from zapper-95/fix-signer
fix: Fix signer
2 parents 2907a81 + d9d97bf commit 3222d0f

File tree

15 files changed

+196
-110
lines changed

15 files changed

+196
-110
lines changed
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1+
optimism_package:
2+
chains:
3+
- batcher_params:
4+
private_key: "e7848b12992369c383cfbff59633aeb305dbbd7a2c2ca19e60cc514dd953aefa"
5+
challenger_params:
6+
private_key: "e7848b12992369c383cfbff59633aeb305dbbd7a2c2ca19e60cc514dd953aefb"
7+
enabled: true
8+
sequencer_params:
9+
private_key: "e7848b12992369c383cfbff59633aeb305dbbd7a2c2ca19e60cc514dd953aefc"
10+
proposer_params:
11+
private_key: "e7848b12992369c383cfbff59633aeb305dbbd7a2c2ca19e60cc514dd953aefd"
112
external_l1_network_params:
213
network_id: "3151908"
314
rpc_kind: standard
415
el_rpc_url: http://el-1-geth-teku:8545
516
el_ws_url: ws://el-1-geth-teku:8546
617
cl_rpc_url: http://cl-1-teku-geth:4000
7-
priv_key: "0xbcdf20249abf0ed6d944c0288fad489e33f66b3960d9e6229c1cd214ed3bbe31"
18+
priv_key: "0xbcdf20249abf0ed6d944c0288fad489e33f66b3960d9e6229c1cd214ed3bbe31"

README.md

Lines changed: 92 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,54 @@
1-
# Welcome to Optimism Package
1+
# UpRoll Optimism Package
2+
This is a fork of the optimism package built to allow more chain configurations. Its intended purpose is to give [UpRoll CLI](https://github.com/zapper-95/UpRoll-cli.git) greater control over deployed rollups.
3+
4+
## New Configurations
5+
### Signer Information
6+
In the upstream package, privates keys are determined by the mnemonic `test test test test test test test test test test test junk` and cannot be customised.
7+
8+
We introduce customisation for private keys and signer information (address and endpoint) for each privallaged role.
9+
10+
11+
| Role | Parameter | Path |
12+
|------------|---------------|-----------------------------------------|
13+
| **Batcher** | private_key | `chain.batcher_params.private_key` |
14+
| | signer_endpoint | `chain.batcher_params.signer_endpoint` |
15+
| | signer_address | `chain.batcher_params.signer_address` |
16+
| **Sequencer** | private_key | `chain.sequencer_params.private_key` |
17+
| | signer_endpoint | `chain.sequencer_params.signer_endpoint` |
18+
| | signer_address | `chain.sequencer_params.signer_address` |
19+
| **Proposer** | private_key | `chain.proposer_params.private_key` |
20+
| | signer_endpoint | `chain.proposer_params.signer_endpoint` |
21+
| | signer_address | `chain.proposer_params.signer_address` |
22+
| **Challenger** | private_key | `chain.challenger_params.private_key` |
23+
| | signer_endpoint | `chain.challenger_params.signer_endpoint` |
24+
| | signer_address | `chain.challenger_params.signer_address` |
25+
26+
### Network Parameters
27+
| Parameter | Path |
28+
|---------------------------------|---------------------------------------------------|
29+
| Withdrawal delay | `chain.network_params.withdrawal_delay` |
30+
| Fee withdrawal network | `chain.network_params.fee_withdrawal_network` |
31+
| Dispute game finality delay | `chain.network_params.dispute_game_finality_delay` |
32+
33+
### Gas Parameters
34+
| Parameter | Path |
35+
|-----------------------------|--------------------------------------------|
36+
| Block gas limit | `chain.gas_params.gas_limit` |
37+
| EIP 1559 Elasticity | `chain.gas_params.eip1559Elasticity` |
38+
| EIP 1559 Denominator | `chain.gas_params.denominator` |
39+
| Base Fee Scalar | `chain.gas_params.base_fee_scalar` |
40+
| Blob Base Fee Scalar | `chain.gas_params.blob_base_fee_scalar` |
41+
42+
43+
### Data Availibility
44+
| Parameter | Path |
45+
|-----------------------------------|----------------------------------------------------------------|
46+
| Data availability type | `optimism_package.altda_deploy_config.da_type` |
47+
| Batch submissions frequency | `optimism_package.altda_deploy_config.da_batch_submission_frequency` |
48+
| DA server endpoint | `chain.da_server_params.server_endpoint` |
49+
| DA Challenge Contract Address | `optimism_package.altda_deploy_config.da_challenge_contract_address` |
250

3-
The default package for Optimism. The kurtosis package uses [op-deployer](https://github.com/ethereum-optimism/optimism/tree/develop/op-deployer) to manage
4-
the L2 chains and all associated artifacts such as contract deployments.
551

6-
```yaml
7-
optimism_package:
8-
chains:
9-
- participants:
10-
- el_type: op-geth
11-
cl_type: op-node
12-
- el_type: op-reth
13-
- el_type: op-erigon
14-
- el_type: op-nethermind
15-
ethereum_package:
16-
network_params:
17-
preset: minimal
18-
genesis_delay: 5
19-
additional_preloaded_contracts: '
20-
{
21-
"0x4e59b44847b379578588920cA78FbF26c0B4956C": {
22-
"balance": "0ETH",
23-
"code": "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3",
24-
"storage": {},
25-
"nonce": "1"
26-
}
27-
}
28-
'
29-
30-
```
31-
32-
Please note, by default your network will be running a `minimal` preset Ethereum network. Click [here](https://github.com/ethereum/consensus-specs/blob/dev/configs/minimal.yaml) to learn more about minimal preset. You can [customize](https://github.com/ethpandaops/ethereum-package) the L1 Ethereum network by modifying the `ethereum_package` configuration.
33-
34-
You can also completely remove `ethereum_package` from your configuration in which case it will default to a `minimal` preset Ethereum network.
3552

3653
## Quickstart
3754

@@ -138,14 +155,17 @@ optimism_package:
138155
# - For altda chains, set da_server_params to use an image and cmd of your choice (one could use da-server, another eigenda-proxy, another celestia proxy, etc). If unset, op's default da-server image will be used.
139156
altda_deploy_config:
140157
use_altda: false
141-
# TODO: Is this field redundant? Afaiu setting it to GenericCommitment will not deploy the
142-
# DAChallengeContract, and hence is equivalent to setting use_altda to false.
143-
# Furthermore, altda rollups using generic commitments might anyways need to support failing over
144-
# to keccak commitments if the altda layer is down.
158+
da_type: "calldata" # allows auto, blobs, calldata or custom. Sets --data-availability-type in batcher_launcher
159+
160+
da_batch_submission_frequency: 1 #--max-channel-duration=1 in block units but user input in minutes
161+
162+
da_challenge_contract_address: "0x49cce536156dC6E5F05B26eaA8a2607Cb943e041"
163+
164+
145165
da_commitment_type: KeccakCommitment
146166
da_challenge_window: 100
147167
da_resolve_window: 100
148-
da_bond_size: 0
168+
da_bond_size: 1000
149169
da_resolver_refund_percentage: 0
150170

151171
# An array of L2 networks to run
@@ -370,6 +390,15 @@ optimism_package:
370390
# The Docker image that should be used for the batcher; leave blank to use the default op-batcher image
371391
image: ""
372392

393+
394+
# If using a testnet, use either a private key or signer information (signer_endpoint and signer_address), but not both
395+
private_key: ""
396+
signer_endpoint: "" # endpoint of the signer
397+
signer_address: "" # wallet address of the signer
398+
399+
signer_endpoint ""
400+
401+
373402
# A list of optional extra params that will be passed to the batcher container for modifying its behaviour
374403
extra_params: []
375404

@@ -381,6 +410,12 @@ optimism_package:
381410
# The Docker image that should be used for the challenger; leave blank to use the default op-challenger image
382411
image: ""
383412

413+
414+
# If using a testnet, use either a private key or signer information (signer_endpoint and signer_address), but not both
415+
private_key: ""
416+
signer_endpoint: "" # endpoint of the signer
417+
signer_address: "" # wallet address of the signer
418+
384419
# A list of optional extra params that will be passed to the challenger container for modifying its behaviour
385420
extra_params: []
386421

@@ -395,6 +430,11 @@ optimism_package:
395430
# The Docker image that should be used for the proposer; leave blank to use the default op-proposer image
396431
image: ""
397432

433+
# If using a testnet, use either a private key or signer information (signer_endpoint and signer_address), but not both
434+
private_key: ""
435+
signer_endpoint: "" # endpoint of the signer
436+
signer_address: "" # wallet address of the signer
437+
398438
# A list of optional extra params that will be passed to the proposer container for modifying its behaviour
399439
extra_params: []
400440

@@ -404,6 +444,19 @@ optimism_package:
404444
# Interval between submitting L2 output proposals
405445
proposal_internal: 10m
406446

447+
sequencer_params:
448+
# If using a testnet, use either a private key or signer information (signer_endpoint and signer_address), but not both
449+
private_key: ""
450+
signer_endpoint: "" # endpoint of the signer
451+
signer_address: "" # wallet address of the signer
452+
453+
gas_params:
454+
gas_limit: "0x17D7840"
455+
eip_1559_elasticity: 6
456+
eip_1559_denominator: 50
457+
base_fee_scalar: 2
458+
blob_base_fee_scalar: 1
459+
407460
# Default MEV configuration
408461
mev_params:
409462
# The Docker image that should be used for rollup boost; leave blank to use the default rollup-boost image
@@ -427,18 +480,8 @@ optimism_package:
427480
# Configuration for da-server - https://specs.optimism.io/experimental/alt-da.html#da-server
428481
# TODO: each op-node and op-batcher should potentially have their own da-server, instead of sharing one like we currently do. For eg batcher needs to write via its da-server, whereas op-nodes don't.
429482
da_server_params:
430-
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/da-server:latest
431-
# Command to pass to the container.
432-
# This is kept maximally generic to allow for any possible configuration, given that different
433-
# da layer da-servers might have completely different flags.
434-
# The below arguments are also the default, so can be omitted, and will work as long as the image
435-
# is the da-server above (which is also the default, so can also be omitted).
436-
cmd:
437-
- "da-server"
438-
- "--file.path=/home"
439-
- "--addr=0.0.0.0"
440-
- "--port=3100"
441-
- "--log.level=debug"
483+
# include your custom da server endpoint
484+
server_endpoint: ""
442485

443486
# L2 contract deployer configuration - used for all L2 networks
444487
# The docker image that should be used for the L2 contract deployer

src/batcher/op-batcher/op_batcher_launcher.star

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,12 @@ def get_batcher_config(
120120
plan.print("Batcher params: " + str(batcher_params))
121121
plan.print(batcher_params.signer_endpoint)
122122
plan.print(batcher_params.signer_address)
123-
124-
cmd.append("--private-key=" + gs_batcher_private_key)
125-
126-
# if batcher_params.private_key:
127-
# cmd.append("--private-key=" + gs_batcher_private_key)
128-
# else:
129-
# cmd.append("--signer.endpoint=" + str(batcher_params.signer_endpoint))
130-
# cmd.append("--signer.address=" + str(batcher_params.signer_address))
131-
# cmd.append("--signer.tls.enabled=false")
123+
if not batcher_params.signer_address:
124+
cmd.append("--private-key=" + gs_batcher_private_key)
125+
else:
126+
cmd.append("--signer.endpoint=" + str(batcher_params.signer_endpoint))
127+
cmd.append("--signer.address=" + str(batcher_params.signer_address))
128+
cmd.append("--signer.tls.enabled=false")
132129

133130
if observability_helper.enabled:
134131
observability.configure_op_service_metrics(cmd, ports)

src/challenger/op-challenger/op_challenger_launcher.star

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,18 @@ def get_challenger_config(
109109
"--l1-beacon=" + l1_config_env_vars["CL_RPC_URL"],
110110
"--l1-eth-rpc=" + l1_config_env_vars["L1_RPC_URL"],
111111
"--l2-eth-rpc=" + el_context.rpc_http_url,
112-
"--private-key=" + challenger_key,
113112
"--rollup-rpc=" + cl_context.beacon_http_url,
114113
"--trace-type=" + ",".join(challenger_params.cannon_trace_types),
115114
]
116115

116+
if not challenger_params.signer_address:
117+
cmd.append("--private-key=" + challenger_key)
118+
else:
119+
cmd.append("--signer.endpoint=" + str(challenger_params.signer_endpoint))
120+
cmd.append("--signer.address=" + str(challenger_params.signer_address))
121+
cmd.append("--signer.tls.enabled=false")
122+
123+
plan.print(cmd)
117124
# configure files
118125

119126
files = {

src/cl/hildr/hildr_launcher.star

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def launch(
7979
observability_helper,
8080
interop_params,
8181
da_server_context,
82+
sequencer_params,
8283
):
8384
# beacon_node_identity_recipe = PostHttpRequestRecipe(
8485
# endpoint="/",
@@ -111,6 +112,7 @@ def launch(
111112
sequencer_enabled,
112113
observability_helper,
113114
da_server_context,
115+
sequencer_params,
114116
)
115117

116118
beacon_service = plan.add_service(service_name, config)
@@ -158,6 +160,7 @@ def get_beacon_config(
158160
sequencer_enabled,
159161
observability_helper,
160162
da_server_context,
163+
sequencer_params,
161164
):
162165
EXECUTION_ENGINE_ENDPOINT = "http://{0}:{1}".format(
163166
el_context.ip_addr,
@@ -223,6 +226,7 @@ def get_beacon_config(
223226
observability.expose_metrics_port(ports)
224227

225228
if sequencer_enabled:
229+
# this value is never used so why is it set?????
226230
sequencer_private_key = util.read_network_config_value(
227231
plan,
228232
launcher.deployment_output,
@@ -279,9 +283,10 @@ def get_beacon_config(
279283
return ServiceConfig(**config_args)
280284

281285

282-
def new_hildr_launcher(deployment_output, jwt_file, network_params):
286+
def new_hildr_launcher(deployment_output, jwt_file, network_params, sequencer_params):
283287
return struct(
284288
deployment_output=deployment_output,
285289
jwt_file=jwt_file,
286290
network_params=network_params,
291+
sequencer_params=sequencer_params,
287292
)

src/cl/op-node/op_node_builder_launcher.star

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def launch(
7878
observability_helper,
7979
interop_params,
8080
da_server_context,
81+
sequencer_params,
8182
):
8283
beacon_node_identity_recipe = PostHttpRequestRecipe(
8384
endpoint="/",
@@ -112,6 +113,7 @@ def launch(
112113
observability_helper,
113114
interop_params,
114115
da_server_context,
116+
sequencer_params,
115117
)
116118

117119
beacon_service = plan.add_service(service_name, config)
@@ -161,6 +163,7 @@ def get_beacon_config(
161163
observability_helper,
162164
interop_params,
163165
da_server_context,
166+
sequencer_params,
164167
):
165168
ports = dict(get_used_ports(BEACON_DISCOVERY_PORT_NUM))
166169

@@ -254,8 +257,18 @@ def get_beacon_config(
254257
".privateKey",
255258
)
256259

260+
if sequencer_params.signer_address:
261+
env_vars.update(
262+
{
263+
"OP_NODE_SIGNER_ADDRESS": str(sequencer_params.signer_address),
264+
"OP_NODE_SIGNER_ENDPOINT": str(sequencer_params.signer_endpoint),
265+
"OP_NODE_SIGNER_TLS_ENABLED": "false",
266+
}
267+
)
268+
else:
269+
cmd += ["--p2p.sequencer.key=" + sequencer_private_key]
270+
257271
cmd += [
258-
"--p2p.sequencer.key=" + sequencer_private_key,
259272
"--sequencer.enabled",
260273
"--sequencer.l1-confs=2",
261274
]
@@ -314,9 +327,12 @@ def get_beacon_config(
314327
return ServiceConfig(**config_args)
315328

316329

317-
def new_op_node_builder_launcher(deployment_output, jwt_file, network_params):
330+
def new_op_node_builder_launcher(
331+
deployment_output, jwt_file, network_params, sequencer_params
332+
):
318333
return struct(
319334
deployment_output=deployment_output,
320335
jwt_file=jwt_file,
321336
network_params=network_params,
337+
sequencer_params=sequencer_params,
322338
)

0 commit comments

Comments
 (0)