diff --git a/etc/env/base/chain.toml b/etc/env/base/chain.toml index 181c7cc8632..a792bfdf443 100644 --- a/etc/env/base/chain.toml +++ b/etc/env/base/chain.toml @@ -57,7 +57,7 @@ compute_overhead_part=0.0 # The constant that represents the possibility that a batch can be sealed because of overuse of pubdata. # It has range from 0 to 1. If it is 0, the pubdata will not depend on the cost for closing the batch. # If it is 1, the pubdata limit per batch will have to cover the entire cost of closing the batch. -pubdata_overhead_part=1.0 +pubdata_overhead_part=1 # The constant amount of L1 gas that is used as the overhead for the batch. It includes the price for batch verification, etc. batch_overhead_l1_gas=800000 @@ -68,14 +68,14 @@ max_gas_per_batch=200000000 # The maximum amount of pubdata that can be used by the batch. Note that if the calldata is used as pubdata, this variable should not exceed 128kb. max_pubdata_per_batch=100000 -# The version of the fee model to use. +# The version of the fee model to use. # - `V1`, the first model that was used in zkSync Era. In this fee model, the pubdata price must be pegged to the L1 gas price. # Also, the fair L2 gas price is expected to only include the proving/computation price for the operator and not the costs that come from # processing the batch on L1. # - `V2`, the second model that was used in zkSync Era. There the pubdata price might be independent from the L1 gas price. Also, # The fair L2 gas price is expected to both the proving/computation price for the operator and the costs that come from # processing the batch on L1. -fee_model_version="V1" +fee_model_version="V2" # Max number of computational gas that validation step is allowed to take. validation_computational_gas_limit=300000 diff --git a/etc/env/base/eth_sender.toml b/etc/env/base/eth_sender.toml index f95a70c5f96..af1b019c706 100644 --- a/etc/env/base/eth_sender.toml +++ b/etc/env/base/eth_sender.toml @@ -62,3 +62,4 @@ pricing_formula_parameter_b=1.0005 internal_l1_pricing_multiplier=0.8 # Node polling period in seconds. poll_period=5 +# internal_enforced_l1_gas_price = 45_000_000_000 diff --git a/infrastructure/zk/src/init.ts b/infrastructure/zk/src/init.ts index cdaeb5ea99f..1b96cd4df36 100644 --- a/infrastructure/zk/src/init.ts +++ b/infrastructure/zk/src/init.ts @@ -34,6 +34,30 @@ export async function init(initArgs: InitArgs = DEFAULT_ARGS) { fs.writeFileSync(process.env.ENV_FILE!, envFileContent); await announced(`Initializing in ${validiumMode ? 'Validium mode' : 'Roll-up mode'}`); + const filePath = 'etc/env/base/chain.toml'; + const paramName = { + pubdata_overhead_part: validiumMode ? 0.0 : 1.0, + batch_overhead_l1_gas: validiumMode ? 1000000 : 800000, + max_pubdata_per_batch: validiumMode ? 1000000000000 : 100000 + }; + + let tomlContent = fs.readFileSync(filePath, 'utf-8'); + const lines = tomlContent.split('\n'); + + for (let i = 0; i < lines.length; i++) { + const line = lines[i]; + for (const [key, value] of Object.entries(paramName)) { + if (line.includes(`${key}=`)) { + lines[i] = `${key}=${value}`; + break; + } + } + } + tomlContent = lines.join('\n'); + fs.writeFileSync(filePath, tomlContent); + + console.log(`The parameters have been updated in the ${filePath} file.`); + if (!process.env.CI && !skipEnvSetup) { await announced('Pulling images', docker.pull()); await announced('Checking environment', checkEnv());