From 8ddc073c14a4bb41471eaf1e41b7bd87af68f4d2 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Sun, 12 Mar 2023 12:17:12 +0800 Subject: [PATCH] fix --- .../contracts/libs/LibSharedConfig.sol | 19 ++----------------- .../protocol/utils/generate_config/main.py | 10 +++++----- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/packages/protocol/contracts/libs/LibSharedConfig.sol b/packages/protocol/contracts/libs/LibSharedConfig.sol index f758008b7db..830553b605e 100644 --- a/packages/protocol/contracts/libs/LibSharedConfig.sol +++ b/packages/protocol/contracts/libs/LibSharedConfig.sol @@ -8,28 +8,13 @@ pragma solidity ^0.8.18; import {TaikoData} from "../L1/TaikoData.sol"; -/* -> cd taiko-mono/packages/protocol/utils/generate_config -> python3 main.py -Expected block time (seconds): 20 -Expected proof time (minutes): 10 -Slot availability multiplier: 20 -Number of ZKPs required per block before verificaiton: 1 -Extra slots (e.g, 50 means 50% more slots): 100 ---------- -min num slots: 30 ---------- -maxNumBlocks: 61 -slotSmoothingFactor: 16789 -*/ - library LibSharedConfig { /// Returns shared configs for both TaikoL1 and TaikoL2 for production. function getConfig() internal pure returns (TaikoData.Config memory) { return TaikoData.Config({ chainId: 167, - maxNumBlocks: 2048, // owner:daniel + maxNumBlocks: 2049, // owner:daniel blockHashHistory: 40, // owner:daniel maxVerificationsPerTx: 10, //owner:david. Each time one more block is verified, there will be ~20k more gas cost. commitConfirmations: 0, // owner:daniel @@ -38,7 +23,7 @@ library LibSharedConfig { maxBytesPerTxList: 120000, // owner:david. Set it to 120KB, since 128KB is the upper size limit of a geth transaction, so using 120KB for the proposed transactions list calldata, 8K for the remaining tx fields. minTxGasLimit: 21000, // owner:david anchorTxGasLimit: 250000, // owner:david - slotSmoothingFactor: 16789, // owner:daniel + slotSmoothingFactor: 946649, // owner:daniel rewardBurnBips: 100, // owner:daniel. 100 basis points or 1% proposerDepositPctg: 25, // owner:daniel - 25% // Moving average factors diff --git a/packages/protocol/utils/generate_config/main.py b/packages/protocol/utils/generate_config/main.py index fc47fac2187..e0449f0fc45 100644 --- a/packages/protocol/utils/generate_config/main.py +++ b/packages/protocol/utils/generate_config/main.py @@ -8,10 +8,10 @@ print("Expected proof time (minutes)", end=": ") proof_time = int(input()) * 60 - print("Slot availability multiplier", end=": ") - slot_availability_multiplier = int(input()) - if slot_availability_multiplier <= 5: - print("error: Slot availability multiplier must be greater than 5") + print("Max baseFee upside (5 = 5x)", end=": ") + max_basefee_upside = int(input()) + if max_basefee_upside < 5: + print("error: Max baseFee upside < 5") exit(1) min_num_slots = math.ceil(1.0 * proof_time / block_time) @@ -24,7 +24,7 @@ print("min num slots:", min_num_slots) max_num_slots = min_num_slots + math.ceil(min_num_slots * extra_slots / 100) + 1 - k = slot_availability_multiplier + k = max_basefee_upside n = max_num_slots # https://www.wolframalpha.com/input?i=solve++%28n%2Bx%29%28n%2Bx-1%29%3Dk*%281%2Bx%29x+for+x