From 90f4ce629f84073b90723c4015c0e809c0d49df6 Mon Sep 17 00:00:00 2001 From: leovct Date: Tue, 19 Mar 2024 12:24:20 +0100 Subject: [PATCH 1/6] chore: clean up cdk params --- cdk/params.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/cdk/params.yml b/cdk/params.yml index 0a531ae94..d451c4321 100644 --- a/cdk/params.yml +++ b/cdk/params.yml @@ -60,10 +60,6 @@ zkevm_db_prover_hostname: "prover-db" zkevm_db_prover_user: "prover_user" zkevm_db_prover_password: "SR5xq2KZPgvQkPDranCRhvkv6pnqfo77" -zkevm_permissionless_db_prover_hostname: "permissionless-prover-db" -zkevm_permissionless_db_prover_user: "permissionless_prover_user" -zkevm_permissionless_db_prover_password: "fJc3BNTnURMNtie4w3HUhtQbe7omWn23" - ## Pool db # Note: Do not change the name of the db # https://github.com/0xPolygonHermez/zkevm-node/blob/develop/db/db.go#L19 @@ -73,10 +69,6 @@ zkevm_db_pool_hostname: "pool-db" zkevm_db_pool_user: "pool_user" zkevm_db_pool_password: "Qso5wMcLAN3oF7EfaawzgWKUUKWM3Vov" -zkevm_permissionless_db_pool_hostname: "permissionless-pool-db" -zkevm_permissionless_db_pool_user: "permissionless_pool_user" -zkevm_permissionless_db_pool_password: "hkqvUnE65RvFjxaurXxNTDf4j6ozkejn" - ## Event db zkevm_db_event_name: "event_db" @@ -84,10 +76,6 @@ zkevm_db_event_hostname: "event-db" zkevm_db_event_user: "event_user" zkevm_db_event_password: "rJXJN6iUAczh4oz8HRKYbVM8yC7tPeZm" -zkevm_permissionless_db_event_hostname: "permissionless-event-db" -zkevm_permissionless_db_event_user: "permissionless_event_user" -zkevm_permissionless_db_event_password: "d3GSJ8dkWxtMpNbP7w4Za7dF3Gh23XwM" - ## State db # Note: Do not change the name of the db # https://github.com/0xPolygonHermez/zkevm-node/blob/develop/db/db.go#L17 @@ -97,10 +85,6 @@ zkevm_db_state_hostname: "state-db" zkevm_db_state_user: "state_user" zkevm_db_state_password: "rHTX7EpajF8zYDPatN32rH3B2pn89dmq" -zkevm_permissionless_db_state_hostname: "permissionless-state-db" -zkevm_permissionless_db_state_user: "permissionless_state_user" -zkevm_permissionless_db_state_password: "BXeRf7Y4QgkB4Z6c7w6mtXzkdptvwixR" - ## Bridge db zkevm_db_bridge_name: "bridge_db" From 38297cf0e2704f4c6359ac27a5cf0ee9a95ad644 Mon Sep 17 00:00:00 2001 From: leovct Date: Tue, 19 Mar 2024 12:24:43 +0100 Subject: [PATCH 2/6] feat: enable to specify genesis artifact directly in pless pkg --- permissionless-node/main.star | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/permissionless-node/main.star b/permissionless-node/main.star index 02123a8dd..3d4d84c47 100644 --- a/permissionless-node/main.star +++ b/permissionless-node/main.star @@ -8,10 +8,15 @@ def run(plan, args): start_databases(plan, args) start_executor(plan, args, cpu_arch) - genesis_file = read_file(src=args["genesis_file"]) - genesis_artifact = plan.render_templates( - name="genesis", config={"genesis.json": struct(template=genesis_file, data={})} - ) + genesis_artifact = "" + if "genesis_artifact" in args: + genesis_artifact = args["genesis_artifact"] + else: + genesis_file = read_file(src=args["genesis_file"]) + genesis_artifact = plan.render_templates( + name="genesis", + config={"genesis.json": struct(template=genesis_file, data={})}, + ) node_config_template = read_file(src="./templates/node-config.toml") node_config_artifact = plan.render_templates( From 039de3927365f6cf060d5099d47a84ffccaed96b Mon Sep 17 00:00:00 2001 From: leovct Date: Tue, 19 Mar 2024 12:25:01 +0100 Subject: [PATCH 3/6] feat: spin up default pless node in cdk env --- cdk/main.star | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cdk/main.star b/cdk/main.star index 20de99791..5e66a1aaf 100644 --- a/cdk/main.star +++ b/cdk/main.star @@ -1,6 +1,7 @@ ethereum_package = import_module( "github.com/kurtosis-tech/ethereum-package/main.star@2.0.0" ) +zkevm_permissionless_node_package = import_module("../permissionless-node/main.star") CONTRACTS_IMAGE = "node:20-bookworm" CONTRACTS_BRANCH = "develop" @@ -164,6 +165,11 @@ def run(plan, args): name="zkevm", description="These are the files needed to start various node services", ) + genesis_artifact = plan.store_service_files( + service_name="contracts" + args["deployment_suffix"], + src="/opt/zkevm/genesis.json", + name="genesis", + ) # Start databases prover_db_init_script = plan.upload_files( @@ -525,6 +531,18 @@ def run(plan, args): ), ) + # Start permissionless node. + permissionless_args = args + permissionless_args["deployment_suffix"] = "-pless-001" + permissionless_args["trusted_sequencer_node_uri"] = "zkevm-node-sequencer-001:6900" + permissionless_args["zkevm_aggregator_host"] = "zkevm-node-aggregator-001" + permissionless_args["genesis_artifact"] = genesis_artifact + permissionless_args["zkevm_executor_image"] = args["zkevm_prover_image"] + permissionless_args["zkevm_db_executor_hostname"] = args["zkevm_db_prover_hostname"] + permissionless_args["zkevm_db_executor_user"] = args["zkevm_db_prover_user"] + permissionless_args["zkevm_db_executor_password"] = args["zkevm_db_prover_password"] + zkevm_permissionless_node_package.run(plan, args) + def start_node_databases(plan, args, prover_db_init_script, event_db_init_script): postgres_port = args["zkevm_db_postgres_port"] From 40e94542d70bb25c0ccf1ce71e1afc5564f2196a Mon Sep 17 00:00:00 2001 From: leovct Date: Tue, 19 Mar 2024 12:25:18 +0100 Subject: [PATCH 4/6] chore: modify deployment suffix of pless pkg to 002 since 001 will be deployed by default --- permissionless-node/params.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/permissionless-node/params.yml b/permissionless-node/params.yml index c4add6087..301a5d95f 100644 --- a/permissionless-node/params.yml +++ b/permissionless-node/params.yml @@ -2,7 +2,7 @@ # Deployment suffix that will be appended to all the resources deployed by the permissionless package. # WARNING: When deploying both the CDK and permissionless package, ensure the permissionless package's # deployment suffix differs from the CDK environment's suffix to prevent naming clashes. -deployment_suffix: "-pless-001" +deployment_suffix: "-pless-002" # Components to connect to l1_rpc_url: "http://el-1-geth-lighthouse:8545" From 91a1c7d495a38f7d33274f2cfc65ed7bb690e8a6 Mon Sep 17 00:00:00 2001 From: leovct Date: Tue, 19 Mar 2024 12:44:30 +0100 Subject: [PATCH 5/6] fix: import pless pkg using absolute locator --- cdk/main.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdk/main.star b/cdk/main.star index 5e66a1aaf..915cb7d0b 100644 --- a/cdk/main.star +++ b/cdk/main.star @@ -1,7 +1,7 @@ ethereum_package = import_module( "github.com/kurtosis-tech/ethereum-package/main.star@2.0.0" ) -zkevm_permissionless_node_package = import_module("../permissionless-node/main.star") +zkevm_permissionless_node_package = import_module("github.com/0xPolygon/kurtosis-cdk/permissionless-node/main.star") CONTRACTS_IMAGE = "node:20-bookworm" CONTRACTS_BRANCH = "develop" From 8c47d666d39f42e99ac6b94497e19642e37ac13c Mon Sep 17 00:00:00 2001 From: leovct Date: Tue, 19 Mar 2024 12:45:22 +0100 Subject: [PATCH 6/6] chore: lint --- cdk/main.star | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cdk/main.star b/cdk/main.star index 915cb7d0b..df2841633 100644 --- a/cdk/main.star +++ b/cdk/main.star @@ -1,7 +1,9 @@ ethereum_package = import_module( "github.com/kurtosis-tech/ethereum-package/main.star@2.0.0" ) -zkevm_permissionless_node_package = import_module("github.com/0xPolygon/kurtosis-cdk/permissionless-node/main.star") +zkevm_permissionless_node_package = import_module( + "github.com/0xPolygon/kurtosis-cdk/permissionless-node/main.star" +) CONTRACTS_IMAGE = "node:20-bookworm" CONTRACTS_BRANCH = "develop"