Skip to content

Commit

Permalink
Merge pull request #353 from 0xPolygon/jhilliard/normalcy-flag
Browse files Browse the repository at this point in the history
Adding support for normalcy/cancun flags
  • Loading branch information
praetoriansentry authored Nov 5, 2024
2 parents b22fe73 + 597488e commit d0883d7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
8 changes: 5 additions & 3 deletions cdk_central_environment.star
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ def run(plan, args):
)
},
)
zkevm_prover_package.start_prover(
plan, args, prover_config_artifact, "zkevm_prover_start_port"
)

if not args["zkevm_use_real_verifier"] and not args["enable_normalcy"]:
zkevm_prover_package.start_prover(
plan, args, prover_config_artifact, "zkevm_prover_start_port"
)

# Get the genesis file artifact.
# TODO: Retrieve the genesis file artifact once it is available in Kurtosis.
Expand Down
2 changes: 2 additions & 0 deletions cdk_erigon.star
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def run_sequencer(plan, args):
template=cdk_erigon_chain_spec_template,
data={
"chain_id": args["zkevm_rollup_chain_id"],
"enable_normalcy": args["enable_normalcy"],
},
),
},
Expand Down Expand Up @@ -125,6 +126,7 @@ def run_rpc(plan, args):
template=cdk_erigon_chain_spec_template,
data={
"chain_id": args["zkevm_rollup_chain_id"],
"enable_normalcy": args["enable_normalcy"],
},
),
},
Expand Down
6 changes: 6 additions & 0 deletions input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ DEFAULT_ROLLUP_ARGS = {
# Docker/Kubernetes cluster".
# https://docs.kurtosis.com/advanced-concepts/public-and-private-ips-and-ports/
"use_dynamic_ports": True,
# Set this to true to disable all special logics in hermez and only enable bridge update in pre-block execution
# https://hackmd.io/@4cbvqzFdRBSWMHNeI8Wbwg/r1hKHp_S0
"enable_normalcy": False,
}

DEFAULT_PLESS_ZKEVM_NODE_ARGS = {
Expand Down Expand Up @@ -301,6 +304,9 @@ def parse_args(plan, args):
deploy_cdk_erigon_node = deployment_stages.get("deploy_cdk_erigon_node", False)
l2_rpc_name = get_l2_rpc_name(deploy_cdk_erigon_node)

if args["enable_normalcy"] and args["erigon_strict_mode"]:
fail("normalcy and strict mode cannot be enabled together")

# Determine static ports, if specified.
if not args.get("use_dynamic_ports", True):
plan.print("Using static ports.")
Expand Down
11 changes: 6 additions & 5 deletions templates/cdk-erigon/chainspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
"istanbulBlock": 0,
"muirGlacierBlock": 0,
"berlinBlock": 0,
"londonBlock": 9999999999999999999999999999999999999999999999999,
"londonBlock": {{if .enable_normalcy}}0{{else}}9999999999999999999999999999999999999999999999999{{end}},
"arrowGlacierBlock": 9999999999999999999999999999999999999999999999999,
"grayGlacierBlock": 9999999999999999999999999999999999999999999999999,
"terminalTotalDifficulty": 58750000000000000000000,
{{if not .enable_normalcy}}"terminalTotalDifficulty": 58750000000000000000000,{{end}}
"terminalTotalDifficultyPassed": false,
"shanghaiTime": 9999999999999999999999999999999999999999999999999,
"cancunTime": 9999999999999999999999999999999999999999999999999,
"shanghaiTime": {{if .enable_normalcy}}0{{else}}9999999999999999999999999999999999999999999999999{{end}},
"cancunTime": {{if .enable_normalcy}}0{{else}}9999999999999999999999999999999999999999999999999{{end}},
"normalcyBlock": {{if .enable_normalcy}}0{{else}}9999999999999999999999999999999999999999999999999{{end}},
"pragueTime": 9999999999999999999999999999999999999999999999999,
"ethash": {}
}
}
5 changes: 5 additions & 0 deletions templates/cdk-erigon/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,12 @@ zkevm.reject-smart-contract-deployments: false
# Disables virtual counters, which are used by sequencer nodes when external execution is not enabled.
# This can impact performance and transaction processing capabilities.
# Default: false
# {{if .enable_normalcy}}
zkevm.disable-virtual-counters: true
# {{else}}
zkevm.disable-virtual-counters: false
# {{end}}


# Multiplier used to reduce the depth of SMT when calculating virtual counters.
# A value less than 1 will decrease SMT depth, potentially improving performance but may affect accuracy.
Expand Down

0 comments on commit d0883d7

Please sign in to comment.