Skip to content

Commit

Permalink
fix fix fix
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct committed Oct 30, 2024
1 parent 8d14031 commit d8e69dc
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 57 deletions.
98 changes: 49 additions & 49 deletions cdk_erigon.star
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,55 @@ cdk_erigon_package = import_module("./lib/cdk_erigon.star")
zkevm_prover_package = import_module("./lib/zkevm_prover.star")


def run_sequencer(plan, args):
cdk_erigon_node_config_template = read_file(src="./templates/cdk-erigon/config.yml")
contract_setup_addresses = service_package.get_contract_setup_addresses(plan, args)
cdk_erigon_node_config_artifact = plan.render_templates(
name="cdk-erigon-node-config-artifact-sequencer",
config={
"config.yaml": struct(
template=cdk_erigon_node_config_template,
data={
"zkevm_data_stream_port": args["zkevm_data_streamer_port"],
"is_sequencer": True,
}
| args
| contract_setup_addresses,
),
},
)

cdk_erigon_node_chain_spec_template = read_file(
src="./templates/cdk-erigon/chainspec.json"
)
cdk_erigon_node_chain_spec_artifact = plan.render_templates(
name="cdk-erigon-node-chain-spec-artifact-sequencer",
config={
"dynamic-kurtosis-chainspec.json": struct(
template=cdk_erigon_node_chain_spec_template,
data={
"chain_id": args["zkevm_rollup_chain_id"],
},
),
},
)

cdk_erigon_node_chain_config_artifact = plan.get_files_artifact(
name="cdk-erigon-node-chain-config",
)
cdk_erigon_node_chain_allocs_artifact = plan.get_files_artifact(
name="cdk-erigon-node-chain-allocs",
)

config_artifacts = struct(
config=cdk_erigon_node_config_artifact,
chain_spec=cdk_erigon_node_chain_spec_artifact,
chain_config=cdk_erigon_node_chain_config_artifact,
chain_allocs=cdk_erigon_node_chain_allocs_artifact,
)
cdk_erigon_package.start_cdk_erigon_sequencer(plan, args, config_artifacts)


def run_rpc(plan, args):
# Start the zkevm stateless executor if strict mode is enabled.
if args["erigon_strict_mode"]:
Expand Down Expand Up @@ -93,52 +142,3 @@ def run_rpc(plan, args):
chain_allocs=cdk_erigon_node_chain_allocs_artifact,
)
cdk_erigon_package.start_cdk_erigon_rpc(plan, args, config_artifacts)


def run_sequencer(plan, args):
cdk_erigon_node_config_template = read_file(src="./templates/cdk-erigon/config.yml")
contract_setup_addresses = service_package.get_contract_setup_addresses(plan, args)
cdk_erigon_node_config_artifact = plan.render_templates(
name="cdk-erigon-node-config-artifact-sequencer",
config={
"config.yaml": struct(
template=cdk_erigon_node_config_template,
data={
"zkevm_data_stream_port": args["zkevm_data_streamer_port"],
"is_sequencer": True,
}
| args
| contract_setup_addresses,
),
},
)

cdk_erigon_node_chain_spec_template = read_file(
src="./templates/cdk-erigon/chainspec.json"
)
cdk_erigon_node_chain_spec_artifact = plan.render_templates(
name="cdk-erigon-node-chain-spec-artifact-sequencer",
config={
"dynamic-kurtosis-chainspec.json": struct(
template=cdk_erigon_node_chain_spec_template,
data={
"chain_id": args["zkevm_rollup_chain_id"],
},
),
},
)

cdk_erigon_node_chain_config_artifact = plan.get_files_artifact(
name="cdk-erigon-node-chain-config",
)
cdk_erigon_node_chain_allocs_artifact = plan.get_files_artifact(
name="cdk-erigon-node-chain-allocs",
)

config_artifacts = struct(
config=cdk_erigon_node_config_artifact,
chain_spec=cdk_erigon_node_chain_spec_artifact,
chain_config=cdk_erigon_node_chain_config_artifact,
chain_allocs=cdk_erigon_node_chain_allocs_artifact,
)
cdk_erigon_package.start_cdk_erigon_rpc(plan, args, config_artifacts)
6 changes: 3 additions & 3 deletions input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ def get_fork_id(zkevm_contracts_image):

def get_sequencer_name(sequencer_type):
if sequencer_type == constants.SEQUENCER_TYPE.CDK_ERIGON:
return constants.SEQUENCER_NAME.CDK_ERIGON
return "cdk-erigon-sequencer"
elif sequencer_type == constants.SEQUENCER_TYPE.ZKEVM:
return constants.SEQUENCER_NAME.ZKEVM
return "zkevm-node-sequencer"
else:
fail(
"Unsupported sequencer type: '{}', please use '{}' or '{}'".format(
Expand All @@ -406,7 +406,7 @@ def get_sequencer_name(sequencer_type):

def get_l2_rpc_name(deploy_cdk_erigon_node):
if deploy_cdk_erigon_node:
return "cdk-erigon-node"
return "cdk-erigon-rpc"
else:
return "zkevm-node-rpc"

Expand Down
5 changes: 0 additions & 5 deletions src/package_io/constants.star
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,4 @@ SEQUENCER_TYPE = struct(
ZKEVM="zkevm",
)

SEQUENCER_NAME = struct(
CDK_ERIGON="cdk-erigon-sequencer",
ZKEVM="zkevm-node-sequencer",
)

TX_SPAMMER_IMG = "leovct/toolbox:0.0.5"

0 comments on commit d8e69dc

Please sign in to comment.