From 3fcbcae25117c7f84c6c100eac32663648f7a486 Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Fri, 19 Jul 2024 10:49:08 +0000 Subject: [PATCH 01/25] Use cdk repo for erigon sequencer wip wip wip wip almost working fix config config wip Tips and tricks Default to Eldelberry wip fix config Bump prover and erigon --- cdk-erigon-sequencer-params.yml | 7 +- cdk_central_environment.star | 97 +++++++++----- databases.star | 10 ++ kurtosis.yml | 4 +- lib/cdk_node.star | 52 ++++++++ main.star | 14 +-- templates/trusted-node/cdk-node-config.toml | 133 ++++++++++++++++++++ templates/trusted-node/prover-config.json | 2 +- 8 files changed, 273 insertions(+), 46 deletions(-) create mode 100644 lib/cdk_node.star create mode 100644 templates/trusted-node/cdk-node-config.toml diff --git a/cdk-erigon-sequencer-params.yml b/cdk-erigon-sequencer-params.yml index 7c41fee6..c2a44ea4 100644 --- a/cdk-erigon-sequencer-params.yml +++ b/cdk-erigon-sequencer-params.yml @@ -53,7 +53,7 @@ args: zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.3-RC18 # zkevm_prover_image: hermeznetwork/zkevm-prover:v4.0.19 zkevm_node_image: hermeznetwork/zkevm-node:v0.6.7 - cdk_node_image: 0xpolygon/cdk-validium-node:0.6.7-cdk + cdk_node_image: ghcr.io/0xpolygon/cdk:0.0.8 zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.7 # zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.6 @@ -62,13 +62,12 @@ args: # zkevm_agglayer_image: 0xpolygon/agglayer:0.1.3 zkevm_agglayer_image: ghcr.io/agglayer/agglayer-rs:main zkevm_bridge_service_image: hermeznetwork/zkevm-bridge-service:v0.4.2 - cdk_erigon_node_image: hermeznetwork/cdk-erigon:beta13-candidate3-5225235-amd64 - # cdk_erigon_node_image: erigon:loop-wait + cdk_erigon_node_image: hermeznetwork/cdk-erigon:2.0.0-beta13 panoptichain_image: minhdvu/panoptichain zkevm_bridge_ui_image: leovct/zkevm-bridge-ui:multi-network zkevm_bridge_proxy_image: haproxy:2.9.9-bookworm workload_image: leovct/workload:0.0.1 - zkevm_sequence_sender_image: hermeznetwork/zkevm-sequence-sender:v0.2.0-RC5 + # zkevm_sequence_sender_image: hermeznetwork/zkevm-sequence-sender:v0.2.0-RC5 toolbox_image: leovct/toolbox:0.0.1 # Port configuration. diff --git a/cdk_central_environment.star b/cdk_central_environment.star index d22efe76..f192c737 100644 --- a/cdk_central_environment.star +++ b/cdk_central_environment.star @@ -4,6 +4,7 @@ zkevm_dac_package = import_module("./lib/zkevm_dac.star") zkevm_node_package = import_module("./lib/zkevm_node.star") zkevm_prover_package = import_module("./lib/zkevm_prover.star") zkevm_sequence_sender_package = import_module("./lib/zkevm_sequence_sender.star") +cdk_node_package = import_module("./lib/cdk_node.star") databases = import_module("./databases.star") @@ -36,41 +37,41 @@ def run(plan, args): config={"genesis.json": struct(template=genesis_file, data={})}, ) - # Create the zkevm node config. - node_config_template = read_file(src="./templates/trusted-node/node-config.toml") - node_config_artifact = plan.render_templates( - config={ - "node-config.toml": struct( - template=node_config_template, - data=args - | { - "is_cdk_validium": data_availability_package.is_cdk_validium(args), - } - | db_configs, - ) - }, - name="trusted-node-config", - ) - - # Start the synchronizer. - zkevm_node_package.start_synchronizer( - plan, args, node_config_artifact, genesis_artifact - ) + if args["sequencer_type"] == "zkevm": + # Create the zkevm node config. + node_config_template = read_file(src="./templates/trusted-node/node-config.toml") + node_config_artifact = plan.render_templates( + config={ + "node-config.toml": struct( + template=node_config_template, + data=args + | { + "is_cdk_validium": data_availability_package.is_cdk_validium(args), + } + | db_configs, + ) + }, + name="trusted-node-config", + ) - # Start the rest of the zkevm node components. - keystore_artifacts = get_keystores_artifacts(plan, args) - zkevm_node_components_configs = ( - zkevm_node_package.create_zkevm_node_components_config( - args, node_config_artifact, genesis_artifact, keystore_artifacts + # Start the synchronizer. + zkevm_node_package.start_synchronizer( + plan, args, node_config_artifact, genesis_artifact + ) + + # Start the rest of the zkevm node components. + keystore_artifacts = get_keystores_artifacts(plan, args) + zkevm_node_components_configs = ( + zkevm_node_package.create_zkevm_node_components_config( + args, node_config_artifact, genesis_artifact, keystore_artifacts + ) ) - ) - plan.add_services( - configs=zkevm_node_components_configs, - description="Starting the rest of the zkevm node components", - ) + plan.add_services( + configs=zkevm_node_components_configs, + description="Starting the rest of the zkevm node components", + ) - if args["sequencer_type"] == "erigon": sequence_sender_config = ( zkevm_sequence_sender_package.create_zkevm_sequence_sender_config( plan, args, genesis_artifact, keystore_artifacts.sequencer @@ -79,7 +80,39 @@ def run(plan, args): plan.add_services( configs=sequence_sender_config, - description="Starting the rest of the zkevm node components", + description="Starting the zkevm sequence-sender components", + ) + + if args["sequencer_type"] == "erigon": + # Create the cdk node config. + node_config_template = read_file(src="./templates/trusted-node/cdk-node-config.toml") + contract_setup_addresses = service_package.get_contract_setup_addresses(plan, args) + node_config_artifact = plan.render_templates( + name="cdk-node-config-artifact", + config={ + "cdk-node-config.toml": struct( + template=node_config_template, + data=args + | { + "is_cdk_validium": data_availability_package.is_cdk_validium(args), + } + | db_configs + | contract_setup_addresses, + ) + }, + ) + + # Start the cdk components. + keystore_artifacts = get_keystores_artifacts(plan, args) + cdk_node_configs = ( + cdk_node_package.create_cdk_node_service_config( + args, node_config_artifact, genesis_artifact, keystore_artifacts + ) + ) + + plan.add_services( + configs=cdk_node_configs, + description="Starting the cdk node components", ) # Start the DAC if in validium mode. diff --git a/databases.star b/databases.star index 53a639dc..3fe7ae17 100644 --- a/databases.star +++ b/databases.star @@ -45,6 +45,16 @@ TRUSTED_DATABASES = { "user": "state_user", "password": "redacted", }, + "aggregator_db": { + "name": "aggregator_db", + "user": "aggregator_user", + "password": "redacted", + }, + "aggregator_syncer_db": { + "name": "syncer_db", + "user": "syncer_user", + "password": "redacted", + }, } PERMISSIONLESS_DATABASES = { diff --git a/kurtosis.yml b/kurtosis.yml index 0e8a9757..43b0efb2 100644 --- a/kurtosis.yml +++ b/kurtosis.yml @@ -40,8 +40,8 @@ description: |- # zkevm_prover_image: hermeznetwork/zkevm-prover:v4.0.19 zkevm_node_image: hermeznetwork/zkevm-node:v0.7.0 - cdk_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk - # cdk_node_image: 0xpolygon/cdk-validium-node:0.5.13-cdk.3 + cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk + cdk_node_image: ghcr.io/0xpolygon/cdk:0.0.2 zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.7 # zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.6 diff --git a/lib/cdk_node.star b/lib/cdk_node.star new file mode 100644 index 00000000..069a6a7d --- /dev/null +++ b/lib/cdk_node.star @@ -0,0 +1,52 @@ +data_availability_package = import_module("./data_availability.star") + +NODE_COMPONENTS = struct( + sequence_sender="sequence-sender", + aggregator="aggregator", +) + +def create_cdk_node_service_config( + args, + config_artifact, + genesis_artifact, + keystore_artifact, +): + cdk_node_name = "cdk-node" + args["deployment_suffix"] + + cmd = [ + "sleep 20 && cdk-node run " + + "-cfg=/etc/cdk/cdk-node-config.toml " + + "-custom-network-file=/etc/cdk/genesis.json " + + "-components=" + NODE_COMPONENTS.sequence_sender + "," + NODE_COMPONENTS.aggregator, + ] + + cdk_node_service_config = ServiceConfig( + image=data_availability_package.get_node_image(args), + ports={ + "aggregator": PortSpec( + args["zkevm_aggregator_port"], application_protocol="grpc" + ), + # "pprof": PortSpec(args["zkevm_pprof_port"], application_protocol="http"), + # "prometheus": PortSpec( + # args["zkevm_prometheus_port"], application_protocol="http" + # ), + }, + files={ + "/etc/cdk": Directory( + artifact_names=[ + config_artifact, + genesis_artifact, + keystore_artifact.aggregator, + keystore_artifact.sequencer, + ], + ), + "/data": Directory( + artifact_names=[], + ), + }, + entrypoint=["sh", "-c"], + # entrypoint=["cdk-node"], + cmd=cmd, + ) + + return {cdk_node_name: cdk_node_service_config} diff --git a/main.star b/main.star index 703b1827..e6279cf4 100644 --- a/main.star +++ b/main.star @@ -110,6 +110,13 @@ def run( else: plan.print("Skipping the deployment of cdk-erigon sequencer") + # Deploy cdk-erigon node. + if deploy_cdk_erigon_node: + plan.print("Deploying cdk-erigon node") + cdk_erigon_package.run_rpc(plan, args) + else: + plan.print("Skipping the deployment of cdk-erigon node") + plan.print("Deploying cdk central/trusted environment") central_environment_args = dict(args) central_environment_args["genesis_artifact"] = genesis_artifact @@ -119,13 +126,6 @@ def run( else: plan.print("Skipping the deployment of cdk central/trusted environment") - # Deploy cdk-erigon node. - if deploy_cdk_erigon_node: - plan.print("Deploying cdk-erigon node") - cdk_erigon_package.run_rpc(plan, args) - else: - plan.print("Skipping the deployment of cdk-erigon node") - # Deploy cdk/bridge infrastructure. if deploy_cdk_bridge_infra: plan.print("Deploying cdk/bridge infrastructure") diff --git a/templates/trusted-node/cdk-node-config.toml b/templates/trusted-node/cdk-node-config.toml new file mode 100644 index 00000000..dfee685e --- /dev/null +++ b/templates/trusted-node/cdk-node-config.toml @@ -0,0 +1,133 @@ +ForkUpgradeBatchNumber = 0 +ForkUpgradeNewForkId = 0 + +[Common] +IsValidiumMode = {{.is_cdk_validium}} +ContractVersions = "elderberry" + +[Log] +Environment = "development" # "production" or "development" +Level = "debug" +Outputs = ["stderr"] + +[SequenceSender] +WaitPeriodSendSequence = "15s" +LastBatchVirtualizationTimeMaxWaitPeriod = "10s" +MaxTxSizeForL1 = 131072 +L2Coinbase = "{{.zkevm_l2_sequencer_address}}" +PrivateKey = {Path = "/etc/cdk/sequencer.keystore", Password = "{{.zkevm_l2_keystore_password}}"} +SequencesTxFileName = "/data/sequencesender.json" +GasOffset = 80000 +WaitPeriodPurgeTxFile = "15m" +MaxPendingTx = 1 + [SequenceSender.StreamClient] + Server = "{{.sequencer_name}}{{.deployment_suffix}}:{{.zkevm_data_streamer_port}}" + [SequenceSender.EthTxManager] + FrequencyToMonitorTxs = "1s" + WaitTxToBeMined = "2m" + ConsolidationL1ConfirmationBlocks = 5 + FinalizationL1ConfirmationBlocks = 10 + WaitReceiptToBeGenerated = "8s" + PrivateKeys = [ + {Path = "/etc/cdk/sequencer.keystore", Password = "{{.zkevm_l2_keystore_password}}"}, + ] + ForcedGas = 0 + GasPriceMarginFactor = 1 + MaxGasPriceLimit = 0 + PersistenceFilename = "/data/ethtxmanager.json" + [SequenceSender.EthTxManager.Etherman] + URL = "{{.l1_rpc_url}}" + L1ChainID = {{.l1_chain_id}} + HTTPHeaders = [] + +[Aggregator] + Host = "0.0.0.0" + Port = "{{.zkevm_aggregator_port}}" + RetryTime = "30s" + VerifyProofInterval = "30s" + ProofStatePollingInterval = "5s" + TxProfitabilityCheckerType = "acceptall" + TxProfitabilityMinReward = "1.1" + IntervalAfterWhichBatchConsolidateAnyway = "0s" + ChainID = "{{.zkevm_rollup_chain_id}}" + ForkId = 9 + CleanupLockedProofsInterval = "2m0s" + GeneratingProofCleanupThreshold = "10m" + GasOffset = 150000 + UpgradeEtrogBatchNumber = 0 + WitnessURL = "http://{{.l2_rpc_name}}{{.deployment_suffix}}:{{.zkevm_rpc_http_port}}" + {{if .is_cdk_validium}} + SenderAddress = "{{.zkevm_l2_agglayer_address}}" + SettlementBackend = "agglayer" + AggLayerTxTimeout = "600s" + AggLayerURL = "http://zkevm-agglayer{{.deployment_suffix}}:{{.zkevm_agglayer_port}}" + {{else}} + + SenderAddress = "{{.zkevm_l2_aggregator_address}}" + {{end}} + + [Aggregator.SequencerPrivateKey] + Path = "/etc/cdk/sequencer.keystore" + Password = "{{.zkevm_l2_keystore_password}}" + + [Aggregator.DB] + Name = "{{.aggregator_db.name}}" + User = "{{.aggregator_db.user}}" + Password = "{{.aggregator_db.password}}" + Host = "{{.aggregator_db.hostname}}" + Port = "{{.aggregator_db.port}}" + EnableLog = false + MaxConns = 200 + [Aggregator.Log] + Environment = "development" # "production" or "development" + Level = "debug" + Outputs = ["stderr"] + [Aggregator.StreamClient] + Server = "{{.sequencer_name}}{{.deployment_suffix}}:{{.zkevm_data_streamer_port}}" + [Aggregator.EthTxManager] + FrequencyToMonitorTxs = "1s" + WaitTxToBeMined = "2m" + GetReceiptMaxTime = "250ms" + GetReceiptWaitInterval = "1s" + PrivateKeys = [ + {Path = "/etc/cdk/aggregator.keystore", Password = "{{.zkevm_l2_keystore_password}}"}, + ] + ForcedGas = 0 + GasPriceMarginFactor = 1 + MaxGasPriceLimit = 0 + PersistenceFilename = "" + ReadPendingL1Txs = false + SafeStatusL1NumberOfBlocks = 0 + FinalizedStatusL1NumberOfBlocks = 0 + [Aggregator.EthTxManager.Etherman] + URL = "{{.l1_rpc_url}}" + L1ChainID = {{.l1_chain_id}} + HTTPHeaders = [] + [Aggregator.Synchronizer] + [Aggregator.Synchronizer.DB] + Name = "{{.aggregator_syncer_db.name}}" + User = "{{.aggregator_syncer_db.user}}" + Password = "{{.aggregator_syncer_db.password}}" + Host = "{{.aggregator_syncer_db.hostname}}" + Port = "{{.aggregator_syncer_db.port}}" + EnableLog = false + MaxConns = 10 + [Aggregator.Synchronizer.Synchronizer] + SyncInterval = "10s" + SyncChunkSize = 1000 + GenesisBlockNumber = 1 + SyncUpToBlock = "latest" + BlockFinality = "latest" + OverrideStorageCheck = false + [Aggregator.Synchronizer.Etherman] + [Aggregator.Synchronizer.Etherman.Validium] + Enabled = {{.is_cdk_validium}} + +[RPC] + +[NetworkConfig.L1] +ChainID = "{{.l1_chain_id}}" +PolAddr = "{{.pol_token_address}}" +ZkEVMAddr = "{{.zkevm_rollup_address}}" +RollupManagerAddr = "{{.zkevm_rollup_manager_address}}" +GlobalExitRootManagerAddr = "{{.zkevm_global_exit_root_address}}" diff --git a/templates/trusted-node/prover-config.json b/templates/trusted-node/prover-config.json index 5570ca5c..78c239d2 100644 --- a/templates/trusted-node/prover-config.json +++ b/templates/trusted-node/prover-config.json @@ -143,7 +143,7 @@ * aggregatorClientHost is the hostname that this prover will * attempt to use while connecting to the aggregator */ -}} - "aggregatorClientHost": "zkevm-node-aggregator{{.deployment_suffix}}", + "aggregatorClientHost": "cdk-node{{.deployment_suffix}}", {{- /* * keccakScriptFile is the keccak-f state machine script file From ce5f5e20930c85967b7e20638a1c007616fab205 Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Thu, 1 Aug 2024 16:15:09 +0000 Subject: [PATCH 02/25] Remove agglayer-db --- databases.star | 5 ----- scripts/reset_postgres.sh | 2 +- templates/bridge-infra/agglayer-config.toml | 11 +---------- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/databases.star b/databases.star index 3fe7ae17..c5857e32 100644 --- a/databases.star +++ b/databases.star @@ -58,11 +58,6 @@ TRUSTED_DATABASES = { } PERMISSIONLESS_DATABASES = { - "agglayer_db": { - "name": "agglayer_db", - "user": "agglayer_user", - "password": "redacted", - }, "bridge_db": { "name": "bridge_db", "user": "bridge_user", diff --git a/scripts/reset_postgres.sh b/scripts/reset_postgres.sh index 9be14cf7..125017a7 100755 --- a/scripts/reset_postgres.sh +++ b/scripts/reset_postgres.sh @@ -8,7 +8,7 @@ # 2. update PGPASSWORD, PGUSER, and PGHOST params per your use case (modify configs) # 3. run ./scripts/reset_postgres.sh (drop/recreate dbs and permissions) # 4. kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . (deploy with fresh dbs) -DB_NAMES=("event_db" "pool_db" "prover_db" "state_db" "agglayer_db" "bridge_db" "dac_db") +DB_NAMES=("event_db" "pool_db" "prover_db" "state_db" "bridge_db" "dac_db") DB_USERS=("event_user" "pool_user" "prover_user" "state_user" "agglayer_user" "bridge_user" "dac_user") # User must update credentials with master postgres IP/hostname and username diff --git a/templates/bridge-infra/agglayer-config.toml b/templates/bridge-infra/agglayer-config.toml index e43de3af..6d43303b 100644 --- a/templates/bridge-infra/agglayer-config.toml +++ b/templates/bridge-infra/agglayer-config.toml @@ -17,15 +17,6 @@ Environment = "production" # "production" or "development" Level = "info" Outputs = ["stderr"] -[DB] -User = "{{.agglayer_db.user}}" -Password = "{{.agglayer_db.password}}" -Name = "{{.agglayer_db.name}}" -Host = "{{.agglayer_db.hostname}}" -Port = "{{.agglayer_db.port}}" -EnableLog = false -MaxConns = 200 - [EthTxManager] FrequencyToMonitorTxs = "1s" WaitTxToBeMined = "2m" @@ -43,4 +34,4 @@ NodeURL = "{{.l1_rpc_url}}" RollupManagerContract = "{{.zkevm_rollup_manager_address}}" [Telemetry] -PrometheusAddr = "0.0.0.0:{{.zkevm_prometheus_port}}" \ No newline at end of file +PrometheusAddr = "0.0.0.0:{{.zkevm_prometheus_port}}" From 646aae9ee25d154e47ea96119717ab19338963bf Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Thu, 1 Aug 2024 16:15:44 +0000 Subject: [PATCH 03/25] Move old zkevm to another var --- cdk-erigon-sequencer-params.yml | 3 ++- input_parser.star | 2 +- params.yml | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cdk-erigon-sequencer-params.yml b/cdk-erigon-sequencer-params.yml index c2a44ea4..e12e108d 100644 --- a/cdk-erigon-sequencer-params.yml +++ b/cdk-erigon-sequencer-params.yml @@ -53,7 +53,8 @@ args: zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.3-RC18 # zkevm_prover_image: hermeznetwork/zkevm-prover:v4.0.19 zkevm_node_image: hermeznetwork/zkevm-node:v0.6.7 - cdk_node_image: ghcr.io/0xpolygon/cdk:0.0.8 + cdk_validium_node_image: hermeznetwork/zkevm-node:v0.6.7-cdk + cdk_node_image: ghcr.io/0xpolygon/cdk:0.0.9 zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.7 # zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.6 diff --git a/input_parser.star b/input_parser.star index 5aa6db33..94a9d8bf 100644 --- a/input_parser.star +++ b/input_parser.star @@ -3,7 +3,7 @@ DEFAULT_ARGS = { "data_availability_mode": "cdk-validium", "zkevm_prover_image": "hermeznetwork/zkevm-prover:v6.0.2", "zkevm_node_image": "hermeznetwork/zkevm-node:v0.7.0", - "cdk_node_image": "0xpolygon/cdk-validium-node:0.7.0-cdk", + "cdk_validium_node_image": "0xpolygon/cdk-validium-node:0.7.0-cdk", "zkevm_da_image": "0xpolygon/cdk-data-availability:0.0.7", "zkevm_contracts_image": "leovct/zkevm-contracts", "zkevm_agglayer_image": "ghcr.io/agglayer/agglayer-rs:main", diff --git a/params.yml b/params.yml index 71cdfba3..8cf1bc8a 100644 --- a/params.yml +++ b/params.yml @@ -49,8 +49,7 @@ args: # zkevm_prover_image: hermeznetwork/zkevm-prover:v4.0.19 zkevm_node_image: hermeznetwork/zkevm-node:v0.7.0 - cdk_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk - # cdk_node_image: 0xpolygon/cdk-validium-node:0.5.13-cdk.3 + cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.7 # zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.6 From 94f608ca5f8bfe3649d8d15ef320fb8acdb7b3ed Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Fri, 2 Aug 2024 09:57:17 +0000 Subject: [PATCH 04/25] Apply feedback --- lib/cdk_node.star | 21 ++++++++------------- templates/trusted-node/prover-config.json | 6 +++++- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/lib/cdk_node.star b/lib/cdk_node.star index 069a6a7d..6cf4f702 100644 --- a/lib/cdk_node.star +++ b/lib/cdk_node.star @@ -13,23 +13,12 @@ def create_cdk_node_service_config( ): cdk_node_name = "cdk-node" + args["deployment_suffix"] - cmd = [ - "sleep 20 && cdk-node run " + - "-cfg=/etc/cdk/cdk-node-config.toml " + - "-custom-network-file=/etc/cdk/genesis.json " + - "-components=" + NODE_COMPONENTS.sequence_sender + "," + NODE_COMPONENTS.aggregator, - ] - cdk_node_service_config = ServiceConfig( image=data_availability_package.get_node_image(args), ports={ "aggregator": PortSpec( args["zkevm_aggregator_port"], application_protocol="grpc" ), - # "pprof": PortSpec(args["zkevm_pprof_port"], application_protocol="http"), - # "prometheus": PortSpec( - # args["zkevm_prometheus_port"], application_protocol="http" - # ), }, files={ "/etc/cdk": Directory( @@ -45,8 +34,14 @@ def create_cdk_node_service_config( ), }, entrypoint=["sh", "-c"], - # entrypoint=["cdk-node"], - cmd=cmd, + # Sleep for 20 seconds in order to wait for datastream server getting ready + # TODO: find a better way instead of waiting + cmd=[ + "sleep 20 && cdk-node run " + + "-cfg=/etc/cdk/cdk-node-config.toml " + + "-custom-network-file=/etc/cdk/genesis.json " + + "-components=" + NODE_COMPONENTS.sequence_sender + "," + NODE_COMPONENTS.aggregator, + ], ) return {cdk_node_name: cdk_node_service_config} diff --git a/templates/trusted-node/prover-config.json b/templates/trusted-node/prover-config.json index 78c239d2..71bd10c5 100644 --- a/templates/trusted-node/prover-config.json +++ b/templates/trusted-node/prover-config.json @@ -143,7 +143,11 @@ * aggregatorClientHost is the hostname that this prover will * attempt to use while connecting to the aggregator */ -}} - "aggregatorClientHost": "cdk-node{{.deployment_suffix}}", + {{if eq .sequencer_type "zkevm-node"}} + "aggregatorClientHost": "zkevm-node-aggregator{{.deployment_suffix}}", + {{else if eq .sequencer_type "erigon"}} + "aggregatorClientHost": "cdk-node{{.deployment_suffix}}", + {{end}} {{- /* * keccakScriptFile is the keccak-f state machine script file From 71ef07b87a6245c7880fe2d5ac58e7ca03838a2f Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Fri, 2 Aug 2024 09:59:15 +0000 Subject: [PATCH 05/25] Lint --- cdk_central_environment.star | 28 ++++++++++++++++++---------- lib/cdk_node.star | 12 ++++++++---- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/cdk_central_environment.star b/cdk_central_environment.star index f192c737..173a7d60 100644 --- a/cdk_central_environment.star +++ b/cdk_central_environment.star @@ -39,14 +39,18 @@ def run(plan, args): if args["sequencer_type"] == "zkevm": # Create the zkevm node config. - node_config_template = read_file(src="./templates/trusted-node/node-config.toml") + node_config_template = read_file( + src="./templates/trusted-node/node-config.toml" + ) node_config_artifact = plan.render_templates( config={ "node-config.toml": struct( template=node_config_template, data=args | { - "is_cdk_validium": data_availability_package.is_cdk_validium(args), + "is_cdk_validium": data_availability_package.is_cdk_validium( + args + ), } | db_configs, ) @@ -58,7 +62,7 @@ def run(plan, args): zkevm_node_package.start_synchronizer( plan, args, node_config_artifact, genesis_artifact ) - + # Start the rest of the zkevm node components. keystore_artifacts = get_keystores_artifacts(plan, args) zkevm_node_components_configs = ( @@ -85,8 +89,12 @@ def run(plan, args): if args["sequencer_type"] == "erigon": # Create the cdk node config. - node_config_template = read_file(src="./templates/trusted-node/cdk-node-config.toml") - contract_setup_addresses = service_package.get_contract_setup_addresses(plan, args) + node_config_template = read_file( + src="./templates/trusted-node/cdk-node-config.toml" + ) + contract_setup_addresses = service_package.get_contract_setup_addresses( + plan, args + ) node_config_artifact = plan.render_templates( name="cdk-node-config-artifact", config={ @@ -94,7 +102,9 @@ def run(plan, args): template=node_config_template, data=args | { - "is_cdk_validium": data_availability_package.is_cdk_validium(args), + "is_cdk_validium": data_availability_package.is_cdk_validium( + args + ), } | db_configs | contract_setup_addresses, @@ -104,10 +114,8 @@ def run(plan, args): # Start the cdk components. keystore_artifacts = get_keystores_artifacts(plan, args) - cdk_node_configs = ( - cdk_node_package.create_cdk_node_service_config( - args, node_config_artifact, genesis_artifact, keystore_artifacts - ) + cdk_node_configs = cdk_node_package.create_cdk_node_service_config( + args, node_config_artifact, genesis_artifact, keystore_artifacts ) plan.add_services( diff --git a/lib/cdk_node.star b/lib/cdk_node.star index 6cf4f702..fbc11ab4 100644 --- a/lib/cdk_node.star +++ b/lib/cdk_node.star @@ -5,6 +5,7 @@ NODE_COMPONENTS = struct( aggregator="aggregator", ) + def create_cdk_node_service_config( args, config_artifact, @@ -37,10 +38,13 @@ def create_cdk_node_service_config( # Sleep for 20 seconds in order to wait for datastream server getting ready # TODO: find a better way instead of waiting cmd=[ - "sleep 20 && cdk-node run " + - "-cfg=/etc/cdk/cdk-node-config.toml " + - "-custom-network-file=/etc/cdk/genesis.json " + - "-components=" + NODE_COMPONENTS.sequence_sender + "," + NODE_COMPONENTS.aggregator, + "sleep 20 && cdk-node run " + + "-cfg=/etc/cdk/cdk-node-config.toml " + + "-custom-network-file=/etc/cdk/genesis.json " + + "-components=" + + NODE_COMPONENTS.sequence_sender + + "," + + NODE_COMPONENTS.aggregator, ], ) From 57dc9010b0d54f8f319e6ad73c621f0f67a4ae6e Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Fri, 2 Aug 2024 10:55:15 +0000 Subject: [PATCH 06/25] Default to erigon seq --- cdk-erigon-sequencer-params.yml | 184 -------------------------------- params.yml | 14 ++- 2 files changed, 10 insertions(+), 188 deletions(-) delete mode 100644 cdk-erigon-sequencer-params.yml diff --git a/cdk-erigon-sequencer-params.yml b/cdk-erigon-sequencer-params.yml deleted file mode 100644 index e12e108d..00000000 --- a/cdk-erigon-sequencer-params.yml +++ /dev/null @@ -1,184 +0,0 @@ ---- -# Deployment parameters. -# The deployment process is divided into various stages. - -# Deploy local L1. -deploy_l1: true - -# Deploy zkevm contracts on L1 (and also fund accounts). -deploy_zkevm_contracts_on_l1: true - -# Deploy zkevm node and cdk peripheral databases. -deploy_databases: true - -# Deploy cdk central/trusted environment. -deploy_cdk_central_environment: true - -# Deploy cdk/bridge infrastructure. -deploy_cdk_bridge_infra: true - -# Deploy permissionless node. -deploy_zkevm_permissionless_node: false - -# Deploy cdk-erigon node. -deploy_cdk_erigon_node: true - -# Deploy observability stack. -deploy_observability: true - -# Deploy Blockscout stack. -deploy_l2_blockscout: false - -# Deploy eth load balancer. -deploy_blutgang: false - -# Apply workload to the different components of the CDK stack. -apply_workload: false - -args: - # Suffix appended to service names. - # Note: It should be a string. - deployment_suffix: "-001" - - # Sequence type. Choose from ["erigon", "zkevm-node"] - sequencer_type: "erigon" - # The type of data availability to use. - # Options: - # - 'rollup': Transaction data is stored on-chain on L1. - # - 'cdk-validium': Transaction data is stored off-chain using the CDK DA layer and a DAC. - # In the future, we would like to support external DA protocols such as Avail, Celestia and Near. - data_availability_mode: cdk-validium - - # Docker images and repositories used to spin up services. - zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.3-RC18 - # zkevm_prover_image: hermeznetwork/zkevm-prover:v4.0.19 - zkevm_node_image: hermeznetwork/zkevm-node:v0.6.7 - cdk_validium_node_image: hermeznetwork/zkevm-node:v0.6.7-cdk - cdk_node_image: ghcr.io/0xpolygon/cdk:0.0.9 - - zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.7 - # zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.6 - zkevm_contracts_image: leovct/zkevm-contracts # the tag is automatically replaced by the value of /zkevm_rollup_fork_id/ - - # zkevm_agglayer_image: 0xpolygon/agglayer:0.1.3 - zkevm_agglayer_image: ghcr.io/agglayer/agglayer-rs:main - zkevm_bridge_service_image: hermeznetwork/zkevm-bridge-service:v0.4.2 - cdk_erigon_node_image: hermeznetwork/cdk-erigon:2.0.0-beta13 - panoptichain_image: minhdvu/panoptichain - zkevm_bridge_ui_image: leovct/zkevm-bridge-ui:multi-network - zkevm_bridge_proxy_image: haproxy:2.9.9-bookworm - workload_image: leovct/workload:0.0.1 - # zkevm_sequence_sender_image: hermeznetwork/zkevm-sequence-sender:v0.2.0-RC5 - toolbox_image: leovct/toolbox:0.0.1 - - # Port configuration. - zkevm_hash_db_port: 50061 - zkevm_executor_port: 50071 - zkevm_aggregator_port: 50081 - zkevm_pprof_port: 6060 - zkevm_prometheus_port: 9091 - zkevm_data_streamer_port: 6900 - zkevm_rpc_http_port: 8123 - zkevm_rpc_ws_port: 8133 - zkevm_bridge_rpc_port: 8080 - zkevm_bridge_grpc_port: 9090 - zkevm_bridge_ui_port: 80 - zkevm_agglayer_port: 4444 - zkevm_dac_port: 8484 - blockscout_public_port: 50101 - - # Addresses and private keys of the different components. - # They have been generated using the following command: - # polycli wallet inspect --mnemonic 'lab code glass agree maid neutral vessel horror deny frequent favorite soft gate galaxy proof vintage once figure diary virtual scissors marble shrug drop' --addresses 9 | tee keys.txt | jq -r '.Addresses[] | [.ETHAddress, .HexPrivateKey] | @tsv' | awk 'BEGIN{split("sequencer,aggregator,claimtxmanager,timelock,admin,loadtest,agglayer,dac,proofsigner",roles,",")} {print "zkevm_l2_" roles[NR] "_address: \"" $1 "\""; print "zkevm_l2_" roles[NR] "_private_key: \"0x" $2 "\"\n"}' - zkevm_l2_sequencer_address: "0x5b06837A43bdC3dD9F114558DAf4B26ed49842Ed" - zkevm_l2_sequencer_private_key: "0x183c492d0ba156041a7f31a1b188958a7a22eebadca741a7fe64436092dc3181" - - zkevm_l2_aggregator_address: "0xCae5b68Ff783594bDe1b93cdE627c741722c4D4d" - zkevm_l2_aggregator_private_key: "0x2857ca0e7748448f3a50469f7ffe55cde7299d5696aedd72cfe18a06fb856970" - - zkevm_l2_claimtxmanager_address: "0x5f5dB0D4D58310F53713eF4Df80ba6717868A9f8" - zkevm_l2_claimtxmanager_private_key: "0x8d5c9ecd4ba2a195db3777c8412f8e3370ae9adffac222a54a84e116c7f8b934" - - zkevm_l2_timelock_address: "0x130aA39Aa80407BD251c3d274d161ca302c52B7A" - zkevm_l2_timelock_private_key: "0x80051baf5a0a749296b9dcdb4a38a264d2eea6d43edcf012d20b5560708cf45f" - - zkevm_l2_admin_address: "0xE34aaF64b29273B7D567FCFc40544c014EEe9970" - zkevm_l2_admin_private_key: "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" - - zkevm_l2_loadtest_address: "0x81457240ff5b49CaF176885ED07e3E7BFbE9Fb81" - zkevm_l2_loadtest_private_key: "0xd7df6d64c569ffdfe7c56e6b34e7a2bdc7b7583db74512a9ffe26fe07faaa5de" - - zkevm_l2_agglayer_address: "0x351e560852ee001d5D19b5912a269F849f59479a" - zkevm_l2_agglayer_private_key: "0x1d45f90c0a9814d8b8af968fa0677dab2a8ff0266f33b136e560fe420858a419" - - zkevm_l2_dac_address: "0x5951F5b2604c9B42E478d5e2B2437F44073eF9A6" - zkevm_l2_dac_private_key: "0x85d836ee6ea6f48bae27b31535e6fc2eefe056f2276b9353aafb294277d8159b" - - zkevm_l2_proofsigner_address: "0x7569cc70950726784c8D3bB256F48e43259Cb445" - zkevm_l2_proofsigner_private_key: "0x77254a70a02223acebf84b6ed8afddff9d3203e31ad219b2bf900f4780cf9b51" - - # Keystore password. - zkevm_l2_keystore_password: pSnv6Dh5s9ahuzGzH9RoCDrKAMddaX3m - - ## L1 configuration. - l1_chain_id: 271828 - l1_preallocated_mnemonic: code code code code code code code code code code code quality - l1_funding_amount: 100ether - l1_rpc_url: http://el-1-geth-lighthouse:8545 - l1_ws_url: ws://el-1-geth-lighthouse:8546 - # https://github.com/kurtosis-tech/ethereum-package/tree/main?tab=readme-ov-file#configuration - l1_additional_services: [ - # blockscout, # block explorer - # dora, # beaconchain explorer - # el_forkmon, # fork monitor tool - ] - l1_preset: minimal - l1_seconds_per_slot: 1 - - ## Rollup configuration. - - # The chain id of the new rollup. - zkevm_rollup_chain_id: 10101 - - # The fork id of the new rollup. It indicates the prover (zkROM/executor) version. - zkevm_rollup_fork_id: 9 - - # The address of the rollup manager contract on L1. - # If specified, the rollup data will be retrieved from this contract instead of using the contracts service. - # zkevm_rollup_manager_address: "" - # # The block number at which the rollup manager contract was deployed. - # zkevm_rollup_manager_block_number: 0 - # # The address of the global exit root contract on L2. - # zkevm_global_exit_root_l2_address: "" - # # The address of the Polygon data committee contract on L1. - # polygon_data_committee_address: "" - - polygon_zkevm_explorer: https://explorer.private/ - l1_explorer_url: https://sepolia.etherscan.io/ - - # If this is true, we will automatically deploy an ERC20 contract on - # L1 to be used at the gasTokenAddress - zkevm_use_gas_token_contract: false - - ## Permissionless node configuration. - trusted_sequencer_node_uri: zkevm-node-sequencer-001:6900 - zkevm_aggregator_host: zkevm-node-aggregator-001 - genesis_file: templates/permissionless-node/genesis.json - - ## Tools versions - polycli_version: v0.1.42 - - ## Workload configuration. - workload_commands: [ - "polycli_loadtest_on_l2.sh t", # eth transfers - "polycli_loadtest_on_l2.sh 2", # erc20 transfers - "polycli_loadtest_on_l2.sh 7", # erc721 mints - "polycli_loadtest_on_l2.sh v3", # uniswapv3 swaps - "polycli_rpcfuzz_on_l2.sh", # rpc calls - "bridge.sh", # bridge tokens l1 -> l2 and l2 -> l1 - ] - - ## ETH Load balancer configuration. - blutgang_image: makemake1337/blutgang:0.3.5 - blutgang_rpc_port: 55555 - blutgang_admin_port: 55556 diff --git a/params.yml b/params.yml index 8cf1bc8a..9433a5c6 100644 --- a/params.yml +++ b/params.yml @@ -20,6 +20,9 @@ deploy_cdk_bridge_infra: true # Deploy permissionless node. deploy_zkevm_permissionless_node: false +# Deploy cdk-erigon node. +deploy_cdk_erigon_node: true + # Deploy observability stack. deploy_observability: false @@ -37,6 +40,9 @@ args: # Note: It should be a string. deployment_suffix: "-001" + # Sequence type. Choose from ["erigon", "zkevm-node"] + sequencer_type: "erigon" + # The type of data availability to use. # Options: # - 'rollup': Transaction data is stored on-chain on L1. @@ -50,6 +56,7 @@ args: zkevm_node_image: hermeznetwork/zkevm-node:v0.7.0 cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk + cdk_node_image: ghcr.io/0xpolygon/cdk:0.0.9 zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.7 # zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.6 @@ -63,9 +70,8 @@ args: zkevm_bridge_ui_image: leovct/zkevm-bridge-ui:multi-network zkevm_bridge_proxy_image: haproxy:2.9.9-bookworm zkevm_sequence_sender_image: "hermeznetwork/zkevm-sequence-sender:v0.2.0-RC4" - cdk_erigon_node_image: hermeznetwork/cdk-erigon:v1.0.9 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:2.0.0-beta13 toolbox_image: leovct/toolbox:0.0.1 - sequencer_type: "zkevm-node" # Port configuration. zkevm_hash_db_port: 50061 @@ -122,14 +128,14 @@ args: l1_funding_amount: 100ether l1_rpc_url: http://el-1-geth-lighthouse:8545 l1_ws_url: ws://el-1-geth-lighthouse:8546 - # https://github.com/ethpandaops/ethereum-package/tree/main?tab=readme-ov-file#configuration + # https://github.com/kurtosis-tech/ethereum-package/tree/main?tab=readme-ov-file#configuration l1_additional_services: [ # blockscout, # block explorer # dora, # beaconchain explorer # el_forkmon, # fork monitor tool ] l1_preset: minimal - l1_seconds_per_slot: 12 + l1_seconds_per_slot: 1 ## Rollup configuration. From c7366ff8f1c463dc53b9410dd0493d6f7d26671c Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Fri, 2 Aug 2024 11:05:24 +0000 Subject: [PATCH 07/25] Update README --- README.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d27c5af2..571125de 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,7 @@ kurtosis clean --all kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . ``` -The command above deploys a CDK stack using [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) as the sequencer. Alternatively, to launch a CDK stack using [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) as a sequencer, you can run the following command. - -```bash -kurtosis run --enclave cdk-v1 --args-file cdk-erigon-sequencer-params.yml --image-download always . -``` +The command above deploys a CDK stack using [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) as a sequencer. Let's do a simple L2 RPC test call. @@ -40,11 +36,7 @@ kurtosis enclave inspect cdk-v1 That output, while quite useful, might also be a little overwhelming. If you want to simply see the port mapping within the `cdk-v1` enclave for the `zkevm-node-rpc` service and the `trusted-rpc` port, you can use the following command. For this test, let's store the RPC URL in an environment variable: ```bash -# if zkevm-node is the sequencer -export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" - -# if cdk-erigon is the sequencer -export ETH_RPC_URL="$(kurtosis port print cdk-v1 cdk-erigon-sequencer-001 rpc)" +export ETH_RPC_URL="$(kurtosis port print cdk-v1 cdk-erigon-node-001 rpc)" ``` That is the same environment variable that `cast` uses, so you should now be able to run this command. Note that the steps below will assume you have the [Foundry toolchain](https://book.getfoundry.sh/getting-started/installation) installed. From b8f6354c922d30512ca63c4ae3958922f350c37d Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Fri, 2 Aug 2024 11:05:40 +0000 Subject: [PATCH 08/25] Update action --- .github/workflows/deploy.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8f39a717..66e9d5cd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -26,3 +26,18 @@ jobs: - name: Monitor verified batches uses: ./.github/actions/monitor-cdk-verified-batches + + deploy-zkevm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Kurtosis CDK tools + uses: ./.github/actions/setup-kurtosis-cdk + + - name: Deploy Kurtosis CDK package + run: | + kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . '{args: {sequencer_type="zkevm"}}' + + - name: Monitor verified batches + uses: ./.github/actions/monitor-cdk-verified-batches From 8111b849b03d245b9c65672cd7a9199eb77e0a87 Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Fri, 2 Aug 2024 14:53:13 +0000 Subject: [PATCH 09/25] Make it compatible with zkevm and tune workflow --- .github/workflows/deploy.yml | 2 +- cdk_central_environment.star | 3 +-- docs/da-mode.md | 4 ++-- kurtosis.yml | 2 +- lib/data_availability.star | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 66e9d5cd..85b34c1b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -37,7 +37,7 @@ jobs: - name: Deploy Kurtosis CDK package run: | - kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . '{args: {sequencer_type="zkevm"}}' + kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . '{deploy_zkevm_permissionless_node: true, args: {sequencer_type: "zkevm"}}' - name: Monitor verified batches uses: ./.github/actions/monitor-cdk-verified-batches diff --git a/cdk_central_environment.star b/cdk_central_environment.star index 173a7d60..58c046ce 100644 --- a/cdk_central_environment.star +++ b/cdk_central_environment.star @@ -37,6 +37,7 @@ def run(plan, args): config={"genesis.json": struct(template=genesis_file, data={})}, ) + keystore_artifacts = get_keystores_artifacts(plan, args) if args["sequencer_type"] == "zkevm": # Create the zkevm node config. node_config_template = read_file( @@ -64,7 +65,6 @@ def run(plan, args): ) # Start the rest of the zkevm node components. - keystore_artifacts = get_keystores_artifacts(plan, args) zkevm_node_components_configs = ( zkevm_node_package.create_zkevm_node_components_config( args, node_config_artifact, genesis_artifact, keystore_artifacts @@ -113,7 +113,6 @@ def run(plan, args): ) # Start the cdk components. - keystore_artifacts = get_keystores_artifacts(plan, args) cdk_node_configs = cdk_node_package.create_cdk_node_service_config( args, node_config_artifact, genesis_artifact, keystore_artifacts ) diff --git a/docs/da-mode.md b/docs/da-mode.md index 8fbe1c8a..9002109e 100644 --- a/docs/da-mode.md +++ b/docs/da-mode.md @@ -6,10 +6,10 @@ The two options are: - `rollup`: Transaction data is stored on-chain on Layer 1 (L1). This approach leverages the security of the main L1 chain (e.g. Ethereum) to ensure data integrity and availability. -> In this mode, the components will run the `zkevm_node_image` and the consensus contract will be `PolygonZkEVMEtrog`. +> In this mode, the components will run CDK in `zkevm` mode and the consensus contract will be `PolygonZkEVMEtrog`. - `cdk-validium`: Transaction data is stored off-chain using a dedicated CDK Data Availability (DA) layer and a Data Availability Committee (DAC). This approach reduces the load on the main chain and can offer improved scalability and lower costs. -> In this mode, the components will run the `cdk_node_image`, the consensus contract will be `PolygonValidiumEtrog` and the CDK DAC will be deployed and configured. +> In this mode, the components will run CDK in `validium` mode, the consensus contract will be `PolygonValidiumEtrog` and the CDK DAC will be deployed and configured. For more detailed information and technical specifications, refer to the [Polygon Knowledge Layer](https://docs.polygon.technology/cdk/spec/validium-vs-rollup/). diff --git a/kurtosis.yml b/kurtosis.yml index 43b0efb2..96ba7598 100644 --- a/kurtosis.yml +++ b/kurtosis.yml @@ -41,7 +41,7 @@ description: |- zkevm_node_image: hermeznetwork/zkevm-node:v0.7.0 cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk - cdk_node_image: ghcr.io/0xpolygon/cdk:0.0.2 + cdk_node_image: ghcr.io/0xpolygon/cdk:0.0.9 zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.7 # zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.6 diff --git a/lib/data_availability.star b/lib/data_availability.star index c6ab9f46..6ab10e37 100644 --- a/lib/data_availability.star +++ b/lib/data_availability.star @@ -18,7 +18,7 @@ def get_node_image(args): # Map data availability modes to node images. node_images = { DATA_AVAILABILITY_MODES.rollup: args["zkevm_node_image"], - DATA_AVAILABILITY_MODES.cdk_validium: args["cdk_node_image"], + DATA_AVAILABILITY_MODES.cdk_validium: args["cdk_validium_node_image"], } return node_images.get(args["data_availability_mode"]) From 5edc900c6702aa247ce99d69b814200856f58476 Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Fri, 2 Aug 2024 15:58:14 +0000 Subject: [PATCH 10/25] Fix cdk-node --- lib/cdk_node.star | 2 +- params.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cdk_node.star b/lib/cdk_node.star index fbc11ab4..98615d1d 100644 --- a/lib/cdk_node.star +++ b/lib/cdk_node.star @@ -15,7 +15,7 @@ def create_cdk_node_service_config( cdk_node_name = "cdk-node" + args["deployment_suffix"] cdk_node_service_config = ServiceConfig( - image=data_availability_package.get_node_image(args), + image=args["cdk_node_image"], ports={ "aggregator": PortSpec( args["zkevm_aggregator_port"], application_protocol="grpc" diff --git a/params.yml b/params.yml index 9433a5c6..66c156ea 100644 --- a/params.yml +++ b/params.yml @@ -51,7 +51,7 @@ args: data_availability_mode: cdk-validium # Docker images and repositories used to spin up services. - zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.2 + zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.3-RC18 # zkevm_prover_image: hermeznetwork/zkevm-prover:v4.0.19 zkevm_node_image: hermeznetwork/zkevm-node:v0.7.0 From ea66dd903e77cbb3631236e8d5eaa4557ddf88d1 Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Fri, 2 Aug 2024 16:04:08 +0000 Subject: [PATCH 11/25] Adjust defaults --- input_parser.star | 9 +++++---- kurtosis.yml | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/input_parser.star b/input_parser.star index 94a9d8bf..66e517b1 100644 --- a/input_parser.star +++ b/input_parser.star @@ -1,7 +1,7 @@ DEFAULT_ARGS = { "deployment_suffix": "-001", "data_availability_mode": "cdk-validium", - "zkevm_prover_image": "hermeznetwork/zkevm-prover:v6.0.2", + "zkevm_prover_image": "hermeznetwork/zkevm-prover:v6.0.3-RC18", "zkevm_node_image": "hermeznetwork/zkevm-node:v0.7.0", "cdk_validium_node_image": "0xpolygon/cdk-validium-node:0.7.0-cdk", "zkevm_da_image": "0xpolygon/cdk-data-availability:0.0.7", @@ -12,9 +12,10 @@ DEFAULT_ARGS = { "zkevm_bridge_ui_image": "leovct/zkevm-bridge-ui:multi-network", "zkevm_bridge_proxy_image": "haproxy:2.9.9-bookworm", "zkevm_sequence_sender_image": "hermeznetwork/zkevm-sequence-sender:v0.2.0-RC4", - "cdk_erigon_node_image": "hermeznetwork/cdk-erigon:v1.0.9", + "cdk_erigon_node_image": "hermeznetwork/cdk-erigon:2.0.0-beta13", + "cdk_node_image": "ghcr.io/0xpolygon/cdk:0.0.9", "toolbox_image": "leovct/toolbox:0.0.1", - "sequencer_type": "zkevm-node", + "sequencer_type": "erigon", "zkevm_hash_db_port": 50061, "zkevm_executor_port": 50071, "zkevm_aggregator_port": 50081, @@ -55,7 +56,7 @@ DEFAULT_ARGS = { "l1_ws_url": "ws://el-1-geth-lighthouse:8546", "l1_additional_services": [], "l1_preset": "minimal", - "l1_seconds_per_slot": 12, + "l1_seconds_per_slot": 1, "zkevm_rollup_chain_id": 10101, "zkevm_rollup_fork_id": 9, "polygon_zkevm_explorer": "https://explorer.private/", diff --git a/kurtosis.yml b/kurtosis.yml index 96ba7598..61c51686 100644 --- a/kurtosis.yml +++ b/kurtosis.yml @@ -36,7 +36,7 @@ description: |- data_availability_mode: cdk-validium # Docker images and repositories used to spin up services. - zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.2 + zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.3-RC18 # zkevm_prover_image: hermeznetwork/zkevm-prover:v4.0.19 zkevm_node_image: hermeznetwork/zkevm-node:v0.7.0 @@ -56,9 +56,9 @@ description: |- zkevm_bridge_proxy_image: haproxy:2.9.9-bookworm zkevm_sequence_sender_image: hermeznetwork/zkevm-sequence-sender:v0.2.0-RC4 - cdk_erigon_node_image: hermeznetwork/cdk-erigon:v1.0.9 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:2.0.0-beta13 toolbox_image: leovct/toolbox:0.0.1 - sequencer_type: zkevm-node + sequencer_type: erigon # Port configuration. zkevm_hash_db_port: 50061 @@ -122,7 +122,7 @@ description: |- # el_forkmon, # fork monitor tool ] l1_preset: minimal - l1_seconds_per_slot: 12 + l1_seconds_per_slot: 1 ## Rollup configuration. From 143ab5638bb80526bdbdd78ec5d08f232dc4d91e Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Fri, 2 Aug 2024 16:15:59 +0000 Subject: [PATCH 12/25] Kurtosis github login --- .github/actions/setup-kurtosis-cdk/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-kurtosis-cdk/action.yml b/.github/actions/setup-kurtosis-cdk/action.yml index fa04daaf..24486c1c 100644 --- a/.github/actions/setup-kurtosis-cdk/action.yml +++ b/.github/actions/setup-kurtosis-cdk/action.yml @@ -6,7 +6,7 @@ inputs: kurtosis-version: description: The version of kurtosis required: false - default: '0.90.1' # https://github.com/kurtosis-tech/kurtosis/releases + default: '1.0.0' # https://github.com/kurtosis-tech/kurtosis/releases runs: using: "composite" @@ -17,6 +17,7 @@ runs: echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update sudo apt install kurtosis-cli=${{ inputs.kurtosis-version }} + kurtosis engine start --github-auth-token="${{ secrets.GITHUB_TOKEN }}" kurtosis version - name: Disable kurtosis analytics From addc86d30a9e73913ae1cd2bb9b07614b66a9f89 Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Fri, 2 Aug 2024 16:21:00 +0000 Subject: [PATCH 13/25] Auth --- .github/actions/setup-kurtosis-cdk/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-kurtosis-cdk/action.yml b/.github/actions/setup-kurtosis-cdk/action.yml index 24486c1c..92d8bdf3 100644 --- a/.github/actions/setup-kurtosis-cdk/action.yml +++ b/.github/actions/setup-kurtosis-cdk/action.yml @@ -17,7 +17,7 @@ runs: echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update sudo apt install kurtosis-cli=${{ inputs.kurtosis-version }} - kurtosis engine start --github-auth-token="${{ secrets.GITHUB_TOKEN }}" + kurtosis engine start --github-auth-token="${{ github.token }}" kurtosis version - name: Disable kurtosis analytics From a8fb627c4e424e4abcd812bdf26eacff239cc82e Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Fri, 2 Aug 2024 16:31:04 +0000 Subject: [PATCH 14/25] login --- .github/actions/setup-kurtosis-cdk/action.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-kurtosis-cdk/action.yml b/.github/actions/setup-kurtosis-cdk/action.yml index 92d8bdf3..6ac12ebe 100644 --- a/.github/actions/setup-kurtosis-cdk/action.yml +++ b/.github/actions/setup-kurtosis-cdk/action.yml @@ -11,13 +11,19 @@ inputs: runs: using: "composite" steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Install kurtosis shell: bash run: | echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update sudo apt install kurtosis-cli=${{ inputs.kurtosis-version }} - kurtosis engine start --github-auth-token="${{ github.token }}" kurtosis version - name: Disable kurtosis analytics From 87c8876420efe2aaae19bd7651394a7a6b8a1182 Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Fri, 2 Aug 2024 16:32:17 +0000 Subject: [PATCH 15/25] login --- .github/actions/setup-kurtosis-cdk/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-kurtosis-cdk/action.yml b/.github/actions/setup-kurtosis-cdk/action.yml index 6ac12ebe..01882db2 100644 --- a/.github/actions/setup-kurtosis-cdk/action.yml +++ b/.github/actions/setup-kurtosis-cdk/action.yml @@ -16,7 +16,7 @@ runs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ github.token }} - name: Install kurtosis shell: bash From a741f4e7ca2443096ff457e436f97bac6cd3ec80 Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Sat, 3 Aug 2024 06:38:55 +0000 Subject: [PATCH 16/25] Allow selection of rpc service in test --- .github/actions/monitor-cdk-verified-batches/action.yml | 6 +++++- .github/workflows/deploy.yml | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/actions/monitor-cdk-verified-batches/action.yml b/.github/actions/monitor-cdk-verified-batches/action.yml index 9d87a031..bf336b93 100644 --- a/.github/actions/monitor-cdk-verified-batches/action.yml +++ b/.github/actions/monitor-cdk-verified-batches/action.yml @@ -11,6 +11,10 @@ inputs: description: The script timeout in seconds required: false default: '600' # 10 minutes + rpc_service: + description: The RPC service to use + required: false + default: 'cdk-erigon-node-001' runs: using: "composite" @@ -18,4 +22,4 @@ runs: - name: Check that batches are being verified working-directory: .github/actions/monitor-cdk-verified-batches shell: bash - run: ./batch_verification_monitor.sh ${{ inputs.verified_batches_target }} ${{ inputs.timeout }} + run: ./batch_verification_monitor.sh ${{ inputs.verified_batches_target }} ${{ inputs.timeout }} ${{ inputs.rpc_service }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 85b34c1b..20912718 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -41,3 +41,5 @@ jobs: - name: Monitor verified batches uses: ./.github/actions/monitor-cdk-verified-batches + with: + rpc_service: zkevm-node-rpc-001 From bae88e0b1fa87202b856c7dc6be36daf9045a1d9 Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Sat, 3 Aug 2024 06:53:28 +0000 Subject: [PATCH 17/25] Clean diff --- input_parser.star | 4 ++-- kurtosis.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/input_parser.star b/input_parser.star index 66e517b1..1e63b4d3 100644 --- a/input_parser.star +++ b/input_parser.star @@ -1,9 +1,11 @@ DEFAULT_ARGS = { "deployment_suffix": "-001", + "sequencer_type": "erigon", "data_availability_mode": "cdk-validium", "zkevm_prover_image": "hermeznetwork/zkevm-prover:v6.0.3-RC18", "zkevm_node_image": "hermeznetwork/zkevm-node:v0.7.0", "cdk_validium_node_image": "0xpolygon/cdk-validium-node:0.7.0-cdk", + "cdk_node_image": "ghcr.io/0xpolygon/cdk:0.0.9", "zkevm_da_image": "0xpolygon/cdk-data-availability:0.0.7", "zkevm_contracts_image": "leovct/zkevm-contracts", "zkevm_agglayer_image": "ghcr.io/agglayer/agglayer-rs:main", @@ -13,9 +15,7 @@ DEFAULT_ARGS = { "zkevm_bridge_proxy_image": "haproxy:2.9.9-bookworm", "zkevm_sequence_sender_image": "hermeznetwork/zkevm-sequence-sender:v0.2.0-RC4", "cdk_erigon_node_image": "hermeznetwork/cdk-erigon:2.0.0-beta13", - "cdk_node_image": "ghcr.io/0xpolygon/cdk:0.0.9", "toolbox_image": "leovct/toolbox:0.0.1", - "sequencer_type": "erigon", "zkevm_hash_db_port": 50061, "zkevm_executor_port": 50071, "zkevm_aggregator_port": 50081, diff --git a/kurtosis.yml b/kurtosis.yml index 61c51686..a3a1b0ef 100644 --- a/kurtosis.yml +++ b/kurtosis.yml @@ -28,6 +28,8 @@ description: |- # Note: It should be a string. deployment_suffix: "-001" + sequencer_type: erigon + # The type of data availability to use. # Options: # - 'rollup': Transaction data is stored on-chain on L1. @@ -58,7 +60,6 @@ description: |- zkevm_sequence_sender_image: hermeznetwork/zkevm-sequence-sender:v0.2.0-RC4 cdk_erigon_node_image: hermeznetwork/cdk-erigon:2.0.0-beta13 toolbox_image: leovct/toolbox:0.0.1 - sequencer_type: erigon # Port configuration. zkevm_hash_db_port: 50061 From 6c216c036b52c8b7818d5739f08b93ff2e36cec6 Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Sat, 3 Aug 2024 08:15:50 +0000 Subject: [PATCH 18/25] Apply bridge --- .github/workflows/deploy.yml | 5 +++-- params.yml | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 20912718..9d130742 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,7 +22,8 @@ jobs: uses: ./.github/actions/setup-kurtosis-cdk - name: Deploy Kurtosis CDK package - run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . + run: | + kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . '{apply_workload: true}' - name: Monitor verified batches uses: ./.github/actions/monitor-cdk-verified-batches @@ -37,7 +38,7 @@ jobs: - name: Deploy Kurtosis CDK package run: | - kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . '{deploy_zkevm_permissionless_node: true, args: {sequencer_type: "zkevm"}}' + kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . '{deploy_zkevm_permissionless_node: true, args: {sequencer_type: "zkevm"}, apply_workload: true}' - name: Monitor verified batches uses: ./.github/actions/monitor-cdk-verified-batches diff --git a/params.yml b/params.yml index 66c156ea..f703ebab 100644 --- a/params.yml +++ b/params.yml @@ -172,11 +172,11 @@ args: ## Workload configuration. workload_commands: [ - "polycli_loadtest_on_l2.sh t", # eth transfers - "polycli_loadtest_on_l2.sh 2", # erc20 transfers - "polycli_loadtest_on_l2.sh 7", # erc721 mints - "polycli_loadtest_on_l2.sh v3", # uniswapv3 swaps - "polycli_rpcfuzz_on_l2.sh", # rpc calls + # "polycli_loadtest_on_l2.sh t", # eth transfers + # "polycli_loadtest_on_l2.sh 2", # erc20 transfers + # "polycli_loadtest_on_l2.sh 7", # erc721 mints + # "polycli_loadtest_on_l2.sh v3", # uniswapv3 swaps + # "polycli_rpcfuzz_on_l2.sh", # rpc calls "bridge.sh", # bridge tokens l1 -> l2 and l2 -> l1 ] From 05be508e297c23b9c882cf3fa941902fce96e46b Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Mon, 5 Aug 2024 17:40:09 +0000 Subject: [PATCH 19/25] Maybe fix --- .../batch_verification_monitor.sh | 5 ++++- main.star | 4 ++-- workload.star | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh b/.github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh index 3922b5d6..13d73c88 100755 --- a/.github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh +++ b/.github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh @@ -27,11 +27,14 @@ end_time=$((start_time + timeout)) rpc_url="$(kurtosis port print cdk-v1 $rpc_service http-rpc)" pk="0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" +# We need to send a first bridge tx in order to force erigon to update the l1infotreeroot because the first batch has a bug in erigon +cast send --legacy --rpc-url "$rpc_url" --private-key "$pk" --gas-limit 643528 --create 0x600160015B810190630000000456 + while true; do verified_batches="$(cast to-dec "$(cast rpc --rpc-url "$rpc_url" zkevm_verifiedBatchNumber | sed 's/"//g')")" echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" - # This is here to take up somce space within the batch in order to make sure the batches actually increase during the duration of the test + # This is here to take up some space within the batch in order to make sure the batches actually increase during the duration of the test cast send --legacy --rpc-url "$rpc_url" --private-key "$pk" --gas-limit 643528 --create 0x600160015B810190630000000456 current_time=$(date +%s) diff --git a/main.star b/main.star index e6279cf4..76c80ff5 100644 --- a/main.star +++ b/main.star @@ -19,8 +19,8 @@ def run( deploy_databases=True, deploy_cdk_bridge_infra=True, deploy_cdk_central_environment=True, - deploy_zkevm_permissionless_node=True, - deploy_cdk_erigon_node=False, + deploy_zkevm_permissionless_node=False, + deploy_cdk_erigon_node=True, deploy_observability=True, deploy_l2_blockscout=False, deploy_blutgang=False, diff --git a/workload.star b/workload.star index 96a85aad..a66dd359 100644 --- a/workload.star +++ b/workload.star @@ -11,7 +11,7 @@ def run(plan, args): bridge_template = read_file(src="./templates/workload/bridge.sh") contract_setup_addresses = service_package.get_contract_setup_addresses(plan, args) - zkevm_rpc_service = plan.get_service("zkevm-node-rpc" + args["deployment_suffix"]) + zkevm_rpc_service = plan.get_service(args["l2_rpc_name"] + args["deployment_suffix"]) zkevm_rpc_url = "http://{}:{}".format( zkevm_rpc_service.ip_address, zkevm_rpc_service.ports["http-rpc"].number ) From 76920720bf8c7fa232e3533be618bde635a8e9fa Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Mon, 5 Aug 2024 18:16:12 +0000 Subject: [PATCH 20/25] Maybe fix --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9d130742..a15a6777 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,7 +13,7 @@ concurrency: jobs: # Basic deployment workflow. # Note that more advanced use cases are tested in the nightly workflow. - deploy: + deploy-cdk: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -38,7 +38,7 @@ jobs: - name: Deploy Kurtosis CDK package run: | - kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . '{deploy_zkevm_permissionless_node: true, args: {sequencer_type: "zkevm"}, apply_workload: true}' + kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . '{deploy_zkevm_permissionless_node: true, args: {sequencer_type: "zkevm"}, deploy_cdk_erigon_node: false, apply_workload: true}' - name: Monitor verified batches uses: ./.github/actions/monitor-cdk-verified-batches From d41f15dee23b78691a1b42951ef741480f545a2b Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Mon, 5 Aug 2024 18:23:18 +0000 Subject: [PATCH 21/25] Lint --- input_parser.star | 12 ++++++------ kurtosis.yml | 10 +++++----- params.yml | 2 +- workload.star | 4 +++- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/input_parser.star b/input_parser.star index 1e63b4d3..38c1eb4b 100644 --- a/input_parser.star +++ b/input_parser.star @@ -56,7 +56,7 @@ DEFAULT_ARGS = { "l1_ws_url": "ws://el-1-geth-lighthouse:8546", "l1_additional_services": [], "l1_preset": "minimal", - "l1_seconds_per_slot": 1, + "l1_seconds_per_slot": 12, "zkevm_rollup_chain_id": 10101, "zkevm_rollup_fork_id": 9, "polygon_zkevm_explorer": "https://explorer.private/", @@ -67,11 +67,11 @@ DEFAULT_ARGS = { "genesis_file": "templates/permissionless-node/genesis.json", "polycli_version": "v0.1.42", "workload_commands": [ - "polycli_loadtest_on_l2.sh t", # eth transfers - "polycli_loadtest_on_l2.sh 2", # erc20 transfers - "polycli_loadtest_on_l2.sh 7", # erc721 mints - "polycli_loadtest_on_l2.sh v3", # uniswapv3 swaps - "polycli_rpcfuzz_on_l2.sh", # rpc calls + # "polycli_loadtest_on_l2.sh t", # eth transfers + # "polycli_loadtest_on_l2.sh 2", # erc20 transfers + # "polycli_loadtest_on_l2.sh 7", # erc721 mints + # "polycli_loadtest_on_l2.sh v3", # uniswapv3 swaps + # "polycli_rpcfuzz_on_l2.sh", # rpc calls "bridge.sh", # bridge tokens l1 -> l2 and l2 -> l1 ], "blutgang_image": "makemake1337/blutgang:0.3.5", diff --git a/kurtosis.yml b/kurtosis.yml index a3a1b0ef..688b5594 100644 --- a/kurtosis.yml +++ b/kurtosis.yml @@ -150,11 +150,11 @@ description: |- ## Workload configuration. workload_commands: [ - "polycli_loadtest_on_l2.sh t", # eth transfers - "polycli_loadtest_on_l2.sh 2", # erc20 transfers - "polycli_loadtest_on_l2.sh 7", # erc721 mints - "polycli_loadtest_on_l2.sh v3", # uniswapv3 swaps - "polycli_rpcfuzz_on_l2.sh", # rpc calls + # "polycli_loadtest_on_l2.sh t", # eth transfers + # "polycli_loadtest_on_l2.sh 2", # erc20 transfers + # "polycli_loadtest_on_l2.sh 7", # erc721 mints + # "polycli_loadtest_on_l2.sh v3", # uniswapv3 swaps + # "polycli_rpcfuzz_on_l2.sh", # rpc calls "bridge.sh", # bridge tokens l1 -> l2 and l2 -> l1 ] diff --git a/params.yml b/params.yml index f703ebab..3622b9bc 100644 --- a/params.yml +++ b/params.yml @@ -135,7 +135,7 @@ args: # el_forkmon, # fork monitor tool ] l1_preset: minimal - l1_seconds_per_slot: 1 + l1_seconds_per_slot: 12 ## Rollup configuration. diff --git a/workload.star b/workload.star index a66dd359..254f8b77 100644 --- a/workload.star +++ b/workload.star @@ -11,7 +11,9 @@ def run(plan, args): bridge_template = read_file(src="./templates/workload/bridge.sh") contract_setup_addresses = service_package.get_contract_setup_addresses(plan, args) - zkevm_rpc_service = plan.get_service(args["l2_rpc_name"] + args["deployment_suffix"]) + zkevm_rpc_service = plan.get_service( + args["l2_rpc_name"] + args["deployment_suffix"] + ) zkevm_rpc_url = "http://{}:{}".format( zkevm_rpc_service.ip_address, zkevm_rpc_service.ports["http-rpc"].number ) From c6fc78d400d1baadf95e6c7e046c228dc8026594 Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Mon, 5 Aug 2024 19:06:10 +0000 Subject: [PATCH 22/25] Lint --- kurtosis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kurtosis.yml b/kurtosis.yml index 688b5594..8830a734 100644 --- a/kurtosis.yml +++ b/kurtosis.yml @@ -123,7 +123,7 @@ description: |- # el_forkmon, # fork monitor tool ] l1_preset: minimal - l1_seconds_per_slot: 1 + l1_seconds_per_slot: 12 ## Rollup configuration. From bc5934d1e76bb78d0d336285836b8e76c0bccac5 Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Mon, 5 Aug 2024 22:25:16 +0000 Subject: [PATCH 23/25] Revert l1 slots --- input_parser.star | 2 +- kurtosis.yml | 2 +- params.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/input_parser.star b/input_parser.star index 38c1eb4b..3c6060fc 100644 --- a/input_parser.star +++ b/input_parser.star @@ -56,7 +56,7 @@ DEFAULT_ARGS = { "l1_ws_url": "ws://el-1-geth-lighthouse:8546", "l1_additional_services": [], "l1_preset": "minimal", - "l1_seconds_per_slot": 12, + "l1_seconds_per_slot": 1, "zkevm_rollup_chain_id": 10101, "zkevm_rollup_fork_id": 9, "polygon_zkevm_explorer": "https://explorer.private/", diff --git a/kurtosis.yml b/kurtosis.yml index 8830a734..688b5594 100644 --- a/kurtosis.yml +++ b/kurtosis.yml @@ -123,7 +123,7 @@ description: |- # el_forkmon, # fork monitor tool ] l1_preset: minimal - l1_seconds_per_slot: 12 + l1_seconds_per_slot: 1 ## Rollup configuration. diff --git a/params.yml b/params.yml index 3622b9bc..f703ebab 100644 --- a/params.yml +++ b/params.yml @@ -135,7 +135,7 @@ args: # el_forkmon, # fork monitor tool ] l1_preset: minimal - l1_seconds_per_slot: 12 + l1_seconds_per_slot: 1 ## Rollup configuration. From 7643bbc4b6bfc44e499015ab229fba087bf79d4c Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Tue, 6 Aug 2024 15:10:47 +0000 Subject: [PATCH 24/25] Fixes --- cdk_central_environment.star | 11 ----------- lib/zkevm_node.star | 2 +- templates/trusted-node/prover-config.json | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/cdk_central_environment.star b/cdk_central_environment.star index 58c046ce..21a6cada 100644 --- a/cdk_central_environment.star +++ b/cdk_central_environment.star @@ -76,17 +76,6 @@ def run(plan, args): description="Starting the rest of the zkevm node components", ) - sequence_sender_config = ( - zkevm_sequence_sender_package.create_zkevm_sequence_sender_config( - plan, args, genesis_artifact, keystore_artifacts.sequencer - ) - ) - - plan.add_services( - configs=sequence_sender_config, - description="Starting the zkevm sequence-sender components", - ) - if args["sequencer_type"] == "erigon": # Create the cdk node config. node_config_template = read_file( diff --git a/lib/zkevm_node.star b/lib/zkevm_node.star index 2e63d33f..6db588f5 100644 --- a/lib/zkevm_node.star +++ b/lib/zkevm_node.star @@ -226,7 +226,7 @@ def create_zkevm_node_components_config( aggregator_config | rpc_config | eth_tx_manager_config | l2_gas_pricer_config ) - if args["sequencer_type"] == "zkevm-node": + if args["sequencer_type"] == "zkevm": sequencer_config = create_sequencer_service_config( args, config_artifact, genesis_artifact ) diff --git a/templates/trusted-node/prover-config.json b/templates/trusted-node/prover-config.json index 71bd10c5..7c4e33c2 100644 --- a/templates/trusted-node/prover-config.json +++ b/templates/trusted-node/prover-config.json @@ -143,7 +143,7 @@ * aggregatorClientHost is the hostname that this prover will * attempt to use while connecting to the aggregator */ -}} - {{if eq .sequencer_type "zkevm-node"}} + {{if eq .sequencer_type "zkevm"}} "aggregatorClientHost": "zkevm-node-aggregator{{.deployment_suffix}}", {{else if eq .sequencer_type "erigon"}} "aggregatorClientHost": "cdk-node{{.deployment_suffix}}", From cee1712aa65418cdd09c5bbd50a60f96611b993f Mon Sep 17 00:00:00 2001 From: Victor Castell <0x@vcastellm.xyz> Date: Tue, 6 Aug 2024 16:04:20 +0000 Subject: [PATCH 25/25] Tune gas for batch verification monitor --- .../monitor-cdk-verified-batches/batch_verification_monitor.sh | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh b/.github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh index f058e8a0..a0b3a230 100755 --- a/.github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh +++ b/.github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh @@ -35,7 +35,7 @@ while true; do --legacy \ --rpc-url "$rpc_url" \ --private-key "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" \ - --gas-limit 643528 \ + --gas-limit 100_000 \ --create 0x600160015B810190630000000456 \ >/dev/null 2>&1 diff --git a/README.md b/README.md index 571125de..fec3dbc2 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ kurtosis enclave inspect cdk-v1 That output, while quite useful, might also be a little overwhelming. If you want to simply see the port mapping within the `cdk-v1` enclave for the `zkevm-node-rpc` service and the `trusted-rpc` port, you can use the following command. For this test, let's store the RPC URL in an environment variable: ```bash -export ETH_RPC_URL="$(kurtosis port print cdk-v1 cdk-erigon-node-001 rpc)" +export ETH_RPC_URL="$(kurtosis port print cdk-v1 cdk-erigon-node-001 http-rpc)" ``` That is the same environment variable that `cast` uses, so you should now be able to run this command. Note that the steps below will assume you have the [Foundry toolchain](https://book.getfoundry.sh/getting-started/installation) installed.